Permalink
Browse files

Merge pull request #144 from Manuel-777/tourneys-dev

Tourneys dev
  • Loading branch information...
Manuel-777 committed Jan 5, 2019
2 parents c4b9584 + 03f0aef commit 36a1db45b30325381dfefd99d756f004c703821e
@@ -26,24 +26,21 @@ An MTG Arena deck tracker and collection manager.
- Win/loss ratios
- Wildcards needed
- Show cards missing
- mana curve
- Mana curve
- Winrate vs color combinations
- Visual view
- Deck export (to mtga, to .txt)
- Draft tracker
- In-draft overlay
- assistant (shows best picks)
- replayer
- Assistant (shows best picks)
- Replayer
- Draft sharing
- Explore decks
- Filter by event
- Filter by owned
- See wildcards and boosters needed
- Sorted by wins/losses

## Roadmap
`These are some features I would like to include, not ordered in any way`
- Metagame / Archetypes on decks explorer `this requires more data to be able to play with`
- Deck editor/modifier, for adding things like specific basic lands and then importing them to MTG Arena.

### Compiling / Run from source
MTG Arena Tool is developed using Electron JS, To get started simply clone this repo and install:

BIN +3.28 KB images/copy.png
Binary file not shown.
BIN +3.52 KB images/refresh.png
Binary file not shown.
BIN +3.06 KB images/swap.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.8",
"version": "2.2.9",
"main": "main.js",
"build": {
"appId": "com.github.manuel777.mtgatool",
@@ -19,7 +19,7 @@
"scripts": {
"start": "electron .",
"postinstall": "install-app-deps",
"dist": "build --ia32 --x64 -w",
"dist": "build --x64 -w",
"test": "jest"
},
"dependencies": {
@@ -1189,6 +1189,18 @@ function toMMSS(sec_num) {
return minutes+':'+seconds;
}

//
function toHHMMSS(sec_num) {
var hours = Math.floor(sec_num / 3600);
var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
var seconds = sec_num - (hours * 3600) - (minutes * 60);

if (hours < 10) {hours = "0"+hours;}
if (minutes < 10) {minutes = "0"+minutes;}
if (seconds < 10) {seconds = "0"+seconds;}
return hours+':'+minutes+':'+seconds;
}

//
function toHHMM(sec_num) {
var hours = Math.floor(sec_num / 3600);
@@ -1236,6 +1236,11 @@ function createMatch(arg) {
ipc_send("set_timer", matchBeginTime, windowOverlay);
ipc_send("set_opponent", oppName, windowOverlay);
ipc_send("set_opponent_rank", get_rank_index(oppRank, oppTier), oppRank+" "+oppTier, windowOverlay);

if (currentEventId == "DirectGame") {
httpApi.httpTournamenCheck(currentDeck, oppName);
}

ipc_send('set_priority_timer', priorityTimers, windowOverlay);
}

@@ -116,6 +116,9 @@ function httpBasic() {
if (_headers.method == 'tou_get') {
ipc_send("tou_set", parsedResult.result);
}
if (_headers.method == 'tou_check') {
//ipc_send("tou_set_game", parsedResult.result);
}

if (_headers.method == 'get_database') {
//resetLogLoop(100);
@@ -128,6 +131,12 @@ function httpBasic() {
ipc_send("popup", {"text": "Metadata: Ok", "time": 1000});
}
}
else if (_headers.method == 'tou_join' ) {
ipc_send("popup", {"text": parsedResult.error, "time": 10000});
}
else if (_headers.method == 'tou_check') {
ipc_send("popup", {"text": parsedResult.state, "time": 10000});
}
else if (parsedResult.ok == false && parsedResult.error != undefined) {
if (_headers.method == 'share_draft') {
ipc_send("popup", {"text": parsedResult.error, "time": 3000});
@@ -296,6 +305,12 @@ function httpTournamentDrop(tid) {
httpAsync.push({'reqId': _id, 'method': 'tou_drop', 'method_path': '/tournament_drop.php', 'id': tid});
}

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

module.exports = {
httpAuth,
httpSubmitCourse,
@@ -313,5 +328,6 @@ module.exports = {
httpTournamentList,
httpTournamentGet,
httpTournamentJoin,
httpTournamentDrop
httpTournamentDrop,
httpTournamenCheck
};
@@ -2228,6 +2228,34 @@ a:hover {
margin: 16px auto;
}

.tou_opp {
color: rgba(250, 229, 210, 0.8);
justify-content: center;
display: flex;
font-size: 18px;
text-align: center;
margin: 16px auto 4px auto;
}

.tou_opp_sub {
font-size: 16px;
margin: 0px 0px 12px 0px;
}

.copy_button {
margin-left: 16px;
cursor: pointer;
width: 28px;
height: 28px;
opacity: 0.5;
background: url(../images/copy.png) no-repeat center;
-webkit-transition: all .2s ease-in-out;
}

.copy_button:hover {
opacity: 1;
}

.tou_tabs_cont {
width: 100%;
height: 32px;
@@ -2334,6 +2362,14 @@ a:hover {
border-bottom: solid 1px rgba(250, 229, 210, 0.6);
}

.swap_icon {
align-self: center;
width: 28px;
height: 72px;
opacity: 0.8;
background: url(../images/swap.png) no-repeat center;
}

.line_dark {
background-color: rgba(145, 121, 97, 0.2);
}
@@ -2363,6 +2399,19 @@ a:hover {
overflow: hidden;
}

.tournament_title {
color: rgba(250, 229, 210, 0.85);
margin-left: 30px;
margin-top: 8px;
font-family: Beleren;
font-size: 18px;
}

.join_decklist {
max-width: 420px;
margin: auto auto 32px auto;
}

.decklist_divided {
margin: 24px;
width: 50%;
@@ -37,9 +37,8 @@
</div>
<div class="top_nav hidden">
<div class="top_nav_separator"></div>
<!--
<div class="top_nav_item ith item_selected" style="width: 60px;"><div class="ith_icon"></div></div>
-->
<div class="top_nav_item ith" style="width: 60px;"><div class="ith_icon"></div></div>

<div class="top_nav_item item_selected it0">MY DECKS</div>
<div class="top_nav_item it1">HISTORY</div>
<div class="top_nav_item it2">EVENTS</div>
@@ -723,6 +723,7 @@ $(document).ready(function() {

if ($(this).hasClass("ith")) {
sidebarActive = -1;
$("#ux_0").html('<div class="loading_bar ux_loading"><div class="loading_color loading_w"></div><div class="loading_color loading_u"></div><div class="loading_color loading_b"></div><div class="loading_color loading_r"></div><div class="loading_color loading_g"></div></div>');
ipc_send('request_tou_list', true);
}
if ($(this).hasClass("it0")) {
@@ -1230,19 +1231,23 @@ function drawDeckVisual(_div, _stats, deck) {
$('<div class="type_icon_cont"><div title="Planeswalkers" class="type_icon type_pla"></div><span>'+types.pla+'</span></div>').appendTo(typesdiv);
typesdiv.prependTo(_div.parent());

_stats.hide();
if (_stats) {
_stats.hide();
}
_div.css("display", "flex");
_div.css("width", "auto");
_div.css("margin", "0 auto");
_div.html('');

_div.parent().css("flex-direction", "column");

$('<div class="button_simple openDeck">Normal view</div>').appendTo(_div.parent());
if (_stats) {
$('<div class="button_simple openDeck">Normal view</div>').appendTo(_div.parent());

$(".openDeck").click(function () {
open_deck(-1, 2);
});
$(".openDeck").click(function () {
open_deck(-1, 2);
});
}

var sz = cardSize;
let div = $('<div class="visual_mainboard"></div>');
Oops, something went wrong.

0 comments on commit 36a1db4

Please sign in to comment.