Skip to content

Commit

Permalink
Non-GUI setting
Browse files Browse the repository at this point in the history
  • Loading branch information
GSKirox committed Jul 16, 2024
1 parent 790152e commit cab9e20
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def make_spoiler(settings: Settings, worlds: list[World]) -> Spoiler:
elif any(world.dungeon_rewards_hinted for world in worlds) or any(hint_type in settings.misc_hints for hint_type in misc_item_hint_table) or any(hint_type in settings.misc_hints for hint_type in misc_location_hint_table):
spoiler.find_misc_hint_items()
spoiler.build_file_hash()
spoiler.build_password(False)
spoiler.build_password(settings.password_lock)
return spoiler


Expand Down
3 changes: 3 additions & 0 deletions Plandomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,9 @@ def to_json(self, include_output: bool = True, spoiler: bool = True) -> dict[str
'settings': self.settings.to_json(),
}

if not self.settings.password_lock:
self_dict.pop('password')

if spoiler:
world_dist_dicts = [world_dist.to_json() for world_dist in self.world_dists]
if self.settings.world_count > 1:
Expand Down
14 changes: 14 additions & 0 deletions SettingsList.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,20 @@ class SettingInfos:
''',
)

password_lock = Checkbutton(
gui_text = "Lock the seed behind a password",
default = False,
gui_tooltip = '''\
The file select screen will be locked behind a password provided in the spoiler log.
''',
shared = True,
disabled_default = 0,
gui_params = {
'optional': True,
"hide_when_disabled": True,
},
)

# Main Rules (and "Guarantee Reachable Locations")

randomize_settings = Checkbutton(
Expand Down
10 changes: 10 additions & 0 deletions data/presets_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"user_message": "Easy Mode",
"world_count": 1,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -196,6 +197,7 @@
"user_message": "S7 Tournament",
"world_count": 1,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -399,6 +401,7 @@
"user_message": "Standard Weekly (2024-07-05)",
"world_count": 1,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -604,6 +607,7 @@
"user_message": "DDR Season 2",
"world_count": 1,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -812,6 +816,7 @@
"user_message": "Scrub Tournament",
"world_count": 1,
"create_spoiler": false,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -1017,6 +1022,7 @@
"user_message": "Multiworld Tournament Season 4",
"world_count": 3,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -1221,6 +1227,7 @@
"user_message": "Hell Mode",
"world_count": 1,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -1599,6 +1606,7 @@
"user_message": "Bingo",
"world_count": 1,
"create_spoiler": true,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down Expand Up @@ -1788,6 +1796,7 @@
"user_message": "OoTR League S7",
"world_count": 1,
"create_spoiler": false,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "beatable",
Expand Down Expand Up @@ -2008,6 +2017,7 @@
"user_message": "Co-Op Tournament Season 3",
"world_count": 1,
"create_spoiler": false,
"password_lock": false,
"randomize_settings": false,
"logic_rules": "glitchless",
"reachable_locations": "all",
Expand Down

0 comments on commit cab9e20

Please sign in to comment.