Fixed XML creation

This commit is contained in:
Chr1Z93 2024-11-02 10:23:59 +01:00
parent 9a79134553
commit 3299554e27

View File

@ -1,10 +1,10 @@
require("playercards/CardsWithHelper")
local playermatApi = require("playermat/PlayermatApi")
local playermatApi = require("playermat/PlayermatApi")
local matColor, handColor, loopId
-- intentionally global
hasXML = true
isHelperEnabled = false
hasXML = true
isHelperEnabled = false
function updateSave()
self.script_state = JSON.encode({ isHelperEnabled = isHelperEnabled, loopId = loopId })
@ -17,10 +17,10 @@ function onLoad(savedData)
loopId = loadedData.loopId
end
updateColors()
createHelperXML()
if isHelperEnabled then
updateDisplay()
createHelperXML()
end
end
@ -53,7 +53,7 @@ function createHelperXML()
children = { {
tag = "Panel",
attributes = {
preferredHeight="300"
preferredHeight = "300"
},
children = { {
tag = "Text",
@ -63,26 +63,26 @@ function createHelperXML()
font = "font_teutonic-arkham",
fontsize = "200"
}
}}
} }
},
{
tag = "Panel",
attributes = {
preferredHeight="900"
},
children = { {
tag = "Text",
{
tag = "Panel",
attributes = {
id = "Count",
fontSize = "700",
scale = "2.2 2.2 1",
color = "Green",
font = "font_teutonic-arkham",
text = 0
}
}}
preferredHeight = "900"
},
children = { {
tag = "Text",
attributes = {
id = "Count",
fontSize = "700",
scale = "2.2 2.2 1",
color = "Green",
font = "font_teutonic-arkham",
text = 0
}
} }
}
}
}
} }
self.UI.setXmlTable(xmlTable)
end