mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
Add Case frame
This commit is contained in:
@@ -4679,8 +4679,8 @@ function changeCardIndex() {
|
|||||||
if (card.text.nickname) {card.text.nickname.text = cardToImport.flavor_name || '';}
|
if (card.text.nickname) {card.text.nickname.text = cardToImport.flavor_name || '';}
|
||||||
if (card.text.mana) {card.text.mana.text = cardToImport.mana_cost || '';}
|
if (card.text.mana) {card.text.mana.text = cardToImport.mana_cost || '';}
|
||||||
if (card.text.type) {card.text.type.text = langFontCode + cardToImport.type_line || '';}
|
if (card.text.type) {card.text.type.text = langFontCode + cardToImport.type_line || '';}
|
||||||
if (card.text.rules) {
|
if (card.text.rules || card.text.case) {
|
||||||
var italicExemptions = ['Boast', 'Cycling', 'Visit', 'Prize', 'I', 'II', 'III', 'IV', 'I, II', 'II, III', 'III, IV', 'I, II, III', 'II, III, IV', 'I, II, III, IV', '• Khans', '• Dragons', '• Mirran', '• Phyrexian', 'Prototype', 'Companion'];
|
var italicExemptions = ['Boast', 'Cycling', 'Visit', 'Prize', 'I', 'II', 'III', 'IV', 'I, II', 'II, III', 'III, IV', 'I, II, III', 'II, III, IV', 'I, II, III, IV', '• Khans', '• Dragons', '• Mirran', '• Phyrexian', 'Prototype', 'Companion', 'To solve', 'Solved'];
|
||||||
var rulesText = (cardToImport.oracle_text || '').replace(/(?:\((?:.*?)\)|[^"\n]+(?= — ))/g, function(a){
|
var rulesText = (cardToImport.oracle_text || '').replace(/(?:\((?:.*?)\)|[^"\n]+(?= — ))/g, function(a){
|
||||||
if (italicExemptions.includes(a)) {return a;}
|
if (italicExemptions.includes(a)) {return a;}
|
||||||
return '{i}' + a + '{/i}';
|
return '{i}' + a + '{/i}';
|
||||||
@@ -4720,6 +4720,9 @@ function changeCardIndex() {
|
|||||||
card.text.rightStatTitle.text = '';
|
card.text.rightStatTitle.text = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (card.version == 'case') {
|
||||||
|
rulesText = rulesText.replace(/(\r\n|\r|\n)/g, '//{bar}//');
|
||||||
|
card.text.case.text = langFontCode + rulesText;
|
||||||
} else {
|
} else {
|
||||||
card.text.rules.text = langFontCode + rulesText;
|
card.text.rules.text = langFontCode + rulesText;
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,7 @@ const frameNames = new Map ([
|
|||||||
['Color Identity Pips', 'M15CIPips'],
|
['Color Identity Pips', 'M15CIPips'],
|
||||||
['"The List" Stamp', 'TheList'],
|
['"The List" Stamp', 'TheList'],
|
||||||
['Lands', 'M15Lands'],
|
['Lands', 'M15Lands'],
|
||||||
|
['Cases (Murders at Karlov Manor)', 'Case'],
|
||||||
['Battles (March of the Machine)', 'Battle'],
|
['Battles (March of the Machine)', 'Battle'],
|
||||||
['Prototype (Brothers\' War)', 'Prototype'],
|
['Prototype (Brothers\' War)', 'Prototype'],
|
||||||
['Prototype (Extended Art) (Brothers\' War)', 'PrototypeExtended'],
|
['Prototype (Extended Art) (Brothers\' War)', 'PrototypeExtended'],
|
||||||
|
@@ -13,6 +13,7 @@ loadFramePacks([
|
|||||||
{name:'"The List" Stamp', value:'TheList'},
|
{name:'"The List" Stamp', value:'TheList'},
|
||||||
{name:'Other Frames', value:'disabled'},
|
{name:'Other Frames', value:'disabled'},
|
||||||
{name:'Lands', value:'M15Lands'},
|
{name:'Lands', value:'M15Lands'},
|
||||||
|
{name:'Cases (Murders at Karlov Manor)', value:'Case'},
|
||||||
{name:'Battle (March of the Machine)', value:'Battle'},
|
{name:'Battle (March of the Machine)', value:'Battle'},
|
||||||
{name:'Prototype (Brothers\' War)', value:'Prototype'},
|
{name:'Prototype (Brothers\' War)', value:'Prototype'},
|
||||||
{name:'Prototype (Extended Art) (Brothers\' War)', value:'PrototypeExtended'},
|
{name:'Prototype (Extended Art) (Brothers\' War)', value:'PrototypeExtended'},
|
||||||
|
40
js/frames/packCase.js
Normal file
40
js/frames/packCase.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
//Create objects for common properties across available frames
|
||||||
|
var masks = [{src:'/img/frames/class/pinline.svg', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/saga/sagaMaskType.png', name:'Type'}, {src:'/img/frames/class/frame.svg', name:'Frame'}, {src:'/img/frames/class/text.svg', name:'Text'}, {src:'/img/frames/class/textRight.png', name:'Text, Right Half'}, {src:'/img/frames/class/border.svg', name:'Border'}];
|
||||||
|
//defines available frames
|
||||||
|
availableFrames = [
|
||||||
|
{name:'White Frame', src:'/img/frames/class/w.png', masks:masks},
|
||||||
|
{name:'Blue Frame', src:'/img/frames/class/u.png', masks:masks},
|
||||||
|
{name:'Black Frame', src:'/img/frames/class/b.png', masks:masks},
|
||||||
|
{name:'Red Frame', src:'/img/frames/class/r.png', masks:masks},
|
||||||
|
{name:'Green Frame', src:'/img/frames/class/g.png', masks:masks},
|
||||||
|
{name:'Multicolored Frame', src:'/img/frames/class/m.png', masks:masks},
|
||||||
|
{name:'Artifact Frame', src:'/img/frames/class/a.png', masks:masks},
|
||||||
|
{name:'Land Frame', src:'/img/frames/class/l.png', masks:masks}
|
||||||
|
];
|
||||||
|
//disables/enables the "Load Frame Version" button
|
||||||
|
document.querySelector('#loadFrameVersion').disabled = false;
|
||||||
|
//defines process for loading this version, if applicable
|
||||||
|
document.querySelector('#loadFrameVersion').onclick = async function() {
|
||||||
|
//resets things so that every frame doesn't have to
|
||||||
|
await resetCardIrregularities();
|
||||||
|
//sets card version
|
||||||
|
card.version = 'case';
|
||||||
|
//art bounds
|
||||||
|
card.artBounds = {x:0.0753, y:0.1124, width:0.4247, height:0.7253};
|
||||||
|
autoFitArt();
|
||||||
|
//set symbol bounds
|
||||||
|
card.setSymbolBounds = {x:0.9227, y:0.8739, width:0.12, height:0.0381, vertical:'center', horizontal: 'right'};
|
||||||
|
resetSetSymbol();
|
||||||
|
//watermark bounds
|
||||||
|
card.watermarkBounds = {x:0.5214, y:0.4748, width:0.38, height:0.6767};
|
||||||
|
resetWatermark();
|
||||||
|
//text
|
||||||
|
loadTextOptions({
|
||||||
|
mana: {name:'Mana Cost', text:'', y:0.0613, width:0.9292, height:71/2100, oneLine:true, size:71/1638, align:'right', shadowX:-0.001, shadowY:0.0029, manaCost:true, manaSpacing:0},
|
||||||
|
title: {name:'Title', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381},
|
||||||
|
type: {name:'Type', text:'', x:0.0854, y:0.8481, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324},
|
||||||
|
case: {name:'Rules Text', text:'//{bar}//To solve — {i}(If unsolved, solve at the beginning of your end step.){/i}//{bar}//Solved — ', x:0.5093, y:356/2814, width:0.404, height:1974/2814, size:0.03445}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//loads available frames
|
||||||
|
loadFramePack();
|
Reference in New Issue
Block a user