ItemReminder: Added player selection feature and description entry limit
This commit is contained in:
1 parent
96cd905a10
commit
de7668bcba
6 files changed
+109
-47
No files matched your search
@@ -918,6 +918,7 @@ EID.descriptions[languageCode].MCM = {
|
|||||||
-- the ItemReminder description will predict the abilities of items with a header like "Item Name Result"
|
-- the ItemReminder description will predict the abilities of items with a header like "Item Name Result"
|
||||||
EID.descriptions[languageCode].ItemReminder = {
|
EID.descriptions[languageCode].ItemReminder = {
|
||||||
ResultHeader = " Result",
|
ResultHeader = " Result",
|
||||||
|
InventoryEmpty = "(Player has no items)",
|
||||||
CategoryNames = {
|
CategoryNames = {
|
||||||
Overview = "Inventory Overview",
|
Overview = "Inventory Overview",
|
||||||
Special = "Special",
|
Special = "Special",
|
||||||
|
|||||||
@@ -1972,3 +1972,10 @@ function EID:GetIconStringByDescriptionObject(descObj)
|
|||||||
end
|
end
|
||||||
return "{{Blank}}"
|
return "{{Blank}}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- returns the markup for a given player ID or type. If no icon was found, returns the customTransformation icon markup
|
||||||
|
function EID:GetPlayerIcon(playerID, altFallback)
|
||||||
|
local fallback = altFallback or "{{CustomTransformation}}"
|
||||||
|
|
||||||
|
return EID:getIcon("Player" .. playerID) ~= EID.InlineIcons["ERROR"] and "{{Player" .. playerID .. "}}" or fallback
|
||||||
|
end
|
||||||
+11
-1
@@ -336,7 +336,15 @@ EID.UserConfig = {
|
|||||||
-- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html
|
-- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html
|
||||||
-- Default = ButtonAction.ACTION_SHOOTLEFT
|
-- Default = ButtonAction.ACTION_SHOOTLEFT
|
||||||
["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT,
|
["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT,
|
||||||
--
|
-- Set the keybinding that is used to scroll thru the players in the left direction
|
||||||
|
-- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html
|
||||||
|
-- Default = ButtonAction.ACTION_SHOOTDOWN
|
||||||
|
["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN,
|
||||||
|
-- Number of entries to display per category of the item description.
|
||||||
|
-- Set the keybinding that is used to scroll thru the players in the right direction
|
||||||
|
-- Look into the AB+ or Repentance documentation for the key names here: https://wofsauge.github.io/IsaacDocs/rep/enums/ButtonAction.html
|
||||||
|
-- Default = ButtonAction.ACTION_SHOOTUP
|
||||||
|
["ItemReminderNavigateUpButton"] = ButtonAction.ACTION_SHOOTUP,
|
||||||
-- Default = 3
|
-- Default = 3
|
||||||
["ItemReminderMaxEntriesCount"] = 3,
|
["ItemReminderMaxEntriesCount"] = 3,
|
||||||
-- Show recently acquired item descriptions in the Item Reminder (good for Curse of the Blind!)
|
-- Show recently acquired item descriptions in the Item Reminder (good for Curse of the Blind!)
|
||||||
@@ -607,6 +615,8 @@ EID.DefaultConfig = {
|
|||||||
["BagOfCraftingToggleKey"] = ButtonAction.ACTION_MAP,
|
["BagOfCraftingToggleKey"] = ButtonAction.ACTION_MAP,
|
||||||
["ItemReminderNavigateLeftButton"] = ButtonAction.ACTION_SHOOTLEFT,
|
["ItemReminderNavigateLeftButton"] = ButtonAction.ACTION_SHOOTLEFT,
|
||||||
["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT,
|
["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT,
|
||||||
|
["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN,
|
||||||
|
["ItemReminderNavigateUpButton"] = ButtonAction.ACTION_SHOOTUP,
|
||||||
["ItemReminderMaxEntriesCount"] = 5,
|
["ItemReminderMaxEntriesCount"] = 5,
|
||||||
["ItemReminderShowRecentItem"] = 1,
|
["ItemReminderShowRecentItem"] = 1,
|
||||||
["ItemReminderShowActiveDesc"] = 1,
|
["ItemReminderShowActiveDesc"] = 1,
|
||||||
|
|||||||
+80
-45
@@ -3,10 +3,13 @@ local GLITCH_ITEM_FLAG = 4294967296
|
|||||||
local currentBlacklist
|
local currentBlacklist
|
||||||
local lastInputTime = 0
|
local lastInputTime = 0
|
||||||
local lastScrollDirection = 1 -- used for automatic scroll feature, if no description is visible for a category
|
local lastScrollDirection = 1 -- used for automatic scroll feature, if no description is visible for a category
|
||||||
|
local lastAutoScrollPosition = -1 -- Stores last category before the automatic category skip. This prevents infinite loops, when the player has no items
|
||||||
|
local numAvailableDescriptionSlots = 0
|
||||||
|
|
||||||
EID.ItemReminderBlacklist = { ["5.100.714"] = true, ["5.100.715"] = true } -- Dont display these in the Item reminder view
|
EID.ItemReminderBlacklist = { ["5.100.714"] = true, ["5.100.715"] = true } -- Dont display these in the Item reminder view
|
||||||
EID.ItemReminderTempDescriptions = {} -- Temporary stores descriptions that will be displayed after everythng got evaluated
|
EID.ItemReminderTempDescriptions = {} -- Temporary stores descriptions that will be displayed after everythng got evaluated
|
||||||
EID.ItemReminderSelectedCategory = 0 -- Currently selected category
|
EID.ItemReminderSelectedCategory = 0 -- Currently selected category
|
||||||
|
EID.ItemReminderSelectedPlayer = 0 -- Currently selected player
|
||||||
EID.InsideItemReminder = false -- Disable some modifiers, when building the Item Reminder description
|
EID.InsideItemReminder = false -- Disable some modifiers, when building the Item Reminder description
|
||||||
|
|
||||||
-- TODO:
|
-- TODO:
|
||||||
@@ -251,8 +254,16 @@ EID.ItemReminderDescriptionModifier = {
|
|||||||
|
|
||||||
|
|
||||||
-- Simple function to help with adding properly formatted sections to the reminder description
|
-- Simple function to help with adding properly formatted sections to the reminder description
|
||||||
|
-- returns false, when no further descriptions should be added
|
||||||
function EID:ItemReminderAddTempDescriptionEntry(icon, title, newDesc)
|
function EID:ItemReminderAddTempDescriptionEntry(icon, title, newDesc)
|
||||||
table.insert(EID.ItemReminderTempDescriptions, { icon or "{{Blank}}", title, newDesc })
|
table.insert(EID.ItemReminderTempDescriptions, { icon or "{{Blank}}", title, newDesc })
|
||||||
|
numAvailableDescriptionSlots = numAvailableDescriptionSlots - 1
|
||||||
|
return EID:ItemReminderCanAddMoreToView()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- returns true, if its possible for the currently evaluated view to have more descriptions added to it
|
||||||
|
function EID:ItemReminderCanAddMoreToView()
|
||||||
|
return numAvailableDescriptionSlots > 0
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Adds a formatted "Result" text to the item name
|
-- Adds a formatted "Result" text to the item name
|
||||||
@@ -269,7 +280,7 @@ end
|
|||||||
-- Add item description for a given entity to the reminder. Also tries to apply special modifiers if present
|
-- Add item description for a given entity to the reminder. Also tries to apply special modifiers if present
|
||||||
function EID:ItemReminderAddDescription(player, entityType, variant, subType, extraIcon)
|
function EID:ItemReminderAddDescription(player, entityType, variant, subType, extraIcon)
|
||||||
local objectID = entityType .. "." .. variant .. "." .. subType
|
local objectID = entityType .. "." .. variant .. "." .. subType
|
||||||
if currentBlacklist[objectID] then return end
|
if currentBlacklist[objectID] then return true end
|
||||||
|
|
||||||
local descObj = EID:getDescriptionObj(entityType, variant, subType)
|
local descObj = EID:getDescriptionObj(entityType, variant, subType)
|
||||||
|
|
||||||
@@ -285,29 +296,27 @@ function EID:ItemReminderAddDescription(player, entityType, variant, subType, ex
|
|||||||
|
|
||||||
currentBlacklist[objectID] = true
|
currentBlacklist[objectID] = true
|
||||||
local iconString = extraIcon or EID:GetIconStringByDescriptionObject(descObj)
|
local iconString = extraIcon or EID:GetIconStringByDescriptionObject(descObj)
|
||||||
EID:ItemReminderAddTempDescriptionEntry(iconString, descObj.Name, descObj.Description)
|
return EID:ItemReminderAddTempDescriptionEntry(iconString, descObj.Name, descObj.Description)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Recently Acquired Item Descriptions
|
-- Recently Acquired Item Descriptions
|
||||||
function EID:ItemReminderHandleRecentItems(player)
|
function EID:ItemReminderHandleRecentItems(player)
|
||||||
if EID.Config["ItemReminderShowRecentItem"] > 0 then
|
|
||||||
local printedItems = 0
|
|
||||||
local playerNum = EID:getPlayerID(player)
|
local playerNum = EID:getPlayerID(player)
|
||||||
if EID.RecentlyTouchedItems[playerNum] then
|
if EID.RecentlyTouchedItems[playerNum] then
|
||||||
for i = #EID.RecentlyTouchedItems[playerNum], 1, -1 do
|
for i = #EID.RecentlyTouchedItems[playerNum], 1, -1 do
|
||||||
if printedItems >= EID.Config["ItemReminderShowRecentItem"] then break end
|
if not EID:ItemReminderCanAddMoreToView() then return end
|
||||||
printedItems = printedItems + 1
|
|
||||||
local recentID = EID.RecentlyTouchedItems[playerNum][i] % GLITCH_ITEM_FLAG
|
local recentID = EID.RecentlyTouchedItems[playerNum][i] % GLITCH_ITEM_FLAG
|
||||||
EID:ItemReminderAddDescription(player, 5, 100, recentID)
|
EID:ItemReminderAddDescription(player, 5, 100, recentID)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Active Item Descriptions
|
-- Active Item Descriptions
|
||||||
function EID:ItemReminderHandleActiveItems(player)
|
function EID:ItemReminderHandleActiveItems(player)
|
||||||
-- limit number of active item descriptions to 2, since Slot 3 and 4 are handled seperately
|
-- limit number of active item descriptions to 2, since Slot 3 and 4 are handled seperately
|
||||||
for i = 0, math.min(EID.Config["ItemReminderShowActiveDesc"], 2) - 1 do
|
for i = 0, 1 do
|
||||||
|
if not EID:ItemReminderCanAddMoreToView() then return end
|
||||||
-- the modulo is to convert negative IDs (glitched items) to positive IDs
|
-- the modulo is to convert negative IDs (glitched items) to positive IDs
|
||||||
local heldActive = player:GetActiveItem(i) % GLITCH_ITEM_FLAG
|
local heldActive = player:GetActiveItem(i) % GLITCH_ITEM_FLAG
|
||||||
if heldActive > 0 then
|
if heldActive > 0 then
|
||||||
@@ -318,8 +327,7 @@ end
|
|||||||
|
|
||||||
-- pocket active
|
-- pocket active
|
||||||
function EID:ItemReminderHandlePocketActive(player)
|
function EID:ItemReminderHandlePocketActive(player)
|
||||||
if not EID.isRepentance then return end
|
if not EID.isRepentance or not EID:ItemReminderCanAddMoreToView() then return end
|
||||||
|
|
||||||
local pocketActive = player:GetActiveItem(2) or 0
|
local pocketActive = player:GetActiveItem(2) or 0
|
||||||
if pocketActive > 0 then
|
if pocketActive > 0 then
|
||||||
EID:ItemReminderAddDescription(player, 5, 100, pocketActive)
|
EID:ItemReminderAddDescription(player, 5, 100, pocketActive)
|
||||||
@@ -328,7 +336,7 @@ end
|
|||||||
|
|
||||||
-- dice bag
|
-- dice bag
|
||||||
function EID:ItemReminderHandleDiceBag(player)
|
function EID:ItemReminderHandleDiceBag(player)
|
||||||
if not EID.isRepentance then return end
|
if not EID.isRepentance or not EID:ItemReminderCanAddMoreToView() then return end
|
||||||
|
|
||||||
local diceBag = player:GetActiveItem(3) or 0
|
local diceBag = player:GetActiveItem(3) or 0
|
||||||
if diceBag > 0 then
|
if diceBag > 0 then
|
||||||
@@ -338,7 +346,8 @@ end
|
|||||||
|
|
||||||
-- Pocket Item Descriptions
|
-- Pocket Item Descriptions
|
||||||
function EID:ItemReminderHandlePocketItems(player)
|
function EID:ItemReminderHandlePocketItems(player)
|
||||||
for i = 0, EID.Config["ItemReminderShowPocketDesc"] - 1 do
|
for i = 0, 2 do
|
||||||
|
if not EID:ItemReminderCanAddMoreToView() then return end
|
||||||
local heldCard = player:GetCard(i)
|
local heldCard = player:GetCard(i)
|
||||||
local heldPill = player:GetPill(i)
|
local heldPill = player:GetPill(i)
|
||||||
if heldCard > 0 then
|
if heldCard > 0 then
|
||||||
@@ -358,7 +367,8 @@ end
|
|||||||
|
|
||||||
-- Trinket Descriptions
|
-- Trinket Descriptions
|
||||||
function EID:ItemReminderHandleTrinkets(player)
|
function EID:ItemReminderHandleTrinkets(player)
|
||||||
for t = 0, EID.Config["ItemReminderShowTrinketDesc"] - 1 do
|
for t = 0, 1 do
|
||||||
|
if not EID:ItemReminderCanAddMoreToView() then return end
|
||||||
-- account for Golden Trinket IDs
|
-- account for Golden Trinket IDs
|
||||||
local heldTrinketTrue = player:GetTrinket(t)
|
local heldTrinketTrue = player:GetTrinket(t)
|
||||||
local heldTrinket = heldTrinketTrue
|
local heldTrinket = heldTrinketTrue
|
||||||
@@ -372,16 +382,16 @@ end
|
|||||||
-- Gulped/unslotted Modeling Clay
|
-- Gulped/unslotted Modeling Clay
|
||||||
-- (Hidden information, because Modeling Clay does not visually show its item when gulped)
|
-- (Hidden information, because Modeling Clay does not visually show its item when gulped)
|
||||||
function EID:ItemReminderHandleGulpedModelingClay(player)
|
function EID:ItemReminderHandleGulpedModelingClay(player)
|
||||||
if EID.isRepentance and EID.Config["ItemReminderShowHiddenInfo"] and player:GetModelingClayEffect() > 0 then
|
if EID.isRepentance and EID.Config["ItemReminderShowHiddenInfo"] and player:GetModelingClayEffect() > 0 and EID:ItemReminderCanAddMoreToView() then
|
||||||
EID:ItemReminderAddDescription(player, 5, 350, 166)
|
EID:ItemReminderAddDescription(player, 5, 350, 166)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Tainted ??? Poop Descriptions
|
-- Tainted ??? Poop Descriptions
|
||||||
function EID:ItemReminderHandlePoopSpells(player)
|
function EID:ItemReminderHandlePoopSpells(player)
|
||||||
if EID.isRepentance and EID.Config["ItemReminderShowPoopDesc"] > 0 and player:GetPlayerType() == 25 then
|
if EID.isRepentance and player:GetPlayerType() == 25 and EID:ItemReminderCanAddMoreToView() then
|
||||||
local poopInfo = EID:getDescriptionEntry("poopSpells")
|
local poopInfo = EID:getDescriptionEntry("poopSpells")
|
||||||
for i = 0, EID.Config["ItemReminderShowPoopDesc"] - 1 do
|
for i = 0, 3 do
|
||||||
local nextPoop = player:GetPoopSpell(i)
|
local nextPoop = player:GetPoopSpell(i)
|
||||||
EID:ItemReminderAddTempDescriptionEntry("{{PoopSpell" .. nextPoop .. "}}", poopInfo[nextPoop][1],
|
EID:ItemReminderAddTempDescriptionEntry("{{PoopSpell" .. nextPoop .. "}}", poopInfo[nextPoop][1],
|
||||||
poopInfo[nextPoop][2])
|
poopInfo[nextPoop][2])
|
||||||
@@ -410,6 +420,16 @@ function EID:ItemReminderHandleInputs()
|
|||||||
EID.ForceRefreshCache = true
|
EID.ForceRefreshCache = true
|
||||||
lastInputTime = Isaac.GetTime()
|
lastInputTime = Isaac.GetTime()
|
||||||
lastScrollDirection = 1
|
lastScrollDirection = 1
|
||||||
|
elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateDownButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then
|
||||||
|
EID.ItemReminderSelectedPlayer = (EID.ItemReminderSelectedPlayer - 1) % #EID.coopAllPlayers
|
||||||
|
|
||||||
|
EID.ForceRefreshCache = true
|
||||||
|
lastInputTime = Isaac.GetTime()
|
||||||
|
elseif Input.IsActionTriggered(EID.Config["ItemReminderNavigateUpButton"], EID.holdTabPlayer.ControllerIndex) and Isaac.GetTime() - lastInputTime > 50 then
|
||||||
|
EID.ItemReminderSelectedPlayer = (EID.ItemReminderSelectedPlayer + 1) % #EID.coopAllPlayers
|
||||||
|
|
||||||
|
EID.ForceRefreshCache = true
|
||||||
|
lastInputTime = Isaac.GetTime()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -421,68 +441,83 @@ function EID:ItemReminderGetTitle()
|
|||||||
local translatedTitleEnglish = EID:getDescriptionEntryEnglish("ItemReminder", "CategoryNames")
|
local translatedTitleEnglish = EID:getDescriptionEntryEnglish("ItemReminder", "CategoryNames")
|
||||||
local title = translatedTitle and translatedTitle[category.id] or
|
local title = translatedTitle and translatedTitle[category.id] or
|
||||||
translatedTitleEnglish and translatedTitleEnglish[category.id] or category.id
|
translatedTitleEnglish and translatedTitleEnglish[category.id] or category.id
|
||||||
return "{{ButtonDLeft}}{{ColorText}} " .. title .. " {{CR}}{{ButtonDRight}}"
|
|
||||||
|
local combinedText = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateLeftButton"]] ..
|
||||||
|
"{{ColorText}} " .. title .. " {{CR}}" .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateRightButton"]]
|
||||||
|
|
||||||
|
-- add player toggle when more than 1 player is present
|
||||||
|
if #EID.coopAllPlayers > 1 then
|
||||||
|
local currentPlayer = EID.coopAllPlayers[EID.ItemReminderSelectedPlayer + 1]
|
||||||
|
local playerIcon = EID:GetPlayerIcon(currentPlayer:GetPlayerType())
|
||||||
|
combinedText = EID.ButtonToIconMap[EID.Config["ItemReminderNavigateDownButton"]] .. " " ..
|
||||||
|
playerIcon .. " " .. EID.ButtonToIconMap[EID.Config["ItemReminderNavigateUpButton"]] .. " " .. combinedText
|
||||||
end
|
end
|
||||||
|
|
||||||
function EID:ItemReminderGetDescription(player, checkingTwin)
|
return combinedText
|
||||||
|
end
|
||||||
|
|
||||||
|
function EID:ItemReminderGetDescription()
|
||||||
EID.InsideItemReminder = true
|
EID.InsideItemReminder = true
|
||||||
EID.ItemReminderTempDescriptions = {}
|
EID.ItemReminderTempDescriptions = {}
|
||||||
-- empty blacklist and fill with default values
|
-- empty blacklist and fill with default values
|
||||||
currentBlacklist = {}
|
currentBlacklist = {}
|
||||||
for key, _ in pairs(EID.ItemReminderBlacklist) do currentBlacklist[key] = true end
|
for key, _ in pairs(EID.ItemReminderBlacklist) do currentBlacklist[key] = true end
|
||||||
|
|
||||||
|
local player = EID.coopMainPlayers[EID.ItemReminderSelectedPlayer + 1]
|
||||||
|
|
||||||
if EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
|
if EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
|
||||||
-- 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
|
||||||
|
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)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local category = EID.ItemReminderCategories[EID.ItemReminderSelectedCategory + 1]
|
local category = EID.ItemReminderCategories[EID.ItemReminderSelectedCategory + 1]
|
||||||
|
numAvailableDescriptionSlots = EID.Config["ItemReminderMaxEntriesCount"]
|
||||||
for _, func in ipairs(category.entryGenerators) do
|
for _, func in ipairs(category.entryGenerators) do
|
||||||
func(player)
|
func(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Skip category if nothing is in it
|
-- Skip category if nothing is in it
|
||||||
if #EID.ItemReminderTempDescriptions == 0 and EID.ItemReminderSelectedCategory <= #EID.ItemReminderCategories then
|
if #EID.ItemReminderTempDescriptions == 0 then
|
||||||
|
if lastAutoScrollPosition == -1 then
|
||||||
|
-- auto scroll was started. store last valid category. skip overview if its disabled
|
||||||
|
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
|
||||||
|
lastAutoScrollPosition = lastScrollDirection % #EID.ItemReminderCategories
|
||||||
|
else
|
||||||
|
lastAutoScrollPosition = EID.ItemReminderSelectedCategory
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
EID.ItemReminderSelectedCategory = (EID.ItemReminderSelectedCategory + lastScrollDirection) %
|
EID.ItemReminderSelectedCategory = (EID.ItemReminderSelectedCategory + lastScrollDirection) %
|
||||||
#EID.ItemReminderCategories
|
#EID.ItemReminderCategories
|
||||||
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
|
if not EID.Config["ItemReminderShowOverview"] and EID.ItemReminderSelectedCategory == 0 then
|
||||||
EID.ItemReminderSelectedCategory = lastScrollDirection % #EID.ItemReminderCategories
|
EID.ItemReminderSelectedCategory = #EID.ItemReminderCategories
|
||||||
end
|
end
|
||||||
return EID:ItemReminderGetDescription(player, checkingTwin)
|
|
||||||
|
if lastAutoScrollPosition ~= EID.ItemReminderSelectedCategory then
|
||||||
|
-- new category found. try to display text
|
||||||
|
local newCategoryText = EID:ItemReminderGetDescription()
|
||||||
|
if newCategoryText ~= "" then
|
||||||
|
return newCategoryText
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
-- auto scroll was stopped. reset scroll value
|
||||||
|
lastAutoScrollPosition = -1
|
||||||
|
|
||||||
|
return "{{Blank}}#{{Blank}} " .. EID:getDescriptionEntry("ItemReminder", "InventoryEmpty")
|
||||||
|
end
|
||||||
|
lastAutoScrollPosition = -1
|
||||||
|
|
||||||
-- put descriptions into one long description
|
-- put descriptions into one long description
|
||||||
local finalHoldMapDesc = ""
|
local finalHoldMapDesc = ""
|
||||||
for _, entry in ipairs(EID.ItemReminderTempDescriptions) do
|
for _, entry in ipairs(EID.ItemReminderTempDescriptions) do
|
||||||
finalHoldMapDesc = finalHoldMapDesc .. entry[1] .. " {{ColorEIDObjName}}" .. entry[2] .. "#" .. entry[3] .. "#"
|
finalHoldMapDesc = finalHoldMapDesc .. entry[1] .. " {{ColorEIDObjName}}" .. entry[2] .. "#" .. entry[3] .. "#"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Finally, check the twin player of this controller
|
|
||||||
-- If both twins have a desc, show their player icon / name to separate the two descs
|
|
||||||
if EID.isRepentance and not checkingTwin then
|
|
||||||
local twin = player:GetOtherTwin()
|
|
||||||
local mainTwinDesc = finalHoldMapDesc
|
|
||||||
local otherTwinDesc = ""
|
|
||||||
if twin then otherTwinDesc = EID:ItemReminderGetDescription(twin, true) end
|
|
||||||
if otherTwinDesc ~= "" then
|
|
||||||
-- Only the other twin had a desc
|
|
||||||
if mainTwinDesc == "" then
|
|
||||||
finalHoldMapDesc = otherTwinDesc
|
|
||||||
else
|
|
||||||
-- Both twins had a desc; merge them with player icon headers
|
|
||||||
finalHoldMapDesc = (EID:getIcon("Player" .. player:GetPlayerType()) ~= EID.InlineIcons["ERROR"] and "{{Player" .. player:GetPlayerType() .. "}}" or "{{CustomTransformation}}") ..
|
|
||||||
" {{ColorGray}}" .. player:GetName() .. "#" .. mainTwinDesc .. "#"
|
|
||||||
finalHoldMapDesc = finalHoldMapDesc ..
|
|
||||||
(EID:getIcon("Player" .. twin:GetPlayerType()) ~= EID.InlineIcons["ERROR"] and "{{Player" .. twin:GetPlayerType() .. "}}" or "{{CustomTransformation}}") ..
|
|
||||||
" {{ColorGray}}" .. twin:GetName() .. "#" .. otherTwinDesc
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- Only the main twin had a desc
|
|
||||||
finalHoldMapDesc = mainTwinDesc
|
|
||||||
end
|
|
||||||
end
|
|
||||||
finalHoldMapDesc = "{{Blank}}#" .. finalHoldMapDesc
|
finalHoldMapDesc = "{{Blank}}#" .. finalHoldMapDesc
|
||||||
|
|
||||||
EID.InsideItemReminder = false
|
EID.InsideItemReminder = false
|
||||||
|
|||||||
@@ -598,6 +598,12 @@ if MCMLoaded then
|
|||||||
EID:AddNumberSetting("Reminder", "ItemReminderNavigateRightButton", "Navigate Right", 0, 13, {displayTable = actionToName,
|
EID:AddNumberSetting("Reminder", "ItemReminderNavigateRightButton", "Navigate Right", 0, 13, {displayTable = actionToName,
|
||||||
infoText = {"Keybinding that is used to scroll thru the categories in the left direction"}})
|
infoText = {"Keybinding that is used to scroll thru the categories in the left direction"}})
|
||||||
|
|
||||||
|
EID:AddNumberSetting("Reminder", "ItemReminderNavigateDownButton", "Navigate Down", 0, 13, {displayTable = actionToName,
|
||||||
|
infoText = {"Keybinding that is used to scroll thru the players in the left direction"}})
|
||||||
|
|
||||||
|
EID:AddNumberSetting("Reminder", "ItemReminderNavigateUpButton", "Navigate Up", 0, 13, {displayTable = actionToName,
|
||||||
|
infoText = {"Keybinding that is used to scroll thru the players in the right direction"}})
|
||||||
|
|
||||||
MCM.AddSpace("EID", "Reminder")
|
MCM.AddSpace("EID", "Reminder")
|
||||||
MCM.AddText("EID", "Reminder", "Item Descriptions")
|
MCM.AddText("EID", "Reminder", "Item Descriptions")
|
||||||
-- should these be organized in the order they're shown in the map desc code?
|
-- should these be organized in the order they're shown in the map desc code?
|
||||||
|
|||||||
@@ -1285,6 +1285,9 @@ function EID:OnRender()
|
|||||||
local tabHeld, playerNumHoldingTab = EID:PlayersActionPressed(EID.Config["BagOfCraftingToggleKey"])
|
local tabHeld, playerNumHoldingTab = EID:PlayersActionPressed(EID.Config["BagOfCraftingToggleKey"])
|
||||||
if tabHeld then
|
if tabHeld then
|
||||||
EID.holdTabPlayer = EID.coopMainPlayers[playerNumHoldingTab]
|
EID.holdTabPlayer = EID.coopMainPlayers[playerNumHoldingTab]
|
||||||
|
if EID.holdTabCounter == 0 then -- update item reminder player selection
|
||||||
|
EID.ItemReminderSelectedPlayer = playerNumHoldingTab - 1
|
||||||
|
end
|
||||||
EID.holdTabCounter = EID.holdTabCounter + 1
|
EID.holdTabCounter = EID.holdTabCounter + 1
|
||||||
else
|
else
|
||||||
EID.holdTabPlayer = nil
|
EID.holdTabPlayer = nil
|
||||||
@@ -1580,7 +1583,7 @@ function EID:OnRender()
|
|||||||
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
|
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
|
||||||
demoDescObj.PermanentTextEnglish = EID:getDescriptionEntryEnglish("ItemReminder", "Title")
|
demoDescObj.PermanentTextEnglish = EID:getDescriptionEntryEnglish("ItemReminder", "Title")
|
||||||
-- check for scrolling being enabled here and append scroll controls to the title?
|
-- check for scrolling being enabled here and append scroll controls to the title?
|
||||||
demoDescObj.Description = EID:ItemReminderGetDescription(EID.holdTabPlayer)
|
demoDescObj.Description = EID:ItemReminderGetDescription()
|
||||||
demoDescObj.Name = EID:ItemReminderGetTitle()
|
demoDescObj.Name = EID:ItemReminderGetTitle()
|
||||||
if (demoDescObj.Description ~= "") then EID:addDescriptionToPrint(demoDescObj, 1) end
|
if (demoDescObj.Description ~= "") then EID:addDescriptionToPrint(demoDescObj, 1) end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user