Added UI placeholders in code for the other sections.

This commit is contained in:
bluesaxman 2020-09-18 08:56:06 -06:00
parent b395dfaf82
commit d4cdb9b4e4

View File

@ -45,6 +45,9 @@ function updateEvent() {
buttonAdd("#Deck_"+deck.name,null,"Draw", function () { buttonAdd("#Deck_"+deck.name,null,"Draw", function () {
window.gameSession.send('{"action":"draw","deck":"'+deckID+'","hand":"'+"default"+'"}'); // Will need to be updated when I figure out selection window.gameSession.send('{"action":"draw","deck":"'+deckID+'","hand":"'+"default"+'"}'); // Will need to be updated when I figure out selection
}, "deck_button draw","div"); }, "deck_button draw","div");
buttonAdd("#Deck_"+deck.name,null,"X", function () {
window.gameSession.send('{"action":"del","type":"deck","id":"'+deckID+'"}');
}, "deck_button delete", "div");
}); });
buttonAdd("#decks",null,"+",function () { buttonAdd("#decks",null,"+",function () {
popupDialog("addDeck","Please name new deck",true, inputDialog,{"inputType":"text"},function (newDeckName) { popupDialog("addDeck","Please name new deck",true, inputDialog,{"inputType":"text"},function (newDeckName) {
@ -67,13 +70,18 @@ function updateEvent() {
myHands.forEach(function (handID) { myHands.forEach(function (handID) {
var hand = window.gameState.hands[handID]; var hand = window.gameState.hands[handID];
window.UI.display[handID] = elementPlace("#hands","Hand_"+hand.name,"hand","li"); window.UI.display[handID] = elementPlace("#hands","Hand_"+hand.name,"hand","li");
window.UI.display[handID].innerText = hand.name; window.UI.display[handID].controls = elementPlace("#Hand_"+hand.name,null,"controls","div");
window.UI.display[handID].controls.innerHTML = "<div>"+hand.name+"</div>";
// Muligan Hand
// Delete Hand
window.UI.display[handID].cards = elementPlace("#Hand_"+hand.name,hand.name+"_cards",null,"ol"); window.UI.display[handID].cards = elementPlace("#Hand_"+hand.name,hand.name+"_cards",null,"ol");
hand.cards.forEach(function (card,index) { hand.cards.forEach(function (card,index) {
window.UI.display[handID].cards[index] = elementPlace("#"+hand.name+"_cards",null,"card","li"); window.UI.display[handID].cards[index] = elementPlace("#"+hand.name+"_cards",null,"card","li");
window.UI.display[handID].cards[index].innerHTML = card; window.UI.display[handID].cards[index].innerHTML = card;
// Play Card
}); });
}); });
// Add Hand
} }
if (window.UI.menu.pools.button.checked) { if (window.UI.menu.pools.button.checked) {
elementPlace("#display","pools",null,"ol"); elementPlace("#display","pools",null,"ol");
@ -83,7 +91,9 @@ function updateEvent() {
var pool = window.gameState.pools[poolID]; var pool = window.gameState.pools[poolID];
window.UI.display[poolID] = elementPlace("#pools","Pool_"+pool.name,"pool","li"); window.UI.display[poolID] = elementPlace("#pools","Pool_"+pool.name,"pool","li");
window.UI.display[poolID].innerText = pool.name+":"+pool.top; window.UI.display[poolID].innerText = pool.name+":"+pool.top;
// Delete Pool
}); });
// Add Pool
} }
} }