Permalink
Browse files

Merge branch 'master' into master

  • Loading branch information...
KyleADOlson committed Jan 20, 2019
2 parents 39a0971 + d59f632 commit 138e4daf071c914ad3bffe9600a30ddc5355403a
@@ -46,6 +46,7 @@ MTG Arena Tool is developed using Electron JS, To get started simply clone this

```
git clone https://github.com/Manuel-777/MTG-Arena-Tool
cd MTG-Arena-Tool
npm install
npm start
```
@@ -1,5 +1,24 @@
This is meant as a guide to help you locate and resolve the most common issues running MTG Arena Tool. **Please** only follow these steps if you encounter one of the issues mentioned.

### Stuck on 'please wait a minute' (without loading %)

Refer to this issue, the solution is on the comments;
[github.com/Manuel-777/MTG-Arena-Tool/issues/112](https://github.com/Manuel-777/MTG-Arena-Tool/issues/112)

### Overlay is a black or white box

Change the 'Overlay Scale' and 'Overlay transparency' settings to any value, then restart mtgatool.

### Overlay is not visible, but visible in the taskbar (offscreen)
Use `Alt+Tab` to switch to the off-screen application.
Press `Alt+SPACE` to bring up the system menu (you won't see it because it is off screen)
Press `R` to select the "Restore" menu choice to ensure the windows isn't maximized (you cannot move it if it is maximized)
Press `Alt+SPACE` again, then M to select the "Move" menu choice.
Press one of the arrow keys to initiate the movement.
Now just use the mouse to place the window where you want.

[Link](https://superuser.com/questions/53585/how-to-move-windows-that-open-up-offscreen)

### If the app freezes in loading "Just a second" page:
This is probably caused by an error reading the user configuration, probably due to an unhandled exception or new data added from MTGA that mtgatool is not handling properly. Bear in mind this issue is **not** because of a bad or improper installation, so reinstalling will make no difference. Altrough, you can roll back to a previous version safely if an update caused it.

@@ -23,11 +42,6 @@ If the last step worked, send the the .json file to [mtgatool@gmail.com](mailto:

Close MTG Arena and MTG Arena tool, then start MTG Arena. Once MTG Arena is loaded run MTG Arena Tool again.

### Stuck on 'please wait a minute' (without loading %)

Refer to this issue, the solution is on the comments;
[github.com/Manuel-777/MTG-Arena-Tool/issues/112](https://github.com/Manuel-777/MTG-Arena-Tool/issues/112)

### If you have any other unexpected behaviour

First of all, uninstalling and installing again will probably not change anything, as most errors are either configuration errors or log provessing errors. Neither of them are solved by uninstalling. So, just to save you some time, make sure you have the latest version only.
Binary file not shown.
BIN -48 Bytes (99%) images/status_green.png
Binary file not shown.
BIN -47 Bytes (99%) images/status_red.png
Binary file not shown.
BIN -43 Bytes (99%) images/status_yellow.png
Binary file not shown.
@@ -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.2.12",
"version": "2.2.13",
"main": "main.js",
"build": {
"appId": "com.github.manuel777.mtgatool",
@@ -24,7 +24,7 @@ body {
}

label {
font-family: var(--main-font-name);
font-family: "Roboto";
color: rgba(250, 229, 210, 1);
margin: auto 0;
}
@@ -692,6 +692,7 @@ function updateSettings(_settings, relay) {
if (_settings.overlay_deck == undefined) _settings.overlay_deck = true;
if (_settings.overlay_clock == undefined) _settings.overlay_clock = true;
if (_settings.overlay_ontop == undefined) _settings.overlay_ontop = true;
if (_settings.overlay_scale == undefined) _settings.overlay_scale = 100;

ipc_send("overlay_set_ontop", _settings.overlay_ontop);

@@ -239,13 +239,23 @@ function removeFromHttp(req) {
});
}

function heartbeatClear() {
httpAsync.forEach( function(h, i) {
if (h.method == "heartbeat") {
httpAsync.splice(i, 1);
}
});
}

function httpAuth(user, pass) {
heartbeatClear();
var _id = makeId(6);
playerUsername = user;
httpAsync.push({'reqId': _id, 'method': 'auth', 'method_path': '/login.php', 'email': user, 'password': pass, 'playerid': playerId, 'playername': playerName, 'mtgaversion': arenaVersion, 'version': window.electron.remote.app.getVersion()});
}

function httpSubmitCourse(course) {
heartbeatClear();
var _id = makeId(6);
if (store.get("settings").anon_explore == true) {
course.PlayerId = "000000000000000";
@@ -256,104 +266,128 @@ function httpSubmitCourse(course) {
}

function httpSetPlayer() {
//heartbeatClear();
// useless I think
//var _id = makeId(6);
//httpAsync.push({'reqId': _id, 'method': 'set_player', 'name': name, 'rank': rank, 'tier': tier});
}

function httpGetTopDecks(query, collection) {
heartbeatClear();
var _id = makeId(6);
collection = JSON.stringify(collection);
httpAsync.push({'reqId': _id, 'method': 'get_top_decks', 'method_path': '/get_courses_list.php', 'query': query, 'collection': collection});
}

function httpGetTopLadderDecks() {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'get_ladder_decks', 'method_path': '/top_ladder.json'});
}

function httpGetCourse(courseId) {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'get_course', 'method_path': '/get_course.php', 'courseid': courseId});
}

function httpSetMatch(match) {
heartbeatClear();
var _id = makeId(6);
match = JSON.stringify(match);
httpAsync.push({'reqId': _id, 'method': 'set_match', 'method_path': '/send_match.php', 'match': match});
}

function httpSetDraft(draft) {
heartbeatClear();
var _id = makeId(6);
draft = JSON.stringify(draft);
httpAsync.push({'reqId': _id, 'method': 'set_draft', 'method_path': '/send_draft.php', 'draft': draft});
}

function httpSetEconomy(change) {
heartbeatClear();
var _id = makeId(6);
change = JSON.stringify(change);
httpAsync.push({'reqId': _id, 'method': 'set_economy', 'method_path': '/send_economy.php', 'change': change});
}

function httpSendError(error) {
heartbeatClear();
var _id = makeId(6);
error = JSON.stringify(error);
httpAsync.push({'reqId': _id, 'method': 'send_error', 'method_path': '/send_error.php', 'error': error});
}

function httpDeleteData() {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'delete_data', 'method_path': '/delete_data.php'});
}

function httpGetDatabase() {
heartbeatClear();
var _id = makeId(6);
ipc_send("popup", {"text": "Downloading metadata", "time": 0});
httpAsync.push({'reqId': _id, 'method': 'get_database'});
}

function htttpGetStatus() {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'get_status'});
}

function httpDraftShareLink(did, exp) {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'share_draft', 'method_path': '/get_share_draft.php', 'id': did, 'expire': exp});
}

function httpTournamentList() {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'tou_list', 'method_path': '/tournament_list.php'});
}

function httpTournamentGet(tid) {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'tou_get', 'method_path': '/tournament_get.php', 'id': tid});
}

function httpTournamentJoin(tid, _deck) {
heartbeatClear();
let _id = makeId(6);
let deck = JSON.stringify(decks[_deck]);
httpAsync.push({'reqId': _id, 'method': 'tou_join', 'method_path': '/tournament_join.php', 'id': tid, 'deck': deck});
}

function httpTournamentDrop(tid) {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'tou_drop', 'method_path': '/tournament_drop.php', 'id': tid});
}

function httpTournamentCheck(deck, opp, setCheck) {
heartbeatClear();
var _id = makeId(6);
deck = JSON.stringify(deck);
httpAsync.push({'reqId': _id, 'method': 'tou_check', 'method_path': '/check_match.php', 'deck': deck, 'opp': opp, 'setcheck': setCheck});
}

function httpHeartbeat() {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'heartbeat', 'method_path': '/heartbeat.php'});
}

function httpSetMythicRank(opp, rank) {
heartbeatClear();
var _id = makeId(6);
httpAsync.push({'reqId': _id, 'method': 'mythicrank', 'method_path': '/send_mythic_rank.php', 'opp': opp, 'rank': rank});
}

module.exports = {
httpAuth,
httpSubmitCourse,
@@ -373,5 +407,6 @@ module.exports = {
httpTournamentGet,
httpTournamentJoin,
httpTournamentDrop,
httpTournamentCheck
httpTournamentCheck,
httpSetMythicRank
};
@@ -654,6 +654,10 @@ function onLabelEventMatchCreated(entry, json) {
if (!json) return;
matchBeginTime = parseWotcTime(entry.timestamp);

if (entry.opponentRankingClass == "Mythic") {
httpApi.httpSetMythicRank(entry.opponentScreenName, entry.opponentMythicLeaderboardPlace);
}

ipc_send("ipc_log", "MATCH CREATED: "+matchBeginTime);
if (json.eventId != "NPE") {
createMatch(json);
@@ -195,7 +195,7 @@ function open_decks_tab() {
d.classList.add('list_deck_winrate');

let colClass = getWinrateClass(wr.total);
d.innerHTML = `Wins: ${wr.wins} / Losses: ${wr.losses} <span class="${colClass}_bright">(${Math.round(wr.total*100)}%)</span>`;
d.innerHTML = `${wr.wins}:${wr.losses} <span class="${colClass}_bright">(${Math.round(wr.total*100)}%)</span>`;
flr.appendChild(d);

d = document.createElement("div");
@@ -258,9 +258,10 @@ function open_decks_tab() {
d = document.createElement("div");
d.classList.add('list_deck_winrate');
wrTotal = 1 / wrTotal * wrTotalWins;
wrTotal = wrTotal || 0;

let colClass = getWinrateClass(wrTotal);
d.innerHTML = `Wins: ${wrTotalWins} / Losses: ${wrTotalLosses} (<span class="${colClass}_bright">${Math.round(wrTotal*100)}%</span>)`;
d.innerHTML = `${wrTotalWins}:${wrTotalLosses} (<span class="${colClass}_bright">${Math.round(wrTotal*100)}%</span>)`;
dtwr.appendChild(d);

$("#ux_0").append('<div class="list_fill"></div>');
@@ -190,7 +190,6 @@ function open_economy_tab(loadMore) {
div.classList.add("flex_item");

let fll = document.createElement("div");
fll.classList.add("economy_sub");
div.classList.add("flex_item");
fll.style.lineHeight = "64px";

@@ -481,23 +480,34 @@ function open_economy_tab(loadMore) {
change.aetherizedCards.forEach(function(obj) {
var grpId = obj.grpId;
var card = cardsDb.get(grpId);
if (card && change.delta.cardsAdded.indexOf(grpId) == -1) {
let draw = false;
if (card) {
if (change.delta.cardsAdded) {
if (change.delta.cardsAdded.indexOf(grpId) == -1) {
draw = true;
}
}
else {
draw = true;
}
}
if (draw) {
var d = document.createElement("div");
d.classList.add("inventory_card");
d.style.width = "39px";

var img = document.createElement("img");
img.classList.add("inventory_card_img");
img.classList.add("inventory_card_aetherized");
img.style.width = "39px";
img.src = "https://img.scryfall.com/cards"+card.images[cardQuality];

d.appendChild(img);
flr.appendChild(d);

var imgDom = $(img);
addCardHover(imgDom, card);

imgDom.on('click', function() {
if (cardsDb.get(grpId).dfc == 'SplitHalf') {
card = cardsDb.get(card.dfcId);
@@ -315,6 +315,7 @@ function ladderLoadMore(loadMore, ownedWildcards) {
var flr = document.createElement("div");
flr.classList.add("flex_item");
flr.style.flexDirection = "column";
flr.style.justifyContent = "center";
flr.style.width = '40%';

var flt = document.createElement("div");
@@ -344,13 +345,14 @@ function ladderLoadMore(loadMore, ownedWildcards) {
d = document.createElement("div");
d.classList.add("list_deck_record");
let colClass = getWinrateClass(1/_deck.t*_deck.w);
d.innerHTML = `'Wins: ${_deck.w} / Losses: ${_deck.l} <span class="${colClass}_bright">(${Math.round(100/_deck.t*_deck.w)}%)</span>`;
d.innerHTML = `${_deck.w}:${_deck.l} <span class="${colClass}_bright">(${Math.round(100/_deck.t*_deck.w)}%)</span>`;
flr.appendChild(d);

let rcont = document.createElement("div");
rcont.style.marginLeft = 'auto';
var pr = document.createElement("div");
pr.classList.add("ranks_16");
pr.style.marginTop = "4px";
pr.style.backgroundPosition = (get_rank_index_16(_deck.rank)*-16)+"px 0px";
pr.title = _deck.rank;

@@ -492,6 +494,7 @@ function exploreLoadMore(loadMore, ownedWildcards) {
var flr = document.createElement("div");
flr.classList.add("flex_item");
flr.style.flexDirection = "column";
flr.style.justifyContent = "center";
flr.style.width = '40%';

var flt = document.createElement("div");
@@ -520,7 +523,9 @@ function exploreLoadMore(loadMore, ownedWildcards) {

d = document.createElement("div");
d.classList.add("list_deck_record");
d.innerHTML = _deck.wins+' - '+_deck.losses;

let colClass = getWinrateClass(1/(_deck.wins+_deck.losses)*_deck.wins);
d.innerHTML = `${_deck.wins}:${_deck.losses} <span class="${colClass}_bright">(${Math.round(100/(_deck.wins+_deck.losses)*_deck.wins)}%)</span>`;
flr.appendChild(d);

d = document.createElement("div");
@@ -403,7 +403,7 @@ function renderRanksStats(div) {
let expected = getStepsUntilNextRank(seasonView, lastWinrate/100);
t = document.createElement("div");
t.classList.add("ranks_history_title");
t.innerHTML = `Games until ${getNextRank(seasonView)}: ~${expected}`;
t.innerHTML = `Games until ${getNextRank(seasonView)}: ${expected}`;
div.appendChild(t);


@@ -462,7 +462,7 @@ function getStepsUntilNextRank(mode, winrate) {
n++;
}

return n;
return '~'+n;
}

function addShare(_match) {
Oops, something went wrong.

0 comments on commit 138e4da

Please sign in to comment.