diff --git a/eid_config.lua b/eid_config.lua index 7bdb8e29..9597b36a 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -101,6 +101,11 @@ EID.UserConfig = { -- Default = false ["DisplayAllNearby"] = false, -- Any descriptions displayed beyond the first one will use the "Local" display mode + + -- Set the max number of descriptions to display per frame + -- Set to 1 if you don't want any Local Mode descriptions printed in co-op + -- Default = 99 + ["MaxDescriptionsToDisplay"] = 99, ---------- Display Modes ----------- @@ -445,6 +450,7 @@ EID.DefaultConfig = { ["CoopDescriptions"] = true, ["PairedPlayerDescriptions"] = false, ["DisplayAllNearby"] = false, + ["MaxDescriptionsToDisplay"] = 99, ["DisableOnCurse"] = true, ["DisableOnAltPath"] = true, ["DisableOnAprilFoolsChallenge"] = true, diff --git a/main.lua b/main.lua index e010f370..a8589746 100644 --- a/main.lua +++ b/main.lua @@ -461,6 +461,7 @@ end function EID:addDescriptionToPrint(desc) if desc.Entity and EID.entitiesToPrint[GetPtrHash(desc.Entity)] then return end + if #EID.descriptionsToPrint == EID.Config["MaxDescriptionsToDisplay"] then return end table.insert(EID.descriptionsToPrint, desc) if desc.Entity then EID.entitiesToPrint[GetPtrHash(desc.Entity)] = true end end @@ -1267,7 +1268,8 @@ local function onRender(t) end end - if not displayedDesc or EID.Config["DisplayAllNearby"] then + if (not displayedDesc or EID.Config["DisplayAllNearby"]) and + #EID.descriptionsToPrint < EID.Config["MaxDescriptionsToDisplay"] then -- Searching for the closest describable entity to this player EID.lastDescriptionEntity = nil EID.lastDist = 10000 diff --git a/mod_config_menu.lua b/mod_config_menu.lua index 8b66377d..ba9181e3 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -359,6 +359,10 @@ if MCMLoaded then infoText = "Distance to the object until descriptions are displayed"}) EID:AddBooleanSetting("General", "DisplayAllNearby", "Display All Objects In Range", { infoText = "Descriptions besides the closest one will be shown using the Local display mode" }) + local descsToDisplaySteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99} + EID:AddScrollSetting("General", "MaxDescriptionsToDisplay", "Max Descriptions to Display", descsToDisplaySteps, + {infoText = "Max number of descriptions to display per frame"}) + --------Reset to default MCM.AddSpace("EID", "General")