Permalink
Browse files

username display

  • Loading branch information...
Manuel-777 committed Sep 26, 2018
1 parent c62b8ee commit b5490b7b29eb8ceac27575bfedb38221456f1868
Showing with 36 additions and 15 deletions.
  1. +19 −2 window_main/index.css
  2. +1 −0 window_main/index.html
  3. +11 −8 window_main/renderer.js
  4. +5 −5 window_overlay/overlay.js
@@ -102,13 +102,22 @@ span i {
.top_username {
color: #FAE5D2;
font-size: 20px;
margin-right: 32px;
margin-left: 16px;
align-self: center;
font-family: Beleren;
cursor: default;
}
.top_username_id {
color: rgba(250, 229, 210, 0.5);
font-size: 20px;
margin-right: 32px;
align-self: center;
font-family: Beleren;
cursor: default;
}
.top_rank {
-webkit-app-region: no-drag;
align-self: center;
@@ -1140,14 +1149,22 @@ span i {
overflow-y: auto;
}
.sidebar_column {
.sidebar_column_r {
width: 30% !important;
max-width: 220px;
border-width: 2px;
border-style: none solid none none;
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%;
}
.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 {
margin-top: 16px;
/*
@@ -42,6 +42,7 @@
<div class="flex_item" style="margin-left: auto;">
<div class="top_rank" ></div>
<div class="top_username"></div>
<div class="top_username_id"></div>
</div>
</div>
@@ -73,7 +73,8 @@ ipc.on('set_db', function (event, arg) {
ipc.on('set_username', function (event, arg) {
userName = arg;
if (sidebarActive != -1) {
$('.top_username').html(userName);
$('.top_username').html(userName.slice(0, -6));
$('.top_username_id').html(userName.slice(-6));
}
});
@@ -242,7 +243,9 @@ ipc.on('set_economy', function (event, arg) {
//
ipc.on('initialize', function (event, arg) {
$('.top_username').html(userName);
$('.top_username').html(userName.slice(0, -6));
$('.top_username_id').html(userName.slice(-6));
$(".top_rank").css("background-position", (rankOffset*-48)+"px 0px").attr("title", rankTitle);
sidebarActive = 0;
setDecks(null);
@@ -445,7 +448,7 @@ function setHistory(loadMore) {
var wrap_r = document.createElement("div");
wrap_r.classList.add("wrapper_column");
wrap_r.classList.add("sidebar_column");
wrap_r.classList.add("sidebar_column_l");
var div = document.createElement("div");
div.classList.add("ranks_history");
@@ -572,7 +575,7 @@ function setHistory(loadMore) {
var d = document.createElement("div");
d.classList.add("list_match_title");
d.innerHTML = "vs "+match.opponent.name;
d.innerHTML = "vs "+match.opponent.name.slice(0, -6);
fct.appendChild(d);
var or = document.createElement("div");
@@ -1770,7 +1773,7 @@ function open_match(id) {
var tier = match.player.tier;
r.css("background-position", (get_rank_index(rank, tier)*-48)+"px 0px").attr("title", rank+" "+tier);
var name = $('<div class="list_match_player_left">'+match.player.name+' ('+match.player.win+')</div>');
var name = $('<div class="list_match_player_left">'+match.player.name.slice(0, -6)+' ('+match.player.win+')</div>');
name.appendTo(fltrt);
if (match.player.win > match.opponent.win) {
@@ -1798,7 +1801,7 @@ function open_match(id) {
var tier = match.opponent.tier;
r.css("background-position", (get_rank_index(rank, tier)*-48)+"px 0px").attr("title", rank+" "+tier);
var name = $('<div class="list_match_player_right">'+match.opponent.name+' ('+match.opponent.win+')</div>');
var name = $('<div class="list_match_player_right">'+match.opponent.name.slice(0, -6)+' ('+match.opponent.win+')</div>');
name.appendTo(fltrt);
if (match.player.win < match.opponent.win) {
@@ -1827,7 +1830,7 @@ function open_match(id) {
});
$(".exportDeckStandard").click(function () {
var list = get_deck_export_txt(deck);
ipc_send('export_txt', {str: list, name: match.opponent.name+"'s deck"});
ipc_send('export_txt', {str: list, name: match.opponent.name.slice(0, -6)+"'s deck"});
});
$(".back").click(function () {
@@ -2695,7 +2698,7 @@ function open_settings(openSection) {
$("#ux_0").html('');
$("#ux_0").addClass('flex_item');
var wrap_l = $('<div class="wrapper_column sidebar_column"></div>');
var wrap_l = $('<div class="wrapper_column sidebar_column_r"></div>');
$('<div class="settings_nav sn1" style="margin-top: 28px;" >Behaviour</div>').appendTo(wrap_l);
$('<div class="settings_nav sn2">Overlay</div>').appendTo(wrap_l);
$('<div class="settings_nav sn3">Visual</div>').appendTo(wrap_l);
@@ -187,7 +187,7 @@ ipc.on('set_hover', function (event, arg) {
//
ipc.on('set_opponent', function (event, arg) {
$('.top_username').html(arg);
$('.top_username').html(arg.slice(0, -6));
});
//
@@ -207,15 +207,15 @@ ipc.on('set_deck', function (event, arg) {
$(".overlay_deckcolors").html('');
if (deckMode == 3) {
$(".overlay_deckname").html("Played by "+arg.name);
$(".overlay_deckname").html("Played by "+arg.name.slice(0, -6));
}
else {
$(".overlay_deckname").html(arg.name);
}
arg.colors = get_deck_colors(arg);
arg.colors.forEach(function(color) {
$(".overlay_deckcolors").append('<div class="mana_20 mana_'+mana[color]+'"></div>');
$(".overlay_deckcolors").append('<div class="mana_s20 mana_'+mana[color]+'"></div>');
});
arg.mainDeck.sort(compare_cards);
@@ -308,7 +308,7 @@ function setDraft() {
if (draftMode == 0) {
var colors = get_ids_colors(draftPick);
colors.forEach(function(color) {
$(".overlay_deckcolors").append('<div class="mana_20 mana_'+mana[color]+'"></div>');
$(".overlay_deckcolors").append('<div class="mana_s20 mana_'+mana[color]+'"></div>');
});
draftPick.sort(compare_draft_cards);
@@ -320,7 +320,7 @@ function setDraft() {
else if (draftMode == 1) {
var colors = get_ids_colors(draftPack);
colors.forEach(function(color) {
$(".overlay_deckcolors").append('<div class="mana_20 mana_'+mana[color]+'"></div>');
$(".overlay_deckcolors").append('<div class="mana_s20 mana_'+mana[color]+'"></div>');
});
draftPack.sort(compare_draft_picks);

0 comments on commit b5490b7

Please sign in to comment.