From c05238cbce7a8859bc32d3ea73d9f7291badd60f Mon Sep 17 00:00:00 2001 From: Buhallin Date: Fri, 2 Dec 2022 11:45:59 -0800 Subject: [PATCH 01/31] Automatic location connections, Phase 1 --- src/core/PlayArea.ttslua | 221 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 216 insertions(+), 5 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 503cc145..e7e6deec 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -3,14 +3,27 @@ --------------------------------------------------------- -- set true to enable debug logging -DEBUG = false +local DEBUG = true + +-- Location connection directional options +local BIDIRECTIONAL = 0 +local ONE_WAY = 1 +local CONNECTION_THICKNESS = 0.015 +local CONNECTION_COLOR = { 0.4, 0.4, 0.4, 1 } +local DIRECTIONAL_ARROW_DISTANCE = 3.5 +local ARROW_ARM_LENGTH = 0.9 +local ARROW_ANGLE = 25 -- we use this to turn off collision handling until onLoad() is complete -COLLISION_ENABLED = false +local collisionEnabled = false local INVESTIGATOR_COUNTER_GUID = "f182ee" local clueData = {} -spawnedLocationGUIDs = {} +local spawnedLocationGUIDs = {} + +local locations = { } +local locationConnections = { } +local draggingGuids = { } --------------------------------------------------------- -- general code @@ -35,7 +48,7 @@ function onLoad(save_state) LOCATIONS = dataHelper.getTable('LOCATIONS_DATA') self.interactable = DEBUG - Wait.time(function() COLLISION_ENABLED = true end, 1) + Wait.time(function() collisionEnabled = true end, 1) end function log(message) @@ -112,7 +125,7 @@ function updateLocations(args) end function onCollisionEnter(collision_info) - if not COLLISION_ENABLED then return end + if not collisionEnabled then return end -- check if we should spawn clues here and do so according to playercount local object = collision_info.collision_object @@ -120,9 +133,207 @@ function onCollisionEnter(collision_info) local clueCount = getClueCount(object, object.is_face_down, getInvestigatorCount()) if clueCount > 0 then spawnCluesAtLocation(clueCount, object) end end + draggingGuid = nil + maybeTrackLocation(collision_info.collision_object) end +function onCollisionExit(collisionInfo) + maybeUntrackLocation(collisionInfo.collision_object) +end + +function onObjectPickUp(player, object) + -- onCollisionExit fires first, so we have to check the card to see if it's a location we should + -- be tracking + if isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= "" then + local pickedUpGuid = object.getGUID() + local metadata = JSON.decode(object.getGMNotes()) + if (metadata.type == "Location") then + draggingGuids[pickedUpGuid] = metadata + rebuildConnectionList() + end + end +end + +function onUpdate() + local needsConnectionDraw = false + for guid, _ in pairs(draggingGuids) do + local obj = getObjectFromGUID(guid) + if obj == nil or not isInPlayArea(obj) then + draggingGuids[guid] = nil + rebuildConnectionList() + end + -- Even if the last location left the play area, need one last draw to clear the lines + needsConnectionDraw = true + end + if needsConnectionDraw then + drawConnections() + end +end + +function maybeTrackLocation(card) + -- Collision checks for any part of the card overlap, but our other tracking is centerpoint + -- Ignore any collision where the centerpoint isn't in the area + if isInPlayArea(card) then + local metadata = JSON.decode(card.getGMNotes()) or { } + if metadata.type == "Location" then + locations[card.getGUID()] = metadata + rebuildConnectionList() + end + end +end + +function maybeUntrackLocation(card) + local metadata = JSON.decode(card.getGMNotes()) or { } + if metadata.type == "Location" then + locations[card.getGUID()] = nil + rebuildConnectionList() + end +end + +function rebuildConnectionList() + local iconCardList = { } + + for cardId, metadata in pairs(draggingGuids) do + buildLocListByIcon(cardId, iconCardList) + end + for cardId, metadata in pairs(locations) do + buildLocListByIcon(cardId, iconCardList) + end + + locationConnections = { } + for cardId, metadata in pairs(draggingGuids) do + buildConnection(cardId, iconCardList) + end + for cardId, metadata in pairs(locations) do + -- Build everything else + if draggingGuids[cardId] == nil then + buildConnection(cardId, iconCardList) + end + end + + drawConnections() +end + +function buildLocListByIcon(cardId, iconCardList) + local card = getObjectFromGUID(cardId) + local locData = getLocationData(card) + if locData.icons ~= nil then + for icon in string.gmatch(locData.icons, "%a+") do + if iconCardList[icon] == nil then + iconCardList[icon] = { } + end + table.insert(iconCardList[icon], card.getGUID()) + end + end +end + +function buildConnection(cardId, iconCardList) + local card = getObjectFromGUID(cardId) + local locData = getLocationData(card) + if locData.connections ~= nil then + locationConnections[card.getGUID()] = { } + for icon in string.gmatch(locData.connections, "%a+") do + if iconCardList[icon] ~= nil then + for _, connectedGuid in ipairs(iconCardList[icon]) do + -- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way + if locationConnections[connectedGuid] ~= nil + and locationConnections[connectedGuid][card.getGUID()] ~= nil then + locationConnections[connectedGuid][card.getGUID()] = BIDIRECTIONAL + else + locationConnections[card.getGUID()][connectedGuid] = ONE_WAY + end + end + end + end + end +end + +function getLocationData(card) + if card == nil then + return { } + end + if card.is_face_down then + return JSON.decode(card.getGMNotes()).locationBack + else + return JSON.decode(card.getGMNotes()).locationFront + end +end + +function drawConnections() + local cardConnectionLines = { } + for originGuid, targetGuids in pairs(locationConnections) do + local originCard = getObjectFromGUID(originGuid) + for targetGuid, direction in pairs(targetGuids) do + local targetCard = getObjectFromGUID(targetGuid) + if direction == BIDIRECTIONAL then + addBidirectionalVector(originCard, targetCard, cardConnectionLines) + elseif direction == ONE_WAY then + addOneWayVector(originCard, targetCard, cardConnectionLines) + end + end + end + self.setVectorLines(cardConnectionLines) +end + +function addBidirectionalVector(card1, card2, lines) + table.insert(lines, { + points = { self.positionToLocal(card1.getPosition()), self.positionToLocal(card2.getPosition()) }, + color = CONNECTION_COLOR, + thickness = CONNECTION_THICKNESS, + }); +end + +function addOneWayVector(origin, target, lines) + -- Start with the BiDi then add the arrow lines to it + addBidirectionalVector(origin, target, lines) + local originPos = origin.getPosition() + local targetPos = target.getPosition() + + -- Calculate card distance to be closer for horizontal positions than vertical, since cards are + -- taller than they are wide + local heading = Vector(originPos):sub(targetPos):heading("y") + local distanceFromCard = DIRECTIONAL_ARROW_DISTANCE * 0.7 + DIRECTIONAL_ARROW_DISTANCE * 0.3 * math.abs(math.sin(math.rad(heading))) + + -- Calculate the three possible arrow positions. These are offset by half the arrow length to + -- make them visually balanced by keeping the arrows centered, not tracking the point + local midpoint = Vector(originPos):add(targetPos):scale(Vector(0.5, 0.5, 0.5)):moveTowards(targetPos, ARROW_ARM_LENGTH / 2) + local closeToOrigin = Vector(originPos):moveTowards(targetPos, distanceFromCard + ARROW_ARM_LENGTH / 2) + local closeToTarget = Vector(targetPos):moveTowards(originPos, distanceFromCard - ARROW_ARM_LENGTH / 2) + + if (originPos:distance(closeToOrigin) > originPos:distance(closeToTarget)) then + addArrowLines(midpoint, originPos, lines) + else + addArrowLines(closeToOrigin, originPos, lines) + addArrowLines(closeToTarget, originPos, lines) + end +end + +function addArrowLines(arrowheadPos, originPos, lines) + local arrowArm1 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver("y", -1 * ARROW_ANGLE):add(arrowheadPos) + local arrowArm2 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver("y", ARROW_ANGLE):add(arrowheadPos) + + local head = self.positionToLocal(arrowheadPos) + local arm1 = self.positionToLocal(arrowArm1) + local arm2 = self.positionToLocal(arrowArm2) + table.insert(lines, { + points = { arm1, head, arm2}, + color = CONNECTION_COLOR, + thickness = CONNECTION_THICKNESS + }) +end + + function getInvestigatorCount() local investigatorCounter = getObjectFromGUID('f182ee') return investigatorCounter.getVar("val") end + +function isInPlayArea(object) + local bounds = self.getBounds() + local position = object.getPosition() + -- Corners are arbitrary since it's all global - c1 goes down both axes, c2 goes up + local c1 = { x = bounds.center.x - bounds.size.x / 2, z = bounds.center.z - bounds.size.z / 2} + local c2 = { x = bounds.center.x + bounds.size.x / 2, z = bounds.center.z + bounds.size.z / 2} + + return position.x > c1.x and position.x < c2.x and position.z > c1.z and position.z < c2.z +end From 5d1e23a91b3d77163a48c1c38ddb09e333bc86cc Mon Sep 17 00:00:00 2001 From: Buhallin Date: Fri, 2 Dec 2022 17:42:19 -0800 Subject: [PATCH 02/31] Finalize location connections Includes some bugfixes and further optimizations --- src/core/PlayArea.ttslua | 109 ++++++++++++++++++++++++++++++++------- 1 file changed, 90 insertions(+), 19 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index e7e6deec..ed2fb5c9 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -3,17 +3,22 @@ --------------------------------------------------------- -- set true to enable debug logging -local DEBUG = true +local DEBUG = false -- Location connection directional options local BIDIRECTIONAL = 0 local ONE_WAY = 1 + +-- Connector draw parameters local CONNECTION_THICKNESS = 0.015 local CONNECTION_COLOR = { 0.4, 0.4, 0.4, 1 } local DIRECTIONAL_ARROW_DISTANCE = 3.5 local ARROW_ARM_LENGTH = 0.9 local ARROW_ANGLE = 25 +-- Height to draw the connector lines, places them just above the table and always below cards +local CONNECTION_LINE_Y = 1.525 + -- we use this to turn off collision handling until onLoad() is complete local collisionEnabled = false @@ -124,23 +129,28 @@ function updateLocations(args) end end -function onCollisionEnter(collision_info) +function onCollisionEnter(collisionInfo) if not collisionEnabled then return end -- check if we should spawn clues here and do so according to playercount - local object = collision_info.collision_object + local object = collisionInfo.collision_object if getLocation(object) ~= nil and spawnedLocationGUIDs[object.getGUID()] == nil then local clueCount = getClueCount(object, object.is_face_down, getInvestigatorCount()) if clueCount > 0 then spawnCluesAtLocation(clueCount, object) end end - draggingGuid = nil - maybeTrackLocation(collision_info.collision_object) + draggingGuids[object.getGUID()] = nil + maybeTrackLocation(collisionInfo.collision_object) end function onCollisionExit(collisionInfo) maybeUntrackLocation(collisionInfo.collision_object) end +-- Destroyed objects don't trigger onCollisionExit(), so check on destruction to untrack as well +function onObjectDestroy(object) + maybeUntrackLocation(object) +end + function onObjectPickUp(player, object) -- onCollisionExit fires first, so we have to check the card to see if it's a location we should -- be tracking @@ -155,21 +165,30 @@ function onObjectPickUp(player, object) end function onUpdate() + -- Due to the frequence of onUpdate calls, ensure that we only process any changes to the + -- connection list once, and only redraw once + local needsConnectionRebuild = false local needsConnectionDraw = false for guid, _ in pairs(draggingGuids) do local obj = getObjectFromGUID(guid) if obj == nil or not isInPlayArea(obj) then draggingGuids[guid] = nil - rebuildConnectionList() + needsConnectionRebuild = true end -- Even if the last location left the play area, need one last draw to clear the lines needsConnectionDraw = true end + if (needsConnectionRebuild) then + rebuildConnectionList() + end if needsConnectionDraw then drawConnections() end end +-- Checks the given card and adds it to the list of locations tracked for connection purposes. +-- A card will be added to the tracking if it is a location in the play area (based on centerpoint). +-- @param A card object, possibly a location. function maybeTrackLocation(card) -- Collision checks for any part of the card overlap, but our other tracking is centerpoint -- Ignore any collision where the centerpoint isn't in the area @@ -178,18 +197,28 @@ function maybeTrackLocation(card) if metadata.type == "Location" then locations[card.getGUID()] = metadata rebuildConnectionList() + drawConnections() end end end +-- Stop tracking a location for connection drawing. This should be called for both collision exit +-- and destruction, as a destroyed object does not trigger collision exit. An object can also be +-- deleted mid-drag, but the ordering for drag events means we can't clear those here and those will +-- be cleared in the next onUpdate() cycle. +-- @param card Card to (maybe) stop tracking function maybeUntrackLocation(card) - local metadata = JSON.decode(card.getGMNotes()) or { } - if metadata.type == "Location" then + if locations[card.getGUID()] ~= nil then locations[card.getGUID()] = nil rebuildConnectionList() + drawConnections() end end +-- Builds a list of GUID to GUID connection information based on the currently tracked locations. +-- This will update the connection information and store it in the locationConnections data member, +-- but does not draw those connections. This should often be followed by a call to +-- drawConnections() function rebuildConnectionList() local iconCardList = { } @@ -210,10 +239,11 @@ function rebuildConnectionList() buildConnection(cardId, iconCardList) end end - - drawConnections() end +-- Extracts the card's icon string into a list of individual location icons +-- @param cardID GUID of the card to pull the icon data from +-- @param iconCardList A table of icon->GUID list. Mutable, will be updated by this method function buildLocListByIcon(cardId, iconCardList) local card = getObjectFromGUID(cardId) local locData = getLocationData(card) @@ -227,6 +257,10 @@ function buildLocListByIcon(cardId, iconCardList) end end +-- Builds the connections for the given cardID by finding matching icons and adding them to the +-- Playarea's locationConnections table. +-- @param cardId GUID of the card to build the connections for +-- @param iconCardList A table of icon->GUID List. Used to find matching icons for connections. function buildConnection(cardId, iconCardList) local card = getObjectFromGUID(cardId) local locData = getLocationData(card) @@ -248,6 +282,10 @@ function buildConnection(cardId, iconCardList) end end +-- Helper method to extract the location metadata from a card based on whether it's front or back +-- is showing. +-- @param card Card object to extract data from +-- @return Table with either the locationFront or locationBack metadata structure function getLocationData(card) if card == nil then return { } @@ -259,35 +297,61 @@ function getLocationData(card) end end +-- Draws the lines for connections currently in locationConnections. function drawConnections() local cardConnectionLines = { } + for originGuid, targetGuids in pairs(locationConnections) do - local originCard = getObjectFromGUID(originGuid) - for targetGuid, direction in pairs(targetGuids) do - local targetCard = getObjectFromGUID(targetGuid) - if direction == BIDIRECTIONAL then - addBidirectionalVector(originCard, targetCard, cardConnectionLines) - elseif direction == ONE_WAY then - addOneWayVector(originCard, targetCard, cardConnectionLines) + -- Objects should reliably exist at this point, but since this can be called during onUpdate the + -- object checks are conservative just to make sure. + local origin = getObjectFromGUID(originGuid) + if origin != nil then + for targetGuid, direction in pairs(targetGuids) do + local target = getObjectFromGUID(targetGuid) + if target != nil then + if direction == BIDIRECTIONAL then + addBidirectionalVector(origin, target, cardConnectionLines) + elseif direction == ONE_WAY then + addOneWayVector(origin, target, cardConnectionLines) + end + end end end end self.setVectorLines(cardConnectionLines) end +-- Draws a bidirectional location connection between the two cards, adding the lines to do so to the +-- given lines list. +-- @param card1 One of the card objects to connect +-- @param card2 The other card object to connect +-- @param lines List of vector line elements. Mutable, will be updated to add this connector function addBidirectionalVector(card1, card2, lines) + local cardPos1 = card1.getPosition() + local cardPos2 = card2.getPosition() + cardPos1.y = CONNECTION_LINE_Y + cardPos2.y = CONNECTION_LINE_Y + local pos1 = self.positionToLocal(cardPos1) + local pos2 = self.positionToLocal(cardPos2) table.insert(lines, { - points = { self.positionToLocal(card1.getPosition()), self.positionToLocal(card2.getPosition()) }, + points = { pos1, pos2 }, color = CONNECTION_COLOR, thickness = CONNECTION_THICKNESS, }); end +-- Draws a one-way location connection between the two cards, adding the lines to do so to the +-- given lines list. Arrows will point towards the target card. +-- @param origin Origin card in the connection +-- @param target Target card object to connect +-- @param lines List of vector line elements. Mutable, will be updated to add this connector function addOneWayVector(origin, target, lines) -- Start with the BiDi then add the arrow lines to it addBidirectionalVector(origin, target, lines) local originPos = origin.getPosition() local targetPos = target.getPosition() + originPos.y = CONNECTION_LINE_Y + targetPos.y = CONNECTION_LINE_Y -- Calculate card distance to be closer for horizontal positions than vertical, since cards are -- taller than they are wide @@ -308,6 +372,10 @@ function addOneWayVector(origin, target, lines) end end +-- Draws an arrowhead at the given position. +-- @param arrowheadPosition Centerpoint of the arrowhead to draw (NOT the tip of the arrow) +-- @param originPos Origin point of the connection, used to position the arrow arms +-- @param lines List of vector line elements. Mutable, will be updated to add this arrow function addArrowLines(arrowheadPos, originPos, lines) local arrowArm1 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver("y", -1 * ARROW_ANGLE):add(arrowheadPos) local arrowArm2 = Vector(arrowheadPos):moveTowards(originPos, ARROW_ARM_LENGTH):sub(arrowheadPos):rotateOver("y", ARROW_ANGLE):add(arrowheadPos) @@ -322,12 +390,15 @@ function addArrowLines(arrowheadPos, originPos, lines) }) end - function getInvestigatorCount() local investigatorCounter = getObjectFromGUID('f182ee') return investigatorCounter.getVar("val") end +-- Check to see if the given object is within the bounds of the play area, based solely on the X and +-- Z coordinates, ignoring height +-- @param object Object to check +-- @return True if the object is inside the play area function isInPlayArea(object) local bounds = self.getBounds() local position = object.getPosition() From 1af38ee3ae5f6e2b1fe593481990152ee8ebeb99 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Sun, 4 Dec 2022 23:54:34 -0800 Subject: [PATCH 03/31] Handle connections for double-sided and locked locations --- src/core/PlayArea.ttslua | 41 ++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index ed2fb5c9..902f32ae 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -17,7 +17,7 @@ local ARROW_ARM_LENGTH = 0.9 local ARROW_ANGLE = 25 -- Height to draw the connector lines, places them just above the table and always below cards -local CONNECTION_LINE_Y = 1.525 +local CONNECTION_LINE_Y = 1.529 -- we use this to turn off collision handling until onLoad() is complete local collisionEnabled = false @@ -30,15 +30,24 @@ local locations = { } local locationConnections = { } local draggingGuids = { } +local locationData + --------------------------------------------------------- -- general code --------------------------------------------------------- -function onSave() return JSON.encode(spawnedLocationGUIDs) end +function onSave() + return JSON.encode({ + spawnedLocations = spawnedLocationGUIDs, + trackedLocations = locations + }) +end -function onLoad(save_state) +function onLoad(saveState) -- records locations we have spawned clues for - spawnedLocationGUIDs = JSON.decode(save_state) or {} + local save = JSON.decode(saveState) or { } + spawnedLocationGUIDs = save.spawnedLocations or { } + locations = save.trackedLocations or { } local TOKEN_DATA = Global.getTable('TOKEN_DATA') clueData = { @@ -50,7 +59,7 @@ function onLoad(save_state) } local dataHelper = getObjectFromGUID('708279') - LOCATIONS = dataHelper.getTable('LOCATIONS_DATA') + locationData = dataHelper.getTable('LOCATIONS_DATA') self.interactable = DEBUG Wait.time(function() collisionEnabled = true end, 1) @@ -66,7 +75,7 @@ end -- try the compound key then the name alone as default function getLocation(object) - return LOCATIONS[object.getName() .. '_' .. object.getGUID()] or LOCATIONS[object.getName()] + return locationData[object.getName() .. '_' .. object.getGUID()] or locationData[object.getName()] end -- Return the number of clues to spawn on this location @@ -125,7 +134,7 @@ function updateLocations(args) local custom_data_helper = getObjectFromGUID(args[1]) for k, v in pairs(custom_data_helper.getTable("LOCATIONS_DATA")) do - LOCATIONS[k] = v + locationData[k] = v end end @@ -208,7 +217,9 @@ end -- be cleared in the next onUpdate() cycle. -- @param card Card to (maybe) stop tracking function maybeUntrackLocation(card) - if locations[card.getGUID()] ~= nil then + -- Locked objects no longer collide (hence triggering an exit event) but are still in the play + -- area. If the object is now locked, don't remove it. + if locations[card.getGUID()] ~= nil and not card.locked then locations[card.getGUID()] = nil rebuildConnectionList() drawConnections() @@ -222,6 +233,7 @@ end function rebuildConnectionList() local iconCardList = { } + -- Build a list of cards with each icon as their location ID for cardId, metadata in pairs(draggingGuids) do buildLocListByIcon(cardId, iconCardList) end @@ -229,12 +241,12 @@ function rebuildConnectionList() buildLocListByIcon(cardId, iconCardList) end + -- Pair up all the icons locationConnections = { } for cardId, metadata in pairs(draggingGuids) do buildConnection(cardId, iconCardList) end for cardId, metadata in pairs(locations) do - -- Build everything else if draggingGuids[cardId] == nil then buildConnection(cardId, iconCardList) end @@ -247,7 +259,7 @@ end function buildLocListByIcon(cardId, iconCardList) local card = getObjectFromGUID(cardId) local locData = getLocationData(card) - if locData.icons ~= nil then + if locData ~= nil and locData.icons ~= nil then for icon in string.gmatch(locData.icons, "%a+") do if iconCardList[icon] == nil then iconCardList[icon] = { } @@ -264,7 +276,7 @@ end function buildConnection(cardId, iconCardList) local card = getObjectFromGUID(cardId) local locData = getLocationData(card) - if locData.connections ~= nil then + if locData ~= nil and locData.connections ~= nil then locationConnections[card.getGUID()] = { } for icon in string.gmatch(locData.connections, "%a+") do if iconCardList[icon] ~= nil then @@ -272,7 +284,7 @@ function buildConnection(cardId, iconCardList) -- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way if locationConnections[connectedGuid] ~= nil and locationConnections[connectedGuid][card.getGUID()] ~= nil then - locationConnections[connectedGuid][card.getGUID()] = BIDIRECTIONAL + locationConnections[connectedGuid][card.getGUID()] = BIDIRECTIONAL else locationConnections[card.getGUID()][connectedGuid] = ONE_WAY end @@ -285,10 +297,11 @@ end -- Helper method to extract the location metadata from a card based on whether it's front or back -- is showing. -- @param card Card object to extract data from --- @return Table with either the locationFront or locationBack metadata structure +-- @return Table with either the locationFront or locationBack metadata structure, or nil if the +-- metadata doesn't exist function getLocationData(card) if card == nil then - return { } + return nil end if card.is_face_down then return JSON.decode(card.getGMNotes()).locationBack From 0b6eb32f750ee4d627ebce5e58201f56886dd9ad Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 22 Dec 2022 03:29:16 +0100 Subject: [PATCH 04/31] moving short supply function directly to card --- .../ShortSupply.e5f541.json | 2 +- .../ShortSupply.e5f541.ttslua | 57 +++++++++ .../HandHelper.450688.ttslua | 110 ++++++------------ 3 files changed, 93 insertions(+), 76 deletions(-) create mode 100644 objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.json b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.json index 864d643d..74ebcdf6 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.json +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.json @@ -33,8 +33,8 @@ "IgnoreFoW": false, "LayoutGroupSortIndex": 0, "Locked": false, - "LuaScript": "", "LuaScriptState": "", + "LuaScript_path": "AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua", "MeasureMovement": false, "Name": "Card", "Nickname": "Short Supply", diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua new file mode 100644 index 00000000..a563189b --- /dev/null +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -0,0 +1,57 @@ +local MAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" } + +function onLoad() + self.addContextMenuItem("Discard 10 cards", shortSupply) +end + +-- called by context menu entry +function shortSupply(color) + local cardPos = self.getPosition() + local playerNumber = getPlayernumber(cardPos) + local mat = getObjectFromGUID(MAT_GUIDS[playerNumber]) + if mat == nil then return end + + -- get draw deck and discard pile + mat.call("getDrawDiscardDecks") + local drawDeck = mat.getVar("drawDeck") + local discardPos = mat.getTable("DISCARD_PILE_POSITION") + if discardPos == nil then + broadcastToAll("Couldn't retrieve discard position from playermat!", "Red") + return + end + + if drawDeck == nil then + broadcastToColor("Deck not found!", color, "Yellow") + return + elseif drawDeck.tag ~= "Deck" then + broadcastToColor("Deck only contains a single card!", color, "Yellow") + return + end + + -- discard cards + discardPos.y = 0.5 + for i = 1, 10 do + discardPos.y = discardPos.y + 0.05 * i + drawDeck.takeObject({ + flip = true, + position = discardPos + }) + end +end + +-- helper to find playernumber based on position +function getPlayernumber(cardPos) + if cardPos.x < -42 then + if cardPos.z > 0 then + return 1 + else + return 2 + end + else + if cardPos.z > 0 then + return 3 + else + return 4 + end + end +end diff --git a/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua b/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua index c186124a..d32b3051 100644 --- a/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua +++ b/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua @@ -1,7 +1,7 @@ MAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" } -local BUTTON_PARAMETERS = {} -BUTTON_PARAMETERS.function_owner = self +local buttonParamaters = {} +buttonParamaters.function_owner = self -- saving "playerColor" and "des" function onSave() return JSON.encode({ playerColor, des}) end @@ -13,41 +13,41 @@ function onLoad(saved_data) des = loaded_data[2] or false -- index 0: button as hand size label - BUTTON_PARAMETERS.hover_color = "White" - BUTTON_PARAMETERS.click_function = "none" - BUTTON_PARAMETERS.position = { 0, 0.1, -0.4 } - BUTTON_PARAMETERS.height = 0 - BUTTON_PARAMETERS.width = 0 - BUTTON_PARAMETERS.font_size = 500 - BUTTON_PARAMETERS.font_color = "White" - self.createButton(BUTTON_PARAMETERS) + buttonParamaters.hover_color = "White" + buttonParamaters.click_function = "none" + buttonParamaters.position = { 0, 0.11, -0.4 } + buttonParamaters.height = 0 + buttonParamaters.width = 0 + buttonParamaters.font_size = 500 + buttonParamaters.font_color = "White" + self.createButton(buttonParamaters) -- index 1: button to toggle "des" - BUTTON_PARAMETERS.label = "DES: " .. (des and "✓" or "✗") - BUTTON_PARAMETERS.click_function = "toggleDES" - BUTTON_PARAMETERS.position = { 0.475, 0.1, 0.25 } - BUTTON_PARAMETERS.height = 175 - BUTTON_PARAMETERS.width = 440 - BUTTON_PARAMETERS.font_size = 90 - BUTTON_PARAMETERS.font_color = "Black" - self.createButton(BUTTON_PARAMETERS) + buttonParamaters.label = "DES: " .. (des and "✓" or "✗") + buttonParamaters.click_function = "toggleDES" + buttonParamaters.position = { 0.475, 0.11, 0.25 } + buttonParamaters.height = 175 + buttonParamaters.width = 440 + buttonParamaters.font_size = 90 + buttonParamaters.font_color = "Black" + self.createButton(buttonParamaters) -- index 2: button to discard a card - BUTTON_PARAMETERS.label = "discard random card" - BUTTON_PARAMETERS.click_function = "discardRandom" - BUTTON_PARAMETERS.position = { 0, 0.1, 0.7 } - BUTTON_PARAMETERS.width = 900 - self.createButton(BUTTON_PARAMETERS) + buttonParamaters.label = "discard random card" + buttonParamaters.click_function = "discardRandom" + buttonParamaters.position = { 0, 0.11, 0.7 } + buttonParamaters.width = 900 + self.createButton(buttonParamaters) -- index 3: button to select color - BUTTON_PARAMETERS.label = playerColor - BUTTON_PARAMETERS.color = playerColor - BUTTON_PARAMETERS.hover_color = playerColor - BUTTON_PARAMETERS.click_function = "changeColor" - BUTTON_PARAMETERS.tooltip = "change color" - BUTTON_PARAMETERS.position = { -0.475, 0.1, 0.25 } - BUTTON_PARAMETERS.width = 440 - self.createButton(BUTTON_PARAMETERS) + buttonParamaters.label = playerColor + buttonParamaters.color = playerColor + buttonParamaters.hover_color = playerColor + buttonParamaters.click_function = "changeColor" + buttonParamaters.tooltip = "change color" + buttonParamaters.position = { -0.475, 0.11, 0.25 } + buttonParamaters.width = 440 + self.createButton(buttonParamaters) -- start loop to update card count loopId = Wait.time(||updateValue(), 1, -1) @@ -71,14 +71,6 @@ function onLoad(saved_data) end function onObjectHover(hover_color, obj) - -- error handling - if obj == nil then return end - - -- add context menu to "short supply" - if obj.getName() == "Short Supply" then - obj.addContextMenuItem("Discard 10 (" .. playerColor .. ")", shortSupply) - end - -- only continue if correct player hovers over "self" if obj ~= self or hover_color ~= playerColor then return end @@ -151,11 +143,11 @@ function changeColor(_, _, isRightClick, color) end -- update "change color" button (note: remove and create instantly updates hover_color) - BUTTON_PARAMETERS.label = playerColor - BUTTON_PARAMETERS.color = playerColor - BUTTON_PARAMETERS.hover_color = playerColor + buttonParamaters.label = playerColor + buttonParamaters.color = playerColor + buttonParamaters.hover_color = playerColor self.removeButton(3) - self.createButton(BUTTON_PARAMETERS) + self.createButton(buttonParamaters) end --------------------------------------------------------- @@ -184,38 +176,6 @@ function discardRandom() end end ---------------------------------------------------------- --- discards the top 10 cards of your deck ---------------------------------------------------------- -function shortSupply(color) - local mat = getPlayermat(playerColor) - if mat == nil then return end - - -- get draw deck and discard pile - mat.call("getDrawDiscardDecks") - drawDeck = mat.getVar("drawDeck") - local discardPos = mat.getTable("DISCARD_PILE_POSITION") - if discardPos == nil then - broadcastToAll("Couldn't retrieve discard position from playermat!", "Red") - return - end - - if drawDeck == nil then - broadcastToColor("Deck not found!", color, "Yellow") - return - elseif drawDeck.tag ~= "Deck" then - broadcastToColor("Deck only contains a single card!", color, "Yellow") - return - end - - -- discard cards - discardPos[2] = 0.5 - for i = 1, 10 do - discardPos[2] = discardPos[2] + 0.05 * i - drawDeck.takeObject({ flip = true; position = discardPos }) - end -end - --------------------------------------------------------- -- helper functions --------------------------------------------------------- From bdccbf707be08225b3fcff3b4644e5a2a71ba532 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 22 Dec 2022 13:35:59 +0100 Subject: [PATCH 05/31] implemented usage of playmatapi --- .../ShortSupply.e5f541.ttslua | 19 +++++++++++-------- src/playermat/PlaymatApi.ttslua | 6 ++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index a563189b..17b6cb0a 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -1,5 +1,7 @@ local MAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" } +local playmatAPI = require("playermat/PlaymatApi") + function onLoad() self.addContextMenuItem("Discard 10 cards", shortSupply) end @@ -7,8 +9,7 @@ end -- called by context menu entry function shortSupply(color) local cardPos = self.getPosition() - local playerNumber = getPlayernumber(cardPos) - local mat = getObjectFromGUID(MAT_GUIDS[playerNumber]) + local mat = playmatAPI.getMatbyColor(getMatColor(cardPos)) if mat == nil then return end -- get draw deck and discard pile @@ -39,19 +40,21 @@ function shortSupply(color) end end --- helper to find playernumber based on position -function getPlayernumber(cardPos) +-- helper to find playermat color based on position +function getMatColor(cardPos) + local color if cardPos.x < -42 then if cardPos.z > 0 then - return 1 + color = "White" else - return 2 + color = "Orange" end else if cardPos.z > 0 then - return 3 + color = "Green" else - return 4 + color = "Red" end end + return color end diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index ba6f1687..7721dff0 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -23,6 +23,12 @@ do Red = "4111de" } + -- Returns the by color requested playermat as object + ---@param matColor String Color of the playermat to return + PlaymatApi.getMatbyColor = function(matColor) + return getObjectFromGUID(MAT_IDS[matColor]) + end + -- Sets the requested playermat's snap points to limit snapping to matching card types or not. If -- matchTypes is true, the main card slot snap points will only snap assets, while the -- investigator area point will only snap Investigators. If matchTypes is false, snap points will From ee6925bf0dcc33f8e7219171fbd358739cae3c9a Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 22 Dec 2022 13:37:41 +0100 Subject: [PATCH 06/31] removed unused lines --- objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua | 2 -- 1 file changed, 2 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index 17b6cb0a..41a2accc 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -1,5 +1,3 @@ -local MAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" } - local playmatAPI = require("playermat/PlaymatApi") function onLoad() From a55d1dff58aab8f027ebd76bb07015d90959131a Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 22 Dec 2022 13:45:47 +0100 Subject: [PATCH 07/31] new function for playermat api --- .../ShortSupply.e5f541.ttslua | 21 +----------- .../HandHelper.450688.ttslua | 29 ++--------------- src/playermat/PlaymatApi.ttslua | 32 ++++++++++++++++++- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index 41a2accc..e8da6501 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -7,7 +7,7 @@ end -- called by context menu entry function shortSupply(color) local cardPos = self.getPosition() - local mat = playmatAPI.getMatbyColor(getMatColor(cardPos)) + local mat = playmatAPI.getMatbyPosition(cardPos) if mat == nil then return end -- get draw deck and discard pile @@ -37,22 +37,3 @@ function shortSupply(color) }) end end - --- helper to find playermat color based on position -function getMatColor(cardPos) - local color - if cardPos.x < -42 then - if cardPos.z > 0 then - color = "White" - else - color = "Orange" - end - else - if cardPos.z > 0 then - color = "Green" - else - color = "Red" - end - end - return color -end diff --git a/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua b/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua index d32b3051..3204c68f 100644 --- a/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua +++ b/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.ttslua @@ -1,4 +1,4 @@ -MAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" } +local playmatAPI = require("playermat/PlaymatApi") local buttonParamaters = {} buttonParamaters.function_owner = self @@ -161,7 +161,8 @@ function discardRandom() if #hand == 0 then broadcastToAll("Cannot discard from empty hand!", "Red") else - local mat = getPlayermat(playerColor) + local searchPos = Player[playerColor].getHandTransform().position + local mat = playmatAPI.getMatbyPosition(searchPos) if mat == nil then return end local discardPos = mat.getTable("DISCARD_PILE_POSITION") @@ -192,27 +193,3 @@ function playerExists(color) local COLORS = Player.getAvailableColors() return indexOf(COLORS, color) and true or false end - --- helper to find playermat based on hand position -function getPlayermat(color) - local pos = Player[playerColor].getHandTransform().position - if pos.x < -30 then - if pos.z > 0 then - playerNumber = 1 - else - playerNumber = 2 - end - else - if pos.z > 0 then - playerNumber = 3 - else - playerNumber = 4 - end - end - - local mat = getObjectFromGUID(MAT_GUIDS[playerNumber]) - if mat == nil then - broadcastToAll(playerColor .. " playermat could not be found!", "Yellow") - end - return mat -end diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 7721dff0..73071295 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -26,7 +26,37 @@ do -- Returns the by color requested playermat as object ---@param matColor String Color of the playermat to return PlaymatApi.getMatbyColor = function(matColor) - return getObjectFromGUID(MAT_IDS[matColor]) + local mat = getObjectFromGUID(MAT_IDS[matColor]) + + if mat == nil then + broadcastToAll(playerColor .. " playermat could not be found!", "Yellow") + end + return mat + end + + -- Returns the by position requested playermat as object + ---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat + PlaymatApi.getMatbyPosition = function(startPos) + local matColor + if startPos.x < -42 then + if startPos.z > 0 then + matColor = "White" + else + matColor = "Orange" + end + else + if startPos.z > 0 then + matColor = "Green" + else + matColor = "Red" + end + end + local mat = getObjectFromGUID(MAT_IDS[matColor]) + + if mat == nil then + broadcastToAll(playerColor .. " playermat could not be found!", "Yellow") + end + return mat end -- Sets the requested playermat's snap points to limit snapping to matching card types or not. If From d97453207230c21362cd6517cae5e0f5120531be Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 22 Dec 2022 14:32:43 +0100 Subject: [PATCH 08/31] adding missing tags --- .../Fan-MadeAccessories.aa8b38/DisplacementTool.0f1374.json | 1 + objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.json | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/objects/Fan-MadeAccessories.aa8b38/DisplacementTool.0f1374.json b/objects/Fan-MadeAccessories.aa8b38/DisplacementTool.0f1374.json index c3fddf97..c8011877 100644 --- a/objects/Fan-MadeAccessories.aa8b38/DisplacementTool.0f1374.json +++ b/objects/Fan-MadeAccessories.aa8b38/DisplacementTool.0f1374.json @@ -41,6 +41,7 @@ "Snap": true, "Sticky": true, "Tags": [ + "CleanUpHelper_ignore", "displacement_excluded" ], "Tooltip": true, diff --git a/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.json b/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.json index 9e917d47..c1137ca5 100644 --- a/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.json +++ b/objects/Fan-MadeAccessories.aa8b38/HandHelper.450688.json @@ -40,6 +40,10 @@ "Nickname": "Hand Helper", "Snap": true, "Sticky": true, + "Tags": [ + "CleanUpHelper_ignore", + "displacement_excluded" + ], "Tooltip": true, "Transform": { "posX": 37.613, From f464e5f0ff6ee8fd4ed51add686f7747106aee24 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Fri, 30 Dec 2022 20:25:50 +0100 Subject: [PATCH 09/31] implementing further usage of playmatAPI --- .../ShortSupply.e5f541.ttslua | 18 +++---- src/playermat/PlaymatApi.ttslua | 51 +++++++++++-------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index e8da6501..6110f0de 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -6,14 +6,13 @@ end -- called by context menu entry function shortSupply(color) - local cardPos = self.getPosition() - local mat = playmatAPI.getMatbyPosition(cardPos) - if mat == nil then return end + local matColor = playmatAPI.getMatColorbyPosition(self.getPosition()) - -- get draw deck and discard pile - mat.call("getDrawDiscardDecks") - local drawDeck = mat.getVar("drawDeck") - local discardPos = mat.getTable("DISCARD_PILE_POSITION") + -- get draw deck and discard position + local drawDeck = playmatAPI.getDrawDeck(matColor) + local discardPos = playmatAPI.getDiscardPosition(matColor) + + -- error handling if discardPos == nil then broadcastToAll("Couldn't retrieve discard position from playermat!", "Red") return @@ -31,9 +30,6 @@ function shortSupply(color) discardPos.y = 0.5 for i = 1, 10 do discardPos.y = discardPos.y + 0.05 * i - drawDeck.takeObject({ - flip = true, - position = discardPos - }) + drawDeck.takeObject({ flip = true, position = discardPos }) end end diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 73071295..b3b6af92 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -3,24 +3,24 @@ do local internal = { } local MAT_IDS = { - White = "8b081b", + White = "8b081b", Orange = "bd0ff4", - Green = "383d8b", - Red = "0840d5" + Green = "383d8b", + Red = "0840d5" } local CLUE_COUNTER_GUIDS = { - White = "37be78", + White = "37be78", Orange = "1769ed", - Green = "032300", - Red = "d86b7c" + Green = "032300", + Red = "d86b7c" } local CLUE_CLICKER_GUIDS = { - White = "db85d6", + White = "db85d6", Orange = "3f22e5", - Green = "891403", - Red = "4111de" + Green = "891403", + Red = "4111de" } -- Returns the by color requested playermat as object @@ -34,29 +34,36 @@ do return mat end - -- Returns the by position requested playermat as object + -- Returns the color of the by position requested playermat as string ---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat - PlaymatApi.getMatbyPosition = function(startPos) - local matColor + PlaymatApi.getMatColorbyPosition = function(startPos) if startPos.x < -42 then if startPos.z > 0 then - matColor = "White" + return "White" else - matColor = "Orange" + return "Orange" end else if startPos.z > 0 then - matColor = "Green" + return "Green" else - matColor = "Red" + return "Red" end - end - local mat = getObjectFromGUID(MAT_IDS[matColor]) + end - if mat == nil then - broadcastToAll(playerColor .. " playermat could not be found!", "Yellow") - end - return mat + -- Returns the draw deck of the requested playmat + ---@param matColor String Color of the playermat + PlaymatApi.getDrawDeck = function(matColor) + local mat = getObjectFromGUID(MAT_IDS[matColor]) + mat.call("getDrawDiscardDecks") + return mat.getVar("drawDeck") + end + + -- Returns the position of the discard pile of the requested playmat + ---@param matColor String Color of the playermat + PlaymatApi.getDiscardPosition = function(matColor) + local mat = getObjectFromGUID(MAT_IDS[matColor]) + return mat.getTable("DISCARD_PILE_POSITION") end -- Sets the requested playermat's snap points to limit snapping to matching card types or not. If From 08936a7230a5172e030e3b8144e4a79904b62787 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Fri, 30 Dec 2022 20:43:55 +0100 Subject: [PATCH 10/31] bugfix and feedback --- objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua | 1 + src/playermat/PlaymatApi.ttslua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index 6110f0de..115b4792 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -27,6 +27,7 @@ function shortSupply(color) end -- discard cards + broadcastToColor("Discarding top 10 cards for player color '" .. matColor .. "'.", color, "White") discardPos.y = 0.5 for i = 1, 10 do discardPos.y = discardPos.y + 0.05 * i diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index b3b6af92..25aaaea2 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -49,6 +49,7 @@ do else return "Red" end + end end -- Returns the draw deck of the requested playmat @@ -122,7 +123,7 @@ do -- Convenience function to look up a mat's object by color, or get all mats. ---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also -- accepts "All" as a special value which will return all four mats. - ---@return Array of playermat objects. If a single mat is requested, will return a single-element + ---@return: Array of playermat objects. If a single mat is requested, will return a single-element -- array to simplify processing by consumers. internal.getMatForColor = function(matColor) local targetMatGuid = MAT_IDS[matColor] From 117612ad7fc2097524b06dfaf97c9baf7d0f63a5 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Fri, 30 Dec 2022 21:01:34 +0100 Subject: [PATCH 11/31] adding infinite bag --- objects/Fan-MadeAccessories.aa8b38.json | 2 +- .../AttachmentHelper.7f4976.json | 51 +++++ .../AttachmentHelper.d45664.json | 65 ++++++ .../AttachmentHelper.d45664.ttslua | 202 ++++++++++++++++++ 4 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976.json create mode 100644 objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.json create mode 100644 objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.ttslua diff --git a/objects/Fan-MadeAccessories.aa8b38.json b/objects/Fan-MadeAccessories.aa8b38.json index be4f769a..56d31505 100644 --- a/objects/Fan-MadeAccessories.aa8b38.json +++ b/objects/Fan-MadeAccessories.aa8b38.json @@ -17,7 +17,7 @@ "ChaosBagManager.023240", "TokenArranger.022907", "CYOACampaignGuides.e87ea2", - "AttachmentHelper.d45664", + "AttachmentHelper.7f4976", "ArkhamFantasy-PixelArtMini-Cards.e17c9e", "jaqenZannsNavigationOverlay.a8affa", "DrawTokenButtonTooltipRenamer.cc77a8", diff --git a/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976.json b/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976.json new file mode 100644 index 00000000..fd21c75a --- /dev/null +++ b/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976.json @@ -0,0 +1,51 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 0.37256, + "r": 0.30589 + }, + "ContainedObjects_order": [ + "AttachmentHelper.d45664" + ], + "ContainedObjects_path": "AttachmentHelper.7f4976", + "Description": "Provides card-sized bags that are useful for cards that are attached facedown (e.g. Backpack).", + "DragSelectable": true, + "GMNotes": "", + "GUID": "7f4976", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "", + "LuaScriptState": "", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Infinite_Bag", + "Nickname": "Attachment Helper", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": 27.677, + "posY": 4.472, + "posZ": -31.034, + "rotX": 0, + "rotY": 0, + "rotZ": 0, + "scaleX": 1, + "scaleY": 1, + "scaleZ": 1 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.json b/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.json new file mode 100644 index 00000000..629ef166 --- /dev/null +++ b/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.json @@ -0,0 +1,65 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "Bag": { + "Order": 0 + }, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomMesh": { + "CastShadows": true, + "ColliderURL": "http://cloud-3.steamusercontent.com/ugc/1754695414379239413/0B8E68F3B7311DCF2138FB701F78D1D93FBA4CAB/", + "Convex": true, + "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/", + "MaterialIndex": 1, + "MeshURL": "http://cloud-3.steamusercontent.com/ugc/1754695414379239413/0B8E68F3B7311DCF2138FB701F78D1D93FBA4CAB/", + "NormalURL": "", + "TypeIndex": 6 + }, + "Description": "Drop cards here to display name, cost and skill icons.\n\nSee context menu for options.", + "DragSelectable": true, + "GMNotes": "", + "GUID": "d45664", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScriptState": "[[],true,true]", + "LuaScript_path": "Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.ttslua", + "MaterialIndex": -1, + "MeasureMovement": false, + "MeshIndex": -1, + "Name": "Custom_Model_Bag", + "Nickname": "Attachment Helper", + "Number": 0, + "Snap": true, + "Sticky": true, + "Tags": [ + "Asset", + "scesetup_memory_object" + ], + "Tooltip": true, + "Transform": { + "posX": 19.228, + "posY": 3.822, + "posZ": -19.636, + "rotX": 0, + "rotY": 270, + "rotZ": 359, + "scaleX": 0.8, + "scaleY": 1, + "scaleZ": 0.8 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.ttslua b/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.ttslua new file mode 100644 index 00000000..de2c31a1 --- /dev/null +++ b/objects/Fan-MadeAccessories.aa8b38/AttachmentHelper.7f4976/AttachmentHelper.d45664.ttslua @@ -0,0 +1,202 @@ +local OPTION_TEXT = { + "Ancestral Knowledge", + "Astronomical Atlas", + "Crystallizer of Dreams", + "Diana Stanley", + "Gloria Goldberg", + "Sefina Rousseau", + "Wooden Sledge" +} + +local IMAGE_LIST = { + -- Ancestral Knowledge + "http://cloud-3.steamusercontent.com/ugc/1915746489207287888/2F9F6F211ED0F98E66C9D35D93221E4C7FB6DD3C/", + -- Astronomical Atlas + "http://cloud-3.steamusercontent.com/ugc/1754695853007989004/9153BC204FC707AE564ECFAC063A11CB8C2B5D1E/", + -- Crystallizer of Dreams + "http://cloud-3.steamusercontent.com/ugc/1915746489207280958/100F16441939E5E23818651D1EB5C209BF3125B9/", + -- Diana Stanley + "http://cloud-3.steamusercontent.com/ugc/1754695635919071208/1AB7222850201630826BFFBA8F2BD0065E2D572F/", + -- Gloria Goldberg + "http://cloud-3.steamusercontent.com/ugc/1754695635919102502/453D4426118C8A6DE2EA281184716E26CA924C84/", + -- Sefina Rousseau + "http://cloud-3.steamusercontent.com/ugc/1754695635919099826/3C3CBFFAADB2ACA9957C736491F470AE906CC953/", + -- Wooden Sledge + "http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/" +} + +-- save state and options to restore onLoad +function onSave() return JSON.encode({ cardsInBag, showCost, showIcons }) end + +-- load variables and create context menu +function onLoad(savedData) + local loadedData = JSON.decode(savedData) + cardsInBag = loadedData[1] or {} + showCost = loadedData[2] or true + showIcons = loadedData[3] or true + + recreateButtons() + + self.addContextMenuItem("Select image", selectImage) + self.addContextMenuItem("Toggle cost", function(color) + showCost = not showCost + printToColor("Show cost of cards: " .. tostring(showCost), color, "White") + refresh() + end) + + self.addContextMenuItem("Toggle skill icons", function(color) + showIcons = not showIcons + printToColor("Show skill icons of cards: " .. tostring(showIcons), color, "White") + refresh() + end) + + self.addContextMenuItem("More Information", function() + printToAll("------------------------------", "White") + printToAll("Attachment Helper by Chr1Z", "Orange") + printToAll("original by bankey", "White") + end) +end + +function selectImage(color) + Player[color].showOptionsDialog("Select image:", OPTION_TEXT, 1, function(_, option_index) + local customInfo = self.getCustomObject() + customInfo.diffuse = IMAGE_LIST[option_index] + self.setCustomObject(customInfo) + self.reload() + end) +end + +-- called for every card that enters +function onObjectEnterContainer(container, object) + if container == self then + if object.tag ~= "Card" then + broadcastToAll("The 'Attachment Helper' is meant to be used for single cards.", "White") + else + findCard(object.getGUID(), object.getName(), object.getGMNotes()) + end + -- TODO: implement splitting of decks that get thrown in here + recreateButtons() + end +end + +-- removes leaving cards from the "cardInBag" table +function onObjectLeaveContainer(container, object) + if container == self then + local guid = object.getGUID() + local found = false + for i, card in ipairs(cardsInBag) do + if card.id == guid then + table.remove(cardsInBag, i) + found = true + break + end + end + + if found ~= true then + local name = object.getName() + for i, card in ipairs(cardsInBag) do + if card.name == name then + table.remove(cardsInBag, i) + break + end + end + end + recreateButtons() + end +end + +-- refreshes displayed buttons based on contained cards +function refresh() + cardsInBag = {} + for _, object in ipairs(self.getObjects()) do + findCard(object.guid, object.name, object.gm_notes) + end + recreateButtons() +end + +-- gets cost and icons for a card +function findCard(guid, name, GMNotes) + local cost = "" + local icons = {} + local metadata = {} + local displayName = name + + if displayName == nil or displayName == "" then displayName = "unnamed" end + if showCost or showIcons then metadata = JSON.decode(GMNotes) end + + if showCost then + if GMNotes ~= "" then cost = metadata.cost end + if cost == nil or cost == "" then cost = "–" end + displayName = "[" .. cost .. "] " .. displayName + end + + if showIcons then + if GMNotes ~= "" then + icons[1] = metadata.wildIcons + icons[2] = metadata.willpowerIcons + icons[3] = metadata.intellectIcons + icons[4] = metadata.combatIcons + icons[5] = metadata.agilityIcons + end + + local IconTypes = { "Wild", "Willpower", "Intellect", "Combat", "Agility" } + local found = false + for i = 1, 5 do + if icons[i] ~= nil and icons[i] ~= "" then + if found == false then + displayName = displayName .. "\n" .. IconTypes[i] .. ": " .. icons[i] + found = true + else + displayName = displayName .. " " .. IconTypes[i] .. ": " .. icons[i] + end + end + end + end + table.insert(cardsInBag, { name = name, displayName = displayName, id = guid }) +end + +-- recreates buttons with up-to-date labels +function recreateButtons() + self.clearButtons() + local verticalPosition = 1.65 + + for _, card in ipairs(cardsInBag) do + local id = card.id + local funcName = "removeCard" .. id + self.setVar(funcName, function() removeCard(id) end) + self.createButton({ + label = card.displayName, + click_function = funcName, + function_owner = self, + position = { 0, 0, verticalPosition }, + height = 200, + width = 1200, + font_size = string.len(card.displayName) > 20 and 75 or 100 + }) + verticalPosition = verticalPosition - 0.5 + end + + local countLabel = "Attachment\nHelper" + if #cardsInBag ~= 0 then countLabel = #cardsInBag end + + self.createButton({ + label = countLabel, + click_function = "none", + function_owner = self, + position = { 0, 0, -1.35 }, + height = 0, + width = 0, + font_size = 225, + font_color = { 1, 1, 1 } + }) +end + +-- click-function for buttons to take a card out of the bag +function removeCard(cardGUID) + self.takeObject({ + guid = cardGUID, + rotation = self.getRotation(), + position = self.getPosition() + Vector(0, 0.25, 0), + callback_function = function(obj) obj.resting = true end + }) +end From d00f6dab1001b330054d8fe68ad1ff87cc662bac Mon Sep 17 00:00:00 2001 From: Buhallin Date: Fri, 30 Dec 2022 14:14:57 -0800 Subject: [PATCH 12/31] SCED Intro Tour, tweaks and fixes Contains a variety of small adjustments to the tour: - Fixed a typo in Darrell's card - Increased overall size by 10% - Increased investigator images by about 50% - Moved some of the card positions slightly to line up with their specific uses - Updated button images to a smaller base image (because TTS's image scaling is crap) --- modsettings/CustomUIAssets.json | 4 +-- src/core/tour/TourCard.ttslua | 42 +++++++++++++++++--------------- src/core/tour/TourManager.ttslua | 9 ++++--- src/core/tour/TourScript.ttslua | 6 ++--- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/modsettings/CustomUIAssets.json b/modsettings/CustomUIAssets.json index cb69884e..da875443 100644 --- a/modsettings/CustomUIAssets.json +++ b/modsettings/CustomUIAssets.json @@ -107,12 +107,12 @@ { "Name": "NextArrow", "Type": 0, - "URL": "https://i.imgur.com/gXRiKmu.png" + "URL": "https://i.imgur.com/MztSQis.png" }, { "Name": "Exit", "Type": 0, - "URL": "https://i.imgur.com/i0VMjPD.png" + "URL": "https://i.imgur.com/8qmTXwt.png" }, { "Name": "Inv-Mandy", diff --git a/src/core/tour/TourCard.ttslua b/src/core/tour/TourCard.ttslua index 02d9ad73..3a77f414 100644 --- a/src/core/tour/TourCard.ttslua +++ b/src/core/tour/TourCard.ttslua @@ -6,8 +6,8 @@ tourCardTemplate = { tag = "Panel", attributes = { id = "tourCard", - height = 195, - width = 300, + height = 215, + width = 330, rotation = "0 0 0", position = "0 300 30", showAnimation = "FadeIn", @@ -19,10 +19,10 @@ tourCardTemplate = { tag = "Image", attributes = { id = "tourNarratorImageLeft", - height=75, - width=50, + height=120, + width=80, rectAlignment="UpperLeft", - offsetXY = "-50 0", + offsetXY = "-80 0", -- Image will be set when the card is updated } }, @@ -31,10 +31,10 @@ tourCardTemplate = { attributes = { id = "tourNarratorImageRight", active = false, - height=75, - width=50, + height=125, + width=80, rectAlignment="UpperRight", - offsetXY = "50 0" + offsetXY = "80 0" -- Image will be set when the card is updated } }, @@ -43,8 +43,8 @@ tourCardTemplate = { attributes = { id = "tourSpeechBubble", color = "#F5F5DC", - height = 195, - width = 300, + height = 215, + width = 330, rectAlignment = "MiddleCenter", image = "SpeechBubble", }, @@ -53,35 +53,37 @@ tourCardTemplate = { tag = "Text", attributes = { id = "tourText", - height = 165, - width = 230, + -- Everything on this is double-sized and scaled down to keep the text sharps + height = 370, + width = 520, + scale = "0.5 0.5 1", rectAlignment = "UpperCenter", offsetXY = "15 -15", resizeTextForBestFit = true, - resizeTextMinSize = 10, - resizeTextMaxSize = 16, + resizeTextMinSize = 20, + resizeTextMaxSize = 32, color = "#050505", alignment = "UpperLeft", horizontalOverflow = "wrap", } }, { - tag = "Button", + tag = "Image", attributes = { id = "tourNext", - height = 40, - width = 40, + height = 45, + width = 45, rectAlignment = "LowerRight", offsetXY = "-5 -45", image = "NextArrow" }, }, { - tag = "Button", + tag = "Image", attributes = { id = "tourStop", - height = 40, - width = 40, + height = 45, + width = 45, rectAlignment = "LowerLeft", offsetXY = "35 -45", image = "Exit" diff --git a/src/core/tour/TourManager.ttslua b/src/core/tour/TourManager.ttslua index 34001fcc..d0a37183 100644 --- a/src/core/tour/TourManager.ttslua +++ b/src/core/tour/TourManager.ttslua @@ -36,10 +36,14 @@ do east = "600 0 0", west = "-600 0 0", south = "0 -300 0", - northwest = "-600 300 0", + -- Northwest is only used by the Mandy card, move it a little right than standard so it's + -- closer to the importer + northwest = "-500 300 0", northeast = "600 300 0", southwest = "-600 -300 0", - southeast = "600 -300 0" + -- Used by the Diana and Wini cards referencing the bottom-right global controls, moved a little + -- closer to them + southeast = "730 -365 0" } -- Tracks the current state of the tours. Keyed by player color to keep each player's tour @@ -264,7 +268,6 @@ do ---@param playerColor String. String color of the player to make this visible for internal.setDeepVisibility = function(xmlUi, playerColor) xmlUi.attributes.visibility = "" .. playerColor - log(xmlUi.attributes.id) if xmlUi.children ~= nil then for _, child in ipairs(xmlUi.children) do internal.setDeepVisibility(child, playerColor) diff --git a/src/core/tour/TourScript.ttslua b/src/core/tour/TourScript.ttslua index addc0d73..2f6fd65c 100644 --- a/src/core/tour/TourScript.ttslua +++ b/src/core/tour/TourScript.ttslua @@ -8,7 +8,7 @@ TOUR_SCRIPT = { }, { narrator = "Darrell", - text = "Cameras can be tricky things. Best you leave handling it to the professionals during the tour. Don't try to move the camera until the tour is complete.\n\nOnce we're done, remmeber you can use the 'p' key to switch back to third-person mode, and the spacebar to reset the position.", + text = "Cameras can be tricky things. Best you leave handling it to the professionals during the tour. Don't try to move the camera until the tour is complete.\n\nOnce we're done, remember you can use the 'p' key to switch back to third-person mode, and the spacebar to reset the position.", position = "center", speakerSide = "right", }, @@ -25,7 +25,7 @@ TOUR_SCRIPT = { text = "To survive what's coming you'll need a deck. If it's safely hidden away on ArkhamDB you can load it here, and even find the newest version after an upgrade without changing the ID.\n\nNo need to publish all your decks, use 'Private' and you can see it. Just make sure to select 'Make your decks public' in ArkhamDB.", showObj = "a28140", distanceFromObj = -10, - position = "west", + position = "northwest", }, { narrator = "Daniela", @@ -83,7 +83,7 @@ TOUR_SCRIPT = { }, { narrator = "Preston", - text = "I can afford to buy what I need, but for those less well-off we've provided an endless pool of tokens to track your game. Simply drag one out of the pools here.\n\nResources are my favorite, of course, but damage and horror are as inevitable as taxes, though I leave those to my bookkeeper. Those tokens can work like counters, use the number keys to change the value.", + text = "I can afford to buy what I need, but for those less well-off we've provided an endless pool of tokens to track your game. Simply drag one out of the pools here.\n\nResources are my favorite of course, but damage and horror are as inevitable as taxes. I leave those to my bookkeeper though. Those tokens can work like counters, use the number keys to change the value.", showObj = "9fadf9", position = "north", skipCentering = true, From 41e30ce9e17b2fc9a558c709762ecda6dbf2bf0a Mon Sep 17 00:00:00 2001 From: Buhallin Date: Fri, 30 Dec 2022 14:18:57 -0800 Subject: [PATCH 13/31] Fix typo in resource token --- objects/TokenSource.124381.json | 2 +- .../{Reesource.00d19a.json => Resource.00d19a.json} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename objects/TokenSource.124381/{Reesource.00d19a.json => Resource.00d19a.json} (97%) diff --git a/objects/TokenSource.124381.json b/objects/TokenSource.124381.json index 0f953b34..9b468f66 100644 --- a/objects/TokenSource.124381.json +++ b/objects/TokenSource.124381.json @@ -18,7 +18,7 @@ "Damage.cd2a02", "Horror.36be72", "ClueDoom.a3fb6c", - "Reesource.00d19a" + "Resource.00d19a" ], "ContainedObjects_path": "TokenSource.124381", "Description": "", diff --git a/objects/TokenSource.124381/Reesource.00d19a.json b/objects/TokenSource.124381/Resource.00d19a.json similarity index 97% rename from objects/TokenSource.124381/Reesource.00d19a.json rename to objects/TokenSource.124381/Resource.00d19a.json index 74817ed2..ac96f326 100644 --- a/objects/TokenSource.124381/Reesource.00d19a.json +++ b/objects/TokenSource.124381/Resource.00d19a.json @@ -37,7 +37,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Token", - "Nickname": "Reesource", + "Nickname": "Resource", "Snap": false, "Sticky": true, "Tooltip": false, From 653a23118eec7c8804a38530294bd75664f86483 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Fri, 30 Dec 2022 23:51:16 +0100 Subject: [PATCH 14/31] playmat moving --- config.json | 6 +- modsettings/SnapPoints.json | 372 ++++++++++-------- objects/ClueCounter.032300.json | 4 +- objects/ClueCounter.1769ed.json | 4 +- objects/ClueCounter.37be78.json | 4 +- objects/ClueCounter.d86b7c.json | 4 +- objects/Clues.4111de.json | 2 +- objects/Clues.891403.json | 2 +- objects/Cluetokens.3b2550.json | 6 +- objects/Cluetokens.fae2f6.json | 6 +- objects/Connectionmarkers.5dcccb.json | 61 --- objects/Connectionmarkers.b118af.json | 61 --- objects/Custom_PDF.d99993.json | 6 +- objects/Damage.1f5a0a.json | 6 +- objects/Damage.591a45.json | 6 +- objects/Damage.e64eec.json | 6 +- objects/Damage.eb08d6.json | 6 +- objects/DamageTokens.93f4a0.json | 6 +- objects/DamageTokens.b0ef6c.json | 6 +- objects/Detailedphasereference.68fe54.json | 6 +- objects/Doomtokens.16724b.json | 6 +- objects/Doomtokens.16fcd6.json | 6 +- objects/HandTrigger.0285cc.json | 2 +- objects/HandTrigger.be2f17.json | 2 +- objects/Horror.0257d9.json | 6 +- objects/Horror.468e88.json | 4 +- objects/Horror.7b5729.json | 6 +- objects/Horror.beb964.json | 6 +- objects/Horrortokens.7bd2a0.json | 6 +- objects/Horrortokens.ae1a4e.json | 6 +- objects/InvestigatorSkillTracker.af7ed7.json | 2 +- objects/InvestigatorSkillTracker.b4a5f7.json | 2 +- objects/InvestigatorSkillTracker.e74881.json | 2 +- objects/LolaNeutral.460250.json | 2 +- objects/LolaNeutral.7ffb43.json | 2 +- objects/LolaNeutral.a1e2a3.json | 2 +- objects/LolaNeutral.a7c0f0.json | 4 +- objects/LolaNeutral.b8409d.json | 2 +- objects/LolaNeutral.bf7cc9.json | 4 +- objects/LolaNeutral.bfcaf4.json | 2 +- objects/LolaNeutral.d7910b.json | 2 +- objects/Playermat3Green.383d8b.json | 26 +- objects/Playermat4Red.0840d5.json | 26 +- objects/Resources.4406f0.json | 4 +- objects/Resources.816d84.json | 6 +- objects/Resources.a4b60d.json | 6 +- objects/Resources.cd15ac.json | 4 +- objects/Resourcetokens.0168ae.json | 6 +- objects/Resourcetokens.fd617a.json | 6 +- ...oundSequenceActionDescription.2eca7c.json} | 8 +- ...oundSequenceActionDescription.fb09d4.json} | 8 +- objects/RulesIndex.91c83e.json | 6 +- objects/ScriptingTrigger.18538f.json | 2 +- objects/ScriptingTrigger.57c22c.json | 2 +- objects/ScriptingTrigger.67ce9a.json | 2 +- objects/ScriptingTrigger.fb28e1.json | 2 +- objects/Trash.4b8594.json | 2 +- objects/Trash.5f896a.json | 2 +- 58 files changed, 325 insertions(+), 449 deletions(-) delete mode 100644 objects/Connectionmarkers.5dcccb.json delete mode 100644 objects/Connectionmarkers.b118af.json rename objects/{Custom_Tile.2eca7c.json => RoundSequenceActionDescription.2eca7c.json} (90%) rename objects/{Custom_Tile.fb09d4.json => RoundSequenceActionDescription.fb09d4.json} (90%) diff --git a/config.json b/config.json index 5e47eb16..2adead0d 100644 --- a/config.json +++ b/config.json @@ -57,8 +57,8 @@ "Cluetokens.11e0cf", "Doomtokens.b015d8", "DoomCounter.85c4c6", - "Custom_Tile.2eca7c", - "Custom_Tile.fb09d4", + "RoundSequenceActionDescription.2eca7c", + "RoundSequenceActionDescription.fb09d4", "3DText.65eb7e", "InvestigatorCount.f182ee", "ScriptingTrigger.c506bf", @@ -96,7 +96,6 @@ "Resourcetokens.0168ae", "Horrortokens.ae1a4e", "DamageTokens.b0ef6c", - "Connectionmarkers.b118af", "Trash.4b8594", "Trash.5f896a", "Trash.147e80", @@ -109,7 +108,6 @@ "Doomtokens.16fcd6", "DamageTokens.93f4a0", "Resourcetokens.fd617a", - "Connectionmarkers.5dcccb", "Cluetokens.31fa39", "Horrortokens.c3ecf4", "Doomtokens.47ffc3", diff --git a/modsettings/SnapPoints.json b/modsettings/SnapPoints.json index ec98ff16..a6cf1c4f 100644 --- a/modsettings/SnapPoints.json +++ b/modsettings/SnapPoints.json @@ -3817,54 +3817,6 @@ "z": 65.419 } }, - { - "Position": { - "x": -22.602, - "y": 1.635, - "z": 22.44 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "Position": { - "x": -25.571, - "y": 1.639, - "z": 22.44 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "Position": { - "x": -28.485, - "y": 1.642, - "z": 22.44 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "Position": { - "x": -31.454, - "y": 1.645, - "z": 22.44 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, { "Position": { "x": -50.852, @@ -3985,106 +3937,6 @@ "z": 0 } }, - { - "Position": { - "x": -28.509, - "y": 1.64, - "z": -22.42 - }, - "Rotation": { - "x": 0, - "y": 180, - "z": 0 - } - }, - { - "Position": { - "x": -25.509, - "y": 1.64, - "z": -22.42 - }, - "Rotation": { - "x": 0, - "y": 180, - "z": 0 - } - }, - { - "Position": { - "x": -22.606, - "y": 1.64, - "z": -22.42 - }, - "Rotation": { - "x": 0, - "y": 180, - "z": 0 - } - }, - { - "Position": { - "x": -19.651, - "y": 1.64, - "z": -22.42 - }, - "Rotation": { - "x": 0, - "y": 180, - "z": 0 - } - }, - { - "Position": { - "x": -34.383, - "y": 1.651, - "z": 22.439 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "Position": { - "x": -16.691, - "y": 1.64, - "z": -22.417 - }, - "Rotation": { - "x": 0, - "y": 180, - "z": 0 - } - }, - { - "Position": { - "x": -34.26, - "y": 1.651, - "z": 23.6 - } - }, - { - "Position": { - "x": -33.12, - "y": 1.65, - "z": 23.6 - } - }, - { - "Position": { - "x": -16.78, - "y": 1.64, - "z": -23.58 - } - }, - { - "Position": { - "x": -17.92, - "y": 1.64, - "z": -23.58 - } - }, { "Position": { "x": -52.07, @@ -4127,20 +3979,6 @@ "z": -21.55 } }, - { - "Position": { - "x": -20.049, - "y": 1.64, - "z": -24.78 - } - }, - { - "Position": { - "x": -30.997, - "y": 1.647, - "z": 24.81 - } - }, { "Position": { "x": 45.336, @@ -4203,5 +4041,215 @@ "y": 1.481, "z": 0 } + }, + { + "Position": { + "x": -24.91, + "y": 1.55, + "z": -24.84 + } + }, + { + "Position": { + "x": -35.77, + "y": 1.55, + "z": 24.86 + } + }, + { + "Position": { + "x": -37.9, + "y": 1.55, + "z": 23.72 + } + }, + { + "Position": { + "x": -39.04, + "y": 1.55, + "z": 23.72 + } + }, + { + "Position": { + "x": -22.78, + "y": 1.55, + "z": -23.72 + } + }, + { + "Position": { + "x": -21.64, + "y": 1.55, + "z": -23.72 + } + }, + { + "Position": { + "x": -21.502, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -24.462, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -27.407, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -30.365, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -33.332, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -36.216, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -39.14, + "y": 1.55, + "z": -22.44 + }, + "Rotation": { + "x": 0, + "y": 180, + "z": 0 + } + }, + { + "Position": { + "x": -39.271, + "y": 1.55, + "z": 22.44 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "Position": { + "x": -36.213, + "y": 1.55, + "z": 22.439 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "Position": { + "x": -33.287, + "y": 1.55, + "z": 22.44 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "Position": { + "x": -30.332, + "y": 1.55, + "z": 22.44 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "Position": { + "x": -27.388, + "y": 1.55, + "z": 22.44 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "Position": { + "x": -24.473, + "y": 1.55, + "z": 22.504 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "Position": { + "x": -21.541, + "y": 1.55, + "z": 22.504 + }, + "Rotation": { + "x": 0, + "y": 0, + "z": 0 + } } ] diff --git a/objects/ClueCounter.032300.json b/objects/ClueCounter.032300.json index 066aa2e8..71211083 100644 --- a/objects/ClueCounter.032300.json +++ b/objects/ClueCounter.032300.json @@ -51,9 +51,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -32.193, + "posX": -36.867, "posY": 1.52, - "posZ": 30.977, + "posZ": 31.025, "rotX": 0, "rotY": 10, "rotZ": 0, diff --git a/objects/ClueCounter.1769ed.json b/objects/ClueCounter.1769ed.json index 51153c45..914b6298 100644 --- a/objects/ClueCounter.1769ed.json +++ b/objects/ClueCounter.1769ed.json @@ -51,9 +51,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -59.426, + "posX": -59.402, "posY": 1.52, - "posZ": -22.721, + "posZ": -22.586, "rotX": 0, "rotY": 280, "rotZ": 0, diff --git a/objects/ClueCounter.37be78.json b/objects/ClueCounter.37be78.json index 1026c19d..5b7fcb52 100644 --- a/objects/ClueCounter.37be78.json +++ b/objects/ClueCounter.37be78.json @@ -51,9 +51,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -18.87, + "posX": -23.89, "posY": 1.52, - "posZ": -30.977, + "posZ": -31.107, "rotX": 0, "rotY": 190, "rotZ": 0, diff --git a/objects/ClueCounter.d86b7c.json b/objects/ClueCounter.d86b7c.json index ca1bedaf..8beb0fc8 100644 --- a/objects/ClueCounter.d86b7c.json +++ b/objects/ClueCounter.d86b7c.json @@ -51,9 +51,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -59.426, + "posX": -59.45, "posY": 1.52, - "posZ": 9.395, + "posZ": 9.589, "rotX": 0, "rotY": 280, "rotZ": 0, diff --git a/objects/Clues.4111de.json b/objects/Clues.4111de.json index efe2d1a7..97c69558 100644 --- a/objects/Clues.4111de.json +++ b/objects/Clues.4111de.json @@ -45,7 +45,7 @@ ], "Tooltip": false, "Transform": { - "posX": -18.87, + "posX": -23.89, "posY": 1.3, "posZ": -30.977, "rotX": 0, diff --git a/objects/Clues.891403.json b/objects/Clues.891403.json index d7dfcd22..32174201 100644 --- a/objects/Clues.891403.json +++ b/objects/Clues.891403.json @@ -45,7 +45,7 @@ ], "Tooltip": false, "Transform": { - "posX": -32.193, + "posX": -36.87, "posY": 1.3, "posZ": 30.977, "rotX": 0, diff --git a/objects/Cluetokens.3b2550.json b/objects/Cluetokens.3b2550.json index e5cdc8d5..86339167 100644 --- a/objects/Cluetokens.3b2550.json +++ b/objects/Cluetokens.3b2550.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -42.227, - "posY": 1.611, - "posZ": -31.182, + "posX": -45.4, + "posY": 1.561, + "posZ": -30.5, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/Cluetokens.fae2f6.json b/objects/Cluetokens.fae2f6.json index b5340f1f..07e31919 100644 --- a/objects/Cluetokens.fae2f6.json +++ b/objects/Cluetokens.fae2f6.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -44.101, - "posY": 1.632, - "posZ": 31.207, + "posX": -45.4, + "posY": 1.561, + "posZ": 30.5, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/Connectionmarkers.5dcccb.json b/objects/Connectionmarkers.5dcccb.json deleted file mode 100644 index 603d2fad..00000000 --- a/objects/Connectionmarkers.5dcccb.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects_order": [ - "Custom_Tile.7234af" - ], - "ContainedObjects_path": "Connectionmarkers.5dcccb", - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/949588657208009702/1786DA3A72B61BF39ADE9577B177797450011602/", - "MaterialIndex": 3, - "MeshURL": "https://pastebin.com/raw/ALrYhQGb", - "NormalURL": "", - "TypeIndex": 7 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "5dcccb", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": true, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Infinite_Bag", - "Nickname": "Connection markers", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -44.559, - "posY": 1.636, - "posZ": -26.724, - "rotX": 0, - "rotY": 180, - "rotZ": 0, - "scaleX": 0.8, - "scaleY": 1, - "scaleZ": 0.8 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/Connectionmarkers.b118af.json b/objects/Connectionmarkers.b118af.json deleted file mode 100644 index 35dc1b27..00000000 --- a/objects/Connectionmarkers.b118af.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "AltLookAngle": { - "x": 0, - "y": 0, - "z": 0 - }, - "Autoraise": true, - "ColorDiffuse": { - "b": 1, - "g": 1, - "r": 1 - }, - "ContainedObjects_order": [ - "Custom_Tile.7234af" - ], - "ContainedObjects_path": "Connectionmarkers.b118af", - "CustomMesh": { - "CastShadows": true, - "ColliderURL": "", - "Convex": true, - "DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/949588657208009702/1786DA3A72B61BF39ADE9577B177797450011602/", - "MaterialIndex": 3, - "MeshURL": "https://pastebin.com/raw/ALrYhQGb", - "NormalURL": "", - "TypeIndex": 7 - }, - "Description": "", - "DragSelectable": true, - "GMNotes": "", - "GUID": "b118af", - "Grid": true, - "GridProjection": false, - "Hands": false, - "HideWhenFaceDown": false, - "IgnoreFoW": false, - "LayoutGroupSortIndex": 0, - "Locked": true, - "LuaScript": "", - "LuaScriptState": "", - "MaterialIndex": -1, - "MeasureMovement": false, - "MeshIndex": -1, - "Name": "Custom_Model_Infinite_Bag", - "Nickname": "Connection markers", - "Snap": true, - "Sticky": true, - "Tooltip": true, - "Transform": { - "posX": -41.769, - "posY": 1.648, - "posZ": 26.75, - "rotX": 0, - "rotY": 0, - "rotZ": 0, - "scaleX": 0.8, - "scaleY": 1, - "scaleZ": 0.8 - }, - "Value": 0, - "XmlUI": "" -} diff --git a/objects/Custom_PDF.d99993.json b/objects/Custom_PDF.d99993.json index 6b2360be..5f0bb689 100644 --- a/objects/Custom_PDF.d99993.json +++ b/objects/Custom_PDF.d99993.json @@ -36,9 +36,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -60.574, - "posY": 1.249, - "posZ": 70.866, + "posX": -61, + "posY": 1.27, + "posZ": 74, "rotX": 0, "rotY": 270, "rotZ": 0, diff --git a/objects/Damage.1f5a0a.json b/objects/Damage.1f5a0a.json index b97d7fd8..38534af1 100644 --- a/objects/Damage.1f5a0a.json +++ b/objects/Damage.1f5a0a.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -32.31, + "posX": -37.182, "posY": 1.52, - "posZ": 29.006, + "posZ": 29.089, "rotX": 0, - "rotY": 11, + "rotY": 10, "rotZ": 1, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Damage.591a45.json b/objects/Damage.591a45.json index 41937170..b1c402b9 100644 --- a/objects/Damage.591a45.json +++ b/objects/Damage.591a45.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -18.706, + "posX": -23.497, "posY": 1.52, - "posZ": -29.027, + "posZ": -29.078, "rotX": 0, - "rotY": 195, + "rotY": 190, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Damage.e64eec.json b/objects/Damage.e64eec.json index 1ea4da6b..99f89b60 100644 --- a/objects/Damage.e64eec.json +++ b/objects/Damage.e64eec.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -57.512, + "posX": -57.507, "posY": 1.52, - "posZ": -22.921, + "posZ": -22.894, "rotX": 0, - "rotY": 285, + "rotY": 280, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Damage.eb08d6.json b/objects/Damage.eb08d6.json index 3e461e08..39eab22d 100644 --- a/objects/Damage.eb08d6.json +++ b/objects/Damage.eb08d6.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -57.488, + "posX": -57.472, "posY": 1.52, - "posZ": 9.184, + "posZ": 9.273, "rotX": 0, - "rotY": 282, + "rotY": 280, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/DamageTokens.93f4a0.json b/objects/DamageTokens.93f4a0.json index 0218c699..75c6a925 100644 --- a/objects/DamageTokens.93f4a0.json +++ b/objects/DamageTokens.93f4a0.json @@ -56,9 +56,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -44.558, - "posY": 1.635, - "posZ": -28.959, + "posX": -45.4, + "posY": 1.581, + "posZ": -26, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/DamageTokens.b0ef6c.json b/objects/DamageTokens.b0ef6c.json index 18b00688..7eba8a5b 100644 --- a/objects/DamageTokens.b0ef6c.json +++ b/objects/DamageTokens.b0ef6c.json @@ -56,9 +56,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -41.77, - "posY": 1.648, - "posZ": 28.985, + "posX": -45.4, + "posY": 1.581, + "posZ": 26, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/Detailedphasereference.68fe54.json b/objects/Detailedphasereference.68fe54.json index a4e53dbe..c1acfc78 100644 --- a/objects/Detailedphasereference.68fe54.json +++ b/objects/Detailedphasereference.68fe54.json @@ -43,9 +43,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -60.384, - "posY": 1.325, - "posZ": 86.713, + "posX": -61, + "posY": 1.27, + "posZ": 89, "rotX": 0, "rotY": 270, "rotZ": 0, diff --git a/objects/Doomtokens.16724b.json b/objects/Doomtokens.16724b.json index 485ed82f..4be9bdd7 100644 --- a/objects/Doomtokens.16724b.json +++ b/objects/Doomtokens.16724b.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -41.77, - "posY": 1.649, - "posZ": 31.207, + "posX": -45.4, + "posY": 1.581, + "posZ": 28.25, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/Doomtokens.16fcd6.json b/objects/Doomtokens.16fcd6.json index e2d3d901..15ad0d79 100644 --- a/objects/Doomtokens.16fcd6.json +++ b/objects/Doomtokens.16fcd6.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -44.558, - "posY": 1.634, - "posZ": -31.182, + "posX": -45.4, + "posY": 1.581, + "posZ": -28.25, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/HandTrigger.0285cc.json b/objects/HandTrigger.0285cc.json index 97fced68..d8eff7f5 100644 --- a/objects/HandTrigger.0285cc.json +++ b/objects/HandTrigger.0285cc.json @@ -32,7 +32,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -27.96, + "posX": -30.5, "posY": 6, "posZ": 36.053, "rotX": 0, diff --git a/objects/HandTrigger.be2f17.json b/objects/HandTrigger.be2f17.json index 80a19e14..ac40365c 100644 --- a/objects/HandTrigger.be2f17.json +++ b/objects/HandTrigger.be2f17.json @@ -32,7 +32,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -27.96, + "posX": -30.5, "posY": 6, "posZ": -36.364, "rotX": 0, diff --git a/objects/Horror.0257d9.json b/objects/Horror.0257d9.json index 6a9ab31a..f933c101 100644 --- a/objects/Horror.0257d9.json +++ b/objects/Horror.0257d9.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -57.882, + "posX": -57.887, "posY": 1.52, - "posZ": -24.902, + "posZ": -24.928, "rotX": 0, - "rotY": 285, + "rotY": 280, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Horror.468e88.json b/objects/Horror.468e88.json index cdda908d..b6a6cb0b 100644 --- a/objects/Horror.468e88.json +++ b/objects/Horror.468e88.json @@ -42,9 +42,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -57.837, + "posX": -57.83, "posY": 1.52, - "posZ": 7.19, + "posZ": 7.229, "rotX": 0, "rotY": 280, "rotZ": 0, diff --git a/objects/Horror.7b5729.json b/objects/Horror.7b5729.json index ba06284c..973828d6 100644 --- a/objects/Horror.7b5729.json +++ b/objects/Horror.7b5729.json @@ -42,9 +42,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -34.234, - "posY": 1.52, - "posZ": 29.394, + "posX": -39.163, + "posY": 1.519, + "posZ": 29.487, "rotX": 0, "rotY": 10, "rotZ": 1, diff --git a/objects/Horror.beb964.json b/objects/Horror.beb964.json index 39d68205..9564ddac 100644 --- a/objects/Horror.beb964.json +++ b/objects/Horror.beb964.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -16.653, + "posX": -21.469, "posY": 1.52, - "posZ": -29.429, + "posZ": -29.42, "rotX": 0, - "rotY": 195, + "rotY": 190, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Horrortokens.7bd2a0.json b/objects/Horrortokens.7bd2a0.json index 1f2cf8a1..6797e278 100644 --- a/objects/Horrortokens.7bd2a0.json +++ b/objects/Horrortokens.7bd2a0.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -42.227, - "posY": 1.632, - "posZ": -28.959, + "posX": -45.4, + "posY": 1.581, + "posZ": -23.75, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/Horrortokens.ae1a4e.json b/objects/Horrortokens.ae1a4e.json index 01e6240f..a2d574d1 100644 --- a/objects/Horrortokens.ae1a4e.json +++ b/objects/Horrortokens.ae1a4e.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -44.101, - "posY": 1.652, - "posZ": 28.985, + "posX": -45.4, + "posY": 1.581, + "posZ": 23.75, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/InvestigatorSkillTracker.af7ed7.json b/objects/InvestigatorSkillTracker.af7ed7.json index b750e89c..8e320a3d 100644 --- a/objects/InvestigatorSkillTracker.af7ed7.json +++ b/objects/InvestigatorSkillTracker.af7ed7.json @@ -46,7 +46,7 @@ ], "Tooltip": true, "Transform": { - "posX": -32.6, + "posX": -37.35, "posY": 1.531, "posZ": 19.35, "rotX": 0, diff --git a/objects/InvestigatorSkillTracker.b4a5f7.json b/objects/InvestigatorSkillTracker.b4a5f7.json index c1b575f9..cbf2123d 100644 --- a/objects/InvestigatorSkillTracker.b4a5f7.json +++ b/objects/InvestigatorSkillTracker.b4a5f7.json @@ -46,7 +46,7 @@ ], "Tooltip": true, "Transform": { - "posX": -47.76, + "posX": -47.75, "posY": 1.531, "posZ": -23.1, "rotX": 0, diff --git a/objects/InvestigatorSkillTracker.e74881.json b/objects/InvestigatorSkillTracker.e74881.json index d6643109..aad443c7 100644 --- a/objects/InvestigatorSkillTracker.e74881.json +++ b/objects/InvestigatorSkillTracker.e74881.json @@ -46,7 +46,7 @@ ], "Tooltip": true, "Transform": { - "posX": -18.6, + "posX": -23.35, "posY": 1.531, "posZ": -19.35, "rotX": 0, diff --git a/objects/LolaNeutral.460250.json b/objects/LolaNeutral.460250.json index 21d24b63..9732283f 100644 --- a/objects/LolaNeutral.460250.json +++ b/objects/LolaNeutral.460250.json @@ -1157,7 +1157,7 @@ ], "Tooltip": true, "Transform": { - "posX": -19.17, + "posX": -23.92, "posY": 1.55, "posZ": -24.845, "rotX": 0, diff --git a/objects/LolaNeutral.7ffb43.json b/objects/LolaNeutral.7ffb43.json index f87b6f78..1b8e0eee 100644 --- a/objects/LolaNeutral.7ffb43.json +++ b/objects/LolaNeutral.7ffb43.json @@ -1157,7 +1157,7 @@ ], "Tooltip": true, "Transform": { - "posX": -34.293, + "posX": -39.043, "posY": 1.55, "posZ": 24.864, "rotX": 0, diff --git a/objects/LolaNeutral.a1e2a3.json b/objects/LolaNeutral.a1e2a3.json index cedc49b2..90ee3bcf 100644 --- a/objects/LolaNeutral.a1e2a3.json +++ b/objects/LolaNeutral.a1e2a3.json @@ -1157,7 +1157,7 @@ ], "Tooltip": true, "Transform": { - "posX": -18.025, + "posX": -22.776, "posY": 1.55, "posZ": -24.845, "rotX": 0, diff --git a/objects/LolaNeutral.a7c0f0.json b/objects/LolaNeutral.a7c0f0.json index 9b55d8b9..9c7a4e9f 100644 --- a/objects/LolaNeutral.a7c0f0.json +++ b/objects/LolaNeutral.a7c0f0.json @@ -1157,9 +1157,9 @@ ], "Tooltip": true, "Transform": { - "posX": -20.049, + "posX": -24.91, "posY": 1.55, - "posZ": -24.78, + "posZ": -24.84, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/LolaNeutral.b8409d.json b/objects/LolaNeutral.b8409d.json index e01f8186..af6b8e3f 100644 --- a/objects/LolaNeutral.b8409d.json +++ b/objects/LolaNeutral.b8409d.json @@ -1157,7 +1157,7 @@ ], "Tooltip": true, "Transform": { - "posX": -32.011, + "posX": -36.761, "posY": 1.55, "posZ": 24.864, "rotX": 0, diff --git a/objects/LolaNeutral.bf7cc9.json b/objects/LolaNeutral.bf7cc9.json index 4d221ec0..ccd541ff 100644 --- a/objects/LolaNeutral.bf7cc9.json +++ b/objects/LolaNeutral.bf7cc9.json @@ -1157,9 +1157,9 @@ ], "Tooltip": true, "Transform": { - "posX": -30.997, + "posX": -35.77, "posY": 1.55, - "posZ": 24.81, + "posZ": 24.86, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/LolaNeutral.bfcaf4.json b/objects/LolaNeutral.bfcaf4.json index b0b1021b..9990e4b2 100644 --- a/objects/LolaNeutral.bfcaf4.json +++ b/objects/LolaNeutral.bfcaf4.json @@ -1157,7 +1157,7 @@ ], "Tooltip": true, "Transform": { - "posX": -16.887, + "posX": -21.638, "posY": 1.55, "posZ": -24.845, "rotX": 0, diff --git a/objects/LolaNeutral.d7910b.json b/objects/LolaNeutral.d7910b.json index 91f903e4..c937b1ad 100644 --- a/objects/LolaNeutral.d7910b.json +++ b/objects/LolaNeutral.d7910b.json @@ -1157,7 +1157,7 @@ ], "Tooltip": true, "Transform": { - "posX": -33.149, + "posX": -37.899, "posY": 1.55, "posZ": 24.864, "rotX": 0, diff --git a/objects/Playermat3Green.383d8b.json b/objects/Playermat3Green.383d8b.json index dae537d8..bfe1d4af 100644 --- a/objects/Playermat3Green.383d8b.json +++ b/objects/Playermat3Green.383d8b.json @@ -145,30 +145,6 @@ "Asset" ] }, - { - "Position": { - "x": 1.37, - "y": 0.1, - "z": -0.637 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "Position": { - "x": 0.914, - "y": 0.1, - "z": -0.637 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, { "Position": { "x": -1.817, @@ -282,7 +258,7 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -25.6, + "posX": -30.35, "posY": 1.45, "posZ": 26.6, "rotX": 0, diff --git a/objects/Playermat4Red.0840d5.json b/objects/Playermat4Red.0840d5.json index bb8fbfac..52126c46 100644 --- a/objects/Playermat4Red.0840d5.json +++ b/objects/Playermat4Red.0840d5.json @@ -179,30 +179,6 @@ "z": 0 } }, - { - "Position": { - "x": 0.911, - "y": 0.1, - "z": -0.641 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "Position": { - "x": 1.367, - "y": 0.1, - "z": -0.641 - }, - "Rotation": { - "x": 0, - "y": 0, - "z": 0 - } - }, { "Position": { "x": -0.982, @@ -282,7 +258,7 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -25.6, + "posX": -30.35, "posY": 1.45, "posZ": -26.6, "rotX": 0, diff --git a/objects/Resources.4406f0.json b/objects/Resources.4406f0.json index d3ca7508..d0ad1b7c 100644 --- a/objects/Resources.4406f0.json +++ b/objects/Resources.4406f0.json @@ -42,9 +42,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -59.774, + "posX": -59.817, "posY": 1.52, - "posZ": 7.535, + "posZ": 7.617, "rotX": 0, "rotY": 280, "rotZ": 0, diff --git a/objects/Resources.816d84.json b/objects/Resources.816d84.json index d95532fe..de7dc10a 100644 --- a/objects/Resources.816d84.json +++ b/objects/Resources.816d84.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -59.793, + "posX": -59.798, "posY": 1.52, - "posZ": -24.544, + "posZ": -24.571, "rotX": 0, - "rotY": 285, + "rotY": 280, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Resources.a4b60d.json b/objects/Resources.a4b60d.json index bfbec567..16acd881 100644 --- a/objects/Resources.a4b60d.json +++ b/objects/Resources.a4b60d.json @@ -42,11 +42,11 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -17.037, + "posX": -21.914, "posY": 1.52, - "posZ": -31.384, + "posZ": -31.433, "rotX": 0, - "rotY": 195, + "rotY": 190, "rotZ": 0, "scaleX": 0.26, "scaleY": 1, diff --git a/objects/Resources.cd15ac.json b/objects/Resources.cd15ac.json index d232153d..d87f1ff2 100644 --- a/objects/Resources.cd15ac.json +++ b/objects/Resources.cd15ac.json @@ -42,9 +42,9 @@ "Sticky": true, "Tooltip": false, "Transform": { - "posX": -33.889, + "posX": -38.812, "posY": 1.52, - "posZ": 31.335, + "posZ": 31.434, "rotX": 0, "rotY": 10, "rotZ": 0, diff --git a/objects/Resourcetokens.0168ae.json b/objects/Resourcetokens.0168ae.json index 27fe1446..b8a1b238 100644 --- a/objects/Resourcetokens.0168ae.json +++ b/objects/Resourcetokens.0168ae.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -44.105, - "posY": 1.651, - "posZ": 26.75, + "posX": -45.4, + "posY": 1.581, + "posZ": 21.5, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/Resourcetokens.fd617a.json b/objects/Resourcetokens.fd617a.json index 5d83bd6b..5aacb91e 100644 --- a/objects/Resourcetokens.fd617a.json +++ b/objects/Resourcetokens.fd617a.json @@ -46,9 +46,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -42.223, - "posY": 1.633, - "posZ": -26.724, + "posX": -45.4, + "posY": 1.581, + "posZ": -21.5, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/Custom_Tile.2eca7c.json b/objects/RoundSequenceActionDescription.2eca7c.json similarity index 90% rename from objects/Custom_Tile.2eca7c.json rename to objects/RoundSequenceActionDescription.2eca7c.json index 2aa56b96..0ccd6c89 100644 --- a/objects/Custom_Tile.2eca7c.json +++ b/objects/RoundSequenceActionDescription.2eca7c.json @@ -37,14 +37,14 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", - "Nickname": "", + "Nickname": "Round Sequence / Action Description", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": -43.21, - "posY": 1.55, - "posZ": 22.5, + "posX": -57, + "posY": 1.255, + "posZ": 48, "rotX": 0, "rotY": 270, "rotZ": 0, diff --git a/objects/Custom_Tile.fb09d4.json b/objects/RoundSequenceActionDescription.fb09d4.json similarity index 90% rename from objects/Custom_Tile.fb09d4.json rename to objects/RoundSequenceActionDescription.fb09d4.json index b9c0f17f..c78e8b51 100644 --- a/objects/Custom_Tile.fb09d4.json +++ b/objects/RoundSequenceActionDescription.fb09d4.json @@ -37,14 +37,14 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Custom_Tile", - "Nickname": "", + "Nickname": "Round Sequence / Action Description", "Snap": true, "Sticky": true, "Tooltip": true, "Transform": { - "posX": -43.21, - "posY": 1.55, - "posZ": -22.5, + "posX": -65, + "posY": 1.355, + "posZ": 48, "rotX": 0, "rotY": 270, "rotZ": 180, diff --git a/objects/RulesIndex.91c83e.json b/objects/RulesIndex.91c83e.json index bbbf924f..58e9b8fe 100644 --- a/objects/RulesIndex.91c83e.json +++ b/objects/RulesIndex.91c83e.json @@ -43,9 +43,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -60.748, - "posY": 1.316, - "posZ": 54.855, + "posX": -61, + "posY": 1.27, + "posZ": 59, "rotX": 0, "rotY": 270, "rotZ": 0, diff --git a/objects/ScriptingTrigger.18538f.json b/objects/ScriptingTrigger.18538f.json index 03a8eebc..8733e093 100644 --- a/objects/ScriptingTrigger.18538f.json +++ b/objects/ScriptingTrigger.18538f.json @@ -31,7 +31,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -14.05, + "posX": -18.8, "posY": 1.481, "posZ": -28.6, "rotX": 0, diff --git a/objects/ScriptingTrigger.57c22c.json b/objects/ScriptingTrigger.57c22c.json index fde6e563..a152fd4c 100644 --- a/objects/ScriptingTrigger.57c22c.json +++ b/objects/ScriptingTrigger.57c22c.json @@ -31,7 +31,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -27.977, + "posX": -30.5, "posY": 4.076, "posZ": -37.889, "rotX": 0, diff --git a/objects/ScriptingTrigger.67ce9a.json b/objects/ScriptingTrigger.67ce9a.json index 126a01bc..5a3529d7 100644 --- a/objects/ScriptingTrigger.67ce9a.json +++ b/objects/ScriptingTrigger.67ce9a.json @@ -31,7 +31,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -28.046, + "posX": -30.5, "posY": 4.065, "posZ": 37.669, "rotX": 0, diff --git a/objects/ScriptingTrigger.fb28e1.json b/objects/ScriptingTrigger.fb28e1.json index f0d9ec82..24cb97b9 100644 --- a/objects/ScriptingTrigger.fb28e1.json +++ b/objects/ScriptingTrigger.fb28e1.json @@ -31,7 +31,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -37.15, + "posX": -41.9, "posY": 1.468, "posZ": 28.6, "rotX": 0, diff --git a/objects/Trash.4b8594.json b/objects/Trash.4b8594.json index ac64bcfc..f93d73c2 100644 --- a/objects/Trash.4b8594.json +++ b/objects/Trash.4b8594.json @@ -46,7 +46,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -37.497, + "posX": -42.25, "posY": 1.653, "posZ": -19.3, "rotX": 0, diff --git a/objects/Trash.5f896a.json b/objects/Trash.5f896a.json index f29269ec..9de436ed 100644 --- a/objects/Trash.5f896a.json +++ b/objects/Trash.5f896a.json @@ -46,7 +46,7 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -37.5, + "posX": -42.25, "posY": 1.664, "posZ": 19.3, "rotX": 0, From 1b52853852228e11995f5cd9be5677a587801c63 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Fri, 30 Dec 2022 23:57:55 +0100 Subject: [PATCH 15/31] moving spawn location of hand helpers --- src/core/Global.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 64389386..01c0729a 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -833,8 +833,8 @@ function applyOptionPanelChange(id, state) elseif id == "showHandHelper" then optionPanel[id][1] = spawnOrRemoveHelper(state, "Hand Helper", {-50.84, 1.6, 7.02}, {0, 270, 0}, "White") optionPanel[id][2] = spawnOrRemoveHelper(state, "Hand Helper", {-50.90, 1.6, -25.10}, {0, 270, 0}, "Orange") - optionPanel[id][3] = spawnOrRemoveHelper(state, "Hand Helper", {-34.38, 1.6, 22.44}, {0, 000, 0}, "Green") - optionPanel[id][4] = spawnOrRemoveHelper(state, "Hand Helper", {-16.69, 1.6, -22.42}, {0, 180, 0}, "Red") + optionPanel[id][3] = spawnOrRemoveHelper(state, "Hand Helper", {-39.27, 1.6, 22.44}, {0, 000, 0}, "Green") + optionPanel[id][4] = spawnOrRemoveHelper(state, "Hand Helper", {-21.51, 1.6, -22.44}, {0, 180, 0}, "Red") -- option: Show chaos bag manager elseif id == "showChaosBagManager" then From a4e7549d47ec2861e5e20468e1aba110a83f6a85 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 31 Dec 2022 00:00:08 +0100 Subject: [PATCH 16/31] moving hand zones --- objects/HandTrigger.5fe087.json | 4 ++-- objects/HandTrigger.a70eee.json | 4 ++-- objects/ScriptingTrigger.c506bf.json | 2 +- objects/ScriptingTrigger.cbc751.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/objects/HandTrigger.5fe087.json b/objects/HandTrigger.5fe087.json index cf44b919..0ea988e6 100644 --- a/objects/HandTrigger.5fe087.json +++ b/objects/HandTrigger.5fe087.json @@ -32,9 +32,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -65.72, + "posX": -65.7, "posY": 6, - "posZ": -13.61, + "posZ": -15.5, "rotX": 0, "rotY": 90, "rotZ": 0, diff --git a/objects/HandTrigger.a70eee.json b/objects/HandTrigger.a70eee.json index 6f58ee22..9fcb112a 100644 --- a/objects/HandTrigger.a70eee.json +++ b/objects/HandTrigger.a70eee.json @@ -32,9 +32,9 @@ "Sticky": true, "Tooltip": true, "Transform": { - "posX": -65.581, + "posX": -65.7, "posY": 6, - "posZ": 13.55, + "posZ": 15.5, "rotX": 0, "rotY": 90, "rotZ": 0, diff --git a/objects/ScriptingTrigger.c506bf.json b/objects/ScriptingTrigger.c506bf.json index 695081e6..19c5df83 100644 --- a/objects/ScriptingTrigger.c506bf.json +++ b/objects/ScriptingTrigger.c506bf.json @@ -33,7 +33,7 @@ "Transform": { "posX": -66.804, "posY": 4.135, - "posZ": 13.565, + "posZ": 15.5, "rotX": 0, "rotY": 90, "rotZ": 0, diff --git a/objects/ScriptingTrigger.cbc751.json b/objects/ScriptingTrigger.cbc751.json index 83b2850d..679e59d0 100644 --- a/objects/ScriptingTrigger.cbc751.json +++ b/objects/ScriptingTrigger.cbc751.json @@ -33,7 +33,7 @@ "Transform": { "posX": -66.963, "posY": 4.117, - "posZ": -13.277, + "posZ": -15.5, "rotX": 0, "rotY": 90, "rotZ": 0, From f5ac476e35e4a1ddd7f7aaa1fd598126a1d8e349 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 31 Dec 2022 00:14:02 +0100 Subject: [PATCH 17/31] changing broadcast color --- objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index 115b4792..71ce480b 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -14,7 +14,7 @@ function shortSupply(color) -- error handling if discardPos == nil then - broadcastToAll("Couldn't retrieve discard position from playermat!", "Red") + broadcastToColor("Couldn't retrieve discard position from playermat!", color, "Red") return end From 405bbc0cfdb490d8a40c9075e082f830742033b6 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 31 Dec 2022 02:41:08 +0100 Subject: [PATCH 18/31] reordering plus snap points --- modsettings/SnapPoints.json | 70 ++++++++++++++++++++++++++++++++ objects/Cluetokens.3b2550.json | 2 +- objects/Cluetokens.fae2f6.json | 2 +- objects/DamageTokens.93f4a0.json | 2 +- objects/DamageTokens.b0ef6c.json | 2 +- objects/Doomtokens.16724b.json | 2 +- objects/Doomtokens.16fcd6.json | 2 +- objects/Horrortokens.7bd2a0.json | 2 +- objects/Horrortokens.ae1a4e.json | 2 +- 9 files changed, 78 insertions(+), 8 deletions(-) diff --git a/modsettings/SnapPoints.json b/modsettings/SnapPoints.json index a6cf1c4f..11cad351 100644 --- a/modsettings/SnapPoints.json +++ b/modsettings/SnapPoints.json @@ -4251,5 +4251,75 @@ "y": 0, "z": 0 } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": 21.5 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": 23.75 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": 26 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": 28.25 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": 30.5 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": -21.5 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": -23.75 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": -26 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": -28.25 + } + }, + { + "Position": { + "x": -45.4, + "y": 1.481, + "z": -30.5 + } } ] diff --git a/objects/Cluetokens.3b2550.json b/objects/Cluetokens.3b2550.json index 86339167..9724ad44 100644 --- a/objects/Cluetokens.3b2550.json +++ b/objects/Cluetokens.3b2550.json @@ -48,7 +48,7 @@ "Transform": { "posX": -45.4, "posY": 1.561, - "posZ": -30.5, + "posZ": -28.25, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/Cluetokens.fae2f6.json b/objects/Cluetokens.fae2f6.json index 07e31919..0ce0296e 100644 --- a/objects/Cluetokens.fae2f6.json +++ b/objects/Cluetokens.fae2f6.json @@ -48,7 +48,7 @@ "Transform": { "posX": -45.4, "posY": 1.561, - "posZ": 30.5, + "posZ": 28.25, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/DamageTokens.93f4a0.json b/objects/DamageTokens.93f4a0.json index 75c6a925..07d4c640 100644 --- a/objects/DamageTokens.93f4a0.json +++ b/objects/DamageTokens.93f4a0.json @@ -58,7 +58,7 @@ "Transform": { "posX": -45.4, "posY": 1.581, - "posZ": -26, + "posZ": -23.75, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/DamageTokens.b0ef6c.json b/objects/DamageTokens.b0ef6c.json index 7eba8a5b..a1581f63 100644 --- a/objects/DamageTokens.b0ef6c.json +++ b/objects/DamageTokens.b0ef6c.json @@ -58,7 +58,7 @@ "Transform": { "posX": -45.4, "posY": 1.581, - "posZ": 26, + "posZ": 23.75, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/Doomtokens.16724b.json b/objects/Doomtokens.16724b.json index 4be9bdd7..7cfbffa0 100644 --- a/objects/Doomtokens.16724b.json +++ b/objects/Doomtokens.16724b.json @@ -48,7 +48,7 @@ "Transform": { "posX": -45.4, "posY": 1.581, - "posZ": 28.25, + "posZ": 30.5, "rotX": 0, "rotY": 0, "rotZ": 0, diff --git a/objects/Doomtokens.16fcd6.json b/objects/Doomtokens.16fcd6.json index 15ad0d79..a078b6b6 100644 --- a/objects/Doomtokens.16fcd6.json +++ b/objects/Doomtokens.16fcd6.json @@ -48,7 +48,7 @@ "Transform": { "posX": -45.4, "posY": 1.581, - "posZ": -28.25, + "posZ": -30.5, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/Horrortokens.7bd2a0.json b/objects/Horrortokens.7bd2a0.json index 6797e278..4cc4205d 100644 --- a/objects/Horrortokens.7bd2a0.json +++ b/objects/Horrortokens.7bd2a0.json @@ -48,7 +48,7 @@ "Transform": { "posX": -45.4, "posY": 1.581, - "posZ": -23.75, + "posZ": -26, "rotX": 0, "rotY": 180, "rotZ": 0, diff --git a/objects/Horrortokens.ae1a4e.json b/objects/Horrortokens.ae1a4e.json index a2d574d1..a3630870 100644 --- a/objects/Horrortokens.ae1a4e.json +++ b/objects/Horrortokens.ae1a4e.json @@ -48,7 +48,7 @@ "Transform": { "posX": -45.4, "posY": 1.581, - "posZ": 23.75, + "posZ": 26, "rotX": 0, "rotY": 0, "rotZ": 0, From 3c240dcdc8f514add45505072aa8212bf1b444a0 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Sat, 31 Dec 2022 02:57:50 +0100 Subject: [PATCH 19/31] removing unused function --- .../AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua | 2 +- src/playermat/PlaymatApi.ttslua | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua index 71ce480b..548ea019 100644 --- a/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua +++ b/objects/AllPlayerCards.15bb07/ShortSupply.e5f541.ttslua @@ -6,7 +6,7 @@ end -- called by context menu entry function shortSupply(color) - local matColor = playmatAPI.getMatColorbyPosition(self.getPosition()) + local matColor = playmatAPI.getMatColorByPosition(self.getPosition()) -- get draw deck and discard position local drawDeck = playmatAPI.getDrawDeck(matColor) diff --git a/src/playermat/PlaymatApi.ttslua b/src/playermat/PlaymatApi.ttslua index 25aaaea2..621c22de 100644 --- a/src/playermat/PlaymatApi.ttslua +++ b/src/playermat/PlaymatApi.ttslua @@ -23,20 +23,9 @@ do Red = "4111de" } - -- Returns the by color requested playermat as object - ---@param matColor String Color of the playermat to return - PlaymatApi.getMatbyColor = function(matColor) - local mat = getObjectFromGUID(MAT_IDS[matColor]) - - if mat == nil then - broadcastToAll(playerColor .. " playermat could not be found!", "Yellow") - end - return mat - end - -- Returns the color of the by position requested playermat as string ---@param startPos Table Position of the search, table get's roughly cut into 4 quarters to assign a playermat - PlaymatApi.getMatColorbyPosition = function(startPos) + PlaymatApi.getMatColorByPosition = function(startPos) if startPos.x < -42 then if startPos.z > 0 then return "White" From 2239133013c2439c3ae813be84bd34813721c3f7 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Fri, 30 Dec 2022 20:43:04 -0800 Subject: [PATCH 20/31] Disable automatic location connections for some scenarios The excluded scenarios have very complex connection limitations beyond what's on the cards; we should handle them eventually, but for now we just don't draw the connections for those scenarios. --- src/core/PlayArea.ttslua | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index cf81fe85..5afff938 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -35,6 +35,10 @@ local SHIFT_EXCLUSION = { ["f182ee"] = true, ["721ba2"] = true } +local LOC_LINK_EXCLUDE_SCENARIOS = { + ["Devil Reef"] = true, + ["The Witching Hour"] = true, +} local INVESTIGATOR_COUNTER_GUID = "f182ee" local PLAY_AREA_ZONE_GUID = "a2f932" @@ -119,7 +123,7 @@ end function onObjectPickUp(player, object) -- onCollisionExit fires first, so we have to check the card to see if it's a location we should -- be tracking - if isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= "" then + if showLocationLinks() and isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= "" then local pickedUpGuid = object.getGUID() local metadata = JSON.decode(object.getGMNotes()) if (metadata.type == "Location") then @@ -157,7 +161,7 @@ end function maybeTrackLocation(card) -- Collision checks for any part of the card overlap, but our other tracking is centerpoint -- Ignore any collision where the centerpoint isn't in the area - if isInPlayArea(card) then + if showLocationLinks() and isInPlayArea(card) then local metadata = JSON.decode(card.getGMNotes()) or { } if metadata.type == "Location" then locations[card.getGUID()] = metadata @@ -187,6 +191,11 @@ end -- but does not draw those connections. This should often be followed by a call to -- drawConnections() function rebuildConnectionList() + if not showLocationLinks() then + locationConnections = { } + return + end + local iconCardList = { } -- Build a list of cards with each icon as their location ID @@ -268,6 +277,10 @@ end -- Draws the lines for connections currently in locationConnections. function drawConnections() + if not showLocationLinks() then + locationConnections = { } + return + end local cardConnectionLines = { } for originGuid, targetGuids in pairs(locationConnections) do @@ -422,4 +435,11 @@ end function onScenarioChanged(scenarioName) currentScenario = scenarioName + if not showLocationLinks() then + broadcastToAll("Automatic location connections not available for this scenario") + end +end + +function showLocationLinks() + return not LOC_LINK_EXCLUDE_SCENARIOS[currentScenario] end From aec6163e442e866cfaad487541951d2f23bd900b Mon Sep 17 00:00:00 2001 From: Buhallin Date: Sat, 31 Dec 2022 20:51:18 -0800 Subject: [PATCH 21/31] Add Unified Player Card panel - Adds the new player card panel - Wires up buttons to functions for spawning cards - Adds cycle, weakness, bonded, and upgrade sheet spawn handling --- config.json | 3 +- objects/PlayerCards.2d30ee.json | 57 +++ src/arkhamdb/ArkhamDb.ttslua | 9 - src/playercards/AllCardsBag.ttslua | 67 ++- src/playercards/PlayerCardPanel.ttslua | 570 +++++++++++++-------- src/playercards/PlayerCardPanelData.ttslua | 50 +- 6 files changed, 498 insertions(+), 258 deletions(-) create mode 100644 objects/PlayerCards.2d30ee.json diff --git a/config.json b/config.json index 2adead0d..0cd2293c 100644 --- a/config.json +++ b/config.json @@ -250,7 +250,8 @@ "TokenSpawnTracker.e3ffc9", "TokenSource.124381", "GameData.3dbe47", - "SCEDTour.0e5aa8" + "SCEDTour.0e5aa8", + "PlayerCards.2d30ee" ], "PlayArea": 1, "PlayerCounts": [ diff --git a/objects/PlayerCards.2d30ee.json b/objects/PlayerCards.2d30ee.json new file mode 100644 index 00000000..8bea32fe --- /dev/null +++ b/objects/PlayerCards.2d30ee.json @@ -0,0 +1,57 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 1, + "g": 1, + "r": 1 + }, + "CustomImage": { + "CustomTile": { + "Stackable": false, + "Stretch": true, + "Thickness": 0.1, + "Type": 3 + }, + "ImageScalar": 1, + "ImageSecondaryURL": "https://i.imgur.com/dISlnEk.jpg", + "ImageURL": "https://i.imgur.com/dISlnEk.jpg", + "WidthScale": 0 + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "2d30ee", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": false, + "LuaScript": "require(\"playercards/PlayerCardPanel\")", + "LuaScriptState": "{\"spawnBagState\":{\"placed\":[],\"placedObjects\":[]}}", + "MeasureMovement": false, + "Name": "Custom_Tile", + "Nickname": "Player Cards", + "Snap": true, + "Sticky": true, + "Tooltip": false, + "Transform": { + "posX": -1.083, + "posY": 1.255, + "posZ": 69.985, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 9.39, + "scaleY": 1, + "scaleZ": 9.39 + }, + "Value": 0, + "XmlUI": "" +} diff --git a/src/arkhamdb/ArkhamDb.ttslua b/src/arkhamdb/ArkhamDb.ttslua index 63ed2ffe..97f853f0 100644 --- a/src/arkhamdb/ArkhamDb.ttslua +++ b/src/arkhamdb/ArkhamDb.ttslua @@ -134,15 +134,6 @@ do internal.maybePrint(table.concat({ "Found decklist: ", deck.name }), playerColor) - log(table.concat({ "-", deck.name, "-" })) - for k, v in pairs(deck) do - if type(v) == "table" then - log(table.concat { k, ": " }) - else - log(table.concat { k, ": ", tostring(v) }) - end - end - -- Initialize deck slot table and perform common transformations. The order of these should not -- be changed, as later steps may act on cards added in each. For example, a random weakness or -- investigator may have bonded cards or taboo entries, and should be present diff --git a/src/playercards/AllCardsBag.ttslua b/src/playercards/AllCardsBag.ttslua index a59a1cb6..a5954e2d 100644 --- a/src/playercards/AllCardsBag.ttslua +++ b/src/playercards/AllCardsBag.ttslua @@ -7,6 +7,8 @@ local WEAKNESS_CHECK_Z = 37 local cardIdIndex = { } local classAndLevelIndex = { } local basicWeaknessList = { } +local uniqueWeaknessList = { } +local cycleIndex = { } local indexingDone = false local allowRemoval = false @@ -45,7 +47,9 @@ function clearIndexes() classAndLevelIndex["Survivor-level0"] = { } classAndLevelIndex["Rogue-level0"] = { } classAndLevelIndex["Neutral-level0"] = { } + cycleIndex = { } basicWeaknessList = { } + uniqueWeaknessList = { } end -- Clears the bag indexes and starts the coroutine to rebuild the indexes @@ -121,27 +125,27 @@ function buildSupplementalIndexes() local cardMetadata = card.metadata -- If the ID key and the metadata ID don't match this is a duplicate card created by an -- alternate_id, and we should skip it - if (cardId == cardMetadata.id) then + if cardId == cardMetadata.id then -- Add card to the basic weakness list, if appropriate. Some weaknesses have -- multiple copies, and are added multiple times - if (cardMetadata.weakness and cardMetadata.basicWeaknessCount ~= nil) then + if cardMetadata.weakness and cardMetadata.basicWeaknessCount ~= nil then + table.insert(uniqueWeaknessList, cardMetadata.id) for i = 1, cardMetadata.basicWeaknessCount do table.insert(basicWeaknessList, cardMetadata.id) + end end - end - table.sort(basicWeaknessList, cardComparator) - -- Add the card to the appropriate class and level indexes - local isGuardian = false - local isSeeker = false - local isMystic = false - local isRogue = false - local isSurvivor = false - local isNeutral = false - local upgradeKey - -- Excludes signature cards (which have no class or level) and alternate - -- ID entries - if (cardMetadata.class ~= nil and cardMetadata.level ~= nil) then + -- Add the card to the appropriate class and level indexes + local isGuardian = false + local isSeeker = false + local isMystic = false + local isRogue = false + local isSurvivor = false + local isNeutral = false + local upgradeKey + -- Excludes signature cards (which have no class or level) and alternate + -- ID entries + if (cardMetadata.class ~= nil and cardMetadata.level ~= nil) then isGuardian = string.match(cardMetadata.class, "Guardian") isSeeker = string.match(cardMetadata.class, "Seeker") isMystic = string.match(cardMetadata.class, "Mystic") @@ -171,12 +175,32 @@ function buildSupplementalIndexes() if (isNeutral) then table.insert(classAndLevelIndex["Neutral"..upgradeKey], cardMetadata.id) end + + local cycleName = cardMetadata.cycle + if cycleName ~= nil then + cycleName = string.lower(cycleName) + if string.match(cycleName, "return") then + cycleName = string.sub(cycleName, 11) + end + if cycleName == "the night of the zealot" then + cycleName = "core" + end + if cycleIndex[cycleName] == nil then + cycleIndex[cycleName] = { } + end + table.insert(cycleIndex[cycleName], cardMetadata.id) + end end end end for _, indexTable in pairs(classAndLevelIndex) do table.sort(indexTable, cardComparator) end + for _, indexTable in pairs(cycleIndex) do + table.sort(indexTable) + end + table.sort(basicWeaknessList, cardComparator) + table.sort(uniqueWeaknessList, cardComparator) end -- Comparison function used to sort the class card bag indexes. Sorts by card @@ -235,6 +259,14 @@ function getCardsByClassAndLevel(params) return classAndLevelIndex[params.class..upgradeKey]; end +function getCardsByCycle(cycleName) + if (not indexingDone) then + broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) + return { } + end + return cycleIndex[string.lower(cycleName)] +end + -- Searches the bag for cards which match the given name and returns a list. Note that this is -- an O(n) search without index support. It may be slow. -- Parameter array must contain these fields to define the search: @@ -303,6 +335,10 @@ function getBasicWeaknesses() return basicWeaknessList end +function getUniqueWeaknesses() + return uniqueWeaknessList +end + -- Helper function that adds one to the table entry for the number of weaknesses in play function incrementWeaknessCount(table, cardMetadata) if (isBasicWeakness(cardMetadata)) then @@ -322,6 +358,7 @@ function isInPlayArea(object) return position.x < WEAKNESS_CHECK_X and position.z < WEAKNESS_CHECK_Z end + function isBasicWeakness(cardMetadata) return cardMetadata ~= nil and cardMetadata.weakness diff --git a/src/playercards/PlayerCardPanel.ttslua b/src/playercards/PlayerCardPanel.ttslua index d6ad9f29..9b85aa2b 100644 --- a/src/playercards/PlayerCardPanel.ttslua +++ b/src/playercards/PlayerCardPanel.ttslua @@ -2,24 +2,49 @@ require("playercards/PlayerCardPanelData") local spawnBag = require("playercards/spawnbag/SpawnBag") local arkhamDb = require("arkhamdb/ArkhamDb") --- TODO: Update when the real UI image is in place -local BUTTON_WIDTH = 150 -local BUTTON_HEIGHT = 550 +-- Size and position information for the three rows of class buttons +local CIRCLE_BUTTON_SIZE = 250 +local CLASS_BUTTONS_X_OFFSET = 0.1325 +local INVESTIGATOR_ROW_START = Vector(0.125, 0.1, -0.447) +local LEVEL_ZERO_ROW_START = Vector(0.125, 0.1, -0.007) +local UPGRADED_ROW_START = Vector(0.125, 0.1, 0.333) + +-- Size and position information for the two blocks of other buttons +local MISC_BUTTONS_X_OFFSET = 0.155 +local WEAKNESS_ROW_START = Vector(0.157, 0.1, 0.666) +local OTHER_ROW_START = Vector(0.605, 0.1, 0.666) + +-- Size and position information for the Cycle (box) buttons +local CYCLE_BUTTON_SIZE = 468 +local CYCLE_BUTTON_START = Vector(-0.716, 0.1, -0.39) +local CYCLE_COLUMN_COUNT = 3 +local CYCLE_BUTTONS_X_OFFSET = 0.267 +local CYCLE_BUTTONS_Z_OFFSET = 0.2665 local ALL_CARDS_BAG_GUID = "15bb07" +local STARTER_DECK_MODE_SELECTED_COLOR = { 0.2, 0.2, 0.2, 0.8 } +local TRANSPARENT = { 0, 0, 0, 0 } +local STARTER_DECK_MODE_STARTERS = "starters" +local STARTER_DECK_MODE_CARDS_ONLY = "cards" + local FACE_UP_ROTATION = { x = 0, y = 270, z = 0} local FACE_DOWN_ROTATION = { x = 0, y = 270, z = 180} --- Coordinates to begin laying out cards to match the reserved areas of the --- table. Cards will lay out horizontally, then create additional rows +-- Coordinates to begin laying out cards. These vary based on the cards that are being placed local START_POSITIONS = { - skill = Vector(58.384, 1.36, 92.4), - event = Vector(53.229, 1.36, 92.4), - asset = Vector(40.960, 1.36, 92.4), - investigator = Vector(60, 1.36, 80) + classCards = Vector(58.384, 1.36, 92.4), + investigator = Vector(60, 1.36, 86), + cycle = Vector(48, 1.36, 92.4), + other = Vector(56, 1.36, 86), + summonedServitor = Vector(55.5, 1.36, 60.2), + randomWeakness = Vector(55, 1.36, 75) } +-- Shifts to move rows of cards, and groups of rows, as different groupings are laid out +local CARD_ROW_OFFSET = 3.7 +local CARD_GROUP_OFFSET = 2 + -- Position offsets for investigator decks in investigator mode, defines the spacing for how the -- rows and columns are laid out local INVESTIGATOR_POSITION_SHIFT_ROW = Vector(-11, 0, 0) @@ -31,7 +56,21 @@ local INVESTIGATOR_MAX_COLS = 6 local INVESTIGATOR_CARD_OFFSET = Vector(-2.55, 0, 0) local INVESTIGATOR_SIGNATURE_OFFSET = Vector(-5.75, 0, 0) -local spawnStarterDecks = false +local CLASS_LIST = { "Guardian", "Seeker", "Rogue", "Mystic", "Survivor", "Neutral" } +local CYCLE_LIST = { + "Core", + "The Dunwich Legacy", + "The Path to Carcosa", + "The Forgotten Age", + "The Circle Undone", + "The Dream-Eaters", + "The Innsmouth Conspiracy", + "Edge of the Earth", + "The Scarlet Keys", + "Investigator Packs" +} + +local starterDeckMode = STARTER_DECK_MODE_CARDS_ONLY function onSave() local saveState = { @@ -48,232 +87,223 @@ function onLoad(savedData) spawnBag.loadFromSave(saveState.spawnBagState) end end + createButtons() +end - self.createButton({ - label="Guardian", click_function="spawnInvestigatorsGuardian", function_owner=self, - position={-0.3,0.2,-0.5}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Seeker", click_function="spawnInvestigatorsSeeker", function_owner=self, - position={0,0.2,-0.5}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Mystic", click_function="spawnInvestigatorsMystic", function_owner=self, - position={0.3,0.2,-0.5}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Rogue", click_function="spawnInvestigatorsRogue", function_owner=self, - position={-0.3,0.2,-0.4}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Survivor", click_function="spawnSurvivor", function_owner=self, - position={0,0.2,-0.4}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Neutral", click_function="spawnNeutral", function_owner=self, - position={0.3,0.2,-0.4}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) +function createButtons() + createInvestigatorButtons() + createLevelZeroButtons() + createUpgradedButtons() + createWeaknessButtons() + createOtherButtons() + createCycleButtons() + createClearButton() + -- Create investigator mode buttons last so the indexes are set when we need to update them + createInvestigatorModeButtons() +end - self.createButton({ - label="Core", click_function="spawnCore", function_owner=self, - position={-0.3,0.2,-0.2}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Dunwich", click_function="spawnDunwich", function_owner=self, - position={0,0.2,-0.2}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Carcosa", click_function="spawnCarcosa", function_owner=self, - position={0.3,0.2,-0.2}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Forgotten Age", click_function="spawnForgottenAge", function_owner=self, - position={-0.3,0.2,-0.1}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Circle Undone", click_function="spawnCircleUndone", function_owner=self, - position={0,0.2,-0.1}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Dream Eaters", click_function="spawnDreamEaters", function_owner=self, - position={0.3,0.2,-0.1}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Innsmouth", click_function="spawnInnsmouth", function_owner=self, - position={-0.3,0.2,0}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="EotE", click_function="spawnEotE", function_owner=self, - position={0,0.2,0}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Scarlet Keys", click_function="spawnScarletKeys", function_owner=self, - position={0.3,0.2,0}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="InvPacks", click_function="spawnInvestigatorDecks", function_owner=self, - position={-0.3,0.2,0.1}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Investigators", click_function="setInvestigators", function_owner=self, - position={-0.15,0.2,-0.6}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Starters", click_function="setStarters", function_owner=self, - position={0.15,0.2,-0.6}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - - self.createButton({ - label="L0 Guardian", click_function="spawnBasicGuardian", function_owner=self, - position={-0.15,0.2,0.3}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L1-5 Guardian", click_function="spawnUpgradedGuardian", function_owner=self, - position={0.15,0.2,0.3}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L0 Seeker", click_function="spawnBasicSeeker", function_owner=self, - position={-0.15,0.2,0.4}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L1-5 Seeker", click_function="spawnUpgradedSeeker", function_owner=self, - position={0.15,0.2,0.4}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L0 Mystic", click_function="spawnBasicMystic", function_owner=self, - position={-0.15,0.2,0.5}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L1-5 Mystic", click_function="spawnUpgradedGuardian", function_owner=self, - position={0.15,0.2,0.5}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L0 Rogue", click_function="spawnBasicRogue", function_owner=self, - position={-0.15,0.2,0.6}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L1-5 Rogue", click_function="spawnUpgradedRogue", function_owner=self, - position={0.15,0.2,0.6}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L0 Survivor", click_function="spawnBasicSurvivor", function_owner=self, - position={-0.15,0.2,0.7}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L1-5 Survivor", click_function="spawnUpgradedSurvivor", function_owner=self, - position={0.15,0.2,0.7}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L0 Neutral", click_function="spawnBasicNeutral", function_owner=self, - position={-0.15,0.2,0.8}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="L1-5 Neutral", click_function="spawnUpgradedNeutral", function_owner=self, - position={0.15,0.2,0.8}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Clear", click_function="deleteAll", function_owner=self, - position={0.5,0.2,0.9}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - self.createButton({ - label="Weaknesses", click_function="spawnWeaknesses", function_owner=self, - position={-0.5,0.2,0.9}, rotation={0,0,0}, height=BUTTON_WIDTH, width=BUTTON_HEIGHT, - font_size=64, color={0,0,0}, font_color={1,1,1}, scale={0.25, 0.25, 0.25} - }) - local classList = { "Guardian", "Seeker", "Mystic", "Rogue", "Survivor", "Neutral" } - for _, className in ipairs(classList) do - local funcName = "spawnInvestigators"..className - self.setVar(funcName, function(_, _, _) spawnGroup(className) end) - funcName = "spawnBasic"..className - self.setVar(funcName, function(_, _, _) spawnClassCards(className, false) end) - funcName = "spawnUpgraded"..className - self.setVar(funcName, function(_, _, _) spawnClassCards(className, true) end) +function createInvestigatorButtons() + local invButtonParams = { + function_owner = self, + rotation = Vector(0, 0, 0), + height = CIRCLE_BUTTON_SIZE, + width = CIRCLE_BUTTON_SIZE, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + } + local buttonPos = INVESTIGATOR_ROW_START:copy() + for _, class in ipairs(CLASS_LIST) do + invButtonParams.click_function = "spawnInvestigators" .. class + invButtonParams.position = buttonPos + self.createButton(invButtonParams) + buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET + self.setVar(invButtonParams.click_function, function(_, _, _) spawnInvestigatorGroup(class) end) end end --- TODO: Replace these with something less manual once the full data in in place so we know what --- keys to use -function placeCore() - spawnGroup("Core") +function createLevelZeroButtons() + local l0ButtonParams = { + function_owner = self, + rotation = Vector(0, 0, 0), + height = CIRCLE_BUTTON_SIZE, + width = CIRCLE_BUTTON_SIZE, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + } + local buttonPos = LEVEL_ZERO_ROW_START:copy() + for _, class in ipairs(CLASS_LIST) do + l0ButtonParams.click_function = "spawnBasic" .. class + l0ButtonParams.position = buttonPos + self.createButton(l0ButtonParams) + buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET + self.setVar(l0ButtonParams.click_function, function(_, _, _) spawnClassCards(class, false) end) + end end -function placeDunwich() - spawnGroup("Dunwich") +function createUpgradedButtons() + local upgradedButtonParams = { + function_owner = self, + rotation = Vector(0, 0, 0), + height = CIRCLE_BUTTON_SIZE, + width = CIRCLE_BUTTON_SIZE, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + } + local buttonPos = UPGRADED_ROW_START:copy() + for _, class in ipairs(CLASS_LIST) do + upgradedButtonParams.click_function = "spawnUpgraded" .. class + upgradedButtonParams.position = buttonPos + self.createButton(upgradedButtonParams) + buttonPos.x = buttonPos.x + CLASS_BUTTONS_X_OFFSET + self.setVar(upgradedButtonParams.click_function, function(_, _, _) spawnClassCards(class, true) end) + end end -function placeCarcosa() - spawnGroup("Carcosa") +function createWeaknessButtons() + local weaknessButtonParams = { + function_owner = self, + rotation = Vector(0, 0, 0), + height = CIRCLE_BUTTON_SIZE, + width = CIRCLE_BUTTON_SIZE, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + } + local buttonPos = WEAKNESS_ROW_START:copy() + weaknessButtonParams.click_function = "spawnWeaknesses" + weaknessButtonParams.tooltip = "Basic Weaknesses" + weaknessButtonParams.position = buttonPos + self.createButton(weaknessButtonParams) + buttonPos.x = buttonPos.x + MISC_BUTTONS_X_OFFSET + weaknessButtonParams.click_function = "spawnRandomWeakness" + weaknessButtonParams.tooltip = "Random Weakness" + weaknessButtonParams.position = buttonPos + self.createButton(weaknessButtonParams) end -function placeForgottenAge() - spawnGroup("ForgottenAge") +function createOtherButtons() + local otherButtonParams = { + function_owner = self, + rotation = Vector(0, 0, 0), + height = CIRCLE_BUTTON_SIZE, + width = CIRCLE_BUTTON_SIZE, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + } + local buttonPos = OTHER_ROW_START:copy() + otherButtonParams.click_function = "spawnBonded" + otherButtonParams.tooltip = "Bonded Cards" + otherButtonParams.position = buttonPos + self.createButton(otherButtonParams) + buttonPos.x = buttonPos.x + MISC_BUTTONS_X_OFFSET + otherButtonParams.click_function = "spawnUpgradeSheets" + otherButtonParams.tooltip = "Customization Upgrade Sheets" + otherButtonParams.position = buttonPos + self.createButton(otherButtonParams) end -function placeCircleUndone() - spawnGroup("CircleUndone") +function createCycleButtons() + local cycleButtonParams = { + function_owner = self, + rotation = Vector(0, 0, 0), + height = CYCLE_BUTTON_SIZE, + width = CYCLE_BUTTON_SIZE, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + } + local buttonPos = CYCLE_BUTTON_START:copy() + local rowCount = 0 + local colCount = 0 + for _, cycle in ipairs(CYCLE_LIST) do + cycleButtonParams.click_function = "spawnCycle" .. cycle + cycleButtonParams.position = buttonPos + cycleButtonParams.tooltip = cycle + self.createButton(cycleButtonParams) + self.setVar(cycleButtonParams.click_function, function(_, _, _) spawnCycle(cycle) end) + colCount = colCount + 1 + -- If we've reached the end of a row, shift down and back to the first column + if colCount >= CYCLE_COLUMN_COUNT then + buttonPos = CYCLE_BUTTON_START:copy() + rowCount = rowCount + 1 + colCount = 0 + buttonPos.z = buttonPos.z + CYCLE_BUTTONS_Z_OFFSET * rowCount + if rowCount == 3 then + -- Account for centered button on the final row + buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET + end + else + buttonPos.x = buttonPos.x + CYCLE_BUTTONS_X_OFFSET + end + end end -function placeDreamEaters() - spawnGroup("DreamEaters") +function createClearButton() + self.createButton({ + function_owner = self, + click_function = "deleteAll", + position = Vector(0, 0.1, 0.852), + rotation = Vector(0, 0, 0), + height = 170, + width = 750, + scale = Vector(0.25, 1, 0.25), + color = TRANSPARENT, + }) end -function placeInnsmouth() - spawnGroup("Innsmouth") +function createInvestigatorModeButtons() + local starterMode = starterDeckMode == STARTER_DECK_MODE_STARTERS + + self.createButton({ + function_owner = self, + click_function = "setCardsOnlyMode", + position = Vector(0.251, 0.1, -0.322), + rotation = Vector(0, 0, 0), + height = 170, + width = 760, + scale = Vector(0.25, 1, 0.25), + color = starterMode and TRANSPARENT or STARTER_DECK_MODE_SELECTED_COLOR + }) + self.createButton({ + function_owner = self, + click_function = "setStarterDeckMode", + position = Vector(0.66, 0.1, -0.322), + rotation = Vector(0, 0, 0), + height = 170, + width = 760, + scale = Vector(0.25, 1, 0.25), + color = starterMode and STARTER_DECK_MODE_SELECTED_COLOR or TRANSPARENT + }) + local checkX = starterMode and 0.52 or 0.11 + self.createButton({ + function_owner = self, + label = "✓", + click_function = "doNothing", + position = Vector(checkX, 0.11, -0.317), + rotation = Vector(0, 0, 0), + height = 0, + width = 0, + scale = Vector(0.3, 1, 0.3), + font_color = { 0, 0, 0 }, + color = { 1, 1, 1 } + }) end -function placeEotE() - spawnGroup("EotE") +function setStarterDeckMode() + starterDeckMode = STARTER_DECK_MODE_STARTERS + updateStarterModeButtons() end -function placeScarletKeys() - spawnGroup("ScarletKeys") +function setCardsOnlyMode() + starterDeckMode = STARTER_DECK_MODE_CARDS_ONLY + updateStarterModeButtons() end -function placeInvestigatorDecks() - spawnGroup("InvestigatorDecks") -end - --- UI handler to put the investigator spawn in investigator mode. -function setInvestigators() - spawnStarterDecks = false - printToAll("Spawning investigator piles") -end - --- UI handler to put the investigator spawn in starter deck mode. -function setStarters() - spawnStarterDecks = true - printToAll("Spawning starter decks") +function updateStarterModeButtons() + local buttonCount = #self.getButtons() + -- Buttons are 0-indexed, so the last three are -1, -2, and -3 from the size + self.removeButton(buttonCount - 1) + self.removeButton(buttonCount - 2) + self.removeButton(buttonCount - 3) + createInvestigatorModeButtons() end -- Deletes all cards currently placed on the table @@ -284,10 +314,11 @@ end -- Spawn an investigator group, based on the current UI setting for either investigators or starter -- decks. ---@param groupName String. Name of the group to spawn, matching a key in InvestigatorPanelData -function spawnGroup(groupName) +function spawnInvestigatorGroup(groupName) + local starterMode = starterDeckMode == STARTER_DECK_MODE_STARTERS spawnBag.recall(true) Wait.frames(function() - if spawnStarterDecks then + if starterMode then spawnStarters(groupName) else spawnInvestigators(groupName) @@ -359,13 +390,13 @@ function buildCommonSpawnSpec(investigatorName, investigatorData, position, oneC return { { name = investigatorName.."minicards", - cards = oneCardOnly and investigatorData.minicards[1] or investigatorData.minicards, + cards = oneCardOnly and { investigatorData.minicards[1] } or investigatorData.minicards, globalPos = position, rotation = FACE_UP_ROTATION, }, { name = investigatorName.."cards", - cards = oneCardOnly and investigatorData.cards[1] or investigatorData.cards, + cards = oneCardOnly and { investigatorData.cards[1] } or investigatorData.cards, globalPos = cardPos, rotation = FACE_UP_ROTATION, }, @@ -452,31 +483,34 @@ function placeClassCards(cardClass, isUpgraded) table.insert(assetList, cardId) end end + local groupPos = Vector(START_POSITIONS.classCards) if #skillList > 0 then spawnBag.spawn({ name = cardClass .. (isUpgraded and "upgraded" or "basic"), cards = skillList, - globalPos = START_POSITIONS.skill, + globalPos = groupPos, rotation = FACE_UP_ROTATION, spread = true, spreadCols = 20 }) + groupPos.x = groupPos.x - math.ceil(#skillList / 20) * CARD_ROW_OFFSET - CARD_GROUP_OFFSET end if #eventList > 0 then spawnBag.spawn({ name = cardClass .. "event" .. (isUpgraded and "upgraded" or "basic"), cards = eventList, - globalPos = START_POSITIONS.event, + globalPos = groupPos, rotation = FACE_UP_ROTATION, spread = true, spreadCols = 20 }) + groupPos.x = groupPos.x - math.ceil(#eventList / 20) * CARD_ROW_OFFSET - CARD_GROUP_OFFSET end if #assetList > 0 then spawnBag.spawn({ name = cardClass .. "asset" .. (isUpgraded and "upgraded" or "basic"), cards = assetList, - globalPos = START_POSITIONS.asset, + globalPos = groupPos, rotation = FACE_UP_ROTATION, spread = true, spreadCols = 20 @@ -484,26 +518,108 @@ function placeClassCards(cardClass, isUpgraded) end end --- Clears the current cards, and places all basic weaknesses on the table. -function spawnWeaknesses() - spawnBag.recall(fast) +-- Spawns the investigator sets and all cards for the given cycle +---@param cycle String Name of a cycle, should match the standard used in card metadata +function spawnCycle(cycle) + spawnBag.recall(true) + spawnInvestigators(cycle) local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) local indexReady = allCardsBag.call("isIndexReady") if (not indexReady) then broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) return end - local weaknessIdList = allCardsBag.call("getBasicWeaknesses") + local cycleCardList = allCardsBag.call("getCardsByCycle", cycle) local copiedList = { } - for i, id in ipairs(weaknessIdList) do + for i, id in ipairs(cycleCardList) do copiedList[i] = id end spawnBag.spawn({ - name = "weaknesses", + name = "cycle"..cycle, cards = copiedList, - globalPos = START_POSITIONS.asset, + globalPos = START_POSITIONS.cycle, rotation = FACE_UP_ROTATION, spread = true, spreadCols = 20 }) end + +function spawnBonded() + spawnBag.recall(true) + spawnBag.spawn({ + name = "bonded", + cards = BONDED_CARD_LIST, + globalPos = START_POSITIONS.classCards, + rotation = FACE_UP_ROTATION, + spread = true, + spreadCols = 20 + }) +end + +function spawnUpgradeSheets() + spawnBag.recall(true) + spawnBag.spawn({ + name = "upgradeSheets", + cards = UPGRADE_SHEET_LIST, + globalPos = START_POSITIONS.classCards, + rotation = FACE_UP_ROTATION, + spread = true, + spreadCols = 20 + }) + spawnBag.spawn({ + name = "servitor", + cards = { "09080-m" }, + globalPos = START_POSITIONS.summonedServitor, + rotation = FACE_UP_ROTATION, + }) +end + +-- Clears the current cards, and places all basic weaknesses on the table. +function spawnWeaknesses() + spawnBag.recall(true) + local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) + local indexReady = allCardsBag.call("isIndexReady") + if (not indexReady) then + broadcastToAll("Still loading player cards, please try again in a few seconds", {0.9, 0.2, 0.2}) + return + end + local weaknessIdList = allCardsBag.call("getUniqueWeaknesses") + local copiedList = { } + for i, id in ipairs(weaknessIdList) do + copiedList[i] = id + end + local groupPos = Vector(START_POSITIONS.classCards) + spawnBag.spawn({ + name = "weaknesses", + cards = copiedList, + globalPos = groupPos, + rotation = FACE_UP_ROTATION, + spread = true, + spreadCols = 20 + }) + groupPos.x = groupPos.x - math.ceil(#copiedList / 20) * CARD_ROW_OFFSET - CARD_GROUP_OFFSET + spawnBag.spawn({ + name = "evolvedWeaknesses", + cards = EVOLVED_WEAKNESSES, + globalPos = groupPos, + rotation = FACE_UP_ROTATION, + spread = true, + spreadCols = 20 + }) +end + +function spawnRandomWeakness() + spawnBag.recall(true) + local allCardsBag = getObjectFromGUID(ALL_CARDS_BAG_GUID) + local weaknessId = allCardsBag.call("getRandomWeaknessId") + if (weaknessId == nil) then + broadcastToAll("All basic weaknesses are in play!", {0.9, 0.2, 0.2}) + return + end + spawnBag.spawn({ + name = "randomWeakness", + cards = { weaknessId }, + globalPos = START_POSITIONS.randomWeakness, + rotation = FACE_UP_ROTATION, + }) +end diff --git a/src/playercards/PlayerCardPanelData.ttslua b/src/playercards/PlayerCardPanelData.ttslua index 62e13e6e..6d186e55 100644 --- a/src/playercards/PlayerCardPanelData.ttslua +++ b/src/playercards/PlayerCardPanelData.ttslua @@ -1,3 +1,45 @@ +BONDED_CARD_LIST = { + "05314", -- Soothing Melody + "06277", -- Wish Eater + "06019", -- Bloodlust + "06022", -- Pendant of the Queen + "05317", -- Blood-rite + "06113", -- Essence of the Dream + "06028", -- Stars Are Right + "06025", -- Guardian of the Crystallizer + "06283", -- Unbound Beast + "06032", -- Zeal + "06031", -- Hope + "06033", -- Augur + "06331", -- Dream Parasite + "06015a", -- Dream-Gate +} + +UPGRADE_SHEET_LIST = { + "09040-c", -- Alchemical Distillation + "09023-c", -- Custom Modifications + "09059-c", -- Damning Testimony + "09041-c", -- Emperical Hypothesis + "09060-c", -- Friends in Low Places + "09101-c", -- Grizzled + "09061-c", -- Honed Instinct + "09021-c", -- Hunter's Armor + "09119-c", -- Hyperphysical Shotcaster + "09079-c", -- Living Ink + "09100-c", -- Makeshift Trap + "09099-c", -- Pocket Multi Tool + "09081-c", -- Power Word + "09022-c", -- Runic Axe + "09080-c", -- Summoned Servitor + "09042-c", -- Raven's Quill +} + +EVOLVED_WEAKNESSES = { + "04039", + "04041", + "04042", +} + ------------------ START INVESTIGATOR DATA DEFINITION ------------------ INVESTIGATOR_GROUPS = { Guardian = { @@ -13,10 +55,6 @@ INVESTIGATOR_GROUPS = { "D2", "R3", "D3", - "R4", - "D4", - "R5", - "D5", }, } @@ -25,13 +63,13 @@ INVESTIGATORS["Roland Banks"] = { cards = { "01001", "01001-promo", "01001-p", "01001-pf", "01001-pb", }, minicards = { "01001-m", "01001-promo-m", }, signatures = { "01006", "01007", "90030", "90031", }, - starterDeck = "1462", + starterDeck = "2624931", } INVESTIGATORS["Daisy Walker"] = { cards = { "01002", "01002-p", "01002-pf", "01002-pb", }, minicards = { "01002-m", }, signatures = { "01008", "01009", "90002", "90003" }, - starterDeck = "42652", + starterDeck = "2624938", } ------------------ END INVESTIGATOR DATA DEFINITION ------------------ INVESTIGATORS["R2"] = INVESTIGATORS["Roland Banks"] From 45d62067ca39758351d1625170ade40b5e842aca Mon Sep 17 00:00:00 2001 From: Buhallin Date: Sat, 31 Dec 2022 20:55:03 -0800 Subject: [PATCH 22/31] Cleanup from comments --- src/core/PlayArea.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 5afff938..3fa91628 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -5,7 +5,7 @@ local tokenManager = require("core/token/TokenManager") --------------------------------------------------------- -- set true to enable debug logging -local DEBUG = true +local DEBUG = false -- Location connection directional options local BIDIRECTIONAL = 0 @@ -319,7 +319,7 @@ function addBidirectionalVector(card1, card2, lines) points = { pos1, pos2 }, color = CONNECTION_COLOR, thickness = CONNECTION_THICKNESS, - }); + }) end -- Draws a one-way location connection between the two cards, adding the lines to do so to the From d8bdb9fdf87459f902c420d06fd38b093958116f Mon Sep 17 00:00:00 2001 From: Pokachi Date: Sun, 1 Jan 2023 01:38:06 -0800 Subject: [PATCH 23/31] added a scenario name splash on placing down scenarios as well as a setting in the settings panel to toggle splashing scenario --- objects/LuaScriptState.luascriptstate | 2 +- src/core/Global.ttslua | 30 ++++++++++++++++++++++++++- src/core/PlayArea.ttslua | 1 + xml/Global.xml | 13 ++++++++++++ xml/OptionPanel.xml | 14 +++++++++++++ 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/objects/LuaScriptState.luascriptstate b/objects/LuaScriptState.luascriptstate index 277d64b4..080f8272 100644 --- a/objects/LuaScriptState.luascriptstate +++ b/objects/LuaScriptState.luascriptstate @@ -1 +1 @@ -{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":[],"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true}} +{"optionPanel":{"showChaosBagManager":false,"showCleanUpHelper":false,"showDrawButton":false,"showHandHelper":[],"showNavigationOverlay":false,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true,"showTitleSplash":true}} diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 01c0729a..e2db6ef9 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -818,6 +818,10 @@ function applyOptionPanelChange(id, state) -- update master clue counter getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state) + -- option: Clickable clue counters + elseif id == "showTitleSplash" then + optionPanel[id] = state + -- option: Show token arranger elseif id == "showTokenArranger" then -- delete previously pulled out tokens @@ -931,7 +935,7 @@ function onClick_defaultSettings() for id, _ in pairs(optionPanel) do local state = false -- override for settings that are enabled by default - if id == "useSnapTags" then + if id == "useSnapTags" or id == "showTitleSplash" then state = true end applyOptionPanelChange(id, state) @@ -942,6 +946,7 @@ function onClick_defaultSettings() useSnapTags = true, showDrawButton = false, useClueClickers = false, + showTitleSplash = true, showTokenArranger = false, showCleanUpHelper = false, showHandHelper = {}, @@ -952,3 +957,26 @@ function onClick_defaultSettings() -- update UI updateOptionPanelState() end + +-- splash scenario title on setup +titleSplashId = nil +function titleSplash(params) + if self.UI.getAttribute('showTitleSplash', "isOn") == "True" then + + -- if there's any ongoing title being displayed, hide it and cancel the waiting function + if titleSplashId then + Wait.stop(titleSplashId) + titleSplashId = nil + UI.setAttribute('title_splash', 'active', false) + end + + -- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen) + -- wait timer to hide the scenario name + UI.setValue('title_splash', params.scenarioName) + UI.show('title_splash') + titleSplashId = Wait.time(function() + UI.hide('title_splash') + titleSplashId = nil + end, 4) + end +end \ No newline at end of file diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index dde1cfe0..9ef407b9 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -130,4 +130,5 @@ end function onScenarioChanged(scenarioName) currentScenario = scenarioName + Global.call('titleSplash', {scenarioName = scenarioName}) end diff --git a/xml/Global.xml b/xml/Global.xml index 6ba20511..96c066f3 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -104,4 +104,17 @@ + + + + diff --git a/xml/OptionPanel.xml b/xml/OptionPanel.xml index afb322b1..c63c85d9 100644 --- a/xml/OptionPanel.xml +++ b/xml/OptionPanel.xml @@ -142,6 +142,20 @@ + + + + + Show Scenario Title on Setup + Fade in the name of the scenario for 2 seconds when placing down a scenario. + + + + + + + From fb4bbe8ab41558bd8eb2c53748b4b78021b6819f Mon Sep 17 00:00:00 2001 From: Buhallin Date: Sun, 1 Jan 2023 01:52:02 -0800 Subject: [PATCH 24/31] Remove double start message for the intro tour --- src/core/tour/TourStarter.ttslua | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/tour/TourStarter.ttslua b/src/core/tour/TourStarter.ttslua index 62bd64e7..cc8a9ee7 100644 --- a/src/core/tour/TourStarter.ttslua +++ b/src/core/tour/TourStarter.ttslua @@ -26,7 +26,6 @@ function onLoad() end function startTour(_, playerColor, _) - broadcastToColor("Starting the tour, please wait", playerColor) tourManager.startTour(playerColor) end From 7a071d30f49b2bd5a61fe88610b82cd351c5c5ef Mon Sep 17 00:00:00 2001 From: Pokachi Date: Sun, 1 Jan 2023 01:57:41 -0800 Subject: [PATCH 25/31] Moved title splash call from PlayArea to MythosArea. updated comment for options --- src/core/Global.ttslua | 2 +- src/core/MythosArea.ttslua | 1 + src/core/PlayArea.ttslua | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index e2db6ef9..585ac13a 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -818,7 +818,7 @@ function applyOptionPanelChange(id, state) -- update master clue counter getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state) - -- option: Clickable clue counters + -- option: Show Title on placing scenarios elseif id == "showTitleSplash" then optionPanel[id] = state diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index 84f962ab..8320bee3 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -55,6 +55,7 @@ function resetTokensIfInDeckZone(container, object) end function fireScenarioChangedEvent() + Global.call('titleSplash', {scenarioName = currentScenario}) playArea.onScenarioChanged(currentScenario) end diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 9ef407b9..dde1cfe0 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -130,5 +130,4 @@ end function onScenarioChanged(scenarioName) currentScenario = scenarioName - Global.call('titleSplash', {scenarioName = scenarioName}) end From de75ed4fc7d68c3e37683efd1458ed3971956bab Mon Sep 17 00:00:00 2001 From: Pokachi Date: Sun, 1 Jan 2023 02:03:14 -0800 Subject: [PATCH 26/31] Wrap title splash text just in case title is too long --- xml/Global.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xml/Global.xml b/xml/Global.xml index 96c066f3..0c86332e 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -114,7 +114,8 @@ showAnimation='FadeIn' hideAnimation='FadeOut' active='false' - animationDuration='2'> + animationDuration='2' + horizontalOverflow="Wrap"> From 9b139a4c824ddc01e8960b7e7192a4d8d158df4e Mon Sep 17 00:00:00 2001 From: Pokachi Date: Sun, 1 Jan 2023 02:04:33 -0800 Subject: [PATCH 27/31] Fixing some styling consistency --- xml/Global.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xml/Global.xml b/xml/Global.xml index 0c86332e..e11d79a5 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -105,16 +105,16 @@ - From f3ab872688f1ece157efbc5f7ba97b275e5bee99 Mon Sep 17 00:00:00 2001 From: Pokachi Date: Sun, 1 Jan 2023 14:10:50 -0800 Subject: [PATCH 28/31] Minor optimization and clean up for scenario name splash --- src/core/Global.ttslua | 20 ++++++++++---------- src/core/MythosArea.ttslua | 2 +- xml/Global.xml | 1 - 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index 585ac13a..c6e3321c 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -34,6 +34,7 @@ local chaosTokens = {} local chaosTokensLastMat = nil local IS_RESHUFFLING = false local bagSearchers = {} +local hideTitleSplashWaitFunctionId = nil local playmatAPI = require("playermat/PlaymatApi") --------------------------------------------------------- @@ -959,24 +960,23 @@ function onClick_defaultSettings() end -- splash scenario title on setup -titleSplashId = nil -function titleSplash(params) - if self.UI.getAttribute('showTitleSplash', "isOn") == "True" then +function titleSplash(scenarioName) + if optionPanel['showTitleSplash'] then -- if there's any ongoing title being displayed, hide it and cancel the waiting function - if titleSplashId then - Wait.stop(titleSplashId) - titleSplashId = nil + if hideTitleSplashWaitFunctionId then + Wait.stop(hideTitleSplashWaitFunctionId) + hideTitleSplashWaitFunctionId = nil UI.setAttribute('title_splash', 'active', false) end -- display scenario name and set a 4 seconds (2 seconds animation and 2 seconds on screen) -- wait timer to hide the scenario name - UI.setValue('title_splash', params.scenarioName) + UI.setValue('title_splash', scenarioName) UI.show('title_splash') - titleSplashId = Wait.time(function() + hideTitleSplashWaitFunctionId = Wait.time(function() UI.hide('title_splash') - titleSplashId = nil + hideTitleSplashWaitFunctionId = nil end, 4) end -end \ No newline at end of file +end diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index 8320bee3..94933d64 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -55,7 +55,7 @@ function resetTokensIfInDeckZone(container, object) end function fireScenarioChangedEvent() - Global.call('titleSplash', {scenarioName = currentScenario}) + Global.call('titleSplash', currentScenario) playArea.onScenarioChanged(currentScenario) end diff --git a/xml/Global.xml b/xml/Global.xml index e11d79a5..dc15bced 100644 --- a/xml/Global.xml +++ b/xml/Global.xml @@ -106,7 +106,6 @@ Date: Mon, 2 Jan 2023 02:42:25 +0100 Subject: [PATCH 29/31] bugfix --- src/playermat/Playmat.ttslua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index d98e3a31..23f3c266 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -663,7 +663,8 @@ function clickableClues(showCounter) local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7}) for i = 1, clueCount do pos.y = pos.y + 0.045 * i - TokenManager.spawnToken(pos, "clue", PLAY_ZONE_ROTATION) + print(i) + tokenManager.spawnToken(pos, "clue", PLAY_ZONE_ROTATION) end end end From ba720a850566534ca154ae7a3b042753517e17f9 Mon Sep 17 00:00:00 2001 From: Chr1Z <97286811+Chr1Z93@users.noreply.github.com> Date: Mon, 2 Jan 2023 02:43:33 +0100 Subject: [PATCH 30/31] removed debug print --- src/playermat/Playmat.ttslua | 1 - 1 file changed, 1 deletion(-) diff --git a/src/playermat/Playmat.ttslua b/src/playermat/Playmat.ttslua index 23f3c266..a879d59a 100644 --- a/src/playermat/Playmat.ttslua +++ b/src/playermat/Playmat.ttslua @@ -663,7 +663,6 @@ function clickableClues(showCounter) local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7}) for i = 1, clueCount do pos.y = pos.y + 0.045 * i - print(i) tokenManager.spawnToken(pos, "clue", PLAY_ZONE_ROTATION) end end From 573ab772969b69de7f0c54e00ead2a445f329502 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Mon, 2 Jan 2023 02:51:40 +0100 Subject: [PATCH 31/31] re-enables tooltip and blanks the name for tokens --- objects/TokenSource.124381/ClueDoom.a3fb6c.json | 2 +- objects/TokenSource.124381/ClueDoom.a40a48.json | 2 +- objects/TokenSource.124381/Resource.00d19a.json | 2 +- src/core/token/TokenManager.ttslua | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/objects/TokenSource.124381/ClueDoom.a3fb6c.json b/objects/TokenSource.124381/ClueDoom.a3fb6c.json index 48b61ac0..3e32ac21 100644 --- a/objects/TokenSource.124381/ClueDoom.a3fb6c.json +++ b/objects/TokenSource.124381/ClueDoom.a3fb6c.json @@ -40,7 +40,7 @@ "Nickname": "ClueDoom", "Snap": false, "Sticky": true, - "Tooltip": false, + "Tooltip": true, "Transform": { "posX": 78.661, "posY": 2.398, diff --git a/objects/TokenSource.124381/ClueDoom.a40a48.json b/objects/TokenSource.124381/ClueDoom.a40a48.json index 9720c15b..c501cd2f 100644 --- a/objects/TokenSource.124381/ClueDoom.a40a48.json +++ b/objects/TokenSource.124381/ClueDoom.a40a48.json @@ -40,7 +40,7 @@ "Nickname": "ClueDoom", "Snap": false, "Sticky": true, - "Tooltip": false, + "Tooltip": true, "Transform": { "posX": 78.738, "posY": 2.287, diff --git a/objects/TokenSource.124381/Resource.00d19a.json b/objects/TokenSource.124381/Resource.00d19a.json index ac96f326..0d1c5508 100644 --- a/objects/TokenSource.124381/Resource.00d19a.json +++ b/objects/TokenSource.124381/Resource.00d19a.json @@ -40,7 +40,7 @@ "Nickname": "Resource", "Snap": false, "Sticky": true, - "Tooltip": false, + "Tooltip": true, "Transform": { "posX": 78.848, "posY": 2.273, diff --git a/src/core/token/TokenManager.ttslua b/src/core/token/TokenManager.ttslua index e5c62cb4..7a7916e1 100644 --- a/src/core/token/TokenManager.ttslua +++ b/src/core/token/TokenManager.ttslua @@ -248,6 +248,8 @@ do else rot.y = 270 end + + tokenTemplate.Nickname = "" return spawnObjectData({ data = tokenTemplate, position = position,