mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-26 21:04:58 -05:00
Add Compleated Planeswalker frame
This commit is contained in:
@@ -2831,6 +2831,23 @@ function autoFitArt() {
|
||||
}
|
||||
artEdited();
|
||||
}
|
||||
|
||||
function centerArtX() {
|
||||
document.querySelector('#art-rotate').value = 0;
|
||||
if (art.width / art.height > scaleWidth(card.artBounds.width) / scaleHeight(card.artBounds.height)) {
|
||||
document.querySelector('#art-x').value = Math.round(scaleX(card.artBounds.x) - (document.querySelector('#art-zoom').value / 100 * art.width - scaleWidth(card.artBounds.width)) / 2 - scaleWidth(card.marginX));
|
||||
} else {
|
||||
document.querySelector('#art-x').value = Math.round(scaleX(card.artBounds.x) - scaleWidth(card.marginX));
|
||||
}
|
||||
artEdited();
|
||||
}
|
||||
|
||||
function centerArtY() {
|
||||
document.querySelector('#art-rotate').value = 0;
|
||||
document.querySelector('#art-y').value = Math.round(scaleY(card.artBounds.y) - (document.querySelector('#art-zoom').value / 100 * art.height - scaleHeight(card.artBounds.height)) / 2 - scaleHeight(card.marginY));
|
||||
artEdited();
|
||||
}
|
||||
|
||||
function artFromScryfall(scryfallResponse) {
|
||||
scryfallArt = []
|
||||
const artIndex = document.querySelector('#art-index');
|
||||
@@ -3328,7 +3345,7 @@ function changeCardIndex() {
|
||||
planeswalkerAbility = ['', planeswalkerAbility[0]];
|
||||
}
|
||||
card.text['ability' + i].text = planeswalkerAbility[1].replace('(', '{i}(').replace(')', '){/i}');
|
||||
if (card.version == 'planeswalkerTall') {
|
||||
if (card.version == 'planeswalkerTall' || card.version == 'planeswalkerCompleated') {
|
||||
document.querySelector('#planeswalker-height-' + i).value = Math.round(scaleHeight(0.3572) / planeswalkerAbilities.length);
|
||||
} else {
|
||||
document.querySelector('#planeswalker-height-' + i).value = Math.round(scaleHeight(0.2915) / planeswalkerAbilities.length);
|
||||
|
@@ -74,6 +74,7 @@ const frameNames = new Map ([
|
||||
['Planeswalker Extended Art', 'PlaneswalkerBoxTopper'],
|
||||
['Planeswalker Tall', 'PlaneswalkerTall'],
|
||||
['Planeswalker Tall Borderless', 'PlaneswalkerTallBorderless'],
|
||||
['Planeswalker Compleated', 'PlaneswalkerCompleated'],
|
||||
['Planeswalker Holo Stamps', 'PlaneswalkerHoloStamps'],
|
||||
['Planeswalker Nickname', 'PlaneswalkerNickname'],
|
||||
['Planeswalker Blackout (SDCC15)', 'PlaneswalkerSDCC15'],
|
||||
|
@@ -4,6 +4,7 @@ loadFramePacks([
|
||||
{name:'Extended Art', value:'PlaneswalkerBoxTopper'},
|
||||
{name:'Tall', value:'PlaneswalkerTall'},
|
||||
{name:'Tall Borderless', value:'PlaneswalkerTallBorderless'},
|
||||
{name:'Compleated', value:'PlaneswalkerCompleated'},
|
||||
{name:'Addons', value:'disabled'},
|
||||
{name:'Holo Stamps', value:'PlaneswalkerHoloStamps'},
|
||||
{name:'Special Frames', value:'disabled'},
|
||||
|
51
js/frames/packPlaneswalkerCompleated.js
Normal file
51
js/frames/packPlaneswalkerCompleated.js
Normal file
@@ -0,0 +1,51 @@
|
||||
//Create objects for common properties across available frames
|
||||
var masks = [{src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedMaskPinline.png', name:'Pinline'}, {src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedMaskTitle.png', name:'Title'}, {src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedMaskType.png', name:'Type'}, {src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedMaskFrame.png', name:'Frame'}, {src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedMaskBorder.png', name:'Border'}, {src:'/img/frames/planeswalker/maskLoyalty.png', name:'Loyalty'}];
|
||||
var bounds = {x:662/1500, y:1894/2100, width:176/1500, height:100/2100};
|
||||
//defines available frames
|
||||
availableFrames = [
|
||||
{name:'White Frame', src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedW.png', masks:masks},
|
||||
{name:'Blue Frame', src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedU.png', masks:masks},
|
||||
{name:'Black Frame', src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedB.png', masks:masks},
|
||||
{name:'Red Frame', src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedR.png', masks:masks},
|
||||
{name:'Green Frame', src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedG.png', masks:masks},
|
||||
{name:'Multicolored Frame', src:'/img/frames/planeswalker/compleated/planeswalkerCompleatedM.png', masks:masks},
|
||||
{name:'White Holo Stamp', src:'/img/frames/planeswalker/compleated/holo/w.png', bounds: bounds},
|
||||
{name:'Blue Holo Stamp', src:'/img/frames/planeswalker/compleated/holo/u.png', bounds: bounds},
|
||||
{name:'Black Holo Stamp', src:'/img/frames/planeswalker/compleated/holo/b.png', bounds: bounds},
|
||||
{name:'Red Holo Stamp', src:'/img/frames/planeswalker/compleated/holo/r.png', bounds: bounds},
|
||||
{name:'Green Holo Stamp', src:'/img/frames/planeswalker/compleated/holo/g.png', bounds: bounds},
|
||||
{name:'Multicolored Holo Stamp', src:'/img/frames/planeswalker/compleated/holo/mm.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 = 'planeswalkerTall';
|
||||
card.onload = '/js/frames/versionPlaneswalker.js';
|
||||
loadScript('/js/frames/versionPlaneswalker.js');
|
||||
//art bounds
|
||||
card.artBounds = {x:0.068, y:0.101, width:0.864, height:0.8143};
|
||||
autoFitArt();
|
||||
//set symbol bounds
|
||||
card.setSymbolBounds = {x:0.9227, y:0.5234, width:0.12, height:0.0381, 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.0481, 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.0867, y:0.0372, width:0.8267, height:0.0548, oneLine:true, font:'belerenb', size:0.0381},
|
||||
type: {name:'Type', text:'', x:0.0867, y:0.4967, width:0.8267, height:0.0548, oneLine:true, font:'belerenb', size:0.0324},
|
||||
ability0: {name:'Ability 1', text:'', x:0.18, y:0.5581, width:0.7467, height:0.0896, size:0.0353},
|
||||
ability1: {name:'Ability 2', text:'', x:0.18, y:0, width:0.7467, height:0.0896, size:0.0353},
|
||||
ability2: {name:'Ability 3', text:'', x:0.18, y:0, width:0.7467, height:0.0896, size:0.0353},
|
||||
ability3: {name:'Ability 4', text:'', x:0.18, y:0, width:0.7467, height:0.0896, size:0.0353},
|
||||
loyalty: {name:'Loyalty', text:'', x:0.806, y:0.902, width:0.14, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center', color:'white'}
|
||||
});
|
||||
}
|
||||
//loads available frames
|
||||
loadFramePack();
|
@@ -38,7 +38,11 @@ if (!loadedVersions.includes('/js/frames/versionPlaneswalker.js')) {
|
||||
<input id='planeswalker-invert' class='input margin-bottom' type='checkbox' onchange='invertPlaneswalkerColors();'>
|
||||
</div>`;
|
||||
if (!card.planeswalker) {
|
||||
card.planeswalker = {abilities:['+1', '0', '-7', ''], abilityAdjust:[0, 0, 0, 0], count:3, x:0.1167, width:0.8094};
|
||||
if (card.version.includes('Compleated')) {
|
||||
card.planeswalker = {abilities:['+1', '0', '-7', ''], abilityAdjust:[0, 0, 0, 0], count:3, x:0.1167, width:0.8094};
|
||||
} else {
|
||||
card.planeswalker = {abilities:['', '+1', '0', '-7'], abilityAdjust:[0, 0, 0, 0], count:3, x:0.1167, width:0.8094};
|
||||
}
|
||||
}
|
||||
if (card.version == 'planeswalkerSeventh') {
|
||||
card.planeswalker.abilityAdjust = [-0.0143, -0.0143, -0.0143, -0.0143];
|
||||
@@ -67,9 +71,9 @@ if (!loadedVersions.includes('/js/frames/versionPlaneswalker.js')) {
|
||||
function planeswalkerEdited() {
|
||||
// manage text masks
|
||||
var planeswalkerTall = 0;
|
||||
if (card.version.includes('Tall')) {
|
||||
if (card.version.includes('Tall') || card.version.includes('Compleated')) {
|
||||
planeswalkerTall = 1;
|
||||
if (!planeswalkerTextMask.src.includes('tall')) {
|
||||
if (!(planeswalkerTextMask.src.includes('tall'))) {
|
||||
setImageUrl(planeswalkerTextMask, '/img/frames/planeswalker/tall/planeswalkerTallMaskRules.png');
|
||||
}
|
||||
} else if (card.version == 'planeswalkerTransformFront') {
|
||||
|
Reference in New Issue
Block a user