Merge pull request #68 from argonui/cluecounter-position

Optional clue counter: fixing position, using require
This commit is contained in:
Buhallin 2022-11-25 13:12:18 -08:00 committed by GitHub
commit ca5f3d88a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 17 additions and 735 deletions

View File

@ -14,11 +14,10 @@
"r": 1
},
"ContainedObjects_order": [
"Doomcounter.19768a",
"Resources.3f22e5",
"Resources.4111de",
"Resources.891403",
"Resources.db85d6"
"Clues.3f22e5",
"Clues.4111de",
"Clues.891403",
"Clues.db85d6"
],
"ContainedObjects_path": "ClueCounterSwapper.d919d6",
"CustomMesh": {

View File

@ -1 +1 @@
{"ml":{"19768a":{"lock":true,"pos":{"x":-5.3639,"y":1.6575,"z":-5.1003},"rot":{"x":359.9197,"y":270.0688,"z":0.0167}},"3f22e5":{"lock":true,"pos":{"x":-59.3181,"y":1.64,"z":-17.674},"rot":{"x":359.9201,"y":269.9747,"z":0.0169}},"4111de":{"lock":true,"pos":{"x":-23.81,"y":1.5885,"z":-30.9272},"rot":{"x":0.0169,"y":180.0104,"z":0.0799}},"891403":{"lock":true,"pos":{"x":-31.9109,"y":1.5644,"z":30.9195},"rot":{"x":359.9831,"y":359.9875,"z":359.9201}},"db85d6":{"lock":true,"pos":{"x":-59.439,"y":1.6367,"z":9.472},"rot":{"x":359.9201,"y":269.9797,"z":0.0169}}}}
{"ml":{"3f22e5":{"lock":true,"pos":{"x":-59.50,"y":1.54,"z":9.56},"rot":{"x":0,"y":280,"z":0}},"4111de":{"lock":true,"pos":{"x":-59.45,"y":1.54,"z":-22.63},"rot":{"x":0,"y":280,"z":0}},"891403":{"lock":true,"pos":{"x":-31.91,"y":1.54,"z":30.97},"rot":{"x":0,"y":10,"z":0}},"db85d6":{"lock":true,"pos":{"x":-18.98,"y":1.54,"z":-31.01},"rot":{"x":0,"y":190,"z":0}}}}

View File

@ -33,11 +33,11 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScriptState": "[true,0]",
"LuaScript_path": "ClueCounterSwapper.d919d6/Resources.3f22e5.ttslua",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
"Nickname": "Clues",
"Snap": true,
"Sticky": true,
"Tooltip": false,

View File

@ -33,11 +33,11 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScriptState": "[true,0]",
"LuaScript_path": "ClueCounterSwapper.d919d6/Resources.4111de.ttslua",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
"Nickname": "Clues",
"Snap": true,
"Sticky": true,
"Tooltip": false,

View File

@ -33,11 +33,11 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScriptState": "[true,0]",
"LuaScript_path": "ClueCounterSwapper.d919d6/Resources.891403.ttslua",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
"Nickname": "Clues",
"Snap": true,
"Sticky": true,
"Tooltip": false,

View File

@ -33,11 +33,11 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScriptState": "[true,0]",
"LuaScript_path": "ClueCounterSwapper.d919d6/Resources.db85d6.ttslua",
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Resources",
"Nickname": "Clues",
"Snap": true,
"Sticky": true,
"Tooltip": false,

View File

@ -1,57 +0,0 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0.87451,
"g": 0.87451,
"r": 0.87451
},
"CustomImage": {
"CustomToken": {
"MergeDistancePixels": 5,
"Stackable": false,
"StandUp": false,
"Thickness": 0.1
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1758068501357164917/1D06F1DC4D6888B6F57124BD2AFE20D0B0DA15A8/",
"WidthScale": 0
},
"Description": "Left click - Increase\nRight click - Decrease",
"DragSelectable": true,
"GMNotes": "",
"GUID": "19768a",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScriptState": "[true,0]",
"LuaScript_path": "ClueCounterSwapper.d919d6/Doomcounter.19768a.ttslua",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "Doom counter\n",
"Snap": true,
"Sticky": true,
"Tooltip": false,
"Transform": {
"posX": -5.364,
"posY": 1.658,
"posZ": -5.1,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 0.42,
"scaleY": 1,
"scaleZ": 0.42
},
"Value": 0,
"XmlUI": ""
}

View File

@ -1,132 +0,0 @@
MIN_VALUE = -99
MAX_VALUE = 999
function onload(saved_data)
light_mode = false
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.5, 0.5, 0.5, 95}
if light_mode then
f_color = {1,1,1,95}
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},
height=600,
width=1000,
alignment = 3,
scale={x=1.5, y=1.5, z=1.5},
font_size=600,
font_color=f_color,
color={0,0,0,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

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

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

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

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