coding and button appearance updates

This commit is contained in:
dscarpac 2024-01-14 16:34:05 -06:00
parent 86f2329f5a
commit e8269ed69c
2 changed files with 8 additions and 14 deletions

View File

@ -156,7 +156,6 @@ function drawEncounterCard(params)
-- nothing here, time to reshuffle -- nothing here, time to reshuffle
if reshuffledAlready == true then if reshuffledAlready == true then
reshuffledAlready = false reshuffledAlready = false
-- print something?
return return
end end
reshuffleEncounterDeck() -- if there is no discard pile either, reshuffleEncounterDeck will give an error message already reshuffleEncounterDeck() -- if there is no discard pile either, reshuffleEncounterDeck will give an error message already
@ -182,7 +181,7 @@ function actualEncounterCardDraw(card, params)
end end
function reshuffleEncounterDeck() function reshuffleEncounterDeck()
--flag to avoid multiple calls -- flag to avoid multiple calls
if isReshuffling then return end if isReshuffling then return end
isReshuffling = true isReshuffling = true
local encounterDeck = getEncounterDeck() local encounterDeck = getEncounterDeck()
@ -190,7 +189,9 @@ function reshuffleEncounterDeck()
if #discardPile > 0 then if #discardPile > 0 then
local discardDeck = discardPile[1] local discardDeck = discardPile[1]
if not discardDeck.is_face_down then discardDeck.setRotation({0, -90, 180}) end --flips discard pile if not discardDeck.is_face_down then --flips discard pile
discardDeck.setRotation({0, -90, 180})
end
if encounterDeck == nil then if encounterDeck == nil then
discardDeck.setPosition(Vector(ENCOUNTER_DECK_POS) + Vector({0, 1, 0})) discardDeck.setPosition(Vector(ENCOUNTER_DECK_POS) + Vector({0, 1, 0}))
discardDeck.shuffle() discardDeck.shuffle()
@ -198,7 +199,7 @@ function reshuffleEncounterDeck()
encounterDeck.putObject(discardDeck) encounterDeck.putObject(discardDeck)
encounterDeck.shuffle() encounterDeck.shuffle()
end end
broadcastToAll("Shuffled encounter discard into deck.", "White") broadcastToAll("Shuffled encounter discard into deck.", "White")
else else
broadcastToAll("Encounter discard pile is already empty.", "Red") broadcastToAll("Encounter discard pile is already empty.", "Red")
end end

View File

@ -1,10 +1,3 @@
<Panel <Panel position="160 70 -13" rotation="0 0 180" height="74" width="315">
position="124 40 -13" <Button scale="0.1 0.1 1" color="#ffffff00" textColors="#ffffff|#88e3cf|#4f8478" font="font_teutonic-arkham" fontSize="62" onClick="reshuffleEncounterDeck">Reshuffle ➡</Button>
rotation="0 0 180" </Panel>
height="74" width="74">
<Button scale="0.1 0.1 1" fontsize="62" onClick="reshuffleEncounterDeck"></Button>
</Panel>