Merge pull request #759 from argonui/hand-helper
Fixed hand helper being loaded first
This commit is contained in:
commit
f8d8cb0d28
@ -9,6 +9,7 @@ function onLoad()
|
||||
|
||||
-- index 0: button as hand size label
|
||||
buttonParamaters.hover_color = "White"
|
||||
buttonParamaters.label = 0
|
||||
buttonParamaters.click_function = "none"
|
||||
buttonParamaters.position = Vector(0, 0.11, -0.4)
|
||||
buttonParamaters.height = 0
|
||||
@ -33,11 +34,14 @@ function onLoad()
|
||||
buttonParamaters.font_color = "Black"
|
||||
self.createButton(buttonParamaters)
|
||||
|
||||
-- make sure this part executes after the playermats are loaded
|
||||
Wait.time(function()
|
||||
updateColors()
|
||||
|
||||
-- start loop to update card count
|
||||
playermatApi.checkForDES(matColor)
|
||||
Wait.time(updateValue, 1, -1)
|
||||
end, 1)
|
||||
end
|
||||
|
||||
-- updates colors when object is dropped somewhere
|
||||
@ -70,6 +74,9 @@ function updateValue()
|
||||
updateColors()
|
||||
end
|
||||
|
||||
-- if one of the colors is undefined, then end here
|
||||
if matColor == nil or handColor == nil then return end
|
||||
|
||||
-- if there is still no handzone, then end here
|
||||
if Player[handColor].getHandCount() == 0 then return end
|
||||
|
||||
|
@ -554,13 +554,11 @@ function doDiscardOne()
|
||||
else
|
||||
local choices = {}
|
||||
for i = 1, #hand do
|
||||
local notes = JSON.decode(hand[i].getGMNotes())
|
||||
if notes ~= nil then
|
||||
if notes.hidden ~= true then
|
||||
table.insert(choices, i)
|
||||
end
|
||||
else
|
||||
local md = JSON.decode(hand[i].getGMNotes())
|
||||
if md ~= nil and (not md.weakness and not md.hidden and md.type ~= "Enemy") then
|
||||
table.insert(choices, i)
|
||||
elseif md == nil then
|
||||
broadcastToColor(hand[i].getName() .. " is missing metadata and won't be discarded.", messageColor, "Orange")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user