Added option to disable the achievement warning

This commit is contained in:
Wofsauge committed 2021-10-31 18:13:00 +01:00
1 parent e9e9751913
commit 5d700d6e29
3 files changed
+29 -1

No files matched your search

+4
View File
@@ -62,6 +62,9 @@ EID.UserConfig = {
-- Toggle obstruction based hiding, when the player has flight -- Toggle obstruction based hiding, when the player has flight
-- Default = true -- Default = true
["DisableObstructionOnFlight"] = true, ["DisableObstructionOnFlight"] = true,
-- If set to true, the mod will no longer check if the save game has achievements unlocked
-- Default = false
["DisableAchievementCheck"] = false,
-------------CURSE------------- -------------CURSE-------------
@@ -262,6 +265,7 @@ EID.DefaultConfig = {
["InitiallyHidden"] = false, ["InitiallyHidden"] = false,
["HideInBattle"] = false, ["HideInBattle"] = false,
["DisableObstructionOnFlight"] = true, ["DisableObstructionOnFlight"] = true,
["DisableAchievementCheck"] = false,
["DisableOnCurse"] = true, ["DisableOnCurse"] = true,
["DisableOnAltPath"] = true, ["DisableOnAltPath"] = true,
["DisableOnAprilFoolsChallenge"] = true, ["DisableOnAprilFoolsChallenge"] = true,
+2 -1
View File
@@ -537,7 +537,7 @@ EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate)
local hasShownAchievementWarning = false local hasShownAchievementWarning = false
local function renderAchievementInfo() local function renderAchievementInfo()
if REPENTANCE and game:GetFrameCount() < 10*30 then if REPENTANCE and not EID.Config.DisableAchievementCheck and game:GetFrameCount() < 10*30 and game.Challenge == 0 then
local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS) local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)
if not hasBookOfRevelationsUnlocked then if not hasBookOfRevelationsUnlocked then
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT) local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
@@ -812,6 +812,7 @@ if EID.MCMLoaded or REPENTANCE then
EID.SaveData(EID, json.encode(EID.Config)) EID.SaveData(EID, json.encode(EID.Config))
EID:hidePermanentText() EID:hidePermanentText()
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_CUBE_OF_MEAT] = nil EID.itemUnlockStates[CollectibleType.COLLECTIBLE_CUBE_OF_MEAT] = nil
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS] = nil
end end
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame) EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame)
end end
+23
View File
@@ -355,6 +355,29 @@ if MCMLoaded then
} }
) )
-- disable achievements
MCM.AddSetting(
"EID",
"General",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["DisableAchievementCheck"]
end,
Display = function()
local onOff = "Enabled"
if EID.Config["DisableAchievementCheck"] then
onOff = "Disabled"
end
return "Achievement warning: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["DisableAchievementCheck"] = currentBool
end,
Info = {"Use this to turn off the achievement warning"}
}
)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
---------------------------------Display----------------------------------- ---------------------------------Display-----------------------------------