Added option to hide soulstone descriptions when they are obstructed
This commit is contained in:
1 parent
72cfe38931
commit
5838e8f2e4
3 files changed
+33
-5
No files matched your search
+4
-1
@@ -1,6 +1,5 @@
|
|||||||
EID.UserConfig = {
|
EID.UserConfig = {
|
||||||
-------GENERAL---------
|
-------GENERAL---------
|
||||||
|
|
||||||
-- Change language of the mod.
|
-- Change language of the mod.
|
||||||
-- Currently Supported: English = "en_us" (Default) , "en_us_detailed"
|
-- Currently Supported: English = "en_us" (Default) , "en_us_detailed"
|
||||||
-- French = "fr" SPECIAL THANKS TO Nicolas Delvaux
|
-- French = "fr" SPECIAL THANKS TO Nicolas Delvaux
|
||||||
@@ -118,6 +117,9 @@ EID.UserConfig = {
|
|||||||
-- Toggle Display of Card / Rune descriptions when its not accessable with walking. AKA behind rock, blocks, spikes
|
-- Toggle Display of Card / Rune descriptions when its not accessable with walking. AKA behind rock, blocks, spikes
|
||||||
-- Default = false
|
-- Default = false
|
||||||
["DisplayObstructedCardInfo"] = false,
|
["DisplayObstructedCardInfo"] = false,
|
||||||
|
-- Toggle Display of Soulstone descriptions when its not accessable with walking. AKA behind rock, blocks, spikes
|
||||||
|
-- Default = true
|
||||||
|
["DisplayObstructedSoulstoneInfo"] = true,
|
||||||
|
|
||||||
------------PILLS--------------
|
------------PILLS--------------
|
||||||
|
|
||||||
@@ -237,6 +239,7 @@ EID.DefaultConfig = {
|
|||||||
["DisplayCardInfoShop"] = false,
|
["DisplayCardInfoShop"] = false,
|
||||||
["DisplaySoulstoneInfoShop"] = true,
|
["DisplaySoulstoneInfoShop"] = true,
|
||||||
["DisplayObstructedCardInfo"] = false,
|
["DisplayObstructedCardInfo"] = false,
|
||||||
|
["DisplayObstructedSoulstoneInfo"] = true,
|
||||||
["DisplayPillInfo"] = true,
|
["DisplayPillInfo"] = true,
|
||||||
["DisplayPillInfoShop"] = true,
|
["DisplayPillInfoShop"] = true,
|
||||||
["DisplayObstructedPillInfo"] = true,
|
["DisplayObstructedPillInfo"] = true,
|
||||||
|
|||||||
@@ -376,6 +376,8 @@ local isMirrorRoom = false
|
|||||||
function EID:onNewRoom()
|
function EID:onNewRoom()
|
||||||
if game:GetLevel():GetAbsoluteStage() == LevelStage.STAGE1_2 then
|
if game:GetLevel():GetAbsoluteStage() == LevelStage.STAGE1_2 then
|
||||||
isMirrorRoom = IsMirror()
|
isMirrorRoom = IsMirror()
|
||||||
|
else
|
||||||
|
isMirrorRoom = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoom)
|
EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoom)
|
||||||
@@ -477,7 +479,7 @@ EID.hasValidWalkingpath = true
|
|||||||
|
|
||||||
function EID:onGameUpdate()
|
function EID:onGameUpdate()
|
||||||
EID.player = Isaac.GetPlayer(0)
|
EID.player = Isaac.GetPlayer(0)
|
||||||
if not EID.Config["DisplayObstructedCardInfo"] or not EID.Config["DisplayObstructedPillInfo"] then
|
if not EID.Config["DisplayObstructedCardInfo"] or not EID.Config["DisplayObstructedPillInfo"] or not EID.Config["DisplayObstructedSoulstoneInfo"] then
|
||||||
if EID.lastDescriptionEntity == nil or (EID.Config["DisableObstructionOnFlight"] and EID.player.CanFly) then
|
if EID.lastDescriptionEntity == nil or (EID.Config["DisableObstructionOnFlight"] and EID.player.CanFly) then
|
||||||
if EID.pathCheckerEntity ~= nil then
|
if EID.pathCheckerEntity ~= nil then
|
||||||
EID.pathCheckerEntity:Remove()
|
EID.pathCheckerEntity:Remove()
|
||||||
@@ -649,13 +651,15 @@ local function onRender(t)
|
|||||||
EID:printDescription(descriptionObj)
|
EID:printDescription(descriptionObj)
|
||||||
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
|
elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then
|
||||||
--Handle Cards & Runes
|
--Handle Cards & Runes
|
||||||
if not EID.Config["DisplayObstructedCardInfo"] and closest.FrameCount < 3 then
|
if ( not EID.Config["DisplayObstructedCardInfo"] or not EID.Config["DisplayObstructedSoulstoneInfo"]) and closest.FrameCount < 3 then
|
||||||
-- small delay when having obstruction enabled & entering the room to prevent spoilers
|
-- small delay when having obstruction enabled & entering the room to prevent spoilers
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if closest:GetData()["EID_DontHide"] ~= true then
|
if closest:GetData()["EID_DontHide"] ~= true then
|
||||||
local hideinShop = closest:ToPickup():IsShopItem() and (((closest.SubType < 81 or closest.SubType > 97) and not EID.Config["DisplayCardInfoShop"]) or (closest.SubType >= 81 and not EID.Config["DisplaySoulstoneInfoShop"]))
|
local isSoulstone = closest.SubType >= 81 and closest.SubType <= 97
|
||||||
if hideinShop or (not EID.Config["DisplayObstructedCardInfo"] and not EID.hasValidWalkingpath) or (REPENTANCE and game.Challenge == Challenge.CHALLENGE_CANTRIPPED) then
|
local hideinShop = closest:ToPickup():IsShopItem() and ((not isSoulstone and not EID.Config["DisplayCardInfoShop"]) or (isSoulstone and not EID.Config["DisplaySoulstoneInfoShop"]))
|
||||||
|
local obstructed = ((not isSoulstone and not EID.Config["DisplayObstructedCardInfo"]) or (not EID.Config["DisplayObstructedSoulstoneInfo"] and isSoulstone)) and not EID.hasValidWalkingpath
|
||||||
|
if hideinShop or obstructed or (REPENTANCE and game.Challenge == Challenge.CHALLENGE_CANTRIPPED) then
|
||||||
EID:renderQuestionMark()
|
EID:renderQuestionMark()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -537,6 +537,27 @@ if MCMLoaded then
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
MCM.AddSetting(
|
||||||
|
"EID",
|
||||||
|
"Display",
|
||||||
|
{
|
||||||
|
Type = ModConfigMenu.OptionType.BOOLEAN,
|
||||||
|
CurrentSetting = function()
|
||||||
|
return EID.Config["DisplayObstructedSoulstoneInfo"]
|
||||||
|
end,
|
||||||
|
Display = function()
|
||||||
|
local onOff = "False"
|
||||||
|
if EID.Config["DisplayObstructedSoulstoneInfo"] then
|
||||||
|
onOff = "True"
|
||||||
|
end
|
||||||
|
return "Soulstone Infos: " .. onOff
|
||||||
|
end,
|
||||||
|
OnChange = function(currentBool)
|
||||||
|
EID.Config["DisplayObstructedSoulstoneInfo"] = currentBool
|
||||||
|
end
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
MCM.AddSetting(
|
MCM.AddSetting(
|
||||||
"EID",
|
"EID",
|
||||||
|
|||||||
Reference in new issue
Block a user