added changes
This commit is contained in:
parent
52551373c7
commit
e08b0cfed4
@ -22,6 +22,13 @@
|
|||||||
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/949592555964782208/CC876694A6684B3C2680CE2FE3259F574AE0AD97/",
|
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/949592555964782208/CC876694A6684B3C2680CE2FE3259F574AE0AD97/",
|
||||||
"WidthScale": 0
|
"WidthScale": 0
|
||||||
},
|
},
|
||||||
|
"CustomUIAssets": [
|
||||||
|
{
|
||||||
|
"Name": "font_teutonic-arkham",
|
||||||
|
"Type": 1,
|
||||||
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2027213118467703445/89328E273B4C5180BF491516CE998DE3C604E162/"
|
||||||
|
}
|
||||||
|
],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"DragSelectable": true,
|
"DragSelectable": true,
|
||||||
"GMNotes": "",
|
"GMNotes": "",
|
||||||
|
@ -10,6 +10,7 @@ local options = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val = 0
|
val = 0
|
||||||
|
self.max_typed_number = 99
|
||||||
|
|
||||||
-- save current value and options
|
-- save current value and options
|
||||||
function onSave() return JSON.encode({ val, options }) end
|
function onSave() return JSON.encode({ val, options }) end
|
||||||
@ -22,7 +23,7 @@ function onLoad(savedData)
|
|||||||
|
|
||||||
-- restore state for option panel
|
-- restore state for option panel
|
||||||
for key, bool in pairs(options) do
|
for key, bool in pairs(options) do
|
||||||
self.UI.setAttribute("option" .. key, "isOn", not bool)
|
if bool == false then changeLabel(key) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -65,6 +66,10 @@ function updateVal(number)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function onNumberTyped(_, number)
|
||||||
|
updateVal(number)
|
||||||
|
end
|
||||||
|
|
||||||
-- called by updateVal and addVal to broadcast total doom in play, including doom threshold
|
-- called by updateVal and addVal to broadcast total doom in play, including doom threshold
|
||||||
function broadcastDoom(val)
|
function broadcastDoom(val)
|
||||||
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
local doomInPlayCounter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DoomInPlayCounter")
|
||||||
@ -122,6 +127,7 @@ end
|
|||||||
-- XML UI functions
|
-- XML UI functions
|
||||||
function optionClick(_, optionName)
|
function optionClick(_, optionName)
|
||||||
options[optionName] = not options[optionName]
|
options[optionName] = not options[optionName]
|
||||||
|
changeLabel(optionName)
|
||||||
printToAll("Doom removal of " .. optionName .. (options[optionName] and " enabled" or " disabled"))
|
printToAll("Doom removal of " .. optionName .. (options[optionName] and " enabled" or " disabled"))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -134,3 +140,12 @@ function toggleOptions()
|
|||||||
self.UI.hide("Options")
|
self.UI.hide("Options")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function changeLabel(optionName)
|
||||||
|
local label = self.UI.getAttribute("option" .. optionName, "text")
|
||||||
|
if options[optionName] == true then
|
||||||
|
self.UI.setAttribute("option" .. optionName, "text", string.gsub(label, "☐", "☑"))
|
||||||
|
else
|
||||||
|
self.UI.setAttribute("option" .. optionName, "text", string.gsub(label, "☑", "☐"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -1,25 +1,26 @@
|
|||||||
<Defaults>
|
<Defaults>
|
||||||
<Panel rotation="0 0 180"></Panel>
|
<Panel rotation="0 0 180"></Panel>
|
||||||
<ToggleButton class="optionButton" font="font_teutonic-arkham" color="#88e3cf" colors="#88e3cf|#4f8478|#303836" fontSize="65" isOn="0" textAlignment="MiddleLeft" padding="30 30 0 0"></ToggleButton>
|
<Button class="optionButton" font="font_teutonic-arkham" colors="#88e3cf|#4f8478|#303836" fontSize="64" isOn="0" textAlignment="MiddleLeft" padding="20 20 0 0"></Button>
|
||||||
|
<Button font="font_teutonic-arkham" colors="#88e3cf|#4f8478|#303836"></Button>
|
||||||
</Defaults>
|
</Defaults>
|
||||||
|
|
||||||
<Panel id="Buttons" offsetXY="0 285">
|
<Panel id="Buttons" offsetXY="0 285">
|
||||||
<TableLayout height="150" width="500" cellSpacing="10">
|
<TableLayout height="150" width="545" cellSpacing="10">
|
||||||
<Row>
|
<Row>
|
||||||
<Cell columnSpan="3">
|
<Cell columnSpan="3">
|
||||||
<Button onClick="startReset" colors="#88e3cf|#4f8478|#303836" font="font_teutonic-arkham" fontSize="110">Reset</Button>
|
<Button onClick="startReset" fontSize="125">Reset</Button>
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<ToggleButton color="#88e3cf" colors="#88e3cf|#4f8478|#303836" onClick="toggleOptions" fontSize="60">☰</ToggleButton>
|
<Button onClick="toggleOptions" fontSize="65">☰</Button>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
<Panel id="Options" offsetXY="0 535" active="false" showAnimation="Grow" hideAnimation="Shrink">
|
<Panel id="Options" offsetXY="0 545" active="false" showAnimation="Grow" hideAnimation="Shrink">
|
||||||
<VerticalLayout height="300" width="500" spacing="10" childAlignment="MiddleCenter">
|
<VerticalLayout height="300" width="545" spacing="10" childAlignment="MiddleCenter">
|
||||||
<ToggleButton class="optionButton" id="optionAgenda" onClick="optionClick(Agenda)">Doom on Agenda</ToggleButton>
|
<Button class="optionButton" id="optionAgenda" text="☑ Doom on Agenda" onClick="optionClick(Agenda)"></Button>
|
||||||
<ToggleButton class="optionButton" id="optionPlayarea" onClick="optionClick(Playarea)">Doom in Playarea</ToggleButton>
|
<Button class="optionButton" id="optionPlayarea" text="☑ Doom in Play Area" onClick="optionClick(Playarea)"></Button>
|
||||||
<ToggleButton class="optionButton" id="optionPlayermats" onClick="optionClick(Playermats)">Doom on Playermats</ToggleButton>
|
<Button class="optionButton" id="optionPlayermats" text="☑ Doom on Playermats" onClick="optionClick(Playermats)"></Button>
|
||||||
</VerticalLayout>
|
</VerticalLayout>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
Loading…
Reference in New Issue
Block a user