From c043ab78eb2fefcb249a7a647cdde9367e4163fe Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 24 Nov 2022 15:00:52 +0100 Subject: [PATCH] fixing position, using require --- objects/ClueCounterSwapper.d919d6.json | 9 +- .../ClueCounterSwapper.d919d6.luascriptstate | 2 +- ...esources.3f22e5.json => Clues.3f22e5.json} | 6 +- ...esources.4111de.json => Clues.4111de.json} | 6 +- ...esources.891403.json => Clues.891403.json} | 6 +- ...esources.db85d6.json => Clues.db85d6.json} | 6 +- .../Doomcounter.19768a.json | 57 -------- .../Doomcounter.19768a.ttslua | 132 ------------------ .../Resources.3f22e5.ttslua | 132 ------------------ .../Resources.4111de.ttslua | 132 ------------------ .../Resources.891403.ttslua | 132 ------------------ .../Resources.db85d6.ttslua | 132 ------------------ 12 files changed, 17 insertions(+), 735 deletions(-) rename objects/ClueCounterSwapper.d919d6/{Resources.3f22e5.json => Clues.3f22e5.json} (89%) rename objects/ClueCounterSwapper.d919d6/{Resources.4111de.json => Clues.4111de.json} (89%) rename objects/ClueCounterSwapper.d919d6/{Resources.891403.json => Clues.891403.json} (89%) rename objects/ClueCounterSwapper.d919d6/{Resources.db85d6.json => Clues.db85d6.json} (89%) delete mode 100644 objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.json delete mode 100644 objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.ttslua delete mode 100644 objects/ClueCounterSwapper.d919d6/Resources.3f22e5.ttslua delete mode 100644 objects/ClueCounterSwapper.d919d6/Resources.4111de.ttslua delete mode 100644 objects/ClueCounterSwapper.d919d6/Resources.891403.ttslua delete mode 100644 objects/ClueCounterSwapper.d919d6/Resources.db85d6.ttslua diff --git a/objects/ClueCounterSwapper.d919d6.json b/objects/ClueCounterSwapper.d919d6.json index 4f87fafd..72d1aa6e 100644 --- a/objects/ClueCounterSwapper.d919d6.json +++ b/objects/ClueCounterSwapper.d919d6.json @@ -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": { diff --git a/objects/ClueCounterSwapper.d919d6.luascriptstate b/objects/ClueCounterSwapper.d919d6.luascriptstate index 4fc9d2ca..42c673a6 100644 --- a/objects/ClueCounterSwapper.d919d6.luascriptstate +++ b/objects/ClueCounterSwapper.d919d6.luascriptstate @@ -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}}}} \ No newline at end of file diff --git a/objects/ClueCounterSwapper.d919d6/Resources.3f22e5.json b/objects/ClueCounterSwapper.d919d6/Clues.3f22e5.json similarity index 89% rename from objects/ClueCounterSwapper.d919d6/Resources.3f22e5.json rename to objects/ClueCounterSwapper.d919d6/Clues.3f22e5.json index bd0b28b9..4c3eced1 100644 --- a/objects/ClueCounterSwapper.d919d6/Resources.3f22e5.json +++ b/objects/ClueCounterSwapper.d919d6/Clues.3f22e5.json @@ -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, diff --git a/objects/ClueCounterSwapper.d919d6/Resources.4111de.json b/objects/ClueCounterSwapper.d919d6/Clues.4111de.json similarity index 89% rename from objects/ClueCounterSwapper.d919d6/Resources.4111de.json rename to objects/ClueCounterSwapper.d919d6/Clues.4111de.json index b69491fd..4d272e1a 100644 --- a/objects/ClueCounterSwapper.d919d6/Resources.4111de.json +++ b/objects/ClueCounterSwapper.d919d6/Clues.4111de.json @@ -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, diff --git a/objects/ClueCounterSwapper.d919d6/Resources.891403.json b/objects/ClueCounterSwapper.d919d6/Clues.891403.json similarity index 89% rename from objects/ClueCounterSwapper.d919d6/Resources.891403.json rename to objects/ClueCounterSwapper.d919d6/Clues.891403.json index 25670b46..4d4b6157 100644 --- a/objects/ClueCounterSwapper.d919d6/Resources.891403.json +++ b/objects/ClueCounterSwapper.d919d6/Clues.891403.json @@ -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, diff --git a/objects/ClueCounterSwapper.d919d6/Resources.db85d6.json b/objects/ClueCounterSwapper.d919d6/Clues.db85d6.json similarity index 89% rename from objects/ClueCounterSwapper.d919d6/Resources.db85d6.json rename to objects/ClueCounterSwapper.d919d6/Clues.db85d6.json index 30891624..12a35cd0 100644 --- a/objects/ClueCounterSwapper.d919d6/Resources.db85d6.json +++ b/objects/ClueCounterSwapper.d919d6/Clues.db85d6.json @@ -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, diff --git a/objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.json b/objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.json deleted file mode 100644 index 812ca8ab..00000000 --- a/objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.json +++ /dev/null @@ -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": "" -} diff --git a/objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.ttslua b/objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.ttslua deleted file mode 100644 index 02a4919c..00000000 --- a/objects/ClueCounterSwapper.d919d6/Doomcounter.19768a.ttslua +++ /dev/null @@ -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 diff --git a/objects/ClueCounterSwapper.d919d6/Resources.3f22e5.ttslua b/objects/ClueCounterSwapper.d919d6/Resources.3f22e5.ttslua deleted file mode 100644 index cd22f422..00000000 --- a/objects/ClueCounterSwapper.d919d6/Resources.3f22e5.ttslua +++ /dev/null @@ -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 diff --git a/objects/ClueCounterSwapper.d919d6/Resources.4111de.ttslua b/objects/ClueCounterSwapper.d919d6/Resources.4111de.ttslua deleted file mode 100644 index cd22f422..00000000 --- a/objects/ClueCounterSwapper.d919d6/Resources.4111de.ttslua +++ /dev/null @@ -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 diff --git a/objects/ClueCounterSwapper.d919d6/Resources.891403.ttslua b/objects/ClueCounterSwapper.d919d6/Resources.891403.ttslua deleted file mode 100644 index cd22f422..00000000 --- a/objects/ClueCounterSwapper.d919d6/Resources.891403.ttslua +++ /dev/null @@ -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 diff --git a/objects/ClueCounterSwapper.d919d6/Resources.db85d6.ttslua b/objects/ClueCounterSwapper.d919d6/Resources.db85d6.ttslua deleted file mode 100644 index cd22f422..00000000 --- a/objects/ClueCounterSwapper.d919d6/Resources.db85d6.ttslua +++ /dev/null @@ -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