Skip to content

Commit

Permalink
Preparing release 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Yemachu committed Sep 14, 2019
2 parents b1d9aa2 + 2987162 commit 8682861
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build/cardmaker.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/tcg/ygo/CardMaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ define(["react", "react-class", "./Card", "webfont"], function App(React, ReactC
e("label", null, "Defense and/or Link", e("input", { onChange: this.updateField("card.def"), type: "text", value: this.state.card.def })),
e("label", null, "Set id", e("input", { onChange: this.updateField("card.id"), type: "text", value: this.state.card.id })),
e("label", null, "Serial number", e("input", { onChange: this.updateField("card.serial"), type: "text", value: this.state.card.serial })),
e("button", {onClick: this.randomizeSerialNumber }, "Randomize"),
e("label", null, "Copyright", e("input", { onChange: this.updateField("card.copyright"), type: "text", value: this.state.card.copyright })),


Expand Down Expand Up @@ -340,6 +341,14 @@ define(["react", "react-class", "./Card", "webfont"], function App(React, ReactC
fr.readAsDataURL(files[0]);
}
}.bind(this);
},

randomizeSerialNumber: function()
{
var value = "0000000000" + (Math.random() * 10000000000).toFixed(0);
console.log(typeof value);

this.updateField("card.serial")({target:{value: value.substring(value.length-10)}});
}
});
});
3 changes: 2 additions & 1 deletion src/tcg/ygo/Rarities.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ define([], function()
return {
common: { name: "Common", foil: undefined, color: undefined },
rare: { name: "Rare", foil: undefined, color: "silver"},
secret: { name: "Secret rare", foil: [ path, "Secret.png" ].join("/"), color: "silver" }
ultra: { name: "Ultra rare", foil: [ path, "Secret.png" ].join("/"), color: "gold" },
secret: { name: "Secret rare", foil: [ path, "Secret.png" ].join("/"), color: "silver" },
};
});
5 changes: 3 additions & 2 deletions src/tcg/ygo/layout/component/CardName.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ define(["react", "react-class", "draw/Text", "../../Rarities"], function CardNam
var colors = {
default: { highlight: { color: "transparent" }, base: { color: "#000"} },
white: { highlight: { color: "transparent" }, base: { color: "#FFF"} },
silver: { highlight: { color: "#FFF" }, base: { color: "#222"} }
silver: { highlight: { color: "#b6b6b6" }, base: { color: "#1e1e1e"} },
gold: { highlight: { color: "#d3b146"}, base: {color: "#4e3518"}}
}

var CardName = ReactClass({
Expand All @@ -47,7 +48,7 @@ define(["react", "react-class", "draw/Text", "../../Rarities"], function CardNam
React.createElement(Text,
{
text: this.props.value,
style: Object.assign({}, style, (colors[color] || colors.default).highlight, { top: style.top+1 }),
style: Object.assign({}, style, (colors[color] || colors.default).highlight, { top: style.top-1, left: style.left-1 }),
repaint: this.props.repaint,
canvas: this.props.canvas
}),
Expand Down

0 comments on commit 8682861

Please sign in to comment.