Merge pull request #593 from argonui/chaos-bag-manager
Updated Chaos Bag Manager
This commit is contained in:
commit
50781fd0dc
@ -11,15 +11,15 @@
|
|||||||
"r": 1
|
"r": 1
|
||||||
},
|
},
|
||||||
"CustomImage": {
|
"CustomImage": {
|
||||||
"CustomToken": {
|
"CustomTile": {
|
||||||
"MergeDistancePixels": 15,
|
|
||||||
"Stackable": false,
|
"Stackable": false,
|
||||||
"StandUp": false,
|
"Stretch": true,
|
||||||
"Thickness": 0.1
|
"Thickness": 0.1,
|
||||||
|
"Type": 3
|
||||||
},
|
},
|
||||||
"ImageScalar": 1,
|
"ImageScalar": 1,
|
||||||
"ImageSecondaryURL": "",
|
"ImageSecondaryURL": "",
|
||||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1857193769884995506/A760D5A6C66A035C4E4812BF5F0D511010EF526C/",
|
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2503508192889053854/82E219D04F01E9B0E5106114E1181A6C176A477B/",
|
||||||
"WidthScale": 0
|
"WidthScale": 0
|
||||||
},
|
},
|
||||||
"Description": "Adds/removes the desired token from the chaos bag.\n\nSee context menu for additional information.",
|
"Description": "Adds/removes the desired token from the chaos bag.\n\nSee context menu for additional information.",
|
||||||
@ -33,10 +33,10 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": true,
|
"Locked": true,
|
||||||
"LuaScript": "require(\"accessories/ChaosBagManager\")",
|
"LuaScript": "require(\"chaosbag/ChaosBagManager\")",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
"Name": "Custom_Token",
|
"Name": "Custom_Tile",
|
||||||
"Nickname": "Chaos Bag Manager",
|
"Nickname": "Chaos Bag Manager",
|
||||||
"Snap": true,
|
"Snap": true,
|
||||||
"Sticky": true,
|
"Sticky": true,
|
||||||
@ -45,15 +45,15 @@
|
|||||||
],
|
],
|
||||||
"Tooltip": true,
|
"Tooltip": true,
|
||||||
"Transform": {
|
"Transform": {
|
||||||
"posX": -66,
|
"posX": -65,
|
||||||
"posY": 1.531,
|
"posY": 1.481,
|
||||||
"posZ": -49.5,
|
"posZ": -50,
|
||||||
"rotX": 0,
|
"rotX": 0,
|
||||||
"rotY": 270,
|
"rotY": 270,
|
||||||
"rotZ": 0,
|
"rotZ": 0,
|
||||||
"scaleX": 2.5,
|
"scaleX": 4.8,
|
||||||
"scaleY": 1,
|
"scaleY": 1,
|
||||||
"scaleZ": 2.5
|
"scaleZ": 4.8
|
||||||
},
|
},
|
||||||
"Value": 0,
|
"Value": 0,
|
||||||
"XmlUI": ""
|
"XmlUI": ""
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"Sticky": true,
|
"Sticky": true,
|
||||||
"Tooltip": true,
|
"Tooltip": true,
|
||||||
"Transform": {
|
"Transform": {
|
||||||
"posX": -42.3,
|
"posX": -40.5,
|
||||||
"posY": 1.531,
|
"posY": 1.531,
|
||||||
"posZ": -46.5,
|
"posZ": -46.5,
|
||||||
"rotX": 0,
|
"rotX": 0,
|
||||||
|
@ -18,39 +18,40 @@ local BUTTON_TOOLTIP = {
|
|||||||
"Elder Sign", "Skull", "Cultist", "Tablet", "Elder Thing", "Auto-fail"
|
"Elder Sign", "Skull", "Cultist", "Tablet", "Elder Thing", "Auto-fail"
|
||||||
}
|
}
|
||||||
|
|
||||||
local BUTTON_POSITION = {
|
local BUTTON_POSITION_X = {
|
||||||
-- first row
|
-- 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
|
-- second row
|
||||||
-1.90, -1.14, -0.38, 0.38, 1.90,
|
-0.9, -0.54, -0.18, 0.18, 0.9,
|
||||||
-- third row
|
-- 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
|
-- common button parameters
|
||||||
local buttonParameters = {}
|
local buttonParameters = {}
|
||||||
buttonParameters.function_owner = self
|
buttonParameters.function_owner = self
|
||||||
buttonParameters.color = { 0, 0, 0, 0 }
|
buttonParameters.color = { 0, 0, 0, 0 }
|
||||||
buttonParameters.width = 300
|
buttonParameters.width = 160
|
||||||
buttonParameters.height = 300
|
buttonParameters.height = 160
|
||||||
|
|
||||||
local name
|
|
||||||
local tokens = {}
|
|
||||||
|
|
||||||
function onLoad()
|
function onLoad()
|
||||||
-- create buttons for tokens
|
-- create buttons for tokens
|
||||||
for i = 1, #BUTTON_POSITION do
|
for i = 1, #BUTTON_POSITION_X do
|
||||||
local funcName = "buttonClick" .. i
|
local funcName = "buttonClick" .. i
|
||||||
self.setVar(funcName, function(_, _, isRightClick) buttonClick(i, isRightClick) end)
|
self.setVar(funcName, function(_, _, isRightClick) buttonClick(i, isRightClick) end)
|
||||||
|
|
||||||
buttonParameters.click_function = funcName
|
buttonParameters.click_function = funcName
|
||||||
buttonParameters.tooltip = BUTTON_TOOLTIP[i]
|
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
|
if i < 7 then
|
||||||
buttonParameters.position.z = -0.778
|
buttonParameters.position.z = BUTTON_POSITION_Z[1]
|
||||||
elseif i > 11 then
|
elseif i < 12 then
|
||||||
buttonParameters.position.z = 0.755
|
buttonParameters.position.z = BUTTON_POSITION_Z[2]
|
||||||
|
else
|
||||||
|
buttonParameters.position.z = BUTTON_POSITION_Z[3]
|
||||||
end
|
end
|
||||||
|
|
||||||
self.createButton(buttonParameters)
|
self.createButton(buttonParameters)
|
Loading…
Reference in New Issue
Block a user