From da2dd6696635ea00bd412b889161b1722348c48d Mon Sep 17 00:00:00 2001 From: Jorge Parra Date: Wed, 15 Mar 2023 17:13:08 -0400 Subject: [PATCH] Modified SS script state, added transparent indicator buttons, and cleaned up requested code logic --- .../SummonedServitorUpgradeSheet.5397a6.json | 2 +- .../SummonedServitorUpgradeSheet.ttslua | 67 ++++++++++--------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json b/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json index dfd159a1..bd29b481 100644 --- a/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json +++ b/objects/AllPlayerCards.15bb07/SummonedServitorUpgradeSheet.5397a6.json @@ -34,7 +34,7 @@ "LayoutGroupSortIndex": 0, "Locked": false, "LuaScript": "require(\"playercards/customizable/SummonedServitorUpgradeSheet\")", - "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"]]", + "LuaScriptState": "[[0,0,0,0,0,0,0,0,0,0],[\"\",\"\",\"\",\"\",\"\"],\"\"]", "MeasureMovement": false, "Name": "CardCustom", "Nickname": "Summoned Servitor Upgrade Sheet", diff --git a/src/playercards/customizable/SummonedServitorUpgradeSheet.ttslua b/src/playercards/customizable/SummonedServitorUpgradeSheet.ttslua index 18dcc60a..8bad5c1e 100644 --- a/src/playercards/customizable/SummonedServitorUpgradeSheet.ttslua +++ b/src/playercards/customizable/SummonedServitorUpgradeSheet.ttslua @@ -237,35 +237,42 @@ end -- Refresh the vector circles indicating a slot is selected. function updateSlotDisplay() local box = {} - if selectedSlot ~= "" then - box = getBoxVector(SLOT_ICON_POSITIONS[selectedSlot], selectedSlot) - end - self.setVectorLines({box}) - end - - function getBoxVector(center, slot) - local vecList = {} - if slot == "arcane" then - vecList = { - Vector(center.x + 0.12, 0.3, center.z + 0.05), - Vector(center.x - 0.12, 0.3, center.z + 0.05), - Vector(center.x - 0.12, 0.3, center.z - 0.05), - Vector(center.x + 0.12, 0.3, center.z - 0.05), - Vector(center.x + 0.12, 0.3, center.z + 0.05), - } - elseif slot == "ally" then - vecList = { - Vector(center.x + 0.07, 0.3, center.z + 0.05), - Vector(center.x - 0.07, 0.3, center.z + 0.05), - Vector(center.x - 0.07, 0.3, center.z - 0.05), - Vector(center.x + 0.07, 0.3, center.z - 0.05), - Vector(center.x + 0.07, 0.3, center.z + 0.05), - } + local center = {} + center = SLOT_ICON_POSITIONS["arcane"] + local arcaneVecList = { + Vector(center.x + 0.12, 0.3, center.z + 0.05), + Vector(center.x - 0.12, 0.3, center.z + 0.05), + Vector(center.x - 0.12, 0.3, center.z - 0.05), + Vector(center.x + 0.12, 0.3, center.z - 0.05), + Vector(center.x + 0.12, 0.3, center.z + 0.05), + } + center = SLOT_ICON_POSITIONS["ally"] + local allyVecList = { + Vector(center.x + 0.07, 0.3, center.z + 0.05), + Vector(center.x - 0.07, 0.3, center.z + 0.05), + Vector(center.x - 0.07, 0.3, center.z - 0.05), + Vector(center.x + 0.07, 0.3, center.z - 0.05), + Vector(center.x + 0.07, 0.3, center.z + 0.05), + } + local arcaneVecColor = {0.5, 0.5, 0.5, 0.75} + local allyVecColor = {0.5, 0.5, 0.5, 0.75} + if selectedSlot == "arcane" then + arcaneVecColor = {0.597, 0.195, 0.796} + elseif selectedSlot == "ally" then + allyVecColor = {0.597, 0.195, 0.796} end - return { - points = vecList, - color = {0.597, 0.195, 0.796}, - thickness = 0.02, - } - end + self.setVectorLines({ + { + points = arcaneVecList, + color = arcaneVecColor, + thickness = 0.02, + }, + { + points = allyVecList, + color = allyVecColor, + thickness = 0.02, + }, + + }) +end