Skip to content
Permalink
Browse files

Merge branch 'master' into filterpalooza

  • Loading branch information...
lusbenjamin committed May 4, 2019
2 parents 4ed9a2a + b3e33e2 commit e1ccaf286edb63b5b16a5b5a7c3edf0b1432ee0f
Showing with 90 additions and 17 deletions.
  1. +7 −0 CHANGELOG.md
  2. +1 −1 package.json
  3. +7 −3 window_main/decks.js
  4. +7 −0 window_main/history.js
  5. +10 −8 window_main/index.css
  6. +58 −5 window_main/renderer.js
@@ -1,3 +1,10 @@
## 2.3.0 (2019-05-04)

* electron-unhandled ([b91f83a](https://github.com/Manuel-777/MTG-Arena-Tool/commit/b91f83a)), closes [#218](https://github.com/Manuel-777/MTG-Arena-Tool/issues/218)
* Make stats column resizable ([71c4119](https://github.com/Manuel-777/MTG-Arena-Tool/commit/71c4119))



## <small>2.2.28 (2019-05-04)</small>

* Aggregator logic component ([2aaa81b](https://github.com/Manuel-777/MTG-Arena-Tool/commit/2aaa81b))
@@ -25,7 +25,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.2.28",
"version": "2.3.0",
"main": "main.js",
"build": {
"appId": "com.github.manuel777.mtgatool",
@@ -13,6 +13,7 @@ global
hideLoadingBars,
getWinrateClass,
ipc_send,
makeResizable,
mana,
open_deck,
orderedCardRarities,
@@ -36,7 +37,8 @@ function open_decks_tab() {
mainDiv.innerHTML = "";

const wrap_r = createDivision(["wrapper_column", "sidebar_column_l"]);

wrap_r.style.width = "300px";
wrap_r.style.flex = "0 0 300px";
const aggregator = new Aggregator(filters);
const statsPanel = new StatsPanel("decks_top", aggregator.stats);
const decks_top_winrate = statsPanel.render();
@@ -45,6 +47,10 @@ function open_decks_tab() {
decks_top_winrate.style.marginTop = "16px";
decks_top_winrate.style.padding = "12px";

let drag = createDivision(["dragger"]);
wrap_r.appendChild(drag);
makeResizable(drag);

wrap_r.appendChild(decks_top_winrate);

const wrap_l = createDivision(["wrapper_column"]);
@@ -276,8 +282,6 @@ function open_decks_tab() {
}
});

$("#ux_0").append('<div class="list_fill"></div>');

$(".delete_item").hover(
function() {
// in
@@ -19,6 +19,7 @@ globals
getWinrateClass,
hideLoadingBars,
ipc_send,
makeResizable,
makeId,
mana,
matchesHistory,
@@ -97,6 +98,8 @@ function open_history_tab(loadMore, _filters = {}) {
loadHistory = 0;

let wrap_r = createDivision(["wrapper_column", "sidebar_column_l"]);
wrap_r.style.width = "300px";
wrap_r.style.flex = "0 0 300px";

div = createDivision(["ranks_history"]);
div.style.padding = "0 12px";
@@ -123,6 +126,10 @@ function open_history_tab(loadMore, _filters = {}) {

d = createDivision(["list_fill"]);

let drag = createDivision(["dragger"]);
wrap_r.appendChild(drag);
makeResizable(drag);

wrap_r.appendChild(div);
mainDiv.appendChild(wrap_l);
mainDiv.appendChild(wrap_r);
@@ -419,6 +419,7 @@ span.top_nav_item_text {
height: 100%;
overflow-x: hidden;
overflow-y: visible;
align-items: stretch;
}

.moving_ux {
@@ -2036,11 +2037,11 @@ a:hover {
}

.sidebar_column_l {
width: 30% !important;
max-width: 220px;
border-width: 2px;
border-style: none none none solid;
/*
border-image: linear-gradient(to bottom, rgba(250, 229, 210, 0) 10px, rgba(250, 229, 210, 0.5) 10px, rgba(250, 229, 210, 0)) 1 100%;
*/
}

.ranks_history {
@@ -3124,9 +3125,10 @@ a:hover {
margin: 4px auto;
}


/*
*/
.dragger {
background-color: rgba(250, 229, 210, 0.75);
position: absolute;
width: 3px;
height: 100%;
cursor: w-resize;
}
@@ -45,7 +45,7 @@ if (!remote.app.isPackaged) {
});
}

require('time-elements');
require("time-elements");

const FilterPanel = require("./FilterPanel.js");
const StatsPanel = require("./StatsPanel.js");
@@ -297,7 +297,10 @@ ipc.on("set_player_data", (event, _data) => {
rankOffset = get_rank_index(constructed.rank, constructed.tier);
let constructedRankIcon = $$(".top_constructed_rank")[0];
constructedRankIcon.style.backgroundPosition = rankOffset * -48 + "px 0px";
constructedRankIcon.setAttribute("title", constructed.rank + " " + constructed.tier);
constructedRankIcon.setAttribute(
"title",
constructed.rank + " " + constructed.tier
);

let limited = playerData.rank.limited;
rankOffset = get_rank_index(limited.rank, limited.tier);
@@ -1069,6 +1072,40 @@ ipc.on("tou_set", function(event, arg) {
$(".moving_ux").animate({ left: "-100%" }, 250, "easeInOutCubic");
});

//
function makeResizable(div) {
var m_pos;

let resize = function(e) {
var parent = div.parentNode;
var dx = m_pos - e.x;
console.log("mousemove", m_pos, e.x, dx, parent.style.width);
m_pos = e.x;
let newWidth = Math.max(10, parseInt(parent.style.width) + dx);
parent.style.width = `${newWidth}px`;
parent.style.flex = `0 0 ${newWidth}px`;
};

div.addEventListener(
"mousedown",
event => {
console.log("mousedown", event);
m_pos = event.x;
document.addEventListener("mousemove", resize, false);
},
false
);

document.addEventListener(
"mouseup",
event => {
console.log("mouseup", event);
document.removeEventListener("mousemove", resize, false);
},
false
);
}

//
function drawDeck(div, deck, showWildcards = false) {
var unique = makeId(4);
@@ -1089,7 +1126,15 @@ function drawDeck(div, deck, showWildcards = false) {
}

if (card.quantity > 0) {
addCardTile(grpId, unique + "a", card.quantity, div, showWildcards, deck, false);
addCardTile(
grpId,
unique + "a",
card.quantity,
div,
showWildcards,
deck,
false
);
}

prevIndex = grpId;
@@ -1103,7 +1148,15 @@ function drawDeck(div, deck, showWildcards = false) {
var grpId = card.id;
//var type = cardsDb.get(grpId).type;
if (card.quantity > 0) {
addCardTile(grpId, unique + "b", card.quantity, div, showWildcards, deck, true);
addCardTile(
grpId,
unique + "b",
card.quantity,
div,
showWildcards,
deck,
true
);
}
});
}
@@ -2374,7 +2427,7 @@ function open_settings(openSection) {
"</div>"
);

about.append('<div class="message_updates green">'+ updateState +'.</div>');
about.append('<div class="message_updates green">' + updateState + ".</div>");
button = $(
'<div class="button_simple centered update_link_about">Check for updates</div>'
);

0 comments on commit e1ccaf2

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