Added ItemReminder "hideInOverview" attribute. Only show character info in starting room

This commit is contained in:
Wofsauge committed 2024-07-17 20:27:22 +02:00
1 parent c28018b0db
commit 789a601ec6
2 files changed
+16 -7

No files matched your search

+16 -4
View File
@@ -18,12 +18,23 @@ EID.ItemReminderPlayerEntity = nil -- for description modifiers to reference
-- Data Tables -- -- Data Tables --
-- Format : Table of { id = "Category Name", entryGenerators = table of functions to generate descriptions, isScrollable = only shows one entry at a time but is scrollable } -- Format : Table of { id = "Category Name",
-- entryGenerators = table of functions to generate descriptions,
-- isScrollable = only shows one entry at a time but is scrollable,
-- hideInOverview = if true, dont show category content in overview. can be function or boolean
-- }
-- Execution order is handles by the order of the table entries. -- Execution order is handles by the order of the table entries.
-- Category name is interpreted as a lookup for the "EID.descriptions.ItemReminder.CategoryNames" table. If no translation is found, use english or the lookup value -- Category name is interpreted as a lookup for the "EID.descriptions.ItemReminder.CategoryNames" table. If no translation is found, use english or the lookup value
EID.ItemReminderCategories = { EID.ItemReminderCategories = {
{ id = "Overview", entryGenerators = {} }, -- special handling for Overview category { id = "Overview", entryGenerators = {} }, -- special handling for Overview category
{ id = "Character", entryGenerators = { function(player) EID:ItemReminderHandleCharacterInfo(player) end, } }, { id = "Character",
entryGenerators = {
function(player) EID:ItemReminderHandleCharacterInfo(player) end
},
hideInOverview = function(_) -- hide character description from overview, if player is not in the starting room
return game:GetLevel():GetStartingRoomIndex() ~= game:GetLevel():GetCurrentRoomIndex()
end
},
{ id = "Special", entryGenerators = { function(player) EID:ItemReminderHandlePoopSpells(player) end, } }, { id = "Special", entryGenerators = { function(player) EID:ItemReminderHandlePoopSpells(player) end, } },
{ id = "Wisps", { id = "Wisps",
isScrollable = true, isScrollable = true,
@@ -767,8 +778,9 @@ function EID:ItemReminderGetDescription()
EID:ItemReminderAddSpecialDescriptions(player) EID:ItemReminderAddSpecialDescriptions(player)
-- execute all functions defined per category -- execute all functions defined per category
for _, category in ipairs(EID.ItemReminderCategories) do for _, category in ipairs(EID.ItemReminderCategories) do
-- don't display character info in the overview after a few rooms local hideInOverview = type(category.hideInOverview) == "function" and category.hideInOverview(player)
if category.id ~= "Character" or EID.roomCount < 5 then or type(category.hideInOverview) == "boolean" and category.hideInOverview
if not hideInOverview then
numAvailableDescriptionSlots = 1 -- limit to one description per category in overview mode numAvailableDescriptionSlots = 1 -- limit to one description per category in overview mode
for _, func in ipairs(category.entryGenerators) do for _, func in ipairs(category.entryGenerators) do
func(player) func(player)
-3
View File
@@ -51,7 +51,6 @@ EID.holdTabPlayer = 0
EID.holdTabCounter = 0 EID.holdTabCounter = 0
EID.DInfinityState = {} EID.DInfinityState = {}
local forgottenDropTimer = 0 local forgottenDropTimer = 0
EID.roomCount = 0
local preHourglassStatus = {} local preHourglassStatus = {}
EID.GameUpdateCount = 0 EID.GameUpdateCount = 0
@@ -777,7 +776,6 @@ end
function EID:onNewRoom() function EID:onNewRoom()
EID:CheckCurrentRoomGridEntities() EID:CheckCurrentRoomGridEntities()
EID.roomCount = EID.roomCount + 1
-- Store values here to be rewound after using Glowing Hour Glass -- Store values here to be rewound after using Glowing Hour Glass
preHourglassStatus = {} preHourglassStatus = {}
preHourglassStatus.absorbedItems = EID:CopyTable(EID.absorbedItems) preHourglassStatus.absorbedItems = EID:CopyTable(EID.absorbedItems)
@@ -1653,7 +1651,6 @@ local function OnGameStartGeneral(_,isSave)
end end
EID.ShouldCheckWisp = true EID.ShouldCheckWisp = true
EID.WildCardEffects = {} EID.WildCardEffects = {}
EID.roomCount = 0
end end
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStartGeneral) EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStartGeneral)