spawn placeholder function completed
This commit is contained in:
parent
ce38acca4f
commit
9ae435e1ed
@ -3,7 +3,6 @@
|
|||||||
"ComponentTags_path": "ComponentTags.json",
|
"ComponentTags_path": "ComponentTags.json",
|
||||||
"CustomUIAssets_path": "CustomUIAssets.json",
|
"CustomUIAssets_path": "CustomUIAssets.json",
|
||||||
"DecalPallet_path": "DecalPallet.json",
|
"DecalPallet_path": "DecalPallet.json",
|
||||||
"Decals": [],
|
|
||||||
"GameComplexity": "",
|
"GameComplexity": "",
|
||||||
"GameMode": "Arkham Horror LCG - Super Complete Edition",
|
"GameMode": "Arkham Horror LCG - Super Complete Edition",
|
||||||
"GameType": "",
|
"GameType": "",
|
||||||
@ -200,6 +199,7 @@
|
|||||||
"TokenArranger.022907",
|
"TokenArranger.022907",
|
||||||
"ChaosBagManager.023240",
|
"ChaosBagManager.023240",
|
||||||
"ArkhamSCE330-1092023-Page1.964222",
|
"ArkhamSCE330-1092023-Page1.964222",
|
||||||
|
"PlaceholderBoxDummy.a93466",
|
||||||
"SoulsofDarkness.a94e6b"
|
"SoulsofDarkness.a94e6b"
|
||||||
],
|
],
|
||||||
"PlayArea": 1,
|
"PlayArea": 1,
|
||||||
|
45
objects/PlaceholderBoxDummy.a93466.json
Normal file
45
objects/PlaceholderBoxDummy.a93466.json
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"AltLookAngle": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"Autoraise": true,
|
||||||
|
"ColorDiffuse": {
|
||||||
|
"b": 0.82353,
|
||||||
|
"g": 0.20157,
|
||||||
|
"r": 0
|
||||||
|
},
|
||||||
|
"Description": "This dummy is there to hold the up-to-date script file for placeholder boxes to be available for placeholder box spawning.",
|
||||||
|
"DragSelectable": true,
|
||||||
|
"GMNotes": "",
|
||||||
|
"GUID": "a93466",
|
||||||
|
"Grid": true,
|
||||||
|
"GridProjection": false,
|
||||||
|
"Hands": false,
|
||||||
|
"HideWhenFaceDown": false,
|
||||||
|
"IgnoreFoW": false,
|
||||||
|
"LayoutGroupSortIndex": 0,
|
||||||
|
"Locked": true,
|
||||||
|
"LuaScript": "require(\"core/DownloadBox\")",
|
||||||
|
"LuaScriptState": "",
|
||||||
|
"MeasureMovement": false,
|
||||||
|
"Name": "BlockRectangle",
|
||||||
|
"Nickname": "Placeholder Box Dummy",
|
||||||
|
"Snap": true,
|
||||||
|
"Sticky": true,
|
||||||
|
"Tooltip": true,
|
||||||
|
"Transform": {
|
||||||
|
"posX": 78,
|
||||||
|
"posY": 1.645,
|
||||||
|
"posZ": -33,
|
||||||
|
"rotX": 0,
|
||||||
|
"rotY": 0,
|
||||||
|
"rotZ": 0,
|
||||||
|
"scaleX": 1,
|
||||||
|
"scaleY": 1,
|
||||||
|
"scaleZ": 1
|
||||||
|
},
|
||||||
|
"Value": 0,
|
||||||
|
"XmlUI": ""
|
||||||
|
}
|
@ -56,6 +56,7 @@ local GuidReferences = {
|
|||||||
MythosArea = "9f334f",
|
MythosArea = "9f334f",
|
||||||
NavigationOverlayHandler = "797ede",
|
NavigationOverlayHandler = "797ede",
|
||||||
OptionPanelSource = "830bd0",
|
OptionPanelSource = "830bd0",
|
||||||
|
PlaceholderBoxDummy = "a93466",
|
||||||
PlayArea = "721ba2",
|
PlayArea = "721ba2",
|
||||||
PlayAreaZone = "a2f932",
|
PlayAreaZone = "a2f932",
|
||||||
PlayerCardPanel = "2d30ee",
|
PlayerCardPanel = "2d30ee",
|
||||||
|
@ -724,7 +724,56 @@ end
|
|||||||
|
|
||||||
-- spawns a placeholder box for the selected object
|
-- spawns a placeholder box for the selected object
|
||||||
function onClick_spawnPlaceholder()
|
function onClick_spawnPlaceholder()
|
||||||
|
-- get object references
|
||||||
|
local item = library[contentToShow][currentListItem]
|
||||||
|
local dummy = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlaceholderBoxDummy")
|
||||||
|
|
||||||
|
-- error handling
|
||||||
|
if not item.boxsize or item.boxsize == "" or not item.boxart or item.boxart == "" then
|
||||||
|
print("Error loading object.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- get data for placeholder
|
||||||
|
local spawnPos = {-39.5, 2, -87}
|
||||||
|
|
||||||
|
local meshTable = {
|
||||||
|
big = "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_MSH.obj",
|
||||||
|
small = "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj",
|
||||||
|
wide = "http://pastebin.com/raw.php?i=uWAmuNZ2"
|
||||||
|
}
|
||||||
|
|
||||||
|
local scaleTable = {
|
||||||
|
big = {1.00, 0.14, 1.00},
|
||||||
|
small = {2.21, 0.46, 2.42},
|
||||||
|
wide = {2.00, 0.11, 1.69}
|
||||||
|
}
|
||||||
|
|
||||||
|
local placeholder = spawnObject({
|
||||||
|
type = "Custom_Model",
|
||||||
|
position = spawnPos,
|
||||||
|
rotation = {0, 270, 0},
|
||||||
|
scale = scaleTable[item.boxsize],
|
||||||
|
})
|
||||||
|
|
||||||
|
placeholder.setCustomObject({
|
||||||
|
mesh = meshTable[item.boxsize],
|
||||||
|
diffuse = item.boxart,
|
||||||
|
material = 3
|
||||||
|
})
|
||||||
|
|
||||||
|
placeholder.setColorTint({1, 1, 1, 71/255})
|
||||||
|
placeholder.setName(item.name)
|
||||||
|
placeholder.setDescription("by " .. (item.author or "Unknown"))
|
||||||
|
placeholder.setGMNotes(item.url)
|
||||||
|
placeholder.setLuaScript(dummy.getLuaScript())
|
||||||
|
Player.getPlayers()[1].pingTable(spawnPos)
|
||||||
|
|
||||||
|
-- hide download window
|
||||||
|
if xmlVisibility.downloadWindow then
|
||||||
|
xmlVisibility.downloadWindow = false
|
||||||
|
UI.hide('downloadWindow')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- toggles the visibility of the respective UI
|
-- toggles the visibility of the respective UI
|
||||||
|
Loading…
Reference in New Issue
Block a user