From ba5d5c25d1aa5df54d6f949af916bb62336d62b1 Mon Sep 17 00:00:00 2001 From: AltoXorg <56553686+Alto1772@users.noreply.github.com> Date: Wed, 18 Jan 2023 06:05:24 +0800 Subject: [PATCH 1/5] changes to the asset extraction script (#2068) - fixes exiting with Ctrl+C on linux - chooseROM returns Z64Rom object in addition to speed - adds simple verbosity for inspecting roms --- OTRExporter/extract_assets.py | 9 ++++----- OTRExporter/rom_chooser.py | 22 ++++++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/OTRExporter/extract_assets.py b/OTRExporter/extract_assets.py index 4e17d45a1..4983e6c94 100755 --- a/OTRExporter/extract_assets.py +++ b/OTRExporter/extract_assets.py @@ -32,17 +32,16 @@ def main(): parser.add_argument("-z", "--zapd", help="Path to ZAPD executable", dest="zapd_exe", type=str) parser.add_argument("rom", help="Path to the rom", type=str, nargs="?") parser.add_argument("--non-interactive", help="Runs the script non-interactively for use in build scripts.", dest="non_interactive", action="store_true") + parser.add_argument("-v", "--verbose", help="Display rom's header checksums and their corresponding xml folder", dest="verbose", action="store_true") args = parser.parse_args() - rom_paths = [ args.rom ] if args.rom else rom_chooser.chooseROM(args.non_interactive) - for rom_path in rom_paths: - rom = Z64Rom(rom_path) - + roms = [ Z64Rom(args.rom) ] if args.rom else rom_chooser.chooseROM(args.verbose, args.non_interactive) + for rom in roms: if (os.path.exists("Extract")): shutil.rmtree("Extract") - BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom_path, zapd_exe=args.zapd_exe) + BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom.file_path, zapd_exe=args.zapd_exe) if __name__ == "__main__": main() diff --git a/OTRExporter/rom_chooser.py b/OTRExporter/rom_chooser.py index 5e79add7e..bdee088be 100644 --- a/OTRExporter/rom_chooser.py +++ b/OTRExporter/rom_chooser.py @@ -2,12 +2,13 @@ import os, sys, glob from rom_info import Z64Rom -def chooseROM(non_interactive=False): +def chooseROM(verbose=False, non_interactive=False): roms = [] for file in glob.glob("*.z64"): - if Z64Rom.isValidRom(file): - roms.append(file) + rom = Z64Rom(file) + if rom.is_valid: + roms.append(rom) if not (roms): print("Error: No roms located, place one in the OTRExporter directory", file=os.sys.stderr) @@ -21,23 +22,28 @@ def chooseROM(non_interactive=False): foundMq = False foundOot = False for rom in roms: - isMq = Z64Rom.isMqRom(rom) - if isMq and not foundMq: + if rom.isMq and not foundMq: romsToExtract.append(rom) foundMq = True - elif not isMq and not foundOot: + elif not rom.isMq and not foundOot: romsToExtract.append(rom) foundOot = True return romsToExtract - print(str(len(roms))+ " roms found, please select one by pressing 1-"+str(len(roms))) + print(f"{len(roms)} roms found, please select one by pressing 1-{len(roms)}") + print() for i in range(len(roms)): - print(str(i+1)+ ". " + roms[i]) + print(f"[{i+1:>2d}] {roms[i].file_path}") + if verbose: + print(f" Checksum: {roms[i].checksum.value}, Version XML: {roms[i].version.xml_ver}") + print() while(1): try: selection = int(input()) + except KeyboardInterrupt: + sys.exit(1) except: print("Bad input. Try again with the number keys.") continue From 13b8f26435e2b58ccd3d97e57aa358bee666a42c Mon Sep 17 00:00:00 2001 From: UltraHDR <108294295+UltraHDR@users.noreply.github.com> Date: Tue, 10 Jan 2023 11:46:03 +0000 Subject: [PATCH 2/5] Set LSApplicationCategoryType to games --- soh/macosx/Info.plist.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/soh/macosx/Info.plist.in b/soh/macosx/Info.plist.in index b44948b36..dd0a49e8f 100644 --- a/soh/macosx/Info.plist.in +++ b/soh/macosx/Info.plist.in @@ -29,6 +29,8 @@ @CMAKE_PROJECT_VERSION@ NSHumanReadableCopyright Copyright 2022 HarbourMasters. + LSApplicationCategoryType + public.app-category.games LSMinimumSystemVersion 10.15 From 418d0f8e6c4431468a5c52447afe09c613462594 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 17 Jan 2023 17:57:02 -0500 Subject: [PATCH 3/5] fix: default cvar values before applying presets (#2357) --- soh/soh/Enhancements/presets.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/presets.cpp index 91d5c323a..aa8558caa 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/presets.cpp @@ -55,9 +55,8 @@ void DrawPresetSelector(PresetType presetTypeId) { ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 4.0f)); if (ImGui::Button(("Apply Preset##" + presetTypeCvar).c_str())) { - if (selectedPresetId == 0) { - clearCvars(presetTypeDef.cvarsToClear); - } else { + clearCvars(presetTypeDef.cvarsToClear); + if (selectedPresetId != 0) { applyPreset(selectedPresetDef.entries); } SohImGui::RequestCvarSaveOnNextTick(); From f665326a67542c4d197a2bfe32ab70c90328101a Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 17 Jan 2023 21:40:02 -0500 Subject: [PATCH 4/5] workaround for vanilla save check tracker crash (#2359) Co-authored-by: briaguya --- soh/soh/Enhancements/randomizer/3drando/item_list.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soh/soh/Enhancements/randomizer/3drando/item_list.cpp b/soh/soh/Enhancements/randomizer/3drando/item_list.cpp index 6a80ec6ef..d7fc6cfcc 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_list.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_list.cpp @@ -286,6 +286,11 @@ Item& ItemFromGIID(const int giid) { } index++; } + + // there are vanilla items that don't exist in the item table we're reading from here + // if we made it this far, it means we didn't find an item in the table + // if we don't return anything, the game will crash, so, as a workaround, return greg + return itemTable[GREEN_RUPEE]; } //This function should only be used to place items containing hint text From 750ae907c2f3eb33fb8d95302a1071a1369d6a5b Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Tue, 17 Jan 2023 22:14:45 -0500 Subject: [PATCH 5/5] sdl windowed fullscreen (#2351) --- libultraship | 2 +- soh/soh/GameMenuBar.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libultraship b/libultraship index b1c75c86e..7f04a562b 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit b1c75c86e902e5036ee1d36afad1a35313988fe7 +Subproject commit 7f04a562b2e1ece4c85165b4efdf4258cdf94d74 diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index fe4986f02..ef736af6c 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -271,6 +271,10 @@ namespace GameMenuBar { ImGui::PopStyleVar(1); } + if (SohImGui::supportsWindowedFullscreen()) { + UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); + } + if (SohImGui::supportsViewports()) { UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false); UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload to take effect.");