Added warning message for disabled achievements

This commit is contained in:
Wofsauge committed 2021-10-21 00:59:22 +02:00
1 parent b7a28b8739
commit 8bea7679d7
2 files changed
+21

No files matched your search

+2
View File
@@ -675,3 +675,5 @@ EID.descriptions["en_us"].CraftingFloorContent = "Floor:"
EID.descriptions["en_us"].CraftingResults = "(Scroll: hold {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}},#Lock: {{ButtonX}}, Refresh: {{ButtonB}})"
EID.descriptions["en_us"].CraftingBagModError = "!!! {{ColorRed}}ERROR:#{{ColorRed}}The \"Crafting result calculation\" feature currently does not work when item mods are installed!#{{ColorRed}}Please uninstall the item mods or deactivate the Bag of Crafting descriptions in the config"
EID.descriptions["en_us"].AchievementWarningTitle = "{{ColorYellow}}!!! WARNING !!!"
EID.descriptions["en_us"].AchievementWarningText = "Achievements are disabled!#In order to enable progression and achievements, you first need to kill Mom (Depths II) without any mods enabled."
+19
View File
@@ -535,6 +535,22 @@ function EID:onGameUpdate()
end
EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate)
local hasShownAchievementWarning = false
local function renderAchievementInfo()
if game:GetFrameCount() < 10*30 then
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
if not hasCubeOfMeatUnlocked then
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or ""
demoDescObj.Description = EID:getDescriptionEntry("AchievementWarningText") or ""
EID:displayPermanentText(demoDescObj)
hasShownAchievementWarning = true
end
elseif hasShownAchievementWarning then
EID:hidePermanentText()
end
end
---------------------------------------------------------------------------
---------------------------On Render Function------------------------------
@@ -550,6 +566,7 @@ local function onRender(t)
end
EID:renderMCMDummyDescription()
renderAchievementInfo()
EID.player = Isaac.GetPlayer(0)
if EID.GameVersion == "ab+" then
@@ -790,6 +807,8 @@ if EID.MCMLoaded or REPENTANCE then
EID.Config["BagFloorContent"] = EID.bagOfCraftingRoomQueries or {}
end
EID.SaveData(EID, json.encode(EID.Config))
EID:hidePermanentText()
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_CUBE_OF_MEAT] = nil
end
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, SaveGame)
end