Merge pull request #593 from argonui/chaos-bag-manager

Updated Chaos Bag Manager
This commit is contained in:
Entrox-Licher 2024-02-15 17:05:58 -05:00 committed by GitHub
commit 50781fd0dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 27 deletions

View File

@ -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": ""

View File

@ -42,7 +42,7 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -42.3,
"posX": -40.5,
"posY": 1.531,
"posZ": -46.5,
"rotX": 0,

View File

@ -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)