-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LttP, Core: Fixes patching LttP on a fresh AP install #2118
Changes from all commits
65b0e41
bb94cb0
bb7c23f
20436eb
4d60241
0491b56
538a205
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -581,31 +581,25 @@ async def game_watcher(self, ctx): | |
def get_alttp_settings(romfile: str): | ||
import LttPAdjuster | ||
|
||
last_settings = Utils.get_adjuster_settings(GAME_ALTTP) | ||
base_settings = LttPAdjuster.get_argparser().parse_known_args(args=[])[0] | ||
allow_list = {"music", "menuspeed", "heartbeep", "heartcolor", "ow_palettes", "quickswap", | ||
"uw_palettes", "sprite", "sword_palettes", "shield_palettes", "hud_palettes", | ||
"reduceflashing", "deathlink", "allowcollect", "oof"} | ||
|
||
for option_name in allow_list: | ||
# set new defaults since last_settings were created | ||
if not hasattr(last_settings, option_name): | ||
setattr(last_settings, option_name, getattr(base_settings, option_name)) | ||
|
||
adjustedromfile = '' | ||
if last_settings: | ||
if vars(Utils.get_adjuster_settings_no_defaults(GAME_ALTTP)): | ||
last_settings = Utils.get_adjuster_settings(GAME_ALTTP) | ||
|
||
allow_list = {"music", "menuspeed", "heartbeep", "heartcolor", "ow_palettes", "quickswap", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list should really just go away - hardly anyone uses text mode, I would guess - and I'd much rather just hide options we don't want to show, rather than hard code a list of special args. |
||
"uw_palettes", "sprite", "sword_palettes", "shield_palettes", "hud_palettes", | ||
"reduceflashing", "deathlink", "allowcollect", "oof"} | ||
choice = 'no' | ||
if not hasattr(last_settings, 'auto_apply') or 'ask' in last_settings.auto_apply: | ||
if 'ask' in last_settings.auto_apply: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Giving some side-eye to all this |
||
printed_options = {name: value for name, value in vars(last_settings).items() if name in allow_list} | ||
if hasattr(last_settings, "sprite_pool"): | ||
sprite_pool = {} | ||
for sprite in last_settings.sprite_pool: | ||
if sprite in sprite_pool: | ||
sprite_pool[sprite] += 1 | ||
else: | ||
sprite_pool[sprite] = 1 | ||
if sprite_pool: | ||
printed_options["sprite_pool"] = sprite_pool | ||
|
||
sprite_pool = {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto for removing this special case. Just show the pool as it exists in the yaml |
||
for sprite in last_settings.sprite_pool: | ||
if sprite in sprite_pool: | ||
sprite_pool[sprite] += 1 | ||
else: | ||
sprite_pool[sprite] = 1 | ||
if sprite_pool: | ||
printed_options["sprite_pool"] = sprite_pool | ||
import pprint | ||
|
||
from CommonClient import gui_enabled | ||
|
@@ -685,17 +679,17 @@ def onButtonClick(answer: str = 'no'): | |
choice = 'yes' | ||
|
||
if 'yes' in choice: | ||
import LttPAdjuster | ||
from worlds.alttp.Rom import get_base_rom_path | ||
last_settings.rom = romfile | ||
last_settings.baserom = get_base_rom_path() | ||
last_settings.world = None | ||
|
||
if hasattr(last_settings, "sprite_pool"): | ||
if last_settings.sprite_pool: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there was maybe a bug here if you had an empty sprite_pool before. |
||
from LttPAdjuster import AdjusterWorld | ||
last_settings.world = AdjusterWorld(getattr(last_settings, "sprite_pool")) | ||
|
||
adjusted = True | ||
import LttPAdjuster | ||
_, adjustedromfile = LttPAdjuster.adjust(last_settings) | ||
|
||
if hasattr(last_settings, "world"): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray, no more duplicated default args.