fixed hand slot issues
This commit is contained in:
parent
bff9dee130
commit
11d4820093
@ -58,7 +58,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.758,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.04
|
||||
},
|
||||
"Tags": [
|
||||
@ -78,7 +78,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.98,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.035
|
||||
},
|
||||
"Tags": [
|
||||
@ -108,7 +108,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.177,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.032
|
||||
},
|
||||
"Tags": [
|
||||
@ -118,7 +118,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.616,
|
||||
"y": 0.102,
|
||||
"y": 0.1,
|
||||
"z": 0.024
|
||||
},
|
||||
"Tags": [
|
||||
@ -138,7 +138,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.371,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.558
|
||||
},
|
||||
"Tags": [
|
||||
@ -148,7 +148,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.977,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.556
|
||||
},
|
||||
"Tags": [
|
||||
@ -178,7 +178,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.174,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.551
|
||||
},
|
||||
"Tags": [
|
||||
@ -329,7 +329,7 @@
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2462982115659543571/5D778EA4BC682DAE97E8F59A991BCF8CB3979B04/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
|
@ -58,7 +58,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.758,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.04
|
||||
},
|
||||
"Tags": [
|
||||
@ -78,7 +78,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.98,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.035
|
||||
},
|
||||
"Tags": [
|
||||
@ -108,7 +108,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.177,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.032
|
||||
},
|
||||
"Tags": [
|
||||
@ -118,7 +118,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.616,
|
||||
"y": 0.102,
|
||||
"y": 0.1,
|
||||
"z": 0.024
|
||||
},
|
||||
"Tags": [
|
||||
@ -138,7 +138,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.371,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.558
|
||||
},
|
||||
"Tags": [
|
||||
@ -148,7 +148,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.977,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.556
|
||||
},
|
||||
"Tags": [
|
||||
@ -178,7 +178,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.174,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.551
|
||||
},
|
||||
"Tags": [
|
||||
@ -329,7 +329,7 @@
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2462982115659543571/5D778EA4BC682DAE97E8F59A991BCF8CB3979B04/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
|
@ -58,7 +58,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.758,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.04
|
||||
},
|
||||
"Tags": [
|
||||
@ -78,7 +78,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.98,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.035
|
||||
},
|
||||
"Tags": [
|
||||
@ -108,7 +108,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.177,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.032
|
||||
},
|
||||
"Tags": [
|
||||
@ -118,7 +118,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.616,
|
||||
"y": 0.102,
|
||||
"y": 0.1,
|
||||
"z": 0.024
|
||||
},
|
||||
"Tags": [
|
||||
@ -138,7 +138,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.371,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.558
|
||||
},
|
||||
"Tags": [
|
||||
@ -148,7 +148,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.977,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.556
|
||||
},
|
||||
"Tags": [
|
||||
@ -178,7 +178,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.174,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.551
|
||||
},
|
||||
"Tags": [
|
||||
@ -329,7 +329,7 @@
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2462982115659543571/5D778EA4BC682DAE97E8F59A991BCF8CB3979B04/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
|
@ -58,7 +58,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.758,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.04
|
||||
},
|
||||
"Tags": [
|
||||
@ -78,7 +78,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.98,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.035
|
||||
},
|
||||
"Tags": [
|
||||
@ -108,7 +108,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.177,
|
||||
"y": 0.101,
|
||||
"y": 0.1,
|
||||
"z": 0.032
|
||||
},
|
||||
"Tags": [
|
||||
@ -118,7 +118,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.616,
|
||||
"y": 0.102,
|
||||
"y": 0.1,
|
||||
"z": 0.024
|
||||
},
|
||||
"Tags": [
|
||||
@ -138,7 +138,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 1.371,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.558
|
||||
},
|
||||
"Tags": [
|
||||
@ -148,7 +148,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": 0.977,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.556
|
||||
},
|
||||
"Tags": [
|
||||
@ -178,7 +178,7 @@
|
||||
{
|
||||
"Position": {
|
||||
"x": -0.174,
|
||||
"y": 0.099,
|
||||
"y": 0.1,
|
||||
"z": 0.551
|
||||
},
|
||||
"Tags": [
|
||||
@ -329,7 +329,7 @@
|
||||
},
|
||||
"ImageScalar": 1,
|
||||
"ImageSecondaryURL": "",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2462982115659543571/5D778EA4BC682DAE97E8F59A991BCF8CB3979B04/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "",
|
||||
|
@ -57,7 +57,7 @@ local slotNameToChar = {
|
||||
}
|
||||
|
||||
-- slot symbol for the respective slot (from top left to bottom right)
|
||||
local slotData
|
||||
local slotData = {}
|
||||
local defaultSlotData = {
|
||||
-- 1st row
|
||||
"any", "any", "any", "Tarot", "Hand (left)", "Hand (right)", "Ally",
|
||||
@ -390,7 +390,7 @@ function doDrawOne(_, clickedByColor)
|
||||
end
|
||||
|
||||
-- draws the specified amount of cards (and shuffles the discard if necessary)
|
||||
---@param numCards num Number of cards to draw
|
||||
---@param numCards number Number of cards to draw
|
||||
function drawCardsWithReshuffle(numCards)
|
||||
local deckAreaObjects = getDeckAreaObjects()
|
||||
|
||||
@ -556,9 +556,8 @@ function redrawSlotXML()
|
||||
attributes = {
|
||||
id = "slotPanel" .. snapId,
|
||||
scale = "0.1 0.1 1",
|
||||
width = "150",
|
||||
height = "150",
|
||||
rotation = getSlotRotation(slotName),
|
||||
width = "175",
|
||||
height = "175",
|
||||
position = x .. " " .. y .. " -11"
|
||||
},
|
||||
children = {
|
||||
@ -566,6 +565,7 @@ function redrawSlotXML()
|
||||
tag = "Text",
|
||||
attributes = {
|
||||
id = "slot" .. snapId,
|
||||
rotation = getSlotRotation(slotName),
|
||||
fontSize = "145",
|
||||
font = "font_arkhamicons",
|
||||
color = "#414141CB",
|
||||
@ -596,35 +596,36 @@ function toggleSlotEditing(_, clickedByColor, isRightClick)
|
||||
if currentlyEditingSlots then
|
||||
editButtonLabel("Edit Slots", "Stop editing")
|
||||
broadcastToColor("Click on a slot symbol (or an empty slot) to edit it.", messageColor, "Orange")
|
||||
for i = 1, #slotData do
|
||||
self.UI.setAttribute("slotPanel" .. i, "onClick", "slotClickfunction")
|
||||
end
|
||||
else
|
||||
editButtonLabel("Stop editing", "Edit Slots")
|
||||
end
|
||||
|
||||
-- set click function (or maybe disable it)
|
||||
local clickFunc = currentlyEditingSlots and "slotClickfunction" or ""
|
||||
for i = 1, #slotData do
|
||||
self.UI.setAttribute("slot" .. i, "onClick", clickFunc)
|
||||
redrawSlotXML()
|
||||
end
|
||||
end
|
||||
|
||||
-- click function for slot symbols during the "slot editing mode"
|
||||
function slotClickfunction(player, clickType, id)
|
||||
local index = id:gsub("slot", "")
|
||||
local slotIndex = id:gsub("slotPanel", "")
|
||||
slotIndex = tonumber(slotIndex)
|
||||
|
||||
-- make a list of the table keys as options for the dialog box
|
||||
local slotNames = {}
|
||||
for slotName, _ in pairs(slotNameToChar) do
|
||||
table.insert(slotNames, slotName)
|
||||
end
|
||||
|
||||
-- prompt player to choose symbol
|
||||
player.showOptionsDialog("Choose Slot Symbol", slotNames, slotData[index],
|
||||
function(chosenSlot, chosenIndex)
|
||||
slotData[chosenIndex] = chosenSlot
|
||||
player.showOptionsDialog("Choose Slot Symbol", slotNames, slotData[slotIndex],
|
||||
function(chosenSlotName)
|
||||
slotData[slotIndex] = chosenSlotName
|
||||
|
||||
-- update slot symbol
|
||||
self.UI.setAttribute(id, "text", slotNameToChar[chosenSlot])
|
||||
self.UI.setAttribute("slot" .. slotIndex, "text", slotNameToChar[chosenSlotName])
|
||||
|
||||
-- update slot rotation
|
||||
self.UI.setAttribute("slotPanel" .. chosenIndex, "rotation", getSlotRotation(chosenSlot))
|
||||
self.UI.setAttribute("slot" .. slotIndex, "rotation", getSlotRotation(chosenSlotName))
|
||||
end
|
||||
)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user