SCED/src/core/DownloadBox.ttslua
2022-12-19 22:06:27 +01:00

42 lines
1.1 KiB
Plaintext

function onLoad()
local notes = self.getGMNotes()
-- default parameters (e.g. scenarios)
local buttonParameters = {
label = "Download",
click_function = "buttonClick_download",
function_owner = self,
position = { x = 0, y = 0.1, z = 2.1 },
height = 250,
width = 800,
font_size = 150,
color = { 0, 0, 0 },
font_color = { 1, 1, 1 }
}
-- return to boxes
if string.match(notes, "................") == "campaigns/return" then
buttonParameters.position.z = -2
-- official campaign boxes
elseif string.match(notes, ".........") == "campaigns" then
buttonParameters.position.z = 6
buttonParameters.height = 500
buttonParameters.width = 1700
buttonParameters.font_size = 350
-- investigator boxes
elseif string.match(notes, ".............") == "investigators" then
buttonParameters.position.z = 7
buttonParameters.height = 850
buttonParameters.width = 3400
buttonParameters.font_size = 700
end
self.createButton(buttonParameters)
end
function buttonClick_download()
Global.call('placeholder_download', { url = self.getGMNotes(), replace = self.guid })
end