Skip to content

Commit

Permalink
Merge pull request #913 from argonui/action-tracker
Browse files Browse the repository at this point in the history
Added a global UI to track remaining actions per player
  • Loading branch information
dscarpac authored Jan 9, 2025
2 parents f27852c + 90fec87 commit 6c5961a
Show file tree
Hide file tree
Showing 11 changed files with 306 additions and 18 deletions.
5 changes: 5 additions & 0 deletions modsettings/CustomUIAssets.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"Type": 0,
"URL": "https://steamusercontent-a.akamaihd.net/ugc/1782854877010106784/6E00433E3425D0A7C6121E0DDB6A79167BA78569/"
},
{
"Name": "actionTrackerToggle",
"Type": 0,
"URL": "https://steamusercontent-a.akamaihd.net/ugc/62586453246237701/EF44EA8D90810464674475AF1E543CCD710C302B/"
},
{
"Name": "OverlayLarge",
"Type": 0,
Expand Down
1 change: 1 addition & 0 deletions objects/LuaScriptState.luascriptstate
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"acknowledgedUpgradeVersions": [],
"actionTrackerVisibility": [],
"blurseVisibility": [],
"chaosTokensGUID": [],
"handVisibility": [],
Expand Down
1 change: 1 addition & 0 deletions src/accessories/CleanUpHelper.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ function tidyPlayerMatCoroutine()
tekeliliHelper.call("spawnStoredTekelili", color)
end
end
Global.call("updateActionTrackerName", color)
end

-- reset "activeInvestigatorId" and "...class"
Expand Down
6 changes: 3 additions & 3 deletions src/core/GUIDReferenceApi.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ do
return getGuidHandler().call("getObjectsByOwner", owner)
end

-- Sends new information to the reference handler to edit the main index
-- Sends new information to the reference handler to edit the main index (if type/guid are omitted, entry will be removed)
---@param owner string Parent of the object
---@param type string Type of the object
---@param guid string GUID of the object
---@param type? string Type of the object
---@param guid? string GUID of the object
GUIDReferenceApi.editIndex = function(owner, type, guid)
return getGuidHandler().call("editIndex", {
owner = owner,
Expand Down
11 changes: 9 additions & 2 deletions src/core/GUIDReferenceHandler.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ end

-- makes an edit to the main index
function editIndex(params)
editsToIndex[params.owner][params.type] = params.guid
if params.type then
if not editsToIndex[params.owner] then
editsToIndex[params.owner] = {}
end
editsToIndex[params.owner][params.type] = params.guid
else
editsToIndex[params.owner] = nil
end
updateSave()
updateMainIndex()
end
Expand Down Expand Up @@ -197,7 +204,7 @@ function getOwnerOfObject(object)
end

-- check if it is on an owned object
local result = searchLib.belowPosition(object.getPosition())
local result = searchLib.belowPosition(object.getPosition(), "isTileOrToken")

for owner, subtable in pairs(GuidReferences) do
for type, guid in pairs(subtable) do
Expand Down
Loading

0 comments on commit 6c5961a

Please sign in to comment.