raising tokens, combining sourcescript

This commit is contained in:
Chr1Z93 2022-11-19 00:33:21 +01:00
parent 410a06e6ef
commit 270c731246
40 changed files with 101 additions and 460 deletions

View File

@ -51,7 +51,7 @@
"Tooltip": true,
"Transform": {
"posX": 31.999,
"posY": 1.531,
"posY": 1.56,
"posZ": -24.492,
"rotX": 0,
"rotY": 270,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/DamageTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Damage\n",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -32.31,
"posY": 1.533,
"posY": 1.55,
"posZ": 29.006,
"rotX": 0,
"rotY": 11,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/DamageTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Damage\n",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -18.706,
"posY": 1.61,
"posY": 1.55,
"posZ": -29.027,
"rotX": 0,
"rotY": 195,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/DamageTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Damage\n",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -57.512,
"posY": 1.61,
"posY": 1.55,
"posZ": -22.921,
"rotX": 0,
"rotY": 285,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/DamageTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Damage\n",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -57.488,
"posY": 1.612,
"posY": 1.55,
"posZ": 9.184,
"rotX": 0,
"rotY": 282,

View File

@ -34,7 +34,7 @@
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"core/DataHelper\")",
"LuaScriptState": "",
"LuaScriptState": "[]",
"MeasureMovement": false,
"Name": "Custom_Tile",
"Nickname": "Data Helper",

View File

@ -6,7 +6,7 @@
-- - use the IGNORE_TAG to exclude objects from tidying (default: "CleanUpHelper_Ignore")
information = {
version = "2.3",
last_updated = "15.11.2022"
last_updated = "19.11.2022"
}
-- enable this for debugging
@ -199,9 +199,7 @@ function resetCounters()
if resetResources or (i < 9 or i > 12) then
local TOKEN = getObjectFromGUID(guid)
if TOKEN ~= nil then
TOKEN.setVar("val", RESET_VALUES[i])
TOKEN.call("updateVal")
TOKEN.call("updateSave")
TOKEN.call("updateVal", RESET_VALUES[i])
else
printToAll("Token number " .. i .. " could not be found and was skipped.", "Yellow")
end

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/HorrorTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Horror",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -57.882,
"posY": 1.61,
"posY": 1.55,
"posZ": -24.902,
"rotX": 0,
"rotY": 285,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/HorrorTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Horror",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -57.837,
"posY": 1.606,
"posY": 1.55,
"posZ": 7.19,
"rotX": 0,
"rotY": 280,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/HorrorTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Horror",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -34.234,
"posY": 1.538,
"posY": 1.55,
"posZ": 29.394,
"rotX": 0,
"rotY": 10,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/HorrorTracker\")",
"LuaScriptState": "[true,0]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Horror",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -16.653,
"posY": 1.61,
"posY": 1.55,
"posZ": -29.429,
"rotX": 0,
"rotY": 195,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.27,
"posY": 1.64,
"posY": 1.55,
"posZ": -21.55,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -19.06,
"posY": 1.64,
"posY": 1.55,
"posZ": -24.78,
"rotX": 0,
"rotY": 180,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.232,
"posY": 1.64,
"posY": 1.55,
"posZ": 10.581,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.206,
"posY": 1.64,
"posY": 1.55,
"posZ": 8.432,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.206,
"posY": 1.64,
"posY": 1.55,
"posZ": 9.573,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -34.264,
"posY": 1.53,
"posY": 1.55,
"posZ": 24.8,
"rotX": 0,
"rotY": 0,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.265,
"posY": 1.64,
"posY": 1.55,
"posZ": -22.542,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.265,
"posY": 1.64,
"posY": 1.55,
"posZ": -24.825,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -17.918,
"posY": 1.64,
"posY": 1.55,
"posZ": -24.783,
"rotX": 0,
"rotY": 180,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -20.049,
"posY": 1.64,
"posY": 1.55,
"posZ": -24.78,
"rotX": 0,
"rotY": 180,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -31.981,
"posY": 1.53,
"posY": 1.55,
"posZ": 24.8,
"rotX": 0,
"rotY": 0,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -30.997,
"posY": 1.53,
"posY": 1.55,
"posZ": 24.81,
"rotX": 0,
"rotY": 0,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -16.777,
"posY": 1.64,
"posY": 1.55,
"posZ": -24.783,
"rotX": 0,
"rotY": 180,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -33.123,
"posY": 1.53,
"posY": 1.55,
"posZ": 24.8,
"rotX": 0,
"rotY": 0,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.206,
"posY": 1.64,
"posY": 1.55,
"posZ": 7.29,
"rotX": 0,
"rotY": 270,

View File

@ -1158,7 +1158,7 @@
"Tooltip": true,
"Transform": {
"posX": -53.265,
"posY": 1.64,
"posY": 1.55,
"posZ": -23.683,
"rotX": 0,
"rotY": 270,

View File

@ -238,7 +238,7 @@
"Tooltip": false,
"Transform": {
"posX": -54.989,
"posY": 1.54,
"posY": 1.45,
"posZ": 16.018,
"rotX": 0,
"rotY": 270,

View File

@ -238,7 +238,7 @@
"Tooltip": false,
"Transform": {
"posX": -54.999,
"posY": 1.54,
"posY": 1.45,
"posZ": -16.098,
"rotX": 0,
"rotY": 270,

View File

@ -238,7 +238,7 @@
"Tooltip": false,
"Transform": {
"posX": -25.57,
"posY": 1.43,
"posY": 1.45,
"posZ": 26.54,
"rotX": 0,
"rotY": 0,

View File

@ -238,7 +238,7 @@
"Tooltip": false,
"Transform": {
"posX": -25.493,
"posY": 1.54,
"posY": 1.45,
"posZ": -26.54,
"rotX": 0,
"rotY": 180,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/ResourceTracker\")",
"LuaScriptState": "[true,5]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -59.774,
"posY": 1.609,
"posY": 1.55,
"posZ": 7.535,
"rotX": 0,
"rotY": 280,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/ResourceTracker\")",
"LuaScriptState": "[true,5]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -59.793,
"posY": 1.61,
"posY": 1.55,
"posZ": -24.544,
"rotX": 0,
"rotY": 285,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/ResourceTracker\")",
"LuaScriptState": "[true,5]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -17.037,
"posY": 1.61,
"posY": 1.55,
"posZ": -31.384,
"rotX": 0,
"rotY": 195,

View File

@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/ResourceTracker\")",
"LuaScriptState": "[true,5]",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
@ -43,7 +43,7 @@
"Tooltip": false,
"Transform": {
"posX": -33.889,
"posY": 1.531,
"posY": 1.55,
"posZ": 31.335,
"rotX": 0,
"rotY": 10,

View File

@ -1,132 +0,0 @@
MIN_VALUE = -99
MAX_VALUE = 999
function onload(saved_data)
light_mode = true
val = 0
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
light_mode = loaded_data[1]
val = loaded_data[2]
end
createAll()
end
function updateSave()
local data_to_save = {light_mode, val}
saved_data = JSON.encode(data_to_save)
self.script_state = saved_data
end
function createAll()
s_color = {0,0,0,100}
if light_mode then
f_color = {1,1,1,100}
else
f_color = {0,0,0,100}
end
self.createButton({
label=tostring(val),
click_function="add_subtract",
function_owner=self,
position={0.1,0.05,0.1},
height=600,
width=1000,
alignment = 3,
scale={x=1.5, y=1.5, z=1.5},
font_size=600,
font_color=f_color,
color={1,1,1,0}
})
if light_mode then
lightButtonText = "[ Set dark ]"
else
lightButtonText = "[ Set light ]"
end
end
function removeAll()
self.removeInput(0)
self.removeInput(1)
self.removeButton(0)
self.removeButton(1)
self.removeButton(2)
end
function reloadAll()
removeAll()
createAll()
updateSave()
end
function swap_fcolor(_obj, _color, alt_click)
light_mode = not light_mode
reloadAll()
end
function swap_align(_obj, _color, alt_click)
center_mode = not center_mode
reloadAll()
end
function editName(_obj, _string, value)
self.setName(value)
setTooltips()
end
function add_subtract(_obj, _color, alt_click)
mod = alt_click and -1 or 1
new_value = math.min(math.max(val + mod, MIN_VALUE), MAX_VALUE)
if val ~= new_value then
val = new_value
updateVal()
updateSave()
end
end
function updateVal()
self.editButton({
index = 0,
label = tostring(val),
})
end
function reset_val()
val = 0
updateVal()
updateSave()
end
function setTooltips()
self.editInput({
index = 0,
value = self.getName(),
tooltip = ttText
})
self.editButton({
index = 0,
value = tostring(val),
tooltip = ttText
})
end
function null()
end
function keepSample(_obj, _string, value)
reloadAll()
end

View File

@ -0,0 +1,39 @@
MIN_VALUE = -99
MAX_VALUE = 999
val = 0
function onSave() return JSON.encode(val) end
function onLoad(saved_data)
if saved_data ~= nil then
val = JSON.decode(saved_data)
end
self.createButton({
label = tostring(val),
click_function = "addOrSubtract",
function_owner = self,
position = { 0, 0.06, 0 },
height = 600,
width = 1000,
scale = { 1.5, 1.5, 1.5 },
font_size = 600,
font_color = { 1, 1, 1, 100 },
color = { 0, 0, 0, 0 }
})
end
function updateVal(newVal)
if tonumber(newVal) then
val = newVal
self.editButton({
index = 0,
label = tostring(val)
})
end
end
function addOrSubtract(_, _, alt_click)
val = math.min(math.max(val + (alt_click and -1 or 1), MIN_VALUE), MAX_VALUE)
self.editButton({ index = 0, label = tostring(val) })
end

View File

@ -1,132 +0,0 @@
MIN_VALUE = -99
MAX_VALUE = 999
function onload(saved_data)
light_mode = true
val = 0
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
light_mode = loaded_data[1]
val = loaded_data[2]
end
createAll()
end
function updateSave()
local data_to_save = {light_mode, val}
saved_data = JSON.encode(data_to_save)
self.script_state = saved_data
end
function createAll()
s_color = {0,0,0,100}
if light_mode then
f_color = {1,1,1,100}
else
f_color = {0,0,0,100}
end
self.createButton({
label=tostring(val),
click_function="add_subtract",
function_owner=self,
position={-0.025,0.05,-0.025},
height=600,
width=1000,
alignment = 3,
scale={x=1.5, y=1.5, z=1.5},
font_size=600,
font_color=f_color,
color={1,1,1,0}
})
if light_mode then
lightButtonText = "[ Set dark ]"
else
lightButtonText = "[ Set light ]"
end
end
function removeAll()
self.removeInput(0)
self.removeInput(1)
self.removeButton(0)
self.removeButton(1)
self.removeButton(2)
end
function reloadAll()
removeAll()
createAll()
updateSave()
end
function swap_fcolor(_obj, _color, alt_click)
light_mode = not light_mode
reloadAll()
end
function swap_align(_obj, _color, alt_click)
center_mode = not center_mode
reloadAll()
end
function editName(_obj, _string, value)
self.setName(value)
setTooltips()
end
function add_subtract(_obj, _color, alt_click)
mod = alt_click and -1 or 1
new_value = math.min(math.max(val + mod, MIN_VALUE), MAX_VALUE)
if val ~= new_value then
val = new_value
updateVal()
updateSave()
end
end
function updateVal()
self.editButton({
index = 0,
label = tostring(val),
})
end
function reset_val()
val = 0
updateVal()
updateSave()
end
function setTooltips()
self.editInput({
index = 0,
value = self.getName(),
tooltip = ttText
})
self.editButton({
index = 0,
value = tostring(val),
tooltip = ttText
})
end
function null()
end
function keepSample(_obj, _string, value)
reloadAll()
end

View File

@ -230,11 +230,11 @@ function doUpkeep(_, color, alt_click)
end
-- gain a resource
RESOURCE_COUNTER.call("add_subtract")
RESOURCE_COUNTER.call("addOrSubtract")
-- gain an additional resource for Jenny Barnes
if string.match(activeInvestigatorId, "%d%d%d%d%d") == "02003" then
RESOURCE_COUNTER.call("add_subtract")
RESOURCE_COUNTER.call("addOrSubtract")
printToColor("Gaining 2 resources (Jenny)", messageColor)
end

View File

@ -1,132 +0,0 @@
MIN_VALUE = -99
MAX_VALUE = 999
function onload(saved_data)
light_mode = true
val = 0
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
light_mode = loaded_data[1]
val = loaded_data[2]
end
createAll()
end
function updateSave()
local data_to_save = {light_mode, val}
saved_data = JSON.encode(data_to_save)
self.script_state = saved_data
end
function createAll()
s_color = {0,0,0,100}
if light_mode then
f_color = {1,1,1,100}
else
f_color = {0,0,0,100}
end
self.createButton({
label=tostring(val),
click_function="add_subtract",
function_owner=self,
position={0,0.05,0.1},
height=600,
width=1000,
alignment = 3,
scale={x=1.5, y=1.5, z=1.5},
font_size=600,
font_color=f_color,
color={1,1,1,0}
})
if light_mode then
lightButtonText = "[ Set dark ]"
else
lightButtonText = "[ Set light ]"
end
end
function removeAll()
self.removeInput(0)
self.removeInput(1)
self.removeButton(0)
self.removeButton(1)
self.removeButton(2)
end
function reloadAll()
removeAll()
createAll()
updateSave()
end
function swap_fcolor(_obj, _color, alt_click)
light_mode = not light_mode
reloadAll()
end
function swap_align(_obj, _color, alt_click)
center_mode = not center_mode
reloadAll()
end
function editName(_obj, _string, value)
self.setName(value)
setTooltips()
end
function add_subtract(_obj, _color, alt_click)
mod = alt_click and -1 or 1
new_value = math.min(math.max(val + mod, MIN_VALUE), MAX_VALUE)
if val ~= new_value then
val = new_value
updateVal()
updateSave()
end
end
function updateVal()
self.editButton({
index = 0,
label = tostring(val),
})
end
function reset_val()
val = 0
updateVal()
updateSave()
end
function setTooltips()
self.editInput({
index = 0,
value = self.getName(),
tooltip = ttText
})
self.editButton({
index = 0,
value = tostring(val),
tooltip = ttText
})
end
function null()
end
function keepSample(_obj, _string, value)
reloadAll()
end