added default hotfix bag

This commit is contained in:
Chr1Z93 2023-12-18 13:34:49 +01:00
parent 7e2a4d71d5
commit 402b3da06d
4 changed files with 75 additions and 6 deletions

View File

@ -3,7 +3,6 @@
"ComponentTags_path": "ComponentTags.json",
"CustomUIAssets_path": "CustomUIAssets.json",
"DecalPallet_path": "DecalPallet.json",
"Decals": [],
"GameComplexity": "",
"GameMode": "Arkham Horror LCG - Super Complete Edition",
"GameType": "",
@ -104,6 +103,7 @@
"MasterClueCounter.4a3aa4",
"LegacyAssets.7165a9",
"PlayArea.721ba2",
"AdditionalPlayerCards.2cba6b",
"BarkhamHorror.308439",
"ChaosBagStatTracker.766620",
"Blesstokens.afa06b",

View File

@ -0,0 +1,54 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"Bag": {
"Order": 0
},
"ColorDiffuse": {
"b": 0,
"g": 0.36652,
"r": 0.70588
},
"Description": "Put any cards in here to add them to the indices for the player card panel and deck importer.\n\nThis can be used for custom cards too.",
"DragSelectable": true,
"GMNotes": "",
"GUID": "2cba6b",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"arkhamdb/HotfixBag\")",
"LuaScriptState": "",
"MaterialIndex": -1,
"MeasureMovement": false,
"MeshIndex": -1,
"Name": "Bag",
"Nickname": "Additional Player Cards",
"Number": 0,
"Snap": true,
"Sticky": true,
"Tags": [
"AllCardsHotfix"
],
"Tooltip": true,
"Transform": {
"posX": 60,
"posY": 1.204,
"posZ": 48,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"scaleX": 1.5,
"scaleY": 1.5,
"scaleZ": 1.5
},
"Value": 0,
"XmlUI": ""
}

View File

@ -12,3 +12,17 @@ local allCardsBagApi = require("playercards/AllCardsBagApi")
function onLoad()
allCardsBagApi.rebuildIndexForHotfix()
end
-- update with small delay to allow multiple cards being added at once
function onObjectEnterContainer(container, object)
if container == self then
Wait.time(function() allCardsBagApi.rebuildIndexForHotfix() end, 1)
end
end
-- update with small delay to allow multiple cards being removed at once
function onObjectLeaveContainer(container, object)
if container == self then
Wait.time(function() allCardsBagApi.rebuildIndexForHotfix() end, 1)
end
end

View File

@ -81,9 +81,6 @@ function buildIndex()
if (cardMetadata ~= nil) then
addCardToIndex(cardData, cardMetadata)
end
if (i % 20 == 0) then
coroutine.yield(0)
end
end
local hotfixBags = getObjectsWithTag("AllCardsHotfix")
for _, hotfixBag in ipairs(hotfixBags) do
@ -102,9 +99,13 @@ function buildIndex()
end
-- Adds a card to any indexes it should be a part of, based on its metadata.
-- Param cardData: TTS object data for the card
-- Param cardMetadata: SCED metadata for the card
---@param cardData: TTS object data for the card
---@param cardMetadata: SCED metadata for the card
function addCardToIndex(cardData, cardMetadata)
-- use the ZoopGuid as fallback if no id present
if cardMetadata.id == nil and cardMetadata.TtsZoopGuid then
cardMetadata.id = cardMetadata.TtsZoopGuid
end
cardIdIndex[cardMetadata.id] = { data = cardData, metadata = cardMetadata }
if (cardMetadata.alternate_ids ~= nil) then
for _, alternateId in ipairs(cardMetadata.alternate_ids) do