ItemReminder: Added feature to reduce length of descriptions shown on the overview page
This commit is contained in:
1 parent
6ff51b782e
commit
13c25fc8de
2 files changed
+26
-1
No files matched your search
@@ -346,6 +346,9 @@ EID.UserConfig = {
|
||||
-- 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,
|
||||
-- Limits the number of description bullet points to be displayed on the overview page for each item
|
||||
-- Default = 2
|
||||
["ItemReminderOverviewHideAfterRows"] = 2,
|
||||
-- Default = 3
|
||||
["ItemReminderMaxEntriesCount"] = 3,
|
||||
-- Items that grant you items without saying what they are (like Zodiac, Liberty Cap) can have their current granted item revealed in the Item Reminder
|
||||
@@ -602,6 +605,7 @@ EID.DefaultConfig = {
|
||||
["ItemReminderNavigateRightButton"] = ButtonAction.ACTION_SHOOTRIGHT,
|
||||
["ItemReminderNavigateDownButton"] = ButtonAction.ACTION_SHOOTDOWN,
|
||||
["ItemReminderNavigateUpButton"] = ButtonAction.ACTION_SHOOTUP,
|
||||
["ItemReminderOverviewHideAfterRows"] = 2,
|
||||
["ItemReminderMaxEntriesCount"] = 5,
|
||||
["ItemReminderShowHiddenInfo"] = false,
|
||||
["ItemReminderShowRNGCheats"] = false,
|
||||
|
||||
+22
-1
@@ -493,6 +493,21 @@ function EID:ItemReminderGetTitle()
|
||||
return combinedText
|
||||
end
|
||||
|
||||
-- trim all entries to make them shorter, by removing bullet points
|
||||
function EID:ItemReminderTrimBulletPoints(description)
|
||||
local trimmedDescription = ""
|
||||
local bulletPointsToPrint = EID.Config["ItemReminderOverviewHideAfterRows"]
|
||||
for bulletPoint in string.gmatch(description, "[^#]+") do
|
||||
if bulletPointsToPrint <= 0 or bulletPoint == "" then
|
||||
trimmedDescription = trimmedDescription .. "..." .. "#"
|
||||
break
|
||||
end
|
||||
trimmedDescription = trimmedDescription .. bulletPoint .. "#"
|
||||
bulletPointsToPrint = bulletPointsToPrint - 1
|
||||
end
|
||||
return trimmedDescription
|
||||
end
|
||||
|
||||
function EID:ItemReminderGetDescription()
|
||||
EID.InsideItemReminder = true
|
||||
EID.ItemReminderTempDescriptions = {}
|
||||
@@ -580,7 +595,13 @@ function EID:ItemReminderGetDescription()
|
||||
|
||||
-- Default: put all descriptions into one long description
|
||||
for _, entry in ipairs(EID.ItemReminderTempDescriptions) do
|
||||
finalHoldMapDesc = finalHoldMapDesc .. entry[1] .. " {{ColorEIDObjName}}" .. entry[2] .. "#" .. entry[3] .. "#"
|
||||
local description = entry[3] .. "#"
|
||||
|
||||
if EID.ItemReminderSelectedCategory == 0 then
|
||||
description = EID:ItemReminderTrimBulletPoints(description)
|
||||
end
|
||||
|
||||
finalHoldMapDesc = finalHoldMapDesc .. entry[1] .. " {{ColorEIDObjName}}" .. entry[2] .. "#" .. description
|
||||
end
|
||||
|
||||
EID.InsideItemReminder = false
|
||||
|
||||
Reference in new issue
Block a user