From 7bc6c58721fe84cb186cb457e47e8e2e52ba98de Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Wed, 8 May 2024 21:39:47 -0500 Subject: [PATCH] Replace some remaining soh branding with 2ship (#341) --- .github/workflows/main.yml | 10 +++++----- .gitignore | 1 + CMakeLists.txt | 20 ++++++++++---------- copy-existing-otrs.cmake | 24 ++++++++++++------------ mm/2s2h/BenPort.cpp | 8 ++++---- mm/2s2h/BenPort.h | 2 +- mm/CMakeLists.txt | 4 ++-- mm/assets/2s2h_assets.h | 2 +- 8 files changed, 36 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eae7e6bdb..8c7f59f2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: run: | export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release - cmake --build build-cmake --config Release --target GenerateSohOtr -j + cmake --build build-cmake --config Release --target Generate2ShipOtr -j cmake --build build-cmake --config Release -j (cd build-cmake && cpack -G External) @@ -79,10 +79,10 @@ jobs: # vcpkg # - name: Configure Developer Command Prompt # uses: ilammy/msvc-dev-cmd@v1 - # - name: Download soh.otr + # - name: Download 2ship.otr # uses: actions/download-artifact@v4 # with: - # name: soh.otr + # name: 2ship.otr # - name: Download Headers # uses: actions/download-artifact@v4 # with: @@ -105,7 +105,7 @@ jobs: # mv ./README.md ./2ship-windows/readme.txt # mv ./build-windows/gamecontrollerdb.txt ./2ship-windows/gamecontrollerdb.txt # mv ./x64/Release/assets ./2ship-windows - # mv ./soh.otr ./2ship-windows/soh.otr + # mv ./2ship.otr ./2ship-windows/2ship.otr # - name: Upload build # uses: actions/upload-artifact@v4 # with: @@ -143,7 +143,7 @@ jobs: run: | set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release - cmake --build build-windows --config Release --target GenerateSohOtr --parallel 10 + cmake --build build-windows --config Release --target Generate2ShipOtr --parallel 10 cmake --build build-windows --config Release --parallel 10 (cd build-windows && cpack) diff --git a/.gitignore b/.gitignore index 9b08fc7b1..b6a50cfd2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.swp logs *.nix +2ship2harkinian.json shipofharkinian.json *.sav .envrc diff --git a/CMakeLists.txt b/CMakeLists.txt index d52262995..d5eb93960 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,7 +109,7 @@ set_property(TARGET mm PROPERTY APPIMAGE_ICON_FILE "${CMAKE_BINARY_DIR}/2s2hIcon if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") install(PROGRAMS "${CMAKE_BINARY_DIR}/linux/2s2h.sh" DESTINATION . COMPONENT appimage) -install(FILES "${CMAKE_SOURCE_DIR}/soh.otr" DESTINATION . COMPONENT ship) +install(FILES "${CMAKE_SOURCE_DIR}/2ship.otr" DESTINATION . COMPONENT ship) install(TARGETS ZAPD DESTINATION ./assets/extractor COMPONENT extractor) install(DIRECTORY "${CMAKE_SOURCE_DIR}/mm/assets/extractor/" DESTINATION ./assets/extractor COMPONENT extractor) install(DIRECTORY "${CMAKE_SOURCE_DIR}/mm/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT extractor) @@ -134,13 +134,13 @@ find_package(Python3 COMPONENTS Interpreter) add_custom_target( ExtractAssets # CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions - COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f mm.otr soh.otr - COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --non-interactive --xml-root ../mm/assets/xml --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}" + COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f mm.otr 2ship.otr + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --non-interactive --xml-root ../mm/assets/xml --custom-otr-file 2ship.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}" COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter COMMENT "Running asset extraction..." DEPENDS ZAPD - BYPRODUCTS mm.otr ${CMAKE_SOURCE_DIR}/mm.otr ${CMAKE_SOURCE_DIR}/soh.otr + BYPRODUCTS mm.otr ${CMAKE_SOURCE_DIR}/mm.otr ${CMAKE_SOURCE_DIR}/2ship.otr ) # Target to generate headers @@ -152,15 +152,15 @@ add_custom_target( DEPENDS ZAPD ) -# Target to generate only soh.otr +# Target to generate only 2ship.otr add_custom_target( - GenerateSohOtr + Generate2ShipOtr # CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions - COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f soh.otr - COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --norom --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}" - COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake + COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f 2ship.otr + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --norom --custom-otr-file 2ship.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/mm/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}" + COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLY2SHIPOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter - COMMENT "Generating soh.otr..." + COMMENT "Generating 2ship.otr..." DEPENDS ZAPD ) diff --git a/copy-existing-otrs.cmake b/copy-existing-otrs.cmake index 3f18f36ca..ae968ab77 100644 --- a/copy-existing-otrs.cmake +++ b/copy-existing-otrs.cmake @@ -1,29 +1,29 @@ message(STATUS "Copying otr files...") -if(NOT ONLYSOHOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.otr) +if(NOT ONLY2SHIPOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.otr) execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.otr ${SOURCE_DIR}) execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.otr ${BINARY_DIR}/mm/) message(STATUS "Copied mm.otr") endif() -if(EXISTS ${SOURCE_DIR}/OTRExporter/soh.otr) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy soh.otr ${SOURCE_DIR}) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy soh.otr ${BINARY_DIR}/mm/) - message(STATUS "Copied soh.otr") +if(EXISTS ${SOURCE_DIR}/OTRExporter/2ship.otr) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.otr ${SOURCE_DIR}) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.otr ${BINARY_DIR}/mm/) + message(STATUS "Copied 2ship.otr") endif() -# Additionally for Windows, copy the otrs to the target dir, side by side with soh.exe +# Additionally for Windows, copy the otrs to the target dir, side by side with 2ship.exe if(SYSTEM_NAME MATCHES "Windows") - if(NOT ONLYSOHOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.otr) + if(NOT ONLY2SHIPOTR AND EXISTS ${SOURCE_DIR}/OTRExporter/mm.otr) execute_process(COMMAND ${CMAKE_COMMAND} -E copy mm.otr ${TARGET_DIR}) endif() - if(EXISTS ${SOURCE_DIR}/OTRExporter/soh.otr) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy soh.otr ${TARGET_DIR}) + if(EXISTS ${SOURCE_DIR}/OTRExporter/2ship.otr) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy 2ship.otr ${TARGET_DIR}) endif() endif() -if(NOT ONLYSOHOTR AND (NOT EXISTS ${SOURCE_DIR}/mm.otr)) +if(NOT ONLY2SHIPOTR AND (NOT EXISTS ${SOURCE_DIR}/mm.otr)) message(FATAL_ERROR "Failed to copy. No OTR files found.") endif() -if(NOT EXISTS ${SOURCE_DIR}/soh.otr) - message(FATAL_ERROR "Failed to copy. No soh OTR found.") +if(NOT EXISTS ${SOURCE_DIR}/2ship.otr) + message(FATAL_ERROR "Failed to copy. No 2ship OTR found.") endif() diff --git a/mm/2s2h/BenPort.cpp b/mm/2s2h/BenPort.cpp index 1bd24dee7..1d710e86a 100644 --- a/mm/2s2h/BenPort.cpp +++ b/mm/2s2h/BenPort.cpp @@ -121,9 +121,9 @@ OTRGlobals::OTRGlobals() { if (std::filesystem::exists(ootPath)) { OTRFiles.push_back(ootPath); } - std::string sohOtrPath = Ship::Context::GetPathRelativeToAppBundle("soh.otr"); - if (std::filesystem::exists(sohOtrPath)) { - OTRFiles.push_back(sohOtrPath); + std::string shipOtrPath = Ship::Context::GetPathRelativeToAppBundle("2ship.otr"); + if (std::filesystem::exists(shipOtrPath)) { + OTRFiles.push_back(shipOtrPath); } std::string patchesPath = Ship::Context::LocateFileAcrossAppDirs("mods", appShortName); if (patchesPath.length() > 0 && std::filesystem::exists(patchesPath)) { @@ -140,7 +140,7 @@ OTRGlobals::OTRGlobals() { OOT_PAL_11, OOT_NTSC_JP_GC_CE, OOT_NTSC_JP_GC, OOT_NTSC_US_GC, OOT_PAL_GC, OOT_PAL_GC_DBG1, OOT_PAL_GC_DBG2 }; // tell LUS to reserve 3 SoH specific threads (Game, Audio, Save) - context = Ship::Context::CreateInstance("2 Ship 2 Harkinian", appShortName, "shipofharkinian.json", OTRFiles, {}, 3); + context = Ship::Context::CreateInstance("2 Ship 2 Harkinian", appShortName, "2ship2harkinian.json", OTRFiles, {}, 3); // Override LUS defaults Ship::Context::GetInstance()->GetLogger()->set_level((spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); diff --git a/mm/2s2h/BenPort.h b/mm/2s2h/BenPort.h index e356411e0..b76d92c0c 100644 --- a/mm/2s2h/BenPort.h +++ b/mm/2s2h/BenPort.h @@ -19,7 +19,7 @@ #include const std::string customMessageTableID = "BaseGameOverrides"; -const std::string appShortName = "soh"; +const std::string appShortName = "2ship"; class OTRGlobals { public: diff --git a/mm/CMakeLists.txt b/mm/CMakeLists.txt index 02e06c2ff..f7e2cfcd6 100644 --- a/mm/CMakeLists.txt +++ b/mm/CMakeLists.txt @@ -693,7 +693,7 @@ endif() if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") INSTALL(FILES $ DESTINATION ./debug COMPONENT 2s2h) -INSTALL(FILES ${CMAKE_BINARY_DIR}/mm/soh.otr DESTINATION . COMPONENT 2s2h) +INSTALL(FILES ${CMAKE_BINARY_DIR}/mm/2ship.otr DESTINATION . COMPONENT 2s2h) endif() if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") @@ -707,7 +707,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/Info.plist.in ${CMAKE_BINARY_DIR}/macosx/Info.plist @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/2s2h-macos.sh.in ${CMAKE_BINARY_DIR}/macosx/2s2h-macos.sh @ONLY) INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT 2s2h) -INSTALL(FILES ${CMAKE_BINARY_DIR}/mm/soh.otr DESTINATION ../Resources COMPONENT 2s2h) +INSTALL(FILES ${CMAKE_BINARY_DIR}/mm/2ship.otr DESTINATION ../Resources COMPONENT 2s2h) elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS") INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION . COMPONENT 2s2h) endif() diff --git a/mm/assets/2s2h_assets.h b/mm/assets/2s2h_assets.h index 1281181a4..b8333d90a 100644 --- a/mm/assets/2s2h_assets.h +++ b/mm/assets/2s2h_assets.h @@ -3,7 +3,7 @@ #include "align_asset_macro.h" // This file is manually made -// When new assets are added to the soh.otr file +// When new assets are added to the 2ship.otr file // We need to add the aligned version of the resource names here and use in code // On Mac, not using aligned resource names was causing crashes in release builds