Skip to content
Permalink
Browse files

2.13.0 (#699)

* Make the Economy page React aware
* inline grid styles
* Migrate constants to TS
* Migrate database.js to TypeScript, introduce necessary types
* Fixed linter complains
* Fix test; introduce enums in contants
* Fix dependency in test
* Mark arrays as const
* Migrated Colors, CardTypes to TypeScript
* Fix usage of database in settings.js; add missing property to database.ts
* Fix more uses of database.data
* stop regressions
* last few regressions
* key + quantity show
* more falsy checks
* updates to shared
* background forceDeckUpdate includes sampleSize
* update interactjs dependency
* move overlay renderer endpoint
* new overlay components
* optimize IPC handleSetPlayerData with useCallback
* remove semaphore from SampleSizePanel
* compact top nav
* convert ActionLog to TS
* convert DeckManaCurve to TS
* convert DeckTypesStats to TS
* Update OverlayController.tsx
* better clock defaults
* extract common overlay util
* playerSeat is not state
* parteon badge and username
* tabs, more control
* WindoletProps should not extend ElementsProps
* groupLandsHack without mutation
* bugfix clock opponent name
* refactor elements
* unused file
* lint
* optimize Howler callback and debounce
* streamline data, cleanup
* more explicit types, less any types
* ranks can be null
* restore interactjs restrictions
* fix tabs
* useRef to get width
* credit for howler dependency
* add react-transition-group dependency
* CardDetailsWindowlet and styles
* update shared card-hover code
* React now managed separate from legacy
* React card hover plumbing, comments, and callbacks
* remove more deprecated hover code
* background adds grpId to actionLog
* ActionLog uses react hover callback
* Change ManaFilterKeys creation
* Redo file content changes
* Fix eventId usage
* CALLBACK error fix
* animejs types
* fix hovers (#700)
* Fix economy card hovers
* Economy styling
* Update metadata (#704)
* update metadata and database.json
* bugfix-settings (#706)
* overlays visibility fix (#702)
* fix top nav styles and buttons (#701)
* Targeted bugfixes for develop branch (#705)
* targeted bugfixes for develop branch
* fix deck filters
* Fix display of aetherized and added cards (#703)
* Fix display of aetherized and added cards
* back button hover fix
* Shared code TypeScript migrations (Take Two) (#709)
* Fix display of aetherized and added cards
* Refactor and fix the fix
* Re-Added some types
* Rename database -- NOT BUILDING!
* Fix compareDraftPicks
* Fix dependency in test
* move DraftRatings to tsx
* DraftRatings types
* move OwnershipStars to tsx
* OwnershipStars types
* Overlay uses DbCardData type
* Discoverable Edit Mode (#717)
* discoverable edit mode
* bugfix ipc signals and edit mode state
* discoverable edit mode buttons
* fblthp gets shy when you click too much
* review feedback
* bugfix split cards take 1 (#716)
* bugfix split cards take 1
* only detect primary split card object
* Update remaining label handlers to use deck v3 (#714)
* Reset windows (#713)
* emergency reset windows taskbar option
* mainWindow.show for good measure
* adds local data links to settings page (#712)
* bugfix color archetype fallback
* bugfix practice matches
* make overlay settings independent of decklist (#722)
* fix commander display (#723)
* bugfix metadata js error (#724)
* dom-fns ts
* More Migrations to TS (#720)
* Migrate constants to TS
* Change type of Rarity; exclude Land from CARD_RARITY loop
* Some bugfixes
* Fix display of needed cards sprite
* npm run format; remove commented out code
* Rename colors.js
* Fix missing types; fix import directives
* Refactorings
  • Loading branch information
lusbenjamin authored and Manuel-777 committed Nov 17, 2019
1 parent 4af7a79 commit c5ddc0041f1de707fb8c3b8ba82d344d6a99651e
Showing with 6,557 additions and 6,152 deletions.
  1. +2 −0 README.md
  2. +5 −3 TROUBLESHOOTING.md
  3. +1,171 −1,816 package-lock.json
  4. +35 −31 package.json
  5. +8 −1 scripts/metadata-constants.js
  6. +3 −3 scripts/metadata.js
  7. +48 −6 src/main.js
  8. +102 −0 src/overlay/ActionLog.tsx
  9. +139 −0 src/overlay/CardDetailsWindowlet.tsx
  10. +4 −13 src/overlay/Clock.tsx
  11. +290 −0 src/overlay/DeckList.tsx
  12. +153 −0 src/overlay/DraftElements.tsx
  13. +139 −0 src/overlay/MatchElements.tsx
  14. +301 −0 src/overlay/OverlayController.tsx
  15. +193 −0 src/overlay/OverlayWindowlet.tsx
  16. +58 −0 src/overlay/SampleSizePanel.tsx
  17. +27 −0 src/{window_overlay_v3 → overlay}/index.css
  18. +21 −0 src/overlay/index.html
  19. +53 −0 src/overlay/index.tsx
  20. +178 −0 src/overlay/overlayUtil.tsx
  21. +1 −1 src/resources/database.json
  22. +93 −93 src/shared/CardTile.tsx
  23. +121 −0 src/shared/DeckManaCurve.tsx
  24. +51 −0 src/shared/DeckTypesStats.tsx
  25. +13 −32 src/shared/{DraftRatings.jsx → DraftRatings.tsx}
  26. +19 −10 src/shared/{OwnershipStars.jsx → OwnershipStars.tsx}
  27. +1 −1 src/shared/__tests__/card-types-spec.js
  28. +26 −88 src/shared/card-hover.js
  29. +1 −1 src/shared/cards-list.js
  30. +0 −179 src/shared/colors.js
  31. +154 −0 src/shared/colors.ts
  32. +0 −773 src/shared/constants.js
  33. +803 −0 src/shared/constants.ts
  34. +0 −233 src/shared/database.js
  35. +266 −0 src/shared/database.ts
  36. +1 −2 src/shared/deck-drawer.js
  37. +1 −1 src/shared/deck.js
  38. +0 −53 src/shared/dom-fns.js
  39. +82 −0 src/shared/dom-fns.ts
  40. +10 −3 src/shared/player-data.js
  41. +15 −1 src/shared/shared.css
  42. +28 −0 src/shared/time-components/LocalTime.tsx
  43. +24 −0 src/shared/types/Deck.ts
  44. +75 −0 src/shared/types/Metadata.ts
  45. +42 −0 src/shared/types/Season.ts
  46. +37 −138 src/shared/util.js
  47. +7 −1 src/window_background/arena-log-watcher.js
  48. +1 −0 src/window_background/background.js
  49. +2 −1 src/window_background/data.ts
  50. +2 −1 src/window_background/forceDeckUpdate.js
  51. +4 −1 src/window_background/getOpponentDeck.js
  52. +47 −22 src/window_background/gre-to-client-interpreter.js
  53. +3 −3 src/window_background/http-api.js
  54. +2 −8 src/window_background/labels.js
  55. +1 −0 src/window_background/loadPlayerConfig.js
  56. +1 −1 src/window_background/mtga-log.js
  57. +25 −24 src/window_main/DateFilter.tsx
  58. +5 −5 src/window_main/FilterPanel.tsx
  59. +1 −1 src/window_main/ManaFilter.tsx
  60. +30 −28 src/window_main/TagOption.tsx
  61. +38 −18 src/window_main/collection.js
  62. +63 −0 src/window_main/components/economy/EconomyDayHeader.tsx
  63. +153 −0 src/window_main/components/economy/EconomyHeader.tsx
  64. +410 −0 src/window_main/components/economy/EconomyRow.tsx
  65. +76 −0 src/window_main/components/economy/EconomyValueRecord.tsx
  66. +1 −1 src/window_main/createSelect.tsx
  67. +2 −1 src/window_main/deck-details.js
  68. +2 −1 src/window_main/decks.js
  69. +31 −941 src/window_main/economy.js
  70. +196 −0 src/window_main/economyUtils.ts
  71. +11 −4 src/window_main/explore.js
  72. +123 −42 src/window_main/index.css
  73. +2 −24 src/window_main/index.html
  74. +36 −27 src/window_main/renderer-util.js
  75. +33 −301 src/window_main/renderer.js
  76. +85 −46 src/window_main/settings.js
  77. +160 −0 src/window_main/tabControl.ts
  78. +210 −0 src/window_main/topNav.tsx
  79. +0 −33 src/window_overlay_v3/index.html
  80. +0 −1,135 src/window_overlay_v3/overlay.jsx
@@ -52,6 +52,8 @@ Please read about [our Privacy Policy and How we use your data here](./PRIVACY.m

[vanilla-picker by Andreas Borgen, Adam Brooks](https://vanilla-picker.js.org/)

[howler.js by James Simpson and GoldFire Studios, Inc.](https://github.com/goldfire/howler.js)

[Draft ranking by Magic Community Set Reviews](https://www.mtgcommunityreview.com/)

[Scryfall.com](http://scryfall.com) in particular, for making an absolutely stunning database of every single card in the multiverse.
@@ -25,16 +25,18 @@ Toggle Edit mode (default `Alt + Shift + E`) or toggle an overlay.
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.

Locate your log and config files;
- Go to the MTG Arena Tool "Settings" page (gear icon), then click on "Data"
- copy the path to the "Arena Log"
- Close MTG Arena and MTG Arena Tool.
- Go to `%APPDATA%\..\LocalLow\Wizards Of The Coast\MTGA\`
- open the "Arena Log" path in a file browser
- Rename `output_log.txt`, do not delete it!
- Run MTG Arena, once open, run MTG Arena Tool again.

If this works, send the the old log file file to [mtgatool@gmail.com](mailto:mtgatool@gmail.com) to analyze the error.

If that does not work;
- Proceed to `%APPDATA%\mtg-arena-tool`
- Locate your *user-data file* (the .json file named with your User ID, something like `0A1F2E3E4D5C6B7A.json`)
- Go to the MTG Arena Tool "Settings" page (gear icon), then click on "Data"
- In the bottom section called "Local Data", click on the link next to "Current player settings and history" (the .json file named with your User ID, something like `0A1F2E3E4D5C6B7A.json`)
- Rename the file, adding something to the end. **Do not delete it!**
- Run MTG Arena Tool again.

Large diffs are not rendered by default.

@@ -71,61 +71,65 @@
"tsc": "tsc"
},
"dependencies": {
"animejs": "^3.0.1",
"async": "^2.6.1",
"chart.js": "^2.8.0",
"@types/animejs": "^3.1.0",
"animejs": "^3.1.0",
"async": "^2.6.3",
"chart.js": "^2.9.2",
"conf": "^2.2.0",
"conic-gradient": "^1.0.0",
"date-fns": "^2.2.1",
"date-fns": "^2.7.0",
"electron-asar-hot-updater": "0.0.5",
"electron-debug": "^1.5.0",
"electron-store": "^3.2.0",
"electron-store": "^3.3.0",
"electron-transparency-mouse-fix": "^1.0.0-rc.1",
"electron-unhandled": "^2.2.0",
"electron-updater": "^4.0.6",
"electron-updater": "^4.2.0",
"electron-util": "^0.11.0",
"google-protobuf": "^3.8.0",
"gunzip-file": "^0.1.1",
"howler": "^2.1.2",
"interactjs": "1.5.2",
"interactjs": "1.6.3",
"js-sha1": "^0.6.0",
"lodash": "^4.17.14",
"mathjs": "^5.9.0",
"npm": "^6.12.0",
"lodash": "^4.17.15",
"mathjs": "^5.10.3",
"npm": "^6.13.0",
"pikaday": "^1.8.0",
"qs": "^6.7.0",
"qs": "^6.9.1",
"queue": "^4.5.1",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-transition-group": "^4.3.0",
"striptags": "^3.1.1",
"time-elements": "^2.0.0",
"vanilla-picker": "^2.8.1",
"time-elements": "^2.0.2",
"vanilla-picker": "^2.10.0",
"xmlhttprequest": "^1.8.0"
},
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"@babel/preset-react": "^7.6.3",
"@babel/preset-typescript": "^7.6.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-react": "^7.7.0",
"@babel/preset-typescript": "^7.7.2",
"@sentry/electron": "^0.17.4",
"@types/lodash": "^4.14.144",
"@types/react": "^16.9.9",
"@types/react-dom": "^16.9.2",
"@types/semver": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^2.4.0",
"@typescript-eslint/parser": "^2.4.0",
"acorn": "^6.1.1",
"@types/howler": "^2.1.1",
"@types/lodash": "^4.14.146",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@types/react-transition-group": "^4.2.3",
"@types/semver": "^6.2.0",
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.6.1",
"acorn": "^6.3.0",
"devtron": "^1.4.0",
"dotenv": "^8.2.0",
"electron": "^5.0.1",
"electron": "^5.0.12",
"electron-builder": "^20.44.4",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"jest": "^24.8.0",
"jest": "^24.9.0",
"prettier": "1.16.4",
"typescript": "^3.6.4"
"typescript": "^3.7.2"
}
}
@@ -50,8 +50,11 @@ exports.EVENT_TO_NAME = {
QuickDraft_RNA_20190913: "Ranked Draft RNA 09/19",
QuickDraft_ELD_20191011: "Ranked Draft ELD 10/19",
QuickDraft_WAR_20191025: "Ranked Draft WAR 10/19",
QuickDraft_GRN_20191108: "Ranked Draft GRN 11/19",

Cascade_Constructed_20190516: "Cascade Constructed",
Omniscience_Draft_20190830: "Omniscience Draft",
Omniscience_Draft_20190830: "Omniscience Draft M20",
Omniscience_Draft_20191107: "Omniscience Draft ELD",

Esports_Qualifier_20190525: "Mythic Qualifier Weekend 05/19",
Esports_Qualifier_20190817: "Mythic Qualifier Weekend 08/19",
@@ -61,6 +64,7 @@ exports.EVENT_TO_NAME = {
CompCons_Metagame_Challenge_20191004: "Metagame Challenge 10/19",
ExtraLife_2019_20191101: "Extra Life",
FestivalFae_Std_Artisan_20191103: "Artisan Standard",
FestivalFae_OkosMadness_20191110: "Okos Madness",

Brawl_Launch_20191024: "Brawl Launch",
Precon_Brawl_ELD: "Precon Brawl",
@@ -114,9 +118,11 @@ exports.EVENT_TO_FORMAT = {
QuickDraft_RNA_20190913: "Draft RNA",
QuickDraft_ELD_20191011: "Draft ELD",
QuickDraft_WAR_20191025: "Draft WAR",
QuickDraft_GRN_20191108: "Draft GRN",

Cascade_Constructed_20190516: "Cascade Constructed",
Omniscience_Draft_20190830: "Draft M20",
Omniscience_Draft_20191107: "Draft ELD",

Esports_Qualifier_20190525: "Traditional Standard",
Esports_Qualifier_20190817: "Traditional Standard",
@@ -126,6 +132,7 @@ exports.EVENT_TO_FORMAT = {
CompCons_Metagame_Challenge_20191004: "Traditional Standard",
ExtraLife_2019_20191101: "Pauper",
FestivalFae_Std_Artisan_20191103: "Artisan",
FestivalFae_OkosMadness_20191110: "Momir",

Brawl_Launch_20191024: "Brawl",
Precon_Brawl_ELD: "Brawl",
@@ -20,7 +20,7 @@ const {
let metagameData = {};
let ranksData = {};

const VERSION = 27;
const VERSION = 28;

const LANGUAGES = [
"EN",
@@ -43,7 +43,7 @@ app.on("ready", () => {
// obtain it from somewhere automatically, like a settings
// file or the output log itself.
manifestParser
.getManifestFiles("1805.734606")
.getManifestFiles("1864.739803")
.then(checkSetsAvailable)
.then(getRanksData)
.then(getScryfallCards)
@@ -114,7 +114,7 @@ function getRanksData() {
try {
ranksData[rank.setCode.toUpperCase()] = processRanksData(str);
} catch (e) {
console.log(e);
console.log("Error processing " + rank.setCode, e);
}
});
});
@@ -44,6 +44,7 @@ let mainLoaded = false;
let backLoaded = false;
let overlayLoaded = false;
let arenaState = ARENA_MODE_IDLE;
let editMode = false;

const singleLock = app.requestSingleInstanceLock();

@@ -227,6 +228,10 @@ function startApp() {
}
break;

case "toggle_edit_mode":
toggleEditMode();
break;

case "renderer_window_minimize":
mainWindow.minimize();
break;
@@ -367,6 +372,12 @@ function setArenaState(state) {
updateOverlayVisibility();
}

function toggleEditMode() {
editMode = !editMode;
overlay.webContents.send("set_edit_mode", editMode);
updateOverlayVisibility();
}

function setSettings(_settings) {
try {
settings = JSON.parse(_settings);
@@ -386,7 +397,7 @@ function setSettings(_settings) {
openOverlayDevTools
);
globalShortcut.register(settings.shortcut_editmode, () => {
overlay.webContents.send("edit");
toggleEditMode();
});
settings.overlays.forEach((_settings, index) => {
let short = "shortcut_overlay_" + (index + 1);
@@ -431,23 +442,34 @@ function updateOverlayVisibility() {
.getAllDisplays()
.find(d => d.id == settings.overlay_display) ||
electron.screen.getPrimaryDisplay();
overlay.show();
overlay.setBounds(bounds);
overlay.show();
}
}

function isEntireOverlayVisible() {
return overlay.isVisible();
}

/**
* Computes whether an Overlay windowlet should be visible based on the
* specified current overlay settings and Arena state. For example, given
* overlay settings for a draft-mode overlay, it will return true iff Arena
* is currently in a draft or idle.
*
* @param OverlaySettingsData settings
*/
function getOverlayVisible(settings) {
if (!settings) return false;

// Note: ensure this logic matches the logic in OverlayWindowlet
// TODO: extract a common utility?
const currentModeApplies =
(OVERLAY_DRAFT_MODES.includes(settings.mode) &&
arenaState === ARENA_MODE_DRAFT) ||
(!OVERLAY_DRAFT_MODES.includes(settings.mode) &&
arenaState === ARENA_MODE_MATCH);
arenaState === ARENA_MODE_MATCH) ||
(editMode && arenaState === ARENA_MODE_IDLE);

return settings.show && (currentModeApplies || settings.show_always);
}
@@ -514,6 +536,22 @@ function saveWindowPos() {
background.webContents.send("windowBounds", obj);
}

function resetWindows() {
const primary = electron.screen.getPrimaryDisplay();
const { bounds, id } = primary;
// reset overlay to primary
overlay.setBounds(bounds);
background.webContents.send("save_user_settings", {
overlay_display: id,
skip_refresh: true
});
// reset main to primary
mainWindow.setBounds({ ...bounds, width: 800, height: 600 });
mainWindow.show();
mainWindow.moveTop();
saveWindowPos();
}

function createUpdaterWindow() {
const win = new electron.BrowserWindow({
frame: false,
@@ -573,7 +611,7 @@ function createOverlayWindow() {
nodeIntegration: true
}
});
overlay.loadURL(`file://${__dirname}/window_overlay_v3/index.html`);
overlay.loadURL(`file://${__dirname}/overlay/index.html`);

if (process.platform !== "linux") {
// https://electronjs.org/docs/api/browser-window#winsetignoremouseeventsignore-options
@@ -618,11 +656,15 @@ function createMainWindow() {
}
},
{
label: "Edit Mode",
label: "Edit Overlay Positions",
click: () => {
overlay.webContents.send("edit");
toggleEditMode();
}
},
{
label: "Reset Windows",
click: () => resetWindows()
},
{
label: "Quit",
click: () => {

0 comments on commit c5ddc00

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