more UI polishing

This commit is contained in:
2020-09-29 21:23:47 +00:00
parent 3bf9fa08db
commit 2ae20af655
2 changed files with 59 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
<html>
<head>
<title>Deckard + Company</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link href="css.css" rel="stylesheet">
<script src="https://labs.murkfall.net/bluesaxman/blue.js/raw/master/libs/bluecore.js"></script>
</head>
@@ -30,9 +33,10 @@ function updateEvent() {
myKeys.forEach(function (deckID) {
var deck = window.gameState.decks[deckID];
window.UI.display[deckID] = elementPlace("#decks","Deck_"+deck.name,"deck"+(deck.name == window.gameState.active.deck ? " selected" : ""),"li");
window.UI.display[deckID].innerHTML = '<div class="object_name">'+deck.name+"</div>";
window.UI.display[deckID].controls = elementPlace("#Deck_"+deck.name,"Deck_controls_"+deck.name,"controls","div");
window.UI.display[deckID].content = elementPlace("#Deck_"+deck.name,null,"content","div");
window.UI.display[deckID].content.innerHTML = '<div class="object_name"'+deck.name+':</div><div class="deck_size">'+deck.size+'</div>';
window.UI.display[deckID].content.innerHTML = '<div class="deck_size">'+deck.size+'</div>';
buttonAdd("#Deck_controls_"+deck.name,null,"Add Cards", function () {
popupDialog("deckLoader","Select DDF (Deck Definition File)",true,inputDialog,{"inputType":"file"},function (f) {
var myFile = new FileReader();
@@ -81,15 +85,16 @@ function updateEvent() {
myHands.forEach(function (handID) {
var hand = window.gameState.hands[handID];
window.UI.display[handID] = elementPlace("#hands","Hand_"+hand.name,"hand"+(hand.name == window.gameState.active.hand ? " selected" : ""),"li");
window.UI.display[handID].innerHTML = "<div>"+hand.name+"</div>";
window.UI.display[handID].innerHTML = '<div class="object_name">'+hand.name+"</div>";
window.UI.display[handID].controls = elementPlace("#Hand_"+hand.name,"Hand_controls_"+hand.name,"controls","div");
window.UI.display[handID].content = elementPlace("#Hand_"+hand.name,"Hand_content_"+hand.name,"content","div");
buttonAdd("#Hand_controls_"+hand.name,null,"Muligan",function () {
window.gameSession.send('{"action":"muligan","hand":"'+handID+'","deck":"'+window.gameState.active.deck+'"}');
}, "hand_button muligan", "div");
buttonAdd("#Hand_controls_"+hand.name,null,"X",function () {
window.gameSession.send('{"action":"del","type":"hand","id":"'+handID+'"}');
}, "hand_button delete", "div");
window.UI.display[handID].cards = elementPlace("#Hand_"+hand.name,hand.name+"_cards",null,"ol");
window.UI.display[handID].cards = elementPlace("#Hand_content_"+hand.name,hand.name+"_cards",null,"ol");
hand.cards.forEach(function (card,index) {
window.UI.display[handID].cards[index] = elementPlace("#"+hand.name+"_cards","card"+hand.name+index,"card","li");
window.UI.display[handID].cards[index].style.position = "relative";
@@ -117,8 +122,10 @@ function updateEvent() {
myPools.forEach(function (poolID) {
var pool = window.gameState.pools[poolID];
window.UI.display[poolID] = elementPlace("#pools","Pool_"+pool.name,"pool"+(pool.name == window.gameState.active.pool ? " selected" : ""),"li");
window.UI.display[poolID].innerHTML = pool.name+":"+pool.top;
window.UI.display[poolID].innerHTML = '<div class="object_name">'+pool.name+"</div>";
window.UI.display[poolID].controls = elementPlace("#Pool_"+pool.name,"Pool_controls_"+pool.name, "controls","div");
window.UI.display[poolID].content = elementPlace("#Pool_"+pool.name,"Pool_content_"+pool.name, "content","div");
window.UI.display[poolID].content.innerHTML += '<div class="card">'+pool.top+"</div>";
buttonAdd("#Pool_controls_"+pool.name,null,"X",function () {
window.gameSession.send('{"action":"del","type":"pool","id":"'+poolID+'","deck":"'+window.gameState.active.deck+'"}');
},"pool_button delete","div");