From b2dff9ef7ec22924a5c92b409238b5a9a77f59c4 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Fri, 27 Nov 2020 23:22:20 +0100 Subject: [PATCH] Adds feature to hide the descriptions when in battle --- eid_config.lua | 6 ++++++ main.lua | 9 ++++++--- mod_config_menu.lua | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/eid_config.lua b/eid_config.lua index e2695f9c..39b5bbe1 100644 --- a/eid_config.lua +++ b/eid_config.lua @@ -42,6 +42,12 @@ EID.DefaultConfig = { -- look into the AB+ documentation for the key names -- Default = Keyboard.KEY_F2 ["HideKey"] = Keyboard.KEY_F2, + -- Initial displaystate. Can be used to change the toggle behavior of the "Hide Key" event + -- Default = false + ["Hidden"] = false, + -- Hide the descriptions when in battle + -- Default = false + ["HideInBattle"] = false, -------------CURSE------------- -- Display informations when the floor has curse of the blind ( ? - Items) diff --git a/main.lua b/main.lua index 1dce2030..a94ca867 100644 --- a/main.lua +++ b/main.lua @@ -263,12 +263,15 @@ local function onRender(t) end if EID.isHidden then return + elseif EID.Config["HideInBattle"] then + if Isaac.CountBosses() > 0 or Isaac.CountEnemies() > 0 then + return + end end - - local player = Isaac.GetPlayer(0) - + EID:renderMCMDummyDescription() + local player = Isaac.GetPlayer(0) if player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG) then EID:addTextPosModifier("Schoolbag", Vector(0,30)) end diff --git a/mod_config_menu.lua b/mod_config_menu.lua index d87cd46d..2b24903b 100644 --- a/mod_config_menu.lua +++ b/mod_config_menu.lua @@ -167,6 +167,26 @@ if MCMLoaded then end } ) + ModConfigMenu.AddSetting( + "EID", + "Rooms", + { + Type = ModConfigMenuOptionType.BOOLEAN, + CurrentSetting = function() + return EID.Config["HideInBattle"] + end, + Display = function() + local onOff = "False" + if EID.Config["HideInBattle"] then + onOff = "True" + end + return "Hide in Battle: " .. onOff + end, + OnChange = function(currentBool) + EID.Config["HideInBattle"] = currentBool + end + } + ) ------------Collectibles--------------