Skip to content
Permalink
Browse files

Merge branch 'master' into small-sample-size

  • Loading branch information...
lusbenjamin committed Sep 11, 2019
2 parents da29dae + a0beec6 commit ac12200e2db0f08cad98299269e7f5b4d60caf42
@@ -1,3 +1,15 @@
## <small>2.9.4 (2019-09-10)</small>

* add future play events ([b141c39](https://github.com/Manuel-777/MTG-Arena-Tool/commit/b141c39))
* bugfix player-data.draftExists still requires draft_index check ([7c8e035](https://github.com/Manuel-777/MTG-Arena-Tool/commit/7c8e035))
* database date ([3991264](https://github.com/Manuel-777/MTG-Arena-Tool/commit/3991264))
* Fixed simple typo ([6214160](https://github.com/Manuel-777/MTG-Arena-Tool/commit/6214160))
* Update database.json ([54e1bd1](https://github.com/Manuel-777/MTG-Arena-Tool/commit/54e1bd1))
* Update package-lock.json ([48ed9eb](https://github.com/Manuel-777/MTG-Arena-Tool/commit/48ed9eb))
* Update TROUBLESHOOTING.md ([4d978a7](https://github.com/Manuel-777/MTG-Arena-Tool/commit/4d978a7))



## <small>2.9.3 (2019-09-05)</small>

* add new sets data ([1e415cd](https://github.com/Manuel-777/MTG-Arena-Tool/commit/1e415cd))
@@ -5,19 +5,13 @@ This is meant as a guide to help you locate and resolve the most common issues r
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
### "No log file found" error or "Output log contains no user data"

Change the 'Overlay Scale' and 'Overlay transparency' settings to any value, then restart mtgatool.
Close MTG Arena and MTG Arena tool, then start MTG Arena. Once MTG Arena is loaded run MTG Arena Tool again.

### 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.
### Screen does not respond to mouse events (overlay covers)

[Link](https://superuser.com/a/53590)
Toggle Edit mode (default `Alt + Shift + E`) or toggle an overlay.

### 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.
@@ -38,10 +32,6 @@ If that does not work;

If the last step worked, send your user-data file to [mtgatool@gmail.com](mailto:mtgatool@gmail.com) and I will inspect what is wrong with it.

### If you recieve a "No log file found" error

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

### 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.
@@ -26,7 +26,7 @@
"homepage": "https://mtgatool.com/",
"repository": "https://github.com/Manuel-777/MTG-Arena-Tool",
"bugs": "https://github.com/Manuel-777/MTG-Arena-Tool/issues",
"version": "2.9.3",
"version": "2.9.4",
"main": "main.js",
"build": {
"appId": "com.github.manuel777.mtgatool",

Large diffs are not rendered by default.

@@ -21,13 +21,16 @@ exports.EVENT_TO_NAME = {
Traditional_Cons_Event: "Traditional Constructed",
Constructed_BestOf3: "Traditional Play",
Traditional_Ladder: "Traditional Ranked",
Future_Play_20190909: "Future Play",
Future_Ranked_20190909: "Future Ranked",

CompDraft_RNA_20190117: "Traditional Draft RNA",
CompDraft_WAR_20190425: "Traditional Draft WAR",
CompDraft_M20_20190708: "Traditional Draft M20",

Sealed_M20_20190630: "Sealed M20",
Sealed_Ravnica_20190816: "Sealed Ravnica",
Sealed_WAR_20190909: "Sealed WAR",

QuickDraft_RNA_20190621: "Ranked Draft RNA 06/19",
QuickDraft_WAR_20190510: "Ranked Draft WAR 05/19",
@@ -67,13 +70,16 @@ exports.EVENT_TO_FORMAT = {
Traditional_Cons_Event: "Traditional Standard",
Constructed_BestOf3: "Traditional Standard",
Traditional_Ladder: "Traditional Standard",
Future_Play_20190909: "Future",
Future_Ranked_20190909: "Traditional Future",

CompDraft_RNA_20190117: "Draft RNA",
CompDraft_WAR_20190425: "Draft WAR",
CompDraft_M20_20190708: "Draft M20",

Sealed_M20_20190630: "Sealed M20",
Sealed_Ravnica_20190816: "Sealed Ravnica",
Sealed_WAR_20190909: "Sealed WAR",

QuickDraft_RNA_20190426: "Draft RNA",
QuickDraft_RNA_20190621: "Draft RNA",
@@ -186,7 +186,9 @@ exports.generateMetadata = function(
if (ranksData[setCode] && ranksData[setCode][englishName]) {
cardObj.rank = Math.round(ranksData[setCode][englishName].rank);
cardObj.rank_values = ranksData[setCode][englishName].values;
cardObj.rank_controversy = ranksData[setCode][englishName].cont;
cardObj.rank_controversy = ranksData[setCode][
englishName
].cont.toFixed(3);
} else {
cardObj.rank = 0;
cardObj.rank_values = 0;
@@ -19,7 +19,7 @@ const {
let metagameData = {};
let ranksData = {};

const VERSION = 15;
const VERSION = 16;
/*
Languages available in loc.json;
"BR"
@@ -19,6 +19,7 @@ class Deck {

this.mainboard = new CardsList(mtgaDeck.mainDeck);
this.sideboard = new CardsList(mtgaDeck.sideboard);
this.commandZoneGRPId = mtgaDeck.commandZoneGRPId || 0;
this.name = mtgaDeck.name || "";
this.id = mtgaDeck.id || "";
this.lastUpdated = mtgaDeck.lastUpdated || "";
@@ -62,7 +63,8 @@ class Deck {
lastUpdated: this.lastUpdated,
deckTileId: this.tile,
tags: this.tags,
custom: this.custom
custom: this.custom,
commandZoneGRPId: this.commandZoneGRPId
};

let ret = new Deck(objectClone(obj), main, side);
@@ -217,6 +219,7 @@ class Deck {
ret.colors = this.colors.get();
ret.tags = this.tags;
ret.custom = this.custom;
ret.commandZoneGRPId = this.commandZoneGRPId;

return ret;
}
@@ -175,54 +175,50 @@ const defaultDeck = JSON.parse(
',"description":null,"format":"Standard","colors":[],"id":"00000000-0000-0000-0000-000000000000","isValid":false,"lastUpdated":"2018-05-31T00:06:29.7456958","lockedForEdit":false,"lockedForUse":false,"mainDeck":[],"name":"Undefined","resourceId":"00000000-0000-0000-0000-000000000000","sideboard":[]}'
);

// cloned from util to avoid circular dependency
// TODO refactor to recombine
function get_deck_colors(deck) {
var colorIndices = [];
try {
deck.mainDeck.forEach(card => {
if (card.quantity < 1) {
return;
}
// Cannot use Deck/ColorList classes because it would cause circular dependency
// tweaked for heavy use in player-data/aggregator
function getDeckColors(deck) {
if (deck.colors && deck.colors instanceof Array) {
// if field exists, assume it was correctly pre-computed by latest code
return deck.colors;
}

let cardData = db.card(card.id);
const colorSet = new Set();

if (!cardData) {
return;
}
deck.mainDeck.forEach(card => {
if (card.quantity < 1) {
return;
}

let isLand = cardData.type.indexOf("Land") !== -1;
let frame = cardData.frame;
if (isLand && frame.length < 3) {
colorIndices = colorIndices.concat(frame);
}
let cardData = db.card(card.id);

cardData.cost.forEach(cost => {
if (cost === "w") {
colorIndices.push(WHITE);
} else if (cost === "u") {
colorIndices.push(BLUE);
} else if (cost === "b") {
colorIndices.push(BLACK);
} else if (cost === "r") {
colorIndices.push(RED);
} else if (cost === "g") {
colorIndices.push(GREEN);
}
});
});
if (!cardData) {
return;
}

let isLand = cardData.type.indexOf("Land") !== -1;
let frame = cardData.frame;
if (isLand && frame.length < 3) {
frame.forEach(colorIndex => colorSet.add(colorIndex));
}

colorIndices = Array.from(new Set(colorIndices));
colorIndices.sort((a, b) => {
return a - b;
cardData.cost.forEach(cost => {
if (cost === "w") {
colorSet.add(WHITE);
} else if (cost === "u") {
colorSet.add(BLUE);
} else if (cost === "b") {
colorSet.add(BLACK);
} else if (cost === "r") {
colorSet.add(RED);
} else if (cost === "g") {
colorSet.add(GREEN);
}
});
} catch (e) {
// FIXME: Errors shouldn't be caught silently. If this is an
// expected error then there should be a test to catch only that error.
colorIndices = [];
}
});

deck.colors = colorIndices;
const colorIndices = [...colorSet];
colorIndices.sort();
return colorIndices;
}

@@ -385,7 +381,7 @@ class PlayerData {
const deckData = {
...preconData,
...this.decks[id],
colors: get_deck_colors(this.decks[id]),
colors: getDeckColors(this.decks[id]),
custom: !this.static_decks.includes(id),
tags: this.decks_tags[id] || []
};
@@ -409,7 +405,7 @@ class PlayerData {
}

draftExists(id) {
return id in this;
return this.draft_index.includes(id) && id in this;
}

event(id) {
@@ -437,10 +433,10 @@ class PlayerData {
...preconData,
...matchData.playerDeck
});
playerDeck.colors = get_deck_colors(playerDeck);
playerDeck.colors = getDeckColors(playerDeck);

const oppDeck = { ...defaultDeck, ...matchData.oppDeck };
oppDeck.colors = get_deck_colors(oppDeck);
oppDeck.colors = getDeckColors(oppDeck);

return {
...matchData,
@@ -283,11 +283,34 @@ annotationFunctions.AnnotationType_ZoneTransfer = function(ann, details) {
}
};

annotationFunctions.AnnotationType_AbilityInstanceCreated = function(
ann,
details
) {
let affected = ann.affectedIds[0];
let affector = instanceIdToObject(ann.affectorId);

if (affector) {
currentMatch.gameObjs[affected] = {
instanceId: affected,
grpId: 0,
type: "GameObjectType_Ability",
zoneId: affector.zoneId,
visibility: "Visibility_Public",
ownerSeatId: affector.ownerSeatId,
controllerSeatId: affector.controllerSeatId,
objectSourceGrpId: affector.grpId,
parentId: affector.instanceId
};
}
};

annotationFunctions.AnnotationType_ResolutionStart = function(ann, details) {
let affected = instanceIdToObject(ann.affectedIds[0]);
let grpId = details.grpid;

if (affected.type == "GameObjectType_Ability") {
affected.grpId = grpId;
actionLog(
affected.controllerSeatId,
logTime,
@@ -15,11 +15,7 @@ const {
} = require("../shared/constants");
const db = require("../shared/database");
const pd = require("../shared/player-data");
const {
get_deck_colors,
getReadableEvent,
getRecentDeckName
} = require("../shared/util");
const { getReadableEvent, getRecentDeckName } = require("../shared/util");
const { normalApproximationInterval } = require("../shared/stats-fns");

// Default filter values
@@ -152,11 +148,7 @@ class Aggregator {

// Normalize deck colors into matching data format
const deckColorCodes = Aggregator.getDefaultColorFilter();
if (deck.colors instanceof Array) {
deck.colors.forEach(i => (deckColorCodes[COLORS_ALL[i - 1]] = true));
} else if (deck.colors instanceof Object) {
Object.assign(deckColorCodes, deck.colors);
}
deck.colors.forEach(i => (deckColorCodes[COLORS_ALL[i - 1]] = true));

return Object.entries(_colors).every(([color, value]) => {
if (color === "multi") return true;
@@ -373,7 +365,7 @@ class Aggregator {
}
// process opponent data
if (match.oppDeck) {
const colors = get_deck_colors(match.oppDeck);
const colors = match.oppDeck.colors;
if (colors && colors.length) {
colors.sort();
if (!(colors in this.colorStats)) {
@@ -174,6 +174,16 @@ function renderData(container, index) {
if (!change) return 0;
if (change.archived && !showArchived) return 0;

if (
change.context.startsWith("Event.Prize") &&
change.context.includes("Future") &&
!change.xpGained
) {
// skip transactions that are just empty future play/ranked rewards
// originally for renewal season special events 2019-09
return 0;
}

// print out daily summaries but no sub-events
if (
filterEconomy === "Day Summaries" &&
@@ -627,6 +637,7 @@ function createChangeRow(change, economyId) {
img.classList.add("inventory_card_img");
img.style.width = "39px";
img.src = getCardImage(card);
img.title = card.name;

d.appendChild(img);

@@ -667,13 +678,24 @@ function createChangeRow(change, economyId) {
img.style.width = "39px";
img.src = getCardImage(card);

if (card.rarity) {
// only uncommons and commons go to vault
let vaultProgressDelta =
card.rarity === "uncommon" ? 1 / 300 : 1 / 900;
img.title =
"Vault:+" + formatPercent(vaultProgressDelta, vaultPercentFormat);
let tooltip = card.name;
switch (card.rarity) {
case "mythic":
tooltip += " (Gems:+40)";
break;
case "rare":
tooltip += " (Gems:+20)";
break;
case "uncommon":
tooltip +=
" (Vault:+" + formatPercent(1 / 300, vaultPercentFormat) + ")";
break;
case "common":
tooltip +=
" (Vault:+" + formatPercent(1 / 900, vaultPercentFormat) + ")";
break;
}
img.title = tooltip;

d.appendChild(img);
flexRight.appendChild(d);

0 comments on commit ac12200

Please sign in to comment.
You can’t perform that action at this time.