Skip to content

Commit 8d3b2ef

Browse files
committed
8.0 Hotfix
2 parents 0afb82d + 63749c7 commit 8d3b2ef

File tree

12 files changed

+3188
-3186
lines changed

12 files changed

+3188
-3186
lines changed

ASM/build/asm_symbols.txt

Lines changed: 451 additions & 451 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/build/bundle.o

0 Bytes
Binary file not shown.

ASM/c/ocarina_buttons.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ uint8_t c_block_ocarina() {
1919
}
2020
return res;
2121
}
22-
extern int16_t EPONAS_SONG_NOTES;
22+
extern uint8_t EPONAS_SONG_NOTES;
2323
int8_t can_spawn_epona() {
2424
if (!SHUFFLE_OCARINA_BUTTONS) {
2525
return 1;

ASM/src/config.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ CUSTOM_KEY_MODELS:
197197
SHUFFLE_OCARINA_BUTTONS:
198198
.byte 0x00
199199
EPONAS_SONG_NOTES:
200-
.halfword 0x0000
200+
.byte 0x00
201201
.align 4
202202

203203
; These configuration values are given fixed addresses to aid auto-trackers.

Cosmetics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ def __init__(self, settings: Settings) -> None:
12661266
for setting in self.settings.setting_infos.values():
12671267
if setting.name not in self.src_dict['settings'] or not setting.cosmetic:
12681268
continue
1269-
self.settings.settings_dict[setting.name] = self.src_dict['settings'][setting.name]
1269+
setattr(self.settings, setting.name, self.src_dict['settings'][setting.name])
12701270
valid_settings.append(setting.name)
12711271
for setting in list(self.src_dict['settings'].keys()):
12721272
if setting not in valid_settings:

GUI/src/app/providers/GUIGlobal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ export class GUIGlobal implements OnDestroy {
529529
userSettings[setting.name].forEach(entry => {
530530

531531
let optionEntry = setting.options.find(option => {
532-
if (option.name == entry)
532+
if (option.name === entry)
533533
return true;
534534

535535
return false;
@@ -548,7 +548,7 @@ export class GUIGlobal implements OnDestroy {
548548
}
549549
else {
550550
let optionEntry = setting.options.find(option => {
551-
if (option.name == userSettings[setting.name])
551+
if (option.name === userSettings[setting.name])
552552
return true;
553553

554554
return false;
@@ -886,7 +886,7 @@ export class GUIGlobal implements OnDestroy {
886886
settingsObj[setting.name].forEach(entry => {
887887

888888
let optionEntry = setting.options.find(option => {
889-
if (option.name == entry)
889+
if (option.name === entry)
890890
return true;
891891

892892
return false;
@@ -901,7 +901,7 @@ export class GUIGlobal implements OnDestroy {
901901
else if (setting.type == "Combobox") { //Ensure combobox option exists before applying it (in case of outdated settings being loaded)
902902

903903
let optionEntry = setting.options.find(option => {
904-
if (option.name == settingsObj[setting.name])
904+
if (option.name === settingsObj[setting.name])
905905
return true;
906906

907907
return false;

Patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,7 @@ def update_scrub_text(message: bytearray, text_replacement: list[str], default_p
25082508
song_layout_in_byte_form |= 1 << 3
25092509
if '>' in epona_notes:
25102510
song_layout_in_byte_form |= 1 << 4
2511-
rom.write_int16(rom.sym('EPONAS_SONG_NOTES'), song_layout_in_byte_form)
2511+
rom.write_byte(rom.sym('EPONAS_SONG_NOTES'), song_layout_in_byte_form)
25122512

25132513
# Sets the torch count to open the entrance to Shadow Temple
25142514
if world.settings.easier_fire_arrow_entry:

Plandomizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ def __init__(self, settings: Settings, src_dict: Optional[dict[str, Any]] = None
11861186
or update_dict['_settings'].get('starting_songs', None)):
11871187
update_dict['_settings']['starting_items'] = {}
11881188

1189-
self.settings.settings_dict.update(update_dict['_settings'])
1189+
self.settings.update(update_dict['_settings'])
11901190
if 'settings' in self.src_dict:
11911191
validate_settings(self.src_dict['settings'])
11921192
self.src_dict['_settings'] = self.src_dict['settings']

Settings.py

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ def __init__(self, settings_dict: dict[str, Any], strict: bool = False) -> None:
8484
del settings_dict['compress_rom']
8585
if strict:
8686
validate_settings(settings_dict)
87-
self.settings_dict.update(settings_dict)
88-
for info in self.setting_infos.values():
89-
if info.name not in self.settings_dict:
90-
self.settings_dict[info.name] = info.default
87+
self.update(settings_dict, initialize=True)
9188

9289
if self.world_count < 1:
9390
self.world_count = 1
@@ -105,6 +102,14 @@ def copy(self) -> Settings:
105102
settings.settings_dict = copy.deepcopy(settings.settings_dict)
106103
return settings
107104

105+
def update(self, settings_dict: dict[str, Any], *, initialize: bool = False) -> None:
106+
for info in self.setting_infos.values():
107+
if info.type is type(None):
108+
continue
109+
if not initialize and info.name not in settings_dict:
110+
continue
111+
setattr(self, info.name, settings_dict[info.name] if info.name in settings_dict else info.default)
112+
108113
def get_settings_display(self) -> str:
109114
padding = 0
110115
for setting in filter(lambda s: s.shared, self.setting_infos.values()):
@@ -114,16 +119,16 @@ def get_settings_display(self) -> str:
114119
for setting in filter(lambda s: s.shared, self.setting_infos.values()):
115120
name = setting.name + ': ' + ' ' * (padding - len(setting.name))
116121
if setting.type == list:
117-
val = ('\n' + (' ' * (padding + 2))).join(self.settings_dict[setting.name])
122+
val = ('\n' + (' ' * (padding + 2))).join(getattr(self, setting.name))
118123
else:
119-
val = str(self.settings_dict[setting.name])
124+
val = str(getattr(self, setting.name))
120125
output += name + val + '\n'
121126
return output
122127

123128
def get_settings_string(self) -> str:
124129
bits = []
125130
for setting in filter(lambda s: s.shared and s.bitwidth > 0, self.setting_infos.values()):
126-
value = self.settings_dict[setting.name]
131+
value = getattr(self, setting.name)
127132
i_bits = []
128133
if setting.name in LEGACY_STARTING_ITEM_SETTINGS:
129134
items = LEGACY_STARTING_ITEM_SETTINGS[setting.name]
@@ -223,9 +228,9 @@ def update_with_settings_string(self, text: str) -> None:
223228
else:
224229
raise TypeError(f'Cannot decode type {setting.type} from settings string')
225230

226-
self.settings_dict[setting.name] = value
231+
setattr(self, setting.name, value)
227232

228-
self.settings_dict['starting_items'] = {} # Settings string contains the GUI format, so clear the current value of the dict format.
233+
setattr(self, 'starting_items', {}) # Settings string contains the GUI format, so clear the current value of the dict format.
229234
self.distribution.reset() # convert starting_items
230235
self.settings_string = self.get_settings_string()
231236
self.numeric_seed = self.get_numeric_seed()
@@ -249,10 +254,6 @@ def update_seed(self, seed: str) -> None:
249254
self.sanitize_seed()
250255
self.numeric_seed = self.get_numeric_seed()
251256

252-
def update(self) -> None:
253-
self.settings_string = self.get_settings_string()
254-
self.numeric_seed = self.get_numeric_seed()
255-
256257
def load_distribution(self) -> None:
257258
if self.enable_distribution_file:
258259
if self.distribution_file:
@@ -286,7 +287,7 @@ def check_dependency(self, setting_name: str, check_random: bool = True) -> bool
286287
def get_dependency(self, setting_name: str, check_random: bool = True) -> Any:
287288
info = SettingInfos.setting_infos[setting_name]
288289
not_in_dist = '_settings' not in self.distribution.src_dict or info.name not in self.distribution.src_dict['_settings'].keys()
289-
if check_random and 'randomize_key' in info.gui_params and self.settings_dict[info.gui_params['randomize_key']] and not_in_dist:
290+
if check_random and 'randomize_key' in info.gui_params and getattr(self, info.gui_params['randomize_key']) and not_in_dist:
290291
return info.disabled_default
291292
elif info.dependency is not None:
292293
return info.disabled_default if info.dependency(self) and not_in_dist else None
@@ -298,7 +299,7 @@ def remove_disabled(self) -> None:
298299
if info.dependency is not None:
299300
new_value = self.get_dependency(info.name)
300301
if new_value is not None:
301-
self.settings_dict[info.name] = new_value
302+
setattr(self, info.name, new_value)
302303
self._disabled.add(info.name)
303304

304305
self.settings_string = self.get_settings_string()
@@ -327,46 +328,47 @@ def resolve_random_settings(self, cosmetic: bool, randomize_key: Optional[str] =
327328
# Make sure the setting is meant to be randomized and not specified in distribution
328329
# We that check it's not specified in the distribution so that plando can override randomized settings
329330
not_in_dist = '_settings' not in self.distribution.src_dict or info.name not in self.distribution.src_dict['_settings'].keys()
330-
if self.settings_dict[info.gui_params['randomize_key']] and not_in_dist:
331+
if getattr(self, info.gui_params['randomize_key']) and not_in_dist:
331332
randomize_keys_enabled.add(info.gui_params['randomize_key'])
332333
choices, weights = zip(*info.gui_params['distribution'])
333-
self.settings_dict[info.name] = random.choices(choices, weights=weights)[0]
334+
setattr(self, info.name, random.choices(choices, weights=weights)[0])
334335

335336
# Second pass to make sure disabled settings are set properly.
336337
# Stupid hack: disable randomize keys, then re-enable.
337338
for randomize_keys in randomize_keys_enabled:
338-
self.settings_dict[randomize_keys] = False
339+
setattr(self, randomize_keys, False)
339340
for info in sorted_infos:
340341
if cosmetic == info.shared:
341342
continue
342343
dependency = self.get_dependency(info.name, check_random=False)
343344
if dependency is None:
344345
continue
345-
self.settings_dict[info.name] = dependency
346+
setattr(self, info.name, dependency)
346347
for randomize_keys in randomize_keys_enabled:
347-
self.settings_dict[randomize_keys] = True
348+
setattr(self, randomize_keys, True)
348349

349350
def to_json(self, *, legacy_starting_items: bool = False) -> dict[str, Any]:
350351
if legacy_starting_items:
351352
settings = self.copy()
352353
for setting_name, items in LEGACY_STARTING_ITEM_SETTINGS.items():
353-
settings.settings_dict[setting_name] = []
354+
starting_items = []
355+
setattr(settings, setting_name, starting_items)
354356
for entry in items.values():
355357
if entry.item_name in self.starting_items:
356358
count = self.starting_items[entry.item_name]
357359
if not isinstance(count, int):
358360
count = count.count
359361
if count > entry.i:
360-
settings.settings_dict[setting_name].append(entry.setting_name)
362+
starting_items.append(entry.setting_name)
361363
else:
362364
settings = self
363365
return { # TODO: This should be done in a way that is less insane than a double-digit line dictionary comprehension.
364366
setting.name: (
365367
{name: (
366368
{name: record.to_json() for name, record in record.items()} if isinstance(record, dict) else record.to_json()
367-
) for name, record in settings.settings_dict[setting.name].items()}
369+
) for name, record in getattr(settings, setting.name).items()}
368370
if setting.name == 'starting_items' and not legacy_starting_items else
369-
settings.settings_dict[setting.name]
371+
getattr(settings, setting.name)
370372
)
371373
for setting in self.setting_infos.values()
372374
if setting.shared and (
@@ -380,7 +382,7 @@ def to_json(self, *, legacy_starting_items: bool = False) -> dict[str, Any]:
380382
}
381383

382384
def to_json_cosmetics(self) -> dict[str, Any]:
383-
return {setting.name: self.settings_dict[setting.name] for setting in self.setting_infos.values() if setting.cosmetic}
385+
return {setting.name: getattr(self, setting.name) for setting in self.setting_infos.values() if setting.cosmetic}
384386

385387

386388
# gets the randomizer settings, whether to open the gui, and the logger level from command line arguments

0 commit comments

Comments
 (0)