mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
m15 tapped, abu frames, invocation
This commit is contained in:
@@ -43,6 +43,7 @@ var availableFrames = [];
|
||||
var selectedFrameIndex = 0;
|
||||
var selectedMaskIndex = 0;
|
||||
var selectedTextIndex = 0;
|
||||
var replacementMasks = {};
|
||||
//for imports
|
||||
var scryfallArt;
|
||||
var scryfallCard;
|
||||
@@ -57,6 +58,7 @@ var loadedVersions = [];
|
||||
async function resetCardIrregularities({canvas = [1500, 2100, 0, 0], resetOthers = true} = {}) {
|
||||
//misc details
|
||||
card.margins = false;
|
||||
replacementMasks = {};
|
||||
//rotation
|
||||
if (card.landscape) {
|
||||
// previewContext.scale(card.width/card.height, card.height/card.width);
|
||||
@@ -383,7 +385,12 @@ async function addFrame(additionalMasks = [], loadingFrame = false) {
|
||||
frameToAdd.masks = [];
|
||||
maskThumbnail = false;
|
||||
}
|
||||
additionalMasks.forEach(item => frameToAdd.masks.push(item));
|
||||
additionalMasks.forEach(item => {
|
||||
if (item.name in replacementMasks) {
|
||||
item.src = replacementMasks[item.name];
|
||||
}
|
||||
frameToAdd.masks.push(item);
|
||||
});
|
||||
// Likewise, we now add any complementary frames
|
||||
if ('complementary' in frameToAdd && frameToAdd.masks.length == 0) {
|
||||
if (typeof frameToAdd.complementary == 'number') {
|
||||
|
@@ -2,6 +2,7 @@ loadFramePacks([
|
||||
{name:'Cartoony - Sheepwave', value:'Cartoony'},
|
||||
{name:'Classic-Shifted', value:'Classicshifted'},
|
||||
{name:'Ixalan - @feuer_ameise', value:'FeuerAmeiseIxalan'},
|
||||
{name:'Tapped (Horizontal M15)', value:'Tapped'},
|
||||
{name:'Custom Addons', value:'disabled'},
|
||||
{name:'Brawl Legend Crowns', value:'Brawl'}
|
||||
])
|
@@ -3,6 +3,7 @@ loadFramePacks([
|
||||
{name:'Seventh Edition', value:'Seventh'},
|
||||
{name:'Fifth Edition', value:'SeventhButFifth'},
|
||||
{name:'Legends Multicolored', value:'Legends'},
|
||||
{name:'Alpha/Beta/Unlimited', value:'ABU'},
|
||||
{name:'Misc', value:'disabled'},
|
||||
{name:'Planechase', value:'Planechase'},
|
||||
{name:'Vanguard', value:'Vanguard'}
|
||||
|
9
js/frames/manaSymbolsOld.js
Normal file
9
js/frames/manaSymbolsOld.js
Normal file
@@ -0,0 +1,9 @@
|
||||
//checks to see if it needs to run
|
||||
if (!card.manaSymbols.includes('/js/frames/manaSymbolsOld.js')) {
|
||||
card.manaSymbols.push('/js/frames/manaSymbolsOld.js');
|
||||
}
|
||||
if (findManaSymbolIndex('old') == -1) {
|
||||
loadManaSymbols([
|
||||
'old/oldw', 'old/oldu', 'old/oldb', 'old/oldr', 'old/oldg',
|
||||
]);
|
||||
}
|
51
js/frames/packABU.js
Normal file
51
js/frames/packABU.js
Normal file
@@ -0,0 +1,51 @@
|
||||
//Create objects for common properties across available frames
|
||||
var masks = [{src:'/img/frames/old/abu/dualLand.png', name:'Dual Land'}];
|
||||
//defines available frames
|
||||
availableFrames = [
|
||||
{name:'White Frame', src:'/img/frames/old/abu/w.png'},
|
||||
{name:'Blue Frame', src:'/img/frames/old/abu/u.png'},
|
||||
{name:'Black Frame', src:'/img/frames/old/abu/b.png'},
|
||||
{name:'Red Frame', src:'/img/frames/old/abu/r.png'},
|
||||
{name:'Green Frame', src:'/img/frames/old/abu/g.png'},
|
||||
{name:'Artifact Frame', src:'/img/frames/old/abu/a.png'},
|
||||
{name:'Land Frame', src:'/img/frames/old/abu/l.png', masks:masks},
|
||||
{name:'White Land Frame', src:'/img/frames/old/abu/wl.png', masks:masks},
|
||||
{name:'Blue Land Frame', src:'/img/frames/old/abu/ul.png', masks:masks},
|
||||
{name:'Black Land Frame', src:'/img/frames/old/abu/bl.png', masks:masks},
|
||||
{name:'Red Land Frame', src:'/img/frames/old/abu/rl.png', masks:masks},
|
||||
{name:'Green Land Frame', src:'/img/frames/old/abu/gl.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 = 'abu';
|
||||
loadScript('/js/frames/manaSymbolsOld.js');
|
||||
//art bounds
|
||||
card.artBounds = {x:0.116, y:0.1043, width:0.7654, height:0.441};
|
||||
autoFitArt();
|
||||
//set symbol bounds
|
||||
card.setSymbolBounds = {x:0.8914, y:0.5758, width:0.12, height:0.0353, vertical:'center', horizontal: 'right'};
|
||||
resetSetSymbol();
|
||||
//watermark bounds
|
||||
card.watermarkBounds = {x:0.18, y:0.64, width:0.64, height:0.24};
|
||||
resetWatermark();
|
||||
//text
|
||||
loadTextOptions({
|
||||
mana: {name:'Mana Cost', text:'', x:0.07, y:0.0572, width:0.8467, height:74/2100, oneLine:true, size:74/1638, align:'right', manaCost:true, manaSpacing:0.0014, manaPrefix:'old'},
|
||||
title: {name:'Title', text:'', x:0.07, y:0.05, width:0.8667, height:0.0429, oneLine:true, font:'goudymedieval', size:0.0429, color:'#ababab', shadowX:0.0021, shadowY:0.0015},
|
||||
type: {name:'Type', text:'', x:0.1, y:0.5586, width:0.8, height:0.0334, oneLine:true, size:0.0334, color:'#ababab', shadowX:0.0021, shadowY:0.0015},
|
||||
rules: {name:'Rules Text', text:'', x:0.15, y:0.6048, width:0.7, height:0.2762, size:0.0477},
|
||||
pt: {name:'Power/Toughness', text:'', x:0.8, y:0.8972, width:0.16, height:0.0415, size:0.0415, oneLine:true, align:'center', color:'#ababab', shadowX:0.0021, shadowY:0.0015}
|
||||
});
|
||||
//bottom info
|
||||
loadBottomInfo({
|
||||
artist: {text:'Illus. \u00a9 {elemidinfo-artist}', x:0.1, y:0.9, width:0.7334, height:0.0334, oneLine:true, size:0.0334, align:'left', shadowX:0.0027, shadowY:0.002, color:'#ababab'},
|
||||
cc: {text:'NOT FOR SALE CardConjurer.com', x:0.0614, y:9791, width:0.8774, height:0.0124, oneLine:true, size:0.0124, align:'center', shadowX:0.0027, shadowY:0.002, color:'#ababab'}
|
||||
});
|
||||
}
|
||||
//loads available frames
|
||||
loadFramePack();
|
57
js/frames/packTapped.js
Normal file
57
js/frames/packTapped.js
Normal file
@@ -0,0 +1,57 @@
|
||||
//Create objects for common properties across available frames
|
||||
var masks = [{src:'/img/frames/custom/tapped/pinline.svg', name:'Pinline'}, {src:'/img/frames/custom/tapped/title.svg', name:'Title'}, {src:'/img/frames/custom/tapped/type.svg', name:'Type'}, {src:'/img/frames/custom/tapped/text.svg', name:'Textbox'}, {src:'/img/frames/custom/tapped/border.svg', name:'Border'}];
|
||||
//defines available frames
|
||||
availableFrames = [
|
||||
{name:'White Frame', src:'/img/frames/custom/tapped/w.png', masks:masks},
|
||||
{name:'Blue Frame', src:'/img/frames/custom/tapped/u.png', masks:masks},
|
||||
{name:'Black Frame', src:'/img/frames/custom/tapped/b.png', masks:masks},
|
||||
{name:'Red Frame', src:'/img/frames/custom/tapped/r.png', masks:masks},
|
||||
{name:'Green Frame', src:'/img/frames/custom/tapped/g.png', masks:masks},
|
||||
{name:'Multicolored Frame', src:'/img/frames/custom/tapped/m.png', masks:masks},
|
||||
{name:'Artifact Frame', src:'/img/frames/custom/tapped/a.png', masks:masks},
|
||||
{name:'Land Frame', src:'/img/frames/custom/tapped/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
|
||||
var previousCardHeight = card.height
|
||||
await resetCardIrregularities({canvas:[2100, 1500, 0, 0]});
|
||||
replacementMasks = {'Right Half':'/img/frames/custom/tapped/rightHalf.png'};
|
||||
//sets card version
|
||||
card.version = 'tapped';
|
||||
//rotation
|
||||
card.landscape = true;
|
||||
previewContext.translate(0, previousCardHeight / 2);
|
||||
previewContext.rotate(-Math.PI / 2);
|
||||
previewContext.scale(7/5, 5/7);
|
||||
//art bounds
|
||||
card.artBounds = {x:0.0281, y:0.0394, width:0.9439, height:0.8614};
|
||||
autoFitArt();
|
||||
//set symbol bounds
|
||||
card.setSymbolBounds = {x:0.9439, y:0.8927, width:0.0858, height:0.0467, vertical:'center', horizontal: 'right'};
|
||||
resetSetSymbol();
|
||||
//watermark bounds
|
||||
card.watermarkBounds = {x:0.7253, y:0.5, width:0.381, height:0.5667};
|
||||
resetWatermark();
|
||||
//text
|
||||
loadTextOptions({
|
||||
title: {name:'Title', text:'', x:0.5153, y:0.0814, width:0.4181, height:0.0607, oneLine:true, font:'belerenb', size:0.0607},
|
||||
type: {name:'Type', text:'', x:0.5153, y:0.8707, width:0.4181, height:0.0474, oneLine:true, font:'belerenb', size:0.0474},
|
||||
rules: {name:'Rules Text', text:'', x:0.5191, y:0.1634, width:0.4096, height:0.6734, size:0.0507},
|
||||
additional: {name:'Extra Textbox', text:`Adjust Life{i}{lns}{up${scaleHeight(0.01)}}{bar}{lns}{right}{fontsize-${scaleHeight(0.0067)}}Revived — 20{lns}Survived — +10`, x:0.1286, width:0.2739, y:0.64, height:0.2534, size:0.0607, color:'white', align:'center'}
|
||||
});
|
||||
//bottom info
|
||||
await loadBottomInfo({
|
||||
midLeft: {text:'{elemidinfo-set}*{elemidinfo-language} {savex}{fontbelerenbsc}{fontsize' + scaleHeight(0.001) + '}{upinline' + scaleHeight(0.0005) + '}\uFFEE{elemidinfo-artist}', x:0.0462, y:0.9367, width:0.9077, height:0.024, oneLine:true, font:'gothammedium', size:0.024, color:'white', outlineWidth:0.003},
|
||||
topLeft: {text:'{elemidinfo-number} {loadx}{elemidinfo-rarity}', x:0.0462, y:0.9127, width:0.9077, height:0.024, oneLine:true, font:'gothammedium', size:0.024, color:'white', outlineWidth:0.003},
|
||||
bottomLeft: {text:'NOT FOR SALE', x:0.0462, y:0.9607, width:0.9077, height:0.02, oneLine:true, font:'gothammedium', size:0.02, color:'white', outlineWidth:0.003},
|
||||
wizards: {name:'wizards', text:'\u2122 & \u00a9 ' + date.getFullYear() + ' Wizards of the Coast', x:0.0462, y:0.9607, width:0.9077, height:0.0227, oneLine:true, font:'mplantin', size:0.0227, color:'white', align:'right', outlineWidth:0.003},
|
||||
bottomRight: {text:'CardConjurer.com', x:227/2100, y:0.9607, width:0.9077, height:0.02, oneLine:true, font:'mplantin', size:0.02, color:'white', align:'center', outlineWidth:0.003}
|
||||
});
|
||||
//runs other necessary functions
|
||||
drawFrames();
|
||||
}
|
||||
//loads available frames
|
||||
loadFramePack();
|
Reference in New Issue
Block a user