Modified SS script state, added transparent indicator buttons, and cleaned up requested code logic

This commit is contained in:
Jorge Parra 2023-03-15 17:13:08 -04:00
parent 982621fdd5
commit da2dd66966
2 changed files with 38 additions and 31 deletions

View File

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

View File

@ -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 = {
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),
}
elseif slot == "ally" then
vecList = {
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},
self.setVectorLines({
{
points = arcaneVecList,
color = arcaneVecColor,
thickness = 0.02,
}
end
},
{
points = allyVecList,
color = allyVecColor,
thickness = 0.02,
},
})
end