fixes/updates

This commit is contained in:
Kyle
2021-07-13 20:32:59 -07:00
parent d3a486d688
commit b5d2b8af4c
58 changed files with 169 additions and 51 deletions

View File

@@ -13,6 +13,7 @@ loadFramePacks([
{name:'Snow (Kaldheim)', value:'M15Snow'},
{name:'Mutate (Ikoria)', value:'M15Mutate'},
{name:'Nyx (Theros)', value:'M15Nyx'},
{name:'Adventures (Eldraine)', value:'Adventure'},
{name:'Devoid (Zendikar)', value:'M15Devoid'},
{name:'Aftermath (Amonkhet)', value:'Aftermath'},
{name:'Flip (Kamigawa)', value:'Flip'},

View File

@@ -0,0 +1,58 @@
//Create objects for common properties across available frames
var masks = [{src:'/img/frames/adventure/regular/pinline.svg', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/m15/regular/m15MaskType.png', name:'Type'}];
var bounds = {x:0.7573, y:0.8848, width:0.188, height:0.0733};
//defines available frames
availableFrames = [
{name:'White Frame', src:'/img/frames/adventure/regular/w.png'},
{name:'Blue Frame', src:'/img/frames/adventure/regular/u.png'},
{name:'Black Frame', src:'/img/frames/adventure/regular/b.png'},
{name:'Red Frame', src:'/img/frames/adventure/regular/r.png'},
{name:'Green Frame', src:'/img/frames/adventure/regular/g.png'},
{name:'Multicolored Frame', src:'/img/frames/adventure/regular/m.png'},
{name:'Artifact Frame', src:'/img/frames/adventure/regular/a.png'},
{name:'Land Frame', src:'/img/frames/adventure/regular/l.png'},
{name:'White Power/Toughness', src:'/img/frames/m15/regular/m15PTW.png', bounds:bounds},
{name:'Blue Power/Toughness', src:'/img/frames/m15/regular/m15PTU.png', bounds:bounds},
{name:'Black Power/Toughness', src:'/img/frames/m15/regular/m15PTB.png', bounds:bounds},
{name:'Red Power/Toughness', src:'/img/frames/m15/regular/m15PTR.png', bounds:bounds},
{name:'Green Power/Toughness', src:'/img/frames/m15/regular/m15PTG.png', bounds:bounds},
{name:'Multicolored Power/Toughness', src:'/img/frames/m15/regular/m15PTM.png', bounds:bounds},
{name:'Artifact Power/Toughness', src:'/img/frames/m15/regular/m15PTA.png', bounds:bounds},
{name:'Land Power/Toughness', src:'/img/frames/m15/regular/m15PTC.png', bounds:bounds}
];
//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 = 'adventure';
//art bounds
card.artBounds = {x:0.0767, y:0.1129, width:0.8476, height:0.4429};
autoFitArt();
//set symbol bounds
card.setSymbolBounds = {x:0.9213, y:0.5910, width:0.12, height:0.0410, vertical:'center', horizontal: 'right'};
resetSetSymbol();
//watermark bounds
card.watermarkBounds = {x:0.72, y:0.7681, width:0.3867, height:0.2358};
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.5664, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324},
rules: {name:'Rules Text', text:'', x:0.0854, y:0.7358, width:0.3947, height:0.15, size:0.0353},
rules2: {name:'Rules Text (Right)', text:'', x:0.5267, y:0.65, width:0.3867, height:0.2358, size:0.0353},
pt: {name:'Power/Toughness', text:'', x:0.7928, y:0.902, width:0.1367, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center'},
mana2: {name:'Adventure Mana Cost', text:'', x:0.0814, y:0.6391, width:0.4, height:60/2100, oneLine:true, size:60/1638, color:'white', shadowX:-0.001, shadowY:0.0029, align:'right', manaCost:true},
title2: {name:'Adventure Title', text:'', x:0.0814, y:0.6391, width:0.4, height:0.0296, size:0.0296, color:'white', oneLine:true, font:'belerenb'},
type2: {name:'Adventure Type', text:'', x:0.0814, y:0.6839, width:0.4, height:0.0296, size:0.0296, color:'white', oneLine:true, font:'belerenb'},
});
}
//loads available frames
loadFramePack();
//Only for the main version as the webpage loads:
if (!card.text) {
document.querySelector('#loadFrameVersion').click();
}

View File

@@ -7,7 +7,10 @@ availableFrames = [
{name:'Blue Frame', src:'/img/frames/levelers/regular/u.png', masks:masks},
{name:'Black Frame', src:'/img/frames/levelers/regular/b.png', masks:masks},
{name:'Red Frame', src:'/img/frames/levelers/regular/r.png', masks:masks},
{name:'Green Frame', src:'/img/frames/levelers/regular/g.png', masks:masks}
{name:'Green Frame', src:'/img/frames/levelers/regular/g.png', masks:masks},
{name:'Multicolored Frame', src:'/img/frames/levelers/regular/m.png', masks:masks},
{name:'Artifact Frame', src:'/img/frames/levelers/regular/a.png', masks:masks},
{name:'Vehicle Frame', src:'/img/frames/levelers/regular/v.png', masks:masks}
];
//disables/enables the "Load Frame Version" button
document.querySelector('#loadFrameVersion').disabled = false;

52
js/frames/packMH2.js Normal file
View File

@@ -0,0 +1,52 @@
//Create objects for common properties across available frames
// var masks = [{src:'/img/frames/m15/regular/m15MaskPinline.png', name:'Pinline'}, {src:'/img/frames/m15/regular/m15MaskTitle.png', name:'Title'}, {src:'/img/frames/m15/regular/m15MaskType.png', name:'Type'}, {src:'/img/frames/m15/regular/m15MaskRules.png', name:'Rules'}, {src:'/img/frames/m15/regular/m15MaskFrame.png', name:'Frame'}, {src:'/img/frames/m15/regular/m15MaskBorder.png', name:'Border'}];
var bounds = {x:0.748, y:0.8796, width:0.204, height:0.072};
//defines available frames
availableFrames = [
{name:'White Frame', src:'/img/frames/mh2/w.png'},
{name:'Blue Frame', src:'/img/frames/mh2/u.png'},
{name:'Black Frame', src:'/img/frames/mh2/b.png'},
{name:'Red Frame', src:'/img/frames/mh2/r.png'},
{name:'Green Frame', src:'/img/frames/mh2/g.png'},
// {name:'Multicolored Frame', src:'/img/frames/mh2/m.png'},
// {name:'Artifact Frame', src:'/img/frames/mh2/a.png'},
// {name:'Vehicle Frame', src:'/img/frames/mh2/v.png'},
{name:'White Power/Toughness', src:'/img/frames/mh2/wpt.png', bounds:bounds},
{name:'Blue Power/Toughness', src:'/img/frames/mh2/upt.png', bounds:bounds},
{name:'Black Power/Toughness', src:'/img/frames/mh2/bpt.png', bounds:bounds},
{name:'Red Power/Toughness', src:'/img/frames/mh2/rpt.png', bounds:bounds},
{name:'Green Power/Toughness', src:'/img/frames/mh2/gpt.png', bounds:bounds},
// {name:'Multicolored Power/Toughness', src:'/img/frames/mh2/mpt.png', bounds:bounds},
// {name:'Artifact Power/Toughness', src:'/img/frames/mh2/apt.png', bounds:bounds},
// {name:'Vehicle Power/Toughness', src:'/img/frames/mh2/vpt.png', bounds:bounds}
];
//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() {
// notifies
notify('Currently only monocolored frames are available. Due to the nature of the sketch frame, I\'m not sure if/when I\'ll be able to add the remaining frames.', 10);
//resets things so that every frame doesn't have to
await resetCardIrregularities();
//sets card version
card.version = 'mh2';
//art bounds
card.artBounds = {x:0.0767, y:0.1129, width:0.8476, height:0.4429};
autoFitArt();
//set symbol bounds
card.setSymbolBounds = {x:0.9213, y:0.5910, width:0.12, height:0.0410, vertical:'center', horizontal: 'right'};
resetSetSymbol();
//watermark bounds
card.watermarkBounds = {x:0.5, y:0.7762, width:0.75, height:0.2305};
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.5664, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324},
rules: {name:'Rules Text', text:'', x:0.086, y:0.6303, width:0.828, height:0.2875, size:0.0362},
pt: {name:'Power/Toughness', text:'', x:0.7928, y:0.902, width:0.1367, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center'}
});
}
//loads available frames
loadFramePack();

View File

@@ -31,7 +31,7 @@ if (!loadedVersions.includes('/js/frames/versionClass.js')) {
}
document.querySelector('#creator-menu-sections').appendChild(newHTML);
var classHeader = new Image();
classHeader.src = '/img/frames/class/header.png';
classHeader.src = fixUri('/img/frames/class/header.png');
classHeader.onload = classEdited;
fixClassInputs(classEdited);
} else {

View File

@@ -27,34 +27,34 @@ if (!loadedVersions.includes('/js/frames/versionDungeon.js')) {
card.dungeon = {abilities:[1, 1, 1, 0], count:3, x:0.1, width:0.3947};
}
document.querySelector('#creator-menu-sections').appendChild(newHTML);
var dungeonFXtop = new Image(); dungeonFXtop.src = '/img/frames/dungeon/walls/fx/top.png';
var dungeonFXleft = new Image(); dungeonFXleft.src = '/img/frames/dungeon/walls/fx/left.png';
var dungeonFXbottom = new Image(); dungeonFXbottom.src = '/img/frames/dungeon/walls/fx/bottom.png';
var dungeonFXright = new Image(); dungeonFXright.src = '/img/frames/dungeon/walls/fx/right.png';
var dungeonFXtopright = new Image(); dungeonFXtopright.src = '/img/frames/dungeon/walls/fx/topright.png';
var dungeonFXtopleft = new Image(); dungeonFXtopleft.src = '/img/frames/dungeon/walls/fx/topleft.png';
var dungeonFXbottomright = new Image(); dungeonFXbottomright.src = '/img/frames/dungeon/walls/fx/bottomright.png';
var dungeonFXbottomleft = new Image(); dungeonFXbottomleft.src = '/img/frames/dungeon/walls/fx/bottomleft.png';
var dungeonShapetop = new Image(); dungeonShapetop.src = '/img/frames/dungeon/walls/shape/top.png';
var dungeonShapeleft = new Image(); dungeonShapeleft.src = '/img/frames/dungeon/walls/shape/left.png';
var dungeonShapebottom = new Image(); dungeonShapebottom.src = '/img/frames/dungeon/walls/shape/bottom.png';
var dungeonShaperight = new Image(); dungeonShaperight.src = '/img/frames/dungeon/walls/shape/right.png';
var dungeonShapetopright = new Image(); dungeonShapetopright.src = '/img/frames/dungeon/walls/shape/topright.png';
var dungeonShapetopleft = new Image(); dungeonShapetopleft.src = '/img/frames/dungeon/walls/shape/topleft.png';
var dungeonShapebottomright = new Image(); dungeonShapebottomright.src = '/img/frames/dungeon/walls/shape/bottomright.png';
var dungeonShapebottomleft = new Image(); dungeonShapebottomleft.src = '/img/frames/dungeon/walls/shape/bottomleft.png';
var dungeonDoorwayShape = new Image(); dungeonDoorwayShape.src = '/img/frames/dungeon/walls/shape/doorway.png';
var dungeonDoorwayFX = new Image(); dungeonDoorwayFX.src = '/img/frames/dungeon/walls/fx/doorway.png';
var dungeonDoorwayArrow = new Image(); dungeonDoorwayArrow.src = '/img/frames/dungeon/walls/arrow.png';
var dungeonDoorwayCutout = new Image(); dungeonDoorwayCutout.src = '/img/frames/dungeon/walls/doorway.png';
var dungeonOuterShape = new Image(); dungeonOuterShape.src = '/img/frames/dungeon/walls/shape/outer.png';
var dungeonOuterFX = new Image(); dungeonOuterFX.src = '/img/frames/dungeon/walls/fx/outer.png';
var dungeonTextureW = new Image(); dungeonTextureW.src = '/img/frames/dungeon/walls/textures/w.png';
var dungeonTextureU = new Image(); dungeonTextureU.src = '/img/frames/dungeon/walls/textures/u.png';
var dungeonTextureB = new Image(); dungeonTextureB.src = '/img/frames/dungeon/walls/textures/b.png';
var dungeonTextureR = new Image(); dungeonTextureR.src = '/img/frames/dungeon/walls/textures/r.png';
var dungeonTextureG = new Image(); dungeonTextureG.src = '/img/frames/dungeon/walls/textures/g.png';
var dungeonTextureC = new Image(); dungeonTextureC.src = '/img/frames/dungeon/walls/textures/c.png';
var dungeonFXtop = new Image(); dungeonFXtop.src = fixUri('/img/frames/dungeon/walls/fx/top.png');
var dungeonFXleft = new Image(); dungeonFXleft.src = fixUri('/img/frames/dungeon/walls/fx/left.png');
var dungeonFXbottom = new Image(); dungeonFXbottom.src = fixUri('/img/frames/dungeon/walls/fx/bottom.png');
var dungeonFXright = new Image(); dungeonFXright.src = fixUri('/img/frames/dungeon/walls/fx/right.png');
var dungeonFXtopright = new Image(); dungeonFXtopright.src = fixUri('/img/frames/dungeon/walls/fx/topright.png');
var dungeonFXtopleft = new Image(); dungeonFXtopleft.src = fixUri('/img/frames/dungeon/walls/fx/topleft.png');
var dungeonFXbottomright = new Image(); dungeonFXbottomright.src = fixUri('/img/frames/dungeon/walls/fx/bottomright.png');
var dungeonFXbottomleft = new Image(); dungeonFXbottomleft.src = fixUri('/img/frames/dungeon/walls/fx/bottomleft.png');
var dungeonShapetop = new Image(); dungeonShapetop.src = fixUri('/img/frames/dungeon/walls/shape/top.png');
var dungeonShapeleft = new Image(); dungeonShapeleft.src = fixUri('/img/frames/dungeon/walls/shape/left.png');
var dungeonShapebottom = new Image(); dungeonShapebottom.src = fixUri('/img/frames/dungeon/walls/shape/bottom.png');
var dungeonShaperight = new Image(); dungeonShaperight.src = fixUri('/img/frames/dungeon/walls/shape/right.png');
var dungeonShapetopright = new Image(); dungeonShapetopright.src = fixUri('/img/frames/dungeon/walls/shape/topright.png');
var dungeonShapetopleft = new Image(); dungeonShapetopleft.src = fixUri('/img/frames/dungeon/walls/shape/topleft.png');
var dungeonShapebottomright = new Image(); dungeonShapebottomright.src = fixUri('/img/frames/dungeon/walls/shape/bottomright.png');
var dungeonShapebottomleft = new Image(); dungeonShapebottomleft.src = fixUri('/img/frames/dungeon/walls/shape/bottomleft.png');
var dungeonDoorwayShape = new Image(); dungeonDoorwayShape.src = fixUri('/img/frames/dungeon/walls/shape/doorway.png');
var dungeonDoorwayFX = new Image(); dungeonDoorwayFX.src = fixUri('/img/frames/dungeon/walls/fx/doorway.png');
var dungeonDoorwayArrow = new Image(); dungeonDoorwayArrow.src = fixUri('/img/frames/dungeon/walls/arrow.png');
var dungeonDoorwayCutout = new Image(); dungeonDoorwayCutout.src = fixUri('/img/frames/dungeon/walls/doorway.png');
var dungeonOuterShape = new Image(); dungeonOuterShape.src = fixUri('/img/frames/dungeon/walls/shape/outer.png');
var dungeonOuterFX = new Image(); dungeonOuterFX.src = fixUri('/img/frames/dungeon/walls/fx/outer.png');
var dungeonTextureW = new Image(); dungeonTextureW.src = fixUri('/img/frames/dungeon/walls/textures/w.png');
var dungeonTextureU = new Image(); dungeonTextureU.src = fixUri('/img/frames/dungeon/walls/textures/u.png');
var dungeonTextureB = new Image(); dungeonTextureB.src = fixUri('/img/frames/dungeon/walls/textures/b.png');
var dungeonTextureR = new Image(); dungeonTextureR.src = fixUri('/img/frames/dungeon/walls/textures/r.png');
var dungeonTextureG = new Image(); dungeonTextureG.src = fixUri('/img/frames/dungeon/walls/textures/g.png');
var dungeonTextureC = new Image(); dungeonTextureC.src = fixUri('/img/frames/dungeon/walls/textures/c.png');
dungeonTextureC.onload = dungeonEditedBuffer;
}

View File

@@ -1,5 +1,6 @@
//checks to see if it needs to run
if (!loadedVersions.includes('/js/frames/versionPlaneswalker.js')) {
console.log('LOADING PLANESWALKER VERSION SCRIPT')
loadedVersions.push('/js/frames/versionPlaneswalker.js');
sizeCanvas('planeswalker');
document.querySelector('#creator-menu-tabs').innerHTML += '<h3 class="selectable readable-background" onclick="toggleCreatorTabs(event, `planeswalker`)">Planeswalker</h3>';
@@ -42,22 +43,22 @@ if (!loadedVersions.includes('/js/frames/versionPlaneswalker.js')) {
window.planeswalkerAbilityLayout = [[[0.7467], [0.6953, 0.822], [0.6639, 0.7467, 0.8362], [0.6505, 0.72, 0.7905, 0.861]],[[0.72], [0.6391, 0.801], [0.5986, 0.72, 0.8415], [0.5986, 0.6796, 0.7605, 0.8415]]];
document.querySelector('#creator-menu-sections').appendChild(newHTML);
var plusIcon = new Image();
plusIcon.src = '/img/frames/planeswalker/planeswalkerPlus.png';
plusIcon.src = fixUri('/img/frames/planeswalker/planeswalkerPlus.png');
var minusIcon = new Image();
minusIcon.src = '/img/frames/planeswalker/planeswalkerMinus.png';
minusIcon.src = fixUri('/img/frames/planeswalker/planeswalkerMinus.png');
var neutralIcon = new Image();
neutralIcon.src = '/img/frames/planeswalker/planeswalkerNeutral.png';
neutralIcon.src = fixUri('/img/frames/planeswalker/planeswalkerNeutral.png');
var lightToDark = new Image();
lightToDark.src = '/img/frames/planeswalker/abilityLineOdd.png';
lightToDark.src = fixUri('/img/frames/planeswalker/abilityLineOdd.png');
var darkToLight = new Image();
darkToLight.src = '/img/frames/planeswalker/abilityLineEven.png';
darkToLight.src = fixUri('/img/frames/planeswalker/abilityLineEven.png');
var planeswalkerTextMask = new Image();
planeswalkerTextMask.onload = function(){fixPlaneswalkerInputs(planeswalkerEdited);}
planeswalkerTextMask.src = '/img/frames/planeswalker/planeswalkerMaskText.png';
planeswalkerTextMask.src = fixUri('/img/frames/planeswalker/planeswalkerMaskText.png');
var lightColor = 'white';
var darkColor = '#a4a4a4';
} else {
planeswalkerEdited();
fixPlaneswalkerInputs(planeswalkerEdited);
}
function planeswalkerEdited() {
@@ -65,15 +66,15 @@ function planeswalkerEdited() {
if (card.version == 'planeswalkerTall') {
planeswalkerTall = 1;
if (!planeswalkerTextMask.src.includes('tall')) {
planeswalkerTextMask.src = '/img/frames/planeswalker/tall/planeswalkerTallMaskRules.png';
planeswalkerTextMask.src = fixUri('/img/frames/planeswalker/tall/planeswalkerTallMaskRules.png');
}
} else if (card.version == 'planeswalkerMDFC') {
if (!planeswalkerTextMask.src.includes('mdfc')) {
planeswalkerTextMask.src = '/img/frames/planeswalker/mdfc/text.svg';
planeswalkerTextMask.src = fixUri('/img/frames/planeswalker/mdfc/text.svg');
}
} else {
if (planeswalkerTextMask.src.includes('tall') || planeswalkerTextMask.src.includes('mdfc')) {
planeswalkerTextMask.src = '/img/frames/planeswalker/planeswalkerMaskText.png';
planeswalkerTextMask.src = fixUri('/img/frames/planeswalker/planeswalkerMaskText.png');
}
}
card.planeswalker.abilities[0] = document.querySelector('#planeswalker-cost-0').value;
@@ -190,12 +191,12 @@ function invertPlaneswalkerColors(reverse = false) {
if (card.planeswalker.invert) {
darkColor = '#5b5b5b';
lightColor = 'black';
lightToDark.src = '/img/frames/planeswalker/abilityLineOddDarkened.png';
darkToLight.src = '/img/frames/planeswalker/abilityLineEvenDarkened.png';
lightToDark.src = fixUri('/img/frames/planeswalker/abilityLineOddDarkened.png');
darkToLight.src = fixUri('/img/frames/planeswalker/abilityLineEvenDarkened.png');
} else {
darkColor = '#a4a4a4';
lightColor = 'white';
lightToDark.src = '/img/frames/planeswalker/abilityLineOdd.png';
darkToLight.src = '/img/frames/planeswalker/abilityLineEven.png';
lightToDark.src = fixUri('/img/frames/planeswalker/abilityLineOdd.png');
darkToLight.src = fixUri('/img/frames/planeswalker/abilityLineEven.png');
}
}

View File

@@ -35,9 +35,9 @@ if (!loadedVersions.includes('/js/frames/versionSaga.js')) {
}
document.querySelector('#creator-menu-sections').appendChild(newHTML);
var sagaChapter = new Image();
sagaChapter.src = '/img/frames/saga/sagaChapter.png';
sagaChapter.src = fixUri('/img/frames/saga/sagaChapter.png');
var sagaDivider = new Image();
sagaDivider.src = '/img/frames/saga/sagaDivider.png';
sagaDivider.src = fixUri('/img/frames/saga/sagaDivider.png');
sagaChapter.onload = sagaDivider.onload = sagaEdited;
fixSagaInputs(sagaEdited);
}