diff --git a/game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/0.webp b/game/mods/ExampleMod/characters/hermione/poses/default/clothes/hair/ponytail/0.webp similarity index 100% rename from game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/0.webp rename to game/mods/ExampleMod/characters/hermione/poses/default/clothes/hair/ponytail/0.webp diff --git a/game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/1.webp b/game/mods/ExampleMod/characters/hermione/poses/default/clothes/hair/ponytail/1.webp similarity index 100% rename from game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/1.webp rename to game/mods/ExampleMod/characters/hermione/poses/default/clothes/hair/ponytail/1.webp diff --git a/game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/outline.webp b/game/mods/ExampleMod/characters/hermione/poses/default/clothes/hair/ponytail/outline.webp similarity index 100% rename from game/mods/MyMod/characters/hermione/poses/default/clothes/hair/ponytail/outline.webp rename to game/mods/ExampleMod/characters/hermione/poses/default/clothes/hair/ponytail/outline.webp diff --git a/game/mods/MyMod/logo.webp b/game/mods/ExampleMod/logo.webp similarity index 100% rename from game/mods/MyMod/logo.webp rename to game/mods/ExampleMod/logo.webp diff --git a/game/mods/MyMod/manifest.json b/game/mods/ExampleMod/manifest.json similarity index 69% rename from game/mods/MyMod/manifest.json rename to game/mods/ExampleMod/manifest.json index 2fb665b9..dd5f5c2d 100644 --- a/game/mods/MyMod/manifest.json +++ b/game/mods/ExampleMod/manifest.json @@ -1,7 +1,7 @@ { - "Name": "MyMod", + "Name": "ExampleMod", "Author": "LoafyLemon", "Version": "1.0.0", "Description": "Adds ponytail hairstyle for Hermione", - "GameVer": "1.45" + "GameVer": "1.45.2" } diff --git a/game/mods/MyMod/script.rpym b/game/mods/ExampleMod/script.rpym similarity index 92% rename from game/mods/MyMod/script.rpym rename to game/mods/ExampleMod/script.rpym index 662f2ce5..14aa1950 100644 --- a/game/mods/MyMod/script.rpym +++ b/game/mods/ExampleMod/script.rpym @@ -1,7 +1,7 @@ # Add new hairstyle for character as an instance of DollCloth, # make sure the variable name is unique, preferably starting with mod name. -default MyMod_ponytail = DollCloth( - modpath="MyMod", # File path; Usually a mod folder name. (case insensitive) +default ExampleMod_ponytail = DollCloth( + modpath="ExampleMod", # File path; Usually a mod folder name. (case insensitive) name="hermione", # Character name (case sensitive) categories=("head","hair"), # Main category and subcategory of the item (case sensitive) type="hair", # Item type (case sensitive) diff --git a/game/scripts/gui/mods.rpy b/game/scripts/gui/mods.rpy index 64ecf7d3..7a045e70 100644 --- a/game/scripts/gui/mods.rpy +++ b/game/scripts/gui/mods.rpy @@ -34,7 +34,7 @@ screen mods(): $ desc = mod["Description"] $ author = mod["Author"] $ version = mod["Version"] - $ compat = float(mod["GameVer"]) + $ compat = version_float(mod["GameVer"]) #$ order = mod["LoadOrder"] $ logo = mod["Logo"] $ enabled = bool(name in persistent.mods_enabled) @@ -86,7 +86,7 @@ screen mods(): $ desc = mods_list[selection]["Description"] $ author = mods_list[selection]["Author"] $ version = mods_list[selection]["Version"] - $ compat = float(mods_list[selection]["GameVer"]) + $ compat = version_float(mods_list[selection]["GameVer"]) #$ order = mods_list[selection]["LoadOrder"] $ logo = mods_list[selection]["Logo"] diff --git a/game/scripts/mods.rpy b/game/scripts/mods.rpy index ddf821f7..4b331a4e 100644 --- a/game/scripts/mods.rpy +++ b/game/scripts/mods.rpy @@ -4,9 +4,9 @@ init -999: import os if not getattr(persistent, "mods_enabled"): - persistent.mods_enabled = set() + persistent.mods_enabled = _set() - mods_list = dict() + mods_list = _dict() def mods_import(): global mods_list @@ -52,7 +52,8 @@ init -999: try: renpy.include_module(name) except Exception as e: - renpy.error(e) + if config.developer: + renpy.error(e) persistent.mods_enabled.remove(i) mods_import() diff --git a/game/scripts/utility/updater.rpy b/game/scripts/utility/updater.rpy index 58d62f34..53f89228 100644 --- a/game/scripts/utility/updater.rpy +++ b/game/scripts/utility/updater.rpy @@ -140,6 +140,13 @@ init python: getattr(store, "letter_cards_store").wait = 7 + # Fix revertable types for modding + mods_enabled = getattr(persistent, "mods_enabled", _set()) + setattr(persistent, "mods_enabled", _set(mods_enabled)) + + mods_list = getattr(persistent, "mods_list", _dict()) + setattr(persistent, "mods_list", _dict(mods_list)) + if current > latest: raise Exception("Loaded save file is incompatible. (Save Version: {}, Game Version: {})".format(current, latest))