graphic_settings: add scroll wraparound option

This makes the scroll wraparound option available in both games'
graphics dialogs. TR1's dialog is also updated to allow scrolling until
such times as it's moved to the new UI framework.

Resolves #2834.
This commit is contained in:
lahm86 2025-04-23 20:10:00 +01:00
parent 3030d694a5
commit f590c9243c
7 changed files with 41 additions and 0 deletions

View file

@ -369,6 +369,7 @@
"DETAIL_TITLE": "Graphic Options", "DETAIL_TITLE": "Graphic Options",
"DETAIL_TRAPEZOID_FILTER": "Trapezoid filter", "DETAIL_TRAPEZOID_FILTER": "Trapezoid filter",
"DETAIL_UI_BAR_SCALE": "UI bar scale", "DETAIL_UI_BAR_SCALE": "UI bar scale",
"DETAIL_UI_SCROLL_WRAPAROUND": "UI scroll wrap",
"DETAIL_UI_TEXT_SCALE": "UI text scale", "DETAIL_UI_TEXT_SCALE": "UI text scale",
"DETAIL_VSYNC": "VSync", "DETAIL_VSYNC": "VSync",
"DETAIL_WATER_COLOR_B": "Water color (B)", "DETAIL_WATER_COLOR_B": "Water color (B)",

View file

@ -496,6 +496,7 @@
"DETAIL_TITLE": "Graphic Options", "DETAIL_TITLE": "Graphic Options",
"DETAIL_TRAPEZOID_FILTER": "Trapezoid filter", "DETAIL_TRAPEZOID_FILTER": "Trapezoid filter",
"DETAIL_UI_BAR_SCALE": "UI bar scale", "DETAIL_UI_BAR_SCALE": "UI bar scale",
"DETAIL_UI_SCROLL_WRAPAROUND": "UI scroll wrap",
"DETAIL_UI_TEXT_SCALE": "UI text scale", "DETAIL_UI_TEXT_SCALE": "UI text scale",
"DETAIL_USE_PSX_FOV": "Use PSX FOV", "DETAIL_USE_PSX_FOV": "Use PSX FOV",
"DETAIL_WATER_COLOR_B": "Water color (B)", "DETAIL_WATER_COLOR_B": "Water color (B)",

View file

@ -4,6 +4,7 @@
- added support for a hex water color notation (eg. `#80FFFF`) in the game flow file - added support for a hex water color notation (eg. `#80FFFF`) in the game flow file
- added support for antitriggers, like TR2+ (#2580) - added support for antitriggers, like TR2+ (#2580)
- added support for aspect ratio-specific images (#1840) - added support for aspect ratio-specific images (#1840)
- added an option to wraparound when scrolling UI dialogs, such as save/load (#2834)
- changed the `draw_distance_min` and `draw_distance_max` to `fog_start` and `fog_end` - changed the `draw_distance_min` and `draw_distance_max` to `fog_start` and `fog_end`
- changed `Select Detail` dialog title to `Graphic Options` - changed `Select Detail` dialog title to `Graphic Options`
- changed the number of static mesh slots from 50 to 256 (#2734) - changed the number of static mesh slots from 50 to 256 (#2734)

View file

@ -1,4 +1,5 @@
## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-1.0...develop) - ××××-××-×× ## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-1.0...develop) - ××××-××-××
- added an option to wraparound when scrolling UI dialogs, such as save/load (#2834)
- fixed the selected keyboard/controller layout not being saved (#2830, regression from 1.0) - fixed the selected keyboard/controller layout not being saved (#2830, regression from 1.0)
- fixed toggling the PSX FOV option not having an immediate effect (#2831, regression from 1.0) - fixed toggling the PSX FOV option not having an immediate effect (#2831, regression from 1.0)
- fixed changing the aspect ratio not updating the current background image (#2832, regression from 1.0) - fixed changing the aspect ratio not updating the current background image (#2832, regression from 1.0)

View file

@ -150,5 +150,6 @@ GS_DEFINE(DETAIL_TRAPEZOID_FILTER, "Trapezoid filter")
GS_DEFINE(DETAIL_RENDER_MODE, "Render mode") GS_DEFINE(DETAIL_RENDER_MODE, "Render mode")
GS_DEFINE(DETAIL_UI_TEXT_SCALE, "UI text scale") GS_DEFINE(DETAIL_UI_TEXT_SCALE, "UI text scale")
GS_DEFINE(DETAIL_UI_BAR_SCALE, "UI bar scale") GS_DEFINE(DETAIL_UI_BAR_SCALE, "UI bar scale")
GS_DEFINE(DETAIL_UI_SCROLL_WRAPAROUND, "UI scroll wrap")
GS_DEFINE(PAGINATION_NAV, "%d / %d") GS_DEFINE(PAGINATION_NAV, "%d / %d")
GS_DEFINE(MISC_EMPTY_SLOT_FMT, "- EMPTY SLOT -") GS_DEFINE(MISC_EMPTY_SLOT_FMT, "- EMPTY SLOT -")

View file

@ -50,6 +50,7 @@ typedef enum {
OPTION_BRIGHTNESS, OPTION_BRIGHTNESS,
OPTION_UI_TEXT_SCALE, OPTION_UI_TEXT_SCALE,
OPTION_UI_BAR_SCALE, OPTION_UI_BAR_SCALE,
OPTION_UI_SCROLL_WRAPAROUND,
OPTION_RENDER_MODE, OPTION_RENDER_MODE,
OPTION_RESOLUTION, OPTION_RESOLUTION,
OPTION_TRAPEZOID_FILTER, OPTION_TRAPEZOID_FILTER,
@ -95,6 +96,8 @@ static const GRAPHICS_OPTION_ROW m_GfxOptionRows[] = {
GS_ID(DETAIL_FLOAT_FMT) }, GS_ID(DETAIL_FLOAT_FMT) },
{ OPTION_UI_BAR_SCALE, GS_ID(DETAIL_UI_BAR_SCALE), { OPTION_UI_BAR_SCALE, GS_ID(DETAIL_UI_BAR_SCALE),
GS_ID(DETAIL_FLOAT_FMT) }, GS_ID(DETAIL_FLOAT_FMT) },
{ OPTION_UI_SCROLL_WRAPAROUND, GS_ID(DETAIL_UI_SCROLL_WRAPAROUND),
GS_ID(MISC_ON) },
{ OPTION_RENDER_MODE, GS_ID(DETAIL_RENDER_MODE), GS_ID(DETAIL_STRING_FMT) }, { OPTION_RENDER_MODE, GS_ID(DETAIL_RENDER_MODE), GS_ID(DETAIL_STRING_FMT) },
{ OPTION_RESOLUTION, GS_ID(DETAIL_RESOLUTION), { OPTION_RESOLUTION, GS_ID(DETAIL_RESOLUTION),
GS_ID(DETAIL_RESOLUTION_FMT) }, GS_ID(DETAIL_RESOLUTION_FMT) },
@ -177,6 +180,8 @@ static void M_MenuUp(void)
} }
m_GraphicsMenu.cur_option--; m_GraphicsMenu.cur_option--;
M_UpdateText(); M_UpdateText();
} else if (g_Config.ui.enable_wraparound) {
M_Reinitialize(m_GfxOptionRows[OPTION_NUMBER_OF - 1].option_name);
} }
} }
@ -191,6 +196,8 @@ static void M_MenuDown(void)
} }
m_GraphicsMenu.cur_option++; m_GraphicsMenu.cur_option++;
M_UpdateText(); M_UpdateText();
} else if (g_Config.ui.enable_wraparound) {
M_Reinitialize(m_GfxOptionRows[0].option_name);
} }
} }
@ -323,6 +330,10 @@ static void M_UpdateArrows(
m_HideArrowLeft = g_Config.ui.bar_scale <= CONFIG_MIN_BAR_SCALE; m_HideArrowLeft = g_Config.ui.bar_scale <= CONFIG_MIN_BAR_SCALE;
m_HideArrowRight = g_Config.ui.bar_scale >= CONFIG_MAX_BAR_SCALE; m_HideArrowRight = g_Config.ui.bar_scale >= CONFIG_MAX_BAR_SCALE;
break; break;
case OPTION_UI_SCROLL_WRAPAROUND:
m_HideArrowLeft = !g_Config.ui.enable_wraparound;
m_HideArrowRight = g_Config.ui.enable_wraparound;
break;
case OPTION_RENDER_MODE: case OPTION_RENDER_MODE:
local_right_arrow_offset = RIGHT_ARROW_OFFSET_MAX; local_right_arrow_offset = RIGHT_ARROW_OFFSET_MAX;
m_HideArrowLeft = false; m_HideArrowLeft = false;
@ -483,6 +494,11 @@ static void M_ChangeTextOption(
Text_ChangeText(value_text, buf); Text_ChangeText(value_text, buf);
break; break;
case OPTION_UI_SCROLL_WRAPAROUND:
bool is_enabled = g_Config.ui.enable_wraparound;
Text_ChangeText(value_text, is_enabled ? GS(MISC_ON) : GS(MISC_OFF));
break;
case OPTION_RENDER_MODE: case OPTION_RENDER_MODE:
sprintf( sprintf(
buf, GS(DETAIL_STRING_FMT), buf, GS(DETAIL_STRING_FMT),
@ -636,6 +652,13 @@ void Option_Graphics_Control(INVENTORY_ITEM *inv_item, const bool is_busy)
reset = OPTION_UI_BAR_SCALE; reset = OPTION_UI_BAR_SCALE;
break; break;
case OPTION_UI_SCROLL_WRAPAROUND:
if (!g_Config.ui.enable_wraparound) {
g_Config.ui.enable_wraparound = true;
reset = OPTION_UI_SCROLL_WRAPAROUND;
}
break;
case OPTION_RENDER_MODE: case OPTION_RENDER_MODE:
if (g_Config.rendering.render_mode == GFX_RM_LEGACY) { if (g_Config.rendering.render_mode == GFX_RM_LEGACY) {
g_Config.rendering.render_mode = GFX_RM_FRAMEBUFFER; g_Config.rendering.render_mode = GFX_RM_FRAMEBUFFER;
@ -766,6 +789,13 @@ void Option_Graphics_Control(INVENTORY_ITEM *inv_item, const bool is_busy)
reset = OPTION_UI_BAR_SCALE; reset = OPTION_UI_BAR_SCALE;
break; break;
case OPTION_UI_SCROLL_WRAPAROUND:
if (g_Config.ui.enable_wraparound) {
g_Config.ui.enable_wraparound = false;
reset = OPTION_UI_SCROLL_WRAPAROUND;
}
break;
case OPTION_RENDER_MODE: case OPTION_RENDER_MODE:
if (g_Config.rendering.render_mode == GFX_RM_LEGACY) { if (g_Config.rendering.render_mode == GFX_RM_LEGACY) {
g_Config.rendering.render_mode = GFX_RM_FRAMEBUFFER; g_Config.rendering.render_mode = GFX_RM_FRAMEBUFFER;

View file

@ -219,6 +219,12 @@ static const M_OPTION m_Options[] = {
.delta_fast = 10, .delta_fast = 10,
}, },
{
.option_type = COT_BOOL,
.label_id = GS_ID(DETAIL_UI_SCROLL_WRAPAROUND),
.target = &g_Config.ui.enable_wraparound,
},
{ {
.option_type = COT_INT32, .option_type = COT_INT32,
.label_id = GS_ID(DETAIL_SCALER), .label_id = GS_ID(DETAIL_SCALER),