updated download button creation

This commit is contained in:
Chr1Z93 2024-06-25 12:59:08 +02:00
parent d1a65395be
commit 0b5695acc1
33 changed files with 47 additions and 413 deletions

View File

@ -15,7 +15,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": 0,
"posY": 0,
"posZ": 0,
"rotX": 270,
"rotY": 0,
"rotZ": 0,
"scaleX": 2,
"scaleY": 2,
"scaleZ": 2
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": 0,
"posY": 0,
"posZ": 0,
"rotX": 270,
"rotY": 0,
"rotZ": 0,
"scaleX": 2,
"scaleY": 2,
"scaleZ": 2
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -17,12 +17,12 @@
"CustomShader": { "CustomShader": {
"FresnelStrength": 0.1, "FresnelStrength": 0.1,
"SpecularColor": { "SpecularColor": {
"b": 0.745098054, "b": 0.7450981,
"g": 0.8117647, "g": 0.8117647,
"r": 0.8745098 "r": 0.8745098
}, },
"SpecularIntensity": 0.05, "SpecularIntensity": 0.05,
"SpecularSharpness": 3.60000014 "SpecularSharpness": 3.6
}, },
"DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/863978359495062918/777CFB72754EC943DF113C1EC1CA495B07FCB6C1/", "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/863978359495062918/777CFB72754EC943DF113C1EC1CA495B07FCB6C1/",
"MaterialIndex": 1, "MaterialIndex": 1,
@ -50,9 +50,9 @@
"Sticky": false, "Sticky": false,
"Tooltip": true, "Tooltip": true,
"Transform": { "Transform": {
"posX": -66.409, "posX": -66.41,
"posY": 1.863, "posY": 1.863,
"posZ": -84.545, "posZ": -84.55,
"rotX": 90, "rotX": 90,
"rotY": 151, "rotY": 151,
"rotZ": 0, "rotZ": 0,

View File

@ -6,9 +6,9 @@
}, },
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27,
"b": 1, "b": 1,
"g": 0.99608, "g": 1,
"r": 1 "r": 1
}, },
"CustomMesh": { "CustomMesh": {

View File

@ -6,9 +6,9 @@
}, },
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27,
"b": 1, "b": 1,
"g": 0.99608, "g": 1,
"r": 1 "r": 1
}, },
"CustomMesh": { "CustomMesh": {

View File

@ -6,9 +6,9 @@
}, },
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27,
"b": 1, "b": 1,
"g": 0.99608, "g": 1,
"r": 1 "r": 1
}, },
"CustomMesh": { "CustomMesh": {

View File

@ -6,9 +6,9 @@
}, },
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27059, "a": 0.27,
"b": 1, "b": 1,
"g": 0.99608, "g": 1,
"r": 1 "r": 1
}, },
"CustomMesh": { "CustomMesh": {

View File

@ -6,9 +6,9 @@
}, },
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27,
"b": 1, "b": 1,
"g": 0.99608, "g": 1,
"r": 1 "r": 1
}, },
"CustomMesh": { "CustomMesh": {

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": 0,
"posY": 0,
"posZ": 0,
"rotX": 270,
"rotY": 0,
"rotZ": 0,
"scaleX": 2,
"scaleY": 2,
"scaleZ": 2
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -4,26 +4,6 @@
"y": 0, "y": 0,
"z": 0 "z": 0
}, },
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": -0.0021877822,
"posY": -0.08963572,
"posZ": -0.00288731651,
"rotX": 270,
"rotY": 359.869568,
"rotZ": 0,
"scaleX": 2.00000215,
"scaleY": 2.00000238,
"scaleZ": 2.00000262
}
}
],
"Autoraise": true, "Autoraise": true,
"ColorDiffuse": { "ColorDiffuse": {
"a": 0.27451, "a": 0.27451,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -13,7 +13,7 @@
}, },
"CustomMesh": { "CustomMesh": {
"CastShadows": true, "CastShadows": true,
"ColliderURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_COL.obj", "ColliderURL": "",
"Convex": true, "Convex": true,
"CustomShader": { "CustomShader": {
"FresnelStrength": 0, "FresnelStrength": 0,

View File

@ -1,41 +1,35 @@
function onLoad() function onLoad()
local notes = self.getGMNotes() -- make sure the model is loaded so that we can use the bounds
Wait.condition(buttonCreation, function() return not self.loading_custom end)
end
-- default parameters (e.g. scenarios) -- dynamic download button position based on model
local buttonParameters = { function buttonCreation()
local scale = self.getScale()
local bounds = self.getBoundsNormalized()
self.createButton({
label = "Download", label = "Download",
click_function = "buttonClick_download", click_function = "buttonClick_download",
function_owner = self, function_owner = self,
position = { x = 0, y = 0.1, z = 2.1 }, position = {
height = 250, x = 0,
width = 800, y = -(bounds.size.y / 2 + bounds.offset.y) / scale.y + 0.5,
font_size = 150, z = (bounds.size.z / 2 + 1.2) / scale.z
},
height = 700,
width = 2300,
font_size = 430,
color = { 0, 0, 0 }, color = { 0, 0, 0 },
font_color = { 1, 1, 1 } font_color = { 1, 1, 1 },
} scale = { 1 / scale.x, 1, 1 / scale.z }
})
-- return to boxes
if string.match(notes, "................") == "campaigns/return" then
buttonParameters.position.z = 2
-- official campaign boxes
elseif string.match(notes, ".........") == "campaigns" or self.hasTag("LargeBox") 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 end
function buttonClick_download(_, playerColor) function buttonClick_download(_, playerColor)
Global.call('placeholder_download', { url = self.getGMNotes(), player = playerColor and Player[playerColor] or nil, replace = self.guid }) Global.call('placeholder_download', {
url = self.getGMNotes(),
player = playerColor and Player[playerColor] or nil,
replace = self.guid
})
end end