From d696524dbf4bdb492f2e4465e3370ac1df488045 Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Sat, 8 Feb 2025 12:09:15 +0000 Subject: [PATCH] Rename UI Scale Mode to UI Alignment Mode --- UnleashedRecomp/CMakeLists.txt | 2 +- UnleashedRecomp/locale/config_locale.cpp | 10 +++++----- UnleashedRecomp/patches/aspect_ratio_patches.cpp | 10 +++++----- UnleashedRecomp/res/version.txt | 2 +- UnleashedRecomp/ui/options_menu.cpp | 2 +- UnleashedRecomp/ui/options_menu_thumbnails.cpp | 4 ++-- UnleashedRecomp/user/config.cpp | 8 ++++---- UnleashedRecomp/user/config.h | 2 +- UnleashedRecomp/user/config_def.h | 2 +- UnleashedRecompResources | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 09012d7..9fb7e45 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -530,7 +530,7 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/op BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/time_of_day_transition_playstation.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/time_of_day_transition_playstation.dds" ARRAY_NAME "g_time_of_day_transition_playstation" COMPRESSION_TYPE "zstd") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/transparency_antialiasing_false.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/transparency_antialiasing_false.dds" ARRAY_NAME "g_transparency_antialiasing_false" COMPRESSION_TYPE "zstd") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/transparency_antialiasing_true.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/transparency_antialiasing_true.dds" ARRAY_NAME "g_transparency_antialiasing_true" COMPRESSION_TYPE "zstd") -BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/ui_scale_mode.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/ui_scale_mode.dds" ARRAY_NAME "g_ui_scale_mode" COMPRESSION_TYPE "zstd") +BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/ui_alignment_mode.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/ui_alignment_mode.dds" ARRAY_NAME "g_ui_alignment_mode" COMPRESSION_TYPE "zstd") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vertical_camera.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vertical_camera.dds" ARRAY_NAME "g_vertical_camera" COMPRESSION_TYPE "zstd") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/voice_language.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/voice_language.dds" ARRAY_NAME "g_voice_language" COMPRESSION_TYPE "zstd") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/options_menu/thumbnails/vibration.dds" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/options_menu/thumbnails/vibration.dds" ARRAY_NAME "g_vibration" COMPRESSION_TYPE "zstd") diff --git a/UnleashedRecomp/locale/config_locale.cpp b/UnleashedRecomp/locale/config_locale.cpp index c48c0fd..684b327 100644 --- a/UnleashedRecomp/locale/config_locale.cpp +++ b/UnleashedRecomp/locale/config_locale.cpp @@ -367,18 +367,18 @@ CONFIG_DEFINE_ENUM_LOCALE(ECutsceneAspectRatio) } }; -CONFIG_DEFINE_LOCALE(UIScaleMode) +CONFIG_DEFINE_LOCALE(UIAlignmentMode) { - { ELanguage::English, { "UI Scale Mode", "Change how the UI scales to the display." } } + { ELanguage::English, { "UI Alignment Mode", "Change how the UI aligns with the display." } } }; -CONFIG_DEFINE_ENUM_LOCALE(EUIScaleMode) +CONFIG_DEFINE_ENUM_LOCALE(EUIAlignmentMode) { { ELanguage::English, { - { EUIScaleMode::Edge, { "EDGE", "Edge: the UI will anchor to the edges of the display." } }, - { EUIScaleMode::Centre, { "CENTER", "Center: the UI will anchor to the center of the display." } }, + { EUIAlignmentMode::Edge, { "EDGE", "Edge: the UI will align with the edges of the display." } }, + { EUIAlignmentMode::Centre, { "CENTER", "Center: the UI will align with the center of the display." } }, } } }; diff --git a/UnleashedRecomp/patches/aspect_ratio_patches.cpp b/UnleashedRecomp/patches/aspect_ratio_patches.cpp index 6cac110..f1b9ea3 100644 --- a/UnleashedRecomp/patches/aspect_ratio_patches.cpp +++ b/UnleashedRecomp/patches/aspect_ratio_patches.cpp @@ -273,7 +273,7 @@ PPC_FUNC(sub_8258B558) ctx.f1.f64 = offsetX + g_aspectRatioNarrowScale * 140.0f; ctx.f2.f64 = offsetY; - if (Config::UIScaleMode == EUIScaleMode::Edge && g_aspectRatioNarrowScale >= 1.0f) + if (Config::UIAlignmentMode == EUIAlignmentMode::Edge && g_aspectRatioNarrowScale >= 1.0f) ctx.f1.f64 += g_aspectRatioOffsetX / g_aspectRatioScale; sub_830BB3D0(ctx, base); @@ -295,7 +295,7 @@ PPC_FUNC(sub_8258B558) if (textBox != NULL) { float value = 708.0f + g_aspectRatioNarrowScale * 140.0f; - if (Config::UIScaleMode == EUIScaleMode::Edge && g_aspectRatioNarrowScale >= 1.0f) + if (Config::UIAlignmentMode == EUIAlignmentMode::Edge && g_aspectRatioNarrowScale >= 1.0f) value += g_aspectRatioOffsetX / g_aspectRatioScale; PPC_STORE_U32(textBox + 0x38, reinterpret_cast(value)); @@ -917,7 +917,7 @@ static void Draw(PPCContext& ctx, uint8_t* base, PPCFunc* original, uint32_t str return; } - if (Config::UIScaleMode == EUIScaleMode::Centre) + if (Config::UIAlignmentMode == EUIAlignmentMode::Centre) { if (g_aspectRatio >= WIDE_ASPECT_RATIO) modifier.flags &= ~(ALIGN_LEFT | ALIGN_RIGHT); @@ -1274,12 +1274,12 @@ static double ComputeObjGetItemX(uint32_t type) double scaleOffset = (1280.0 * (1.0 - g_aspectRatioGameplayScale)) * g_aspectRatioScale; - if (Config::UIScaleMode == EUIScaleMode::Edge) + if (Config::UIAlignmentMode == EUIAlignmentMode::Edge) { if (type != 47) // Medal x += g_aspectRatioOffsetX * 2.0 + scaleOffset; } - else if (Config::UIScaleMode == EUIScaleMode::Centre) + else if (Config::UIAlignmentMode == EUIAlignmentMode::Centre) { x += g_aspectRatioOffsetX + scaleOffset; } diff --git a/UnleashedRecomp/res/version.txt b/UnleashedRecomp/res/version.txt index df87f00..494d76c 100644 --- a/UnleashedRecomp/res/version.txt +++ b/UnleashedRecomp/res/version.txt @@ -1,4 +1,4 @@ -VERSION_MILESTONE="Beta 1" +VERSION_MILESTONE="Beta 2" VERSION_MAJOR=1 VERSION_MINOR=0 VERSION_REVISION=0 diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index f629da1..30589c7 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -1226,7 +1226,7 @@ static void DrawConfigOptions() DrawConfigOption(rowCount++, yOffset, &Config::MotionBlur, true); DrawConfigOption(rowCount++, yOffset, &Config::XboxColorCorrection, true); DrawConfigOption(rowCount++, yOffset, &Config::CutsceneAspectRatio, true); - DrawConfigOption(rowCount++, yOffset, &Config::UIScaleMode, true); + DrawConfigOption(rowCount++, yOffset, &Config::UIAlignmentMode, true); break; } diff --git a/UnleashedRecomp/ui/options_menu_thumbnails.cpp b/UnleashedRecomp/ui/options_menu_thumbnails.cpp index 7bae7ce..dd93fc7 100644 --- a/UnleashedRecomp/ui/options_menu_thumbnails.cpp +++ b/UnleashedRecomp/ui/options_menu_thumbnails.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -112,7 +112,7 @@ void LoadThumbnails() g_motionBlurThumbnails[EMotionBlur::Enhanced] = LOAD_ZSTD_TEXTURE(g_motion_blur_enhanced); g_configThumbnails[&Config::XboxColorCorrection] = LOAD_ZSTD_TEXTURE(g_xbox_color_correction); - g_configThumbnails[&Config::UIScaleMode] = LOAD_ZSTD_TEXTURE(g_ui_scale_mode); + g_configThumbnails[&Config::UIAlignmentMode] = LOAD_ZSTD_TEXTURE(g_ui_alignment_mode); } template diff --git a/UnleashedRecomp/user/config.cpp b/UnleashedRecomp/user/config.cpp index eea9e01..4aeafb9 100644 --- a/UnleashedRecomp/user/config.cpp +++ b/UnleashedRecomp/user/config.cpp @@ -376,11 +376,11 @@ CONFIG_DEFINE_ENUM_TEMPLATE(ECutsceneAspectRatio) { "Unlocked", ECutsceneAspectRatio::Unlocked } }; -CONFIG_DEFINE_ENUM_TEMPLATE(EUIScaleMode) +CONFIG_DEFINE_ENUM_TEMPLATE(EUIAlignmentMode) { - { "Edge", EUIScaleMode::Edge }, - { "Centre", EUIScaleMode::Centre }, - { "Center", EUIScaleMode::Centre } + { "Edge", EUIAlignmentMode::Edge }, + { "Centre", EUIAlignmentMode::Centre }, + { "Center", EUIAlignmentMode::Centre } }; #undef CONFIG_DEFINE diff --git a/UnleashedRecomp/user/config.h b/UnleashedRecomp/user/config.h index 000e17c..b944f69 100644 --- a/UnleashedRecomp/user/config.h +++ b/UnleashedRecomp/user/config.h @@ -138,7 +138,7 @@ enum class ECutsceneAspectRatio : uint32_t Unlocked }; -enum class EUIScaleMode : uint32_t +enum class EUIAlignmentMode : uint32_t { Edge, Centre diff --git a/UnleashedRecomp/user/config_def.h b/UnleashedRecomp/user/config_def.h index b9cb822..34335e8 100644 --- a/UnleashedRecomp/user/config_def.h +++ b/UnleashedRecomp/user/config_def.h @@ -96,7 +96,7 @@ CONFIG_DEFINE_ENUM("Video", EDepthOfFieldQuality, DepthOfFieldQuality, EDepthOfF CONFIG_DEFINE_ENUM_LOCALISED("Video", EMotionBlur, MotionBlur, EMotionBlur::Original); CONFIG_DEFINE_LOCALISED("Video", bool, XboxColorCorrection, false); CONFIG_DEFINE_ENUM_LOCALISED("Video", ECutsceneAspectRatio, CutsceneAspectRatio, ECutsceneAspectRatio::Original); -CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIScaleMode, UIScaleMode, EUIScaleMode::Edge); +CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIAlignmentMode, UIAlignmentMode, EUIAlignmentMode::Edge); CONFIG_DEFINE_HIDDEN("Exports", bool, AllowCancellingUnleash, false); CONFIG_DEFINE_HIDDEN("Exports", bool, DisableAutoSaveWarning, false); diff --git a/UnleashedRecompResources b/UnleashedRecompResources index 1ec18c1..3a852c7 160000 --- a/UnleashedRecompResources +++ b/UnleashedRecompResources @@ -1 +1 @@ -Subproject commit 1ec18c1385ccf7d00eb7f9ffe697936e78b21fe4 +Subproject commit 3a852c76e537f0cb9103aefae928a564d61378e6