From 05933dbe82c6c737b470e5d1255a0c239f6bfccd Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 14 Aug 2022 22:58:57 +0200 Subject: [PATCH] Added api feature to set pill effects permanently unidentifyable --- .gitignore | 3 ++- eid_api.lua | 5 +++++ eid_debugging.lua | 13 +++++++------ main.lua | 5 ++++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 038f5fe5..5d295d66 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ save1.dat save2.dat save3.dat /scripts/eid_savegames.lua -/.vscode \ No newline at end of file +/.vscode +.luarc.json \ No newline at end of file diff --git a/eid_api.lua b/eid_api.lua index 93cbc03d..6dbe3a5e 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1643,4 +1643,9 @@ end -- Adds an EID Icon to an Object function EID:AddIconToObject(eType, eVariant, eSubType, iconName) EID.ObjectIcon[eType.."."..eVariant.."."..eSubType] = EID.InlineIcons[iconName] +end + +-- Set a pilleffect to be permanently unidentifyable by EID +function EID:SetPillEffectUnidentifyable(pillEffectID, isUnidentifyable) + EID.UnidentifyablePillEffects[pillEffectID] = isUnidentifyable or nil end \ No newline at end of file diff --git a/eid_debugging.lua b/eid_debugging.lua index 07ac5b2e..8cc31b0b 100644 --- a/eid_debugging.lua +++ b/eid_debugging.lua @@ -140,10 +140,10 @@ __eidItemDescriptions[3] = "{{Bomb}} Emote {{Key}} Test {{Test}}{{TestIcon}} {{C __eidItemDescriptions[6] = "This item as Inline Icon {{Collectible6}}#And here are others {{Collectible69}} {{Collectible16}} {{Collectible323}} {{Collectible345}} {{Collectible223}}#And some trinket sprites {{Trinket12}} {{Trinket22}} {{Trinket1}} {{Trinket55}} {{Trinket100}} {{Trinket123}}" -- 5.100.2 = Inner Eye -EID:addIgnoredEntity(5,100,10) -EID:addIgnoredEntity(5,100,11) +EID:addIgnoredEntity(5,100,10) -- Ignore "Halo of flies" collectible entity +EID:addIgnoredEntity(5,100,11) -- Ignore "1Up" collectible entry -EID:removeIgnoredEntity(5,100,10) +EID:removeIgnoredEntity(5,100,10) -- un-Ignore "Halo of flies" collectible entity ------ Test: adding custom icons ------ EID:addColor("ColorTwitterBlue", KColor(0, 0.671875, 0.9296875, 1), nil) @@ -159,7 +159,8 @@ EID:addColor("ColorBlackBlink", nil, function(color) return color end ) - +-- Test: Pill effect unidentifyable +EID:SetPillEffectUnidentifyable(24, true) -- set "I can see forever" to always be unidentifyable local function onDebugRender(t) EID:renderHUDLocationIndicators() @@ -175,13 +176,13 @@ local function onDebugRender(t) ["Name"] = "Some Item with seed ".. v.InitSeed , ["Description"] = "Test specific description#Init seed: ".. v.InitSeed, ["Transformation"] = "1,2" - } + } v:GetData()["EID_Description"] = descTable end end for i, v in ipairs(charsToDebug) do - local pos = EID.getTextPosition() + Vector(-5, - 15 + ((i - 1) * 14)) + local pos = EID:getTextPosition() + Vector(-5, - 15 + ((i - 1) * 14)) EID:renderString(v, pos, Vector(EID.Scale, EID.Scale), KColor(1, 1, 1, 1, 0, 0, 0)) if not showDebugChars then diff --git a/main.lua b/main.lua index da768ad0..e88fd8e0 100644 --- a/main.lua +++ b/main.lua @@ -37,6 +37,7 @@ EID.CraneItemType = {} EID.absorbedItems = {} EID.CollectedItems = {} EID.IgnoredEntities = {} +EID.UnidentifyablePillEffects = {} -- List of pilleffects that are always unidentifyable local pathsChecked = {} local altPathItemChecked = {} local alwaysUseLocalMode = false -- set to true after drawing a non-local mode description this frame @@ -1510,7 +1511,9 @@ local function onRender(t) local pool = game:GetItemPool() local identified = pool:IsPillIdentified(pillColor) if REPENTANCE and pillColor % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then identified = true end - if (identified or EID.Config["ShowUnidentifiedPillDescriptions"]) then + local pillEffectID = EID:getAdjustedSubtype(closest.Type, closest.Variant, pillColor) + + if (identified or EID.Config["ShowUnidentifiedPillDescriptions"]) and not EID.UnidentifyablePillEffects[pillEffectID] then local descEntry = EID:getDescriptionObj(closest.Type, closest.Variant, pillColor, closest) EID:addDescriptionToPrint(descEntry) else