From 3a86fa74064d9b1ba92e07de7e47fc9c910fc326 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 15 Feb 2024 23:01:14 +0100 Subject: [PATCH] updated Chaos Bag Manager --- objects/ChaosBagManager.023240.json | 24 +++++++-------- objects/TokenArranger.022907.json | 2 +- .../ChaosBagManager.ttslua | 29 ++++++++++--------- 3 files changed, 28 insertions(+), 27 deletions(-) rename src/{accessories => chaosbag}/ChaosBagManager.ttslua (75%) diff --git a/objects/ChaosBagManager.023240.json b/objects/ChaosBagManager.023240.json index 364994bd..aaafc3cd 100644 --- a/objects/ChaosBagManager.023240.json +++ b/objects/ChaosBagManager.023240.json @@ -11,15 +11,15 @@ "r": 1 }, "CustomImage": { - "CustomToken": { - "MergeDistancePixels": 15, + "CustomTile": { "Stackable": false, - "StandUp": false, - "Thickness": 0.1 + "Stretch": true, + "Thickness": 0.1, + "Type": 3 }, "ImageScalar": 1, "ImageSecondaryURL": "", - "ImageURL": "http://cloud-3.steamusercontent.com/ugc/1857193769884995506/A760D5A6C66A035C4E4812BF5F0D511010EF526C/", + "ImageURL": "http://cloud-3.steamusercontent.com/ugc/2503508192889053854/82E219D04F01E9B0E5106114E1181A6C176A477B/", "WidthScale": 0 }, "Description": "Adds/removes the desired token from the chaos bag.\n\nSee context menu for additional information.", @@ -33,10 +33,10 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": true, - "LuaScript": "require(\"accessories/ChaosBagManager\")", + "LuaScript": "require(\"chaosbag/ChaosBagManager\")", "LuaScriptState": "", "MeasureMovement": false, - "Name": "Custom_Token", + "Name": "Custom_Tile", "Nickname": "Chaos Bag Manager", "Snap": true, "Sticky": true, @@ -45,15 +45,15 @@ ], "Tooltip": true, "Transform": { - "posX": -66, - "posY": 1.531, - "posZ": -49.5, + "posX": -65, + "posY": 1.481, + "posZ": -50, "rotX": 0, "rotY": 270, "rotZ": 0, - "scaleX": 2.5, + "scaleX": 4.8, "scaleY": 1, - "scaleZ": 2.5 + "scaleZ": 4.8 }, "Value": 0, "XmlUI": "" diff --git a/objects/TokenArranger.022907.json b/objects/TokenArranger.022907.json index 19ab79ff..4f4100b8 100644 --- a/objects/TokenArranger.022907.json +++ b/objects/TokenArranger.022907.json @@ -42,7 +42,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -42.3, + "posX": -40.5, "posY": 1.531, "posZ": -46.5, "rotX": 0, diff --git a/src/accessories/ChaosBagManager.ttslua b/src/chaosbag/ChaosBagManager.ttslua similarity index 75% rename from src/accessories/ChaosBagManager.ttslua rename to src/chaosbag/ChaosBagManager.ttslua index dc1a441d..d5801fd3 100644 --- a/src/accessories/ChaosBagManager.ttslua +++ b/src/chaosbag/ChaosBagManager.ttslua @@ -18,39 +18,40 @@ local BUTTON_TOOLTIP = { "Elder Sign", "Skull", "Cultist", "Tablet", "Elder Thing", "Auto-fail" } -local BUTTON_POSITION = { +local BUTTON_POSITION_X = { -- first row - -1.90, -1.14, -0.38, 0.38, 1.14, 1.90, + -0.9, -0.54, -0.18, 0.18, 0.54, 0.9, -- second row - -1.90, -1.14, -0.38, 0.38, 1.90, + -0.9, -0.54, -0.18, 0.18, 0.9, -- third row - -1.90, -1.14, -0.38, 0.38, 1.14, 1.90 + -0.9, -0.54, -0.18, 0.18, 0.54, 0.9 } +local BUTTON_POSITION_Z = { -0.298, 0.05, 0.399 } + -- common button parameters local buttonParameters = {} buttonParameters.function_owner = self buttonParameters.color = { 0, 0, 0, 0 } -buttonParameters.width = 300 -buttonParameters.height = 300 - -local name -local tokens = {} +buttonParameters.width = 160 +buttonParameters.height = 160 function onLoad() -- create buttons for tokens - for i = 1, #BUTTON_POSITION do + for i = 1, #BUTTON_POSITION_X do local funcName = "buttonClick" .. i self.setVar(funcName, function(_, _, isRightClick) buttonClick(i, isRightClick) end) buttonParameters.click_function = funcName buttonParameters.tooltip = BUTTON_TOOLTIP[i] - buttonParameters.position = { x = BUTTON_POSITION[i], y = 0, z = 0 } + buttonParameters.position = { x = BUTTON_POSITION_X[i], y = 0 } if i < 7 then - buttonParameters.position.z = -0.778 - elseif i > 11 then - buttonParameters.position.z = 0.755 + buttonParameters.position.z = BUTTON_POSITION_Z[1] + elseif i < 12 then + buttonParameters.position.z = BUTTON_POSITION_Z[2] + else + buttonParameters.position.z = BUTTON_POSITION_Z[3] end self.createButton(buttonParameters)