From 6b2a2fc0106ca5f7824475bbcb918f950802aca2 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 10 Sep 2025 20:12:06 -0400 Subject: [Apworld] Read major version from datafile --- apworld/__init__.py | 5 ++--- apworld/static_logic.py | 3 +++ apworld/version.py | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 apworld/version.py (limited to 'apworld') diff --git a/apworld/__init__.py b/apworld/__init__.py index 8051e0f..4044d76 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py @@ -8,9 +8,8 @@ from .options import Lingo2Options from .player_logic import Lingo2PlayerLogic from .regions import create_regions from .static_logic import Lingo2StaticLogic +from .version import APWORLD_VERSION -MAJOR_VERSION = 1 -MINOR_VERSION = 0 class Lingo2WebWorld(WebWorld): rich_text_options_doc = True @@ -90,7 +89,7 @@ class Lingo2World(World): slot_data = { **self.options.as_dict(*slot_options), - "version": [MAJOR_VERSION, MINOR_VERSION], + "version": [self.static_logic.get_data_version(), APWORLD_VERSION], } return slot_data diff --git a/apworld/static_logic.py b/apworld/static_logic.py index c112d8e..07800f8 100644 --- a/apworld/static_logic.py +++ b/apworld/static_logic.py @@ -154,3 +154,6 @@ class Lingo2StaticLogic: return f"{game_map.display_name} ({room.panel_display_name})" else: return game_map.display_name + + def get_data_version(self) -> int: + return self.objects.version diff --git a/apworld/version.py b/apworld/version.py new file mode 100644 index 0000000..645cce6 --- /dev/null +++ b/apworld/version.py @@ -0,0 +1 @@ +APWORLD_VERSION = 0 -- cgit 1.4.1