option for playermat snap tags added

This commit is contained in:
Chr1Z93 2022-12-06 21:26:08 +01:00
parent 5231609f44
commit d4a41b7b02
2 changed files with 13 additions and 4 deletions

View File

@ -613,10 +613,19 @@ function onClick_toggleOption(_, id)
optionPanel[id] = state
end
local PlayerMatAPI = require("playermat/PlaymatApi")
function onClick_applySettings()
print("Enabling following settings:")
for id, value in pairs(optionPanel) do
if value then print(id) end
printToAll("---------------------", "White")
printToAll("Applying settings...", "White")
for id, state in pairs(optionPanel) do
if state then print(id) end
-- option 1: Snap tags
if id == "1" then
printToAll("Playermat snap tags " .. (state and "en" or "dis") .."abled.", "White")
PlayerMatAPI.setLimitSnapsByType(state, "All")
end
end
end

View File

@ -62,7 +62,7 @@
<TableLayout padding="20" cellPadding="10" cellSpacing="10">
<Row class="tblRow">
<Cell>
<Toggle id="toggle1" onValueChanged="onClick_toggleOption(1)">Toggle Text 1</Toggle>
<Toggle id="toggle1" onValueChanged="onClick_toggleOption(1)">Playermats: Snap tags for 'Assets'</Toggle>
</Cell>
<Cell>
<Toggle id="toggle2" onValueChanged="onClick_toggleOption(2)">Toggle Text 2</Toggle>