collapsed functions
This commit is contained in:
parent
b18b6f2b68
commit
d143e8ea02
@ -36,26 +36,18 @@ function createButtons()
|
||||
self.addContextMenuItem("Clear Helper", deleteButtons)
|
||||
self.UI.setAttribute("inactives", "active", true)
|
||||
self.UI.setAttribute("actives", "active", true)
|
||||
self.UI.show("inactive_bless")
|
||||
self.UI.show("inactive_curse")
|
||||
self.UI.hide("active_bless")
|
||||
self.UI.hide("active_curse")
|
||||
self.UI.show("inactiveBless")
|
||||
self.UI.show("inactiveCurse")
|
||||
self.UI.hide("Bless")
|
||||
self.UI.hide("Curse")
|
||||
currentState = "Empty"
|
||||
loopId = Wait.time(countBlessCurse, 1, -1)
|
||||
end
|
||||
|
||||
function resolveCurse()
|
||||
local closestMatColor = playmatApi.getMatColorByPosition(self.getPosition())
|
||||
local mat = guidReferenceApi.getObjectByOwnerAndType(closestMatColor, "Playermat")
|
||||
tokenType = "Curse"
|
||||
chaosBagApi.drawChaosToken(mat, true , tokenType)
|
||||
end
|
||||
|
||||
function resolveBless()
|
||||
local closestMatColor = playmatApi.getMatColorByPosition(self.getPosition())
|
||||
local mat = guidReferenceApi.getObjectByOwnerAndType(closestMatColor, "Playermat")
|
||||
tokenType = "Bless"
|
||||
chaosBagApi.drawChaosToken(mat, true , tokenType)
|
||||
function resolveToken(_, _, tokenType)
|
||||
local closestMatColor = playmatApi.getMatColorByPosition(self.getPosition())
|
||||
local mat = guidReferenceApi.getObjectByOwnerAndType(closestMatColor, "Playermat")
|
||||
chaosBagApi.drawChaosToken(mat, true, tokenType)
|
||||
end
|
||||
|
||||
function countBlessCurse()
|
||||
@ -73,34 +65,34 @@ function countBlessCurse()
|
||||
|
||||
if numInBag.Bless > numInBag.Curse then
|
||||
if currentState ~= "More Bless" then
|
||||
self.UI.show("active_bless")
|
||||
self.UI.hide("inactive_bless")
|
||||
self.UI.show("inactive_curse")
|
||||
self.UI.hide("active_curse")
|
||||
self.UI.show("Bless")
|
||||
self.UI.hide("inactiveBless")
|
||||
self.UI.show("inactiveCurse")
|
||||
self.UI.hide("Curse")
|
||||
end
|
||||
currentState = "More Bless"
|
||||
elseif numInBag.Curse > numInBag.Bless then
|
||||
if currentState ~= "More Curse" then
|
||||
self.UI.show("active_curse")
|
||||
self.UI.hide("inactive_curse")
|
||||
self.UI.show("inactive_bless")
|
||||
self.UI.hide("active_bless")
|
||||
self.UI.show("Curse")
|
||||
self.UI.hide("inactiveCurse")
|
||||
self.UI.show("inactiveBless")
|
||||
self.UI.hide("Bless")
|
||||
end
|
||||
currentState = "More Curse"
|
||||
elseif numInBag.Curse == 0 then
|
||||
if currentState ~= "Empty" then
|
||||
self.UI.show("inactive_bless")
|
||||
self.UI.hide("active_bless")
|
||||
self.UI.show("inactive_curse")
|
||||
self.UI.hide("active_curse")
|
||||
self.UI.show("inactiveBless")
|
||||
self.UI.hide("Bless")
|
||||
self.UI.show("inactiveCurse")
|
||||
self.UI.hide("Curse")
|
||||
end
|
||||
currentState = "Empty"
|
||||
else
|
||||
if currentState ~= "Equal" then
|
||||
self.UI.show("active_bless")
|
||||
self.UI.hide("inactive_bless")
|
||||
self.UI.show("active_curse")
|
||||
self.UI.hide("inactive_curse")
|
||||
self.UI.show("Bless")
|
||||
self.UI.hide("inactiveBless")
|
||||
self.UI.show("Curse")
|
||||
self.UI.hide("inactiveCurse")
|
||||
end
|
||||
currentState = "Equal"
|
||||
end
|
||||
|
@ -6,14 +6,14 @@
|
||||
<TableLayout id="actives" active="false" cellSpacing="80" cellBackgroundColor="rgba(1,1,1,0)">
|
||||
<Row>
|
||||
<Cell>
|
||||
<Button id="active_bless" padding="50 50 50 50" icon="bless" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="White"
|
||||
onClick="resolveBless" color="#9D702CE6" iconAlignment="Right">Resolve</Button>
|
||||
<Button id="Bless" padding="50 50 50 50" icon="bless" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="White"
|
||||
onClick="resolveToken" color="#9D702CE6" iconAlignment="Right">Resolve</Button>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row>
|
||||
<Cell>
|
||||
<Button id="active_curse" padding="50 50 50 50" icon="curse" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="White"
|
||||
onClick="resolveCurse" color="#633A84E6" iconAlignment="Right">Resolve</Button>
|
||||
<Button id="Curse" padding="50 50 50 50" icon="curse" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="White"
|
||||
onClick="resolveToken" color="#633A84E6" iconAlignment="Right">Resolve</Button>
|
||||
</Cell>
|
||||
</Row>
|
||||
</TableLayout>
|
||||
@ -27,13 +27,13 @@
|
||||
<TableLayout id="inactives" active="false" cellSpacing="80" cellBackgroundColor="rgba(1,1,1,0)">
|
||||
<Row>
|
||||
<Cell>
|
||||
<Button id="inactive_bless" padding="50 50 50 50" icon="bless" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="#A0A0A0"
|
||||
<Button id="inactiveBless" padding="50 50 50 50" icon="bless" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="#A0A0A0"
|
||||
onClick="errorMessage" color="#353535E6" iconAlignment="Right">Resolve</Button>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row>
|
||||
<Cell>
|
||||
<Button id="inactive_curse" padding="50 50 50 50" icon="curse" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="#A0A0A0"
|
||||
<Button id="inactiveCurse" padding="50 50 50 50" icon="curse" iconWidth="400" font="font_teutonic-arkham" fontSize="300" textColor="#A0A0A0"
|
||||
onClick="errorMessage" color="#353535E6" iconAlignment="Right">Resolve</Button>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
Loading…
x
Reference in New Issue
Block a user