Permalink
Browse files

Credit the artists

  • Loading branch information...
Manuel-777 committed Nov 8, 2018
1 parent 37edaf8 commit 2325b5a24c2a63c1bc4c5d1c473bb11979324951
Showing with 47 additions and 17 deletions.
  1. +1 −1 package.json
  2. +6 −0 shared/shared.css
  3. +11 −6 window_background/background.js
  4. +1 −0 window_main/index.html
  5. +28 −10 window_main/renderer.js
@@ -3,7 +3,7 @@
"description": "An MTG Arena deck tracker and statistics manager.",
"author": "Manuel-777",
"repository": "https://github.com/Manuel-777/MTG-Arena-Tool",
"version": "2.1.16",
"version": "2.1.17",
"main": "main.js",
"build": {
"appId": "com.github.manuel777.mtgatool",
@@ -285,6 +285,12 @@ label {
opacity: 0.33;
}
.top_artist {
line-height: 32px;
font-style: italic;
color: rgba(250, 229, 210, 0.4);
}
.button {
-webkit-app-region: no-drag;
@@ -1770,13 +1770,18 @@ function gre_to_client(data) {
affected.forEach(function(affd) {
if (gameObjs[aff] !== undefined) {
if (affd == playerSeat || affd == oppSeat) {
actionLog(gameObjs[aff].controllerSeatId, new Date(), actionLogGenerateLink(gameObjs[aff].grpId)+" dealt "+damage+" damage to "+getNameBySeat(affd));
//ipc_send("ipc_log", gameObjs[aff].name+" dealt "+damage+" damage to "+getNameBySeat(affd));
try {
if (affd == playerSeat || affd == oppSeat) {
actionLog(gameObjs[aff].controllerSeatId, new Date(), actionLogGenerateLink(gameObjs[aff].grpId)+" dealt "+damage+" damage to "+getNameBySeat(affd));
//ipc_send("ipc_log", gameObjs[aff].name+" dealt "+damage+" damage to "+getNameBySeat(affd));
}
else {
actionLog(gameObjs[aff].controllerSeatId, new Date(), actionLogGenerateLink(gameObjs[aff].grpId)+" dealt "+damage+" damage to "+actionLogGenerateLink(gameObjs[affd].grpId));
//ipc_send("ipc_log", gameObjs[aff].name+" dealt "+damage+" damage to "+gameObjs[affd]);
}
}
else {
actionLog(gameObjs[aff].controllerSeatId, new Date(), actionLogGenerateLink(gameObjs[aff].grpId)+" dealt "+damage+" damage to "+actionLogGenerateLink(gameObjs[affd].grpId));
//ipc_send("ipc_log", gameObjs[aff].name+" dealt "+damage+" damage to "+gameObjs[affd]);
catch (e) {
}
}
});
@@ -24,6 +24,7 @@
<div class="top">
<div class="flex_item">
<div class="top_logo"></div>
<div class="top_artist">Githu Lavarunner by Jesper Ejsing</div>>
</div>
<div class="flex_item">
<div class="unlink" title="You are not logged-in."></div>
@@ -2169,7 +2169,7 @@ function open_deck(i, type) {
var tileGrpid = _deck.deckTileId;
if (cardsDb.get(tileGrpid)) {
change_background("https://img.scryfall.com/cards"+cardsDb.get(tileGrpid).images["art_crop"]);
change_background("", tileGrpid);
}
var fld = $('<div class="flex_item"></div>');
@@ -2726,7 +2726,7 @@ function open_draft(id, tileGrpid, set) {
top.append(flr);
if (cardsDb.get(tileGrpid)) {
change_background("https://img.scryfall.com/cards"+cardsDb.get(tileGrpid).images["art_crop"]);
change_background("", tileGrpid);
}
var cont = $('<div class="flex_item" style="flex-direction: column;"></div>');
@@ -2823,7 +2823,7 @@ function open_match(id) {
var tileGrpid = match.playerDeck.deckTileId;
if (cardsDb.get(tileGrpid)) {
change_background("https://img.scryfall.com/cards/art_crop/en/"+get_set_scryfall(cardsDb.get(tileGrpid).set)+"/"+cardsDb.get(tileGrpid).cid+".jpg");
change_background("", tileGrpid);
}
var fld = $('<div class="flex_item"></div>');
@@ -3160,7 +3160,7 @@ function printStats() {
const stats = get_collection_stats();
const top = $('<div class="decklist_top"><div class="button back"></div><div class="deck_name">Collection Statistics</div><div class="deck_top_colors"></div></div>');
change_background("http://www.artofmtg.com/wp-content/uploads/2018/04/Urzas-Tome-Dominaria-MtG-Art.jpg");
change_background("", 67574);
const flex = $('<div class="flex_item"></div>');
const mainstats = $('<div class="main_stats"></div>');
@@ -3679,7 +3679,6 @@ function open_settings(openSection) {
about.append('<div class="message_sub_15 white">By Manuel Etchegaray, 2018</div>');
about.append('<div class="message_sub_15 white">Version '+window.electron.remote.app.getVersion()+'</div>');
if (updateState.state == 0) {
about.append('<div class="message_updates white">Checking for updates..</div>');
}
@@ -3841,13 +3840,24 @@ function transparencyFromAlpha(alpha) {
}
//
function change_background(arg) {
function change_background(arg, grpId = 0) {
var artistLine = "";
var _card = cardsDb.get(grpId);
console.log(arg, grpId, _card);
if (arg == "default") {
arg = defaultBackground;
}
if (arg == "") {
$('.main_wrapper').css("background-image", "");
$('.top_artist').html("Githu Lavarunner by Jesper Ejsing");
if (defaultBackground == "") {
$('.main_wrapper').css("background-image", "url(../images/Ghitu-Lavarunner-Dominaria-MtG-Art.jpg)");
}
else {
$('.main_wrapper').css("background-image", "url("+defaultBackground+")");
}
}
else if (_card != false) {
console.log(_card.images["art_crop"]);
$('.main_wrapper').css("background-image", "url(https://img.scryfall.com/cards"+_card.images["art_crop"]+")");
}
else if (fs.existsSync(arg)) {
$('.main_wrapper').css("background-image", "url("+arg+")");
}
@@ -3863,6 +3873,14 @@ function change_background(arg) {
}
});
}
if (_card) {
try {
artistLine = _card.name+" by "+_card.artist;
$('.top_artist').html(artistLine);
}
catch (e) {}
}
}
//

0 comments on commit 2325b5a

Please sign in to comment.