From 4fad600ffea7dba4240669d03b32d5495e53bc5a Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Sep 2025 12:57:18 -0600 Subject: [PATCH 01/21] toggleable keyboard arrows --- Source/Pads/Keyboard.as | 6 ++++-- Source/Settings.as | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index de4b290..c86c07d 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -99,7 +99,9 @@ class DashboardPadKeyboard : IDashboardPad } else { nvg::FillColor(borderColor); } - nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); - nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, text); + if (Setting_Keyboard_ArrowSymbols) { + nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); + nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, text); + } } } diff --git a/Source/Settings.as b/Source/Settings.as index 12de1eb..53be497 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -183,6 +183,9 @@ float Setting_Keyboard_Spacing = 10.0f; [Setting category="Keyboard" name="Inactive alpha" drag min=0 max=1] float Setting_Keyboard_InactiveAlpha = 1.0f; +[Setting category="Keyboard" name="Display arrow symbols"] +bool Setting_Keyboard_ArrowSymbols = true; + [Setting category="Gearbox" name="Show text"] From 0b82e22e1304b9b03f23dd67837349770940848d Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Sep 2025 13:00:28 -0600 Subject: [PATCH 02/21] separate setting for keyboard text color --- Source/Pads/Keyboard.as | 6 +----- Source/Settings.as | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index c86c07d..30e70f1 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -94,11 +94,7 @@ class DashboardPadKeyboard : IDashboardPad nvg::BeginPath(); nvg::FontFace(g_font); nvg::FontSize(size.x / 2); - if (Setting_Keyboard_UseBorderGradient) { - nvg::FillPaint(Setting_Keyboard_BorderGradient.GetPaint(vec2(), m_size, fillAlpha)); - } else { - nvg::FillColor(borderColor); - } + nvg::FillColor(Setting_Keyboard_TextColor); if (Setting_Keyboard_ArrowSymbols) { nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, text); diff --git a/Source/Settings.as b/Source/Settings.as index 53be497..1114fb8 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -186,6 +186,9 @@ float Setting_Keyboard_InactiveAlpha = 1.0f; [Setting category="Keyboard" name="Display arrow symbols"] bool Setting_Keyboard_ArrowSymbols = true; +[Setting category="Keyboard" name="Text and symbol color" color] +vec4 Setting_Keyboard_TextColor = vec4(1, 1, 1, 1); + [Setting category="Gearbox" name="Show text"] From 67a3f712d075002b0735c23691b77e8a32b4e0a4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Sep 2025 13:19:48 -0600 Subject: [PATCH 03/21] add keyboard steer percentage --- Source/Pads/Keyboard.as | 9 +++++++-- Source/Settings.as | 9 +++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index 30e70f1..6a66c01 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -95,8 +95,13 @@ class DashboardPadKeyboard : IDashboardPad nvg::FontFace(g_font); nvg::FontSize(size.x / 2); nvg::FillColor(Setting_Keyboard_TextColor); - if (Setting_Keyboard_ArrowSymbols) { - nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); + nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); + if (Setting_Keyboard_SteerPercentage && fillDir != 0) { + if (value > 0.0f) { + nvg::FontSize(Setting_Keyboard_SteerPercentageSize); + nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, tostring(Math::Round(value * 100)) + "%"); + } + } else if (Setting_Keyboard_ArrowSymbols) { nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, text); } } diff --git a/Source/Settings.as b/Source/Settings.as index 1114fb8..f50cd09 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -186,6 +186,15 @@ float Setting_Keyboard_InactiveAlpha = 1.0f; [Setting category="Keyboard" name="Display arrow symbols"] bool Setting_Keyboard_ArrowSymbols = true; +[Setting category="Keyboard" name="Display steer percentage" description="Overrides left/right arrows of setting above"] +bool Setting_Keyboard_SteerPercentage = false; + +[Setting + category="Keyboard" + name="Steer percentage size" + drag min=2 max=40] +int Setting_Keyboard_SteerPercentageSize = 16; + [Setting category="Keyboard" name="Text and symbol color" color] vec4 Setting_Keyboard_TextColor = vec4(1, 1, 1, 1); From 86501663f39dd768f10481203f56825d2a61a42d Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Sep 2025 14:17:41 -0600 Subject: [PATCH 04/21] add font settings for gamepad/keyboard --- Source/Pads/Gamepad.as | 28 +++++++++++++++++++++++++++- Source/Pads/Keyboard.as | 28 +++++++++++++++++++++++++++- Source/Settings.as | 6 ++++++ Source/Things/PadHost.as | 7 +++++++ 4 files changed, 67 insertions(+), 2 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 9f99709..114eba4 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -1,5 +1,31 @@ class DashboardPadGamepad : IDashboardPad { + nvg::Font m_font; + string m_fontPath; + + DashboardPadGamepad() + { + LoadFont(); + } + + void LoadFont() + { + if (Setting_Gamepad_Font == m_fontPath) { + return; + } + + auto font = nvg::LoadFont(Setting_Gamepad_Font); + if (font >= 0) { + m_fontPath = Setting_Gamepad_Font; + m_font = font; + } + } + + void OnSettingsChanged() override + { + LoadFont(); + } + void RenderUniform(const vec2 &in size, CSceneVehicleVisState@ vis) { float leftSize = size.x * (0.5f - Setting_Gamepad_MiddleScale / 2) - Setting_Gamepad_Spacing; @@ -123,7 +149,7 @@ class DashboardPadGamepad : IDashboardPad // Steering percentage if (Setting_Gamepad_SteerPercentage) { - nvg::FontFace(g_font); + nvg::FontFace(m_font); nvg::FontSize(Setting_Gamepad_SteerPercentageSize); nvg::FillColor(Setting_Gamepad_TextColor); diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index 6a66c01..a87ae13 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -1,7 +1,33 @@ class DashboardPadKeyboard : IDashboardPad { + nvg::Font m_font; + string m_fontPath; + vec2 m_size; + DashboardPadKeyboard() + { + LoadFont(); + } + + void LoadFont() + { + if (Setting_Keyboard_Font == m_fontPath) { + return; + } + + auto font = nvg::LoadFont(Setting_Keyboard_Font); + if (font >= 0) { + m_fontPath = Setting_Keyboard_Font; + m_font = font; + } + } + + void OnSettingsChanged() override + { + LoadFont(); + } + void Render(const vec2 &in size, CSceneVehicleVisState@ vis) override { m_size = size; @@ -92,7 +118,7 @@ class DashboardPadKeyboard : IDashboardPad nvg::Stroke(); nvg::BeginPath(); - nvg::FontFace(g_font); + nvg::FontFace(m_font); nvg::FontSize(size.x / 2); nvg::FillColor(Setting_Keyboard_TextColor); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); diff --git a/Source/Settings.as b/Source/Settings.as index f50cd09..f6df0ff 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -135,6 +135,9 @@ bool Setting_Gamepad_SteerPercentage = false; if="Setting_Gamepad_Style Uniform"] int Setting_Gamepad_SteerPercentageSize = 16; +[Setting category="Gamepad" name="Font" if="Setting_Gamepad_Style Uniform"] +string Setting_Gamepad_Font = "DroidSans.ttf"; + [Setting category="Gamepad" name="Text and symbol color" color if="Setting_Gamepad_Style Uniform"] vec4 Setting_Gamepad_TextColor = vec4(1, 1, 1, 1); @@ -195,6 +198,9 @@ bool Setting_Keyboard_SteerPercentage = false; drag min=2 max=40] int Setting_Keyboard_SteerPercentageSize = 16; +[Setting category="Keyboard" name="Font"] +string Setting_Keyboard_Font = "DroidSans.ttf"; + [Setting category="Keyboard" name="Text and symbol color" color] vec4 Setting_Keyboard_TextColor = vec4(1, 1, 1, 1); diff --git a/Source/Things/PadHost.as b/Source/Things/PadHost.as index 5e1e3ac..99cb17b 100644 --- a/Source/Things/PadHost.as +++ b/Source/Things/PadHost.as @@ -1,5 +1,6 @@ interface IDashboardPad { + void OnSettingsChanged(); void Render(const vec2 &in size, CSceneVehicleVisState@ vis); } @@ -116,4 +117,10 @@ class DashboardPadHost : DashboardThing case PadType::Gamepad: @m_pad = DashboardPadGamepad(); break; } } + + void OnSettingsChanged() override { + if (m_pad !is null) { + m_pad.OnSettingsChanged(); + } + } } From 82a69292d1dc329967c4b3b4bb3c29f040f2ae80 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Sep 2025 14:18:06 -0600 Subject: [PATCH 05/21] use Text::Format for steer percentages --- Source/Pads/Gamepad.as | 4 ++-- Source/Pads/Keyboard.as | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 114eba4..5e7aa4f 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -157,14 +157,14 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::TextBox(0, size.y / 2, leftSize - Setting_Gamepad_Spacing, tostring(Math::Round(steerLeft * 100)) + "%"); + nvg::TextBox(0, size.y / 2, leftSize - Setting_Gamepad_Spacing, Text::Format("%.f%%", steerLeft * 100.0f)); } // Right if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::TextBox(rightX + Setting_Gamepad_Spacing, size.y / 2, rightSize, tostring(Math::Round(steerRight * 100)) + "%"); + nvg::TextBox(rightX + Setting_Gamepad_Spacing, size.y / 2, rightSize, Text::Format("%.f%%", steerRight * 100.0f)); } } } diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index a87ae13..2b2d162 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -125,7 +125,7 @@ class DashboardPadKeyboard : IDashboardPad if (Setting_Keyboard_SteerPercentage && fillDir != 0) { if (value > 0.0f) { nvg::FontSize(Setting_Keyboard_SteerPercentageSize); - nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, tostring(Math::Round(value * 100)) + "%"); + nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, Text::Format("%.f%%", value * 100.0f)); } } else if (Setting_Keyboard_ArrowSymbols) { nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, text); From 202733246c13cc53830d99bcc5b138fe7009ce73 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 5 Sep 2025 14:18:19 -0600 Subject: [PATCH 06/21] fix font loading for default font --- Source/Things/Acceleration.as | 2 +- Source/Things/Clock.as | 2 +- Source/Things/Gearbox.as | 2 +- Source/Things/Speed.as | 2 +- Source/Things/Wheels.as | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Things/Acceleration.as b/Source/Things/Acceleration.as index 871be36..46810e3 100644 --- a/Source/Things/Acceleration.as +++ b/Source/Things/Acceleration.as @@ -47,7 +47,7 @@ class DashboardAcceleration : DashboardThing } auto font = nvg::LoadFont(Setting_Acceleration_Font); - if (font > 0) { + if (font >= 0) { m_fontPath = Setting_Acceleration_Font; m_font = font; } diff --git a/Source/Things/Clock.as b/Source/Things/Clock.as index 7c2f39c..8b12318 100644 --- a/Source/Things/Clock.as +++ b/Source/Things/Clock.as @@ -42,7 +42,7 @@ class DashboardClock : DashboardThing } auto font = nvg::LoadFont(Setting_Clock_Font); - if (font > 0) { + if (font >= 0) { m_fontPath = Setting_Clock_Font; m_font = font; } diff --git a/Source/Things/Gearbox.as b/Source/Things/Gearbox.as index 8fc92f4..a8e6489 100644 --- a/Source/Things/Gearbox.as +++ b/Source/Things/Gearbox.as @@ -45,7 +45,7 @@ class DashboardGearbox : DashboardThing } auto font = nvg::LoadFont(Setting_Gearbox_Font); - if (font > 0) { + if (font >= 0) { m_fontPath = Setting_Gearbox_Font; m_font = font; } diff --git a/Source/Things/Speed.as b/Source/Things/Speed.as index 20a90e5..3938e9c 100644 --- a/Source/Things/Speed.as +++ b/Source/Things/Speed.as @@ -42,7 +42,7 @@ class DashboardSpeed : DashboardThing } auto font = nvg::LoadFont(Setting_Speed_Font); - if (font > 0) { + if (font >= 0) { m_fontPath = Setting_Speed_Font; m_font = font; } diff --git a/Source/Things/Wheels.as b/Source/Things/Wheels.as index 4671bda..e50cc82 100644 --- a/Source/Things/Wheels.as +++ b/Source/Things/Wheels.as @@ -64,7 +64,7 @@ class DashboardWheels : DashboardThing } auto font = nvg::LoadFont(Setting_Wheels_DetailsFont); - if (font > 0) { + if (font >= 0) { m_fontPath = Setting_Wheels_DetailsFont; m_font = font; } From f006c6eed3c521a9dd6f1c637c61deddd9850185 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 6 Sep 2025 13:44:41 -0600 Subject: [PATCH 07/21] fix inactive alpha on text --- Source/Pads/Keyboard.as | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index 2b2d162..738e81a 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -117,10 +117,13 @@ class DashboardPadKeyboard : IDashboardPad } nvg::Stroke(); + vec4 textColor = Setting_Keyboard_TextColor; + textColor.w *= fillAlpha; + nvg::BeginPath(); nvg::FontFace(m_font); nvg::FontSize(size.x / 2); - nvg::FillColor(Setting_Keyboard_TextColor); + nvg::FillColor(textColor); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); if (Setting_Keyboard_SteerPercentage && fillDir != 0) { if (value > 0.0f) { From cdd90c3aa3ef32f07656b0b253a3140b55acf314 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 6 Sep 2025 14:02:16 -0600 Subject: [PATCH 08/21] rename settings, apply to arrow symbols --- Source/Pads/Gamepad.as | 10 +++++----- Source/Pads/Keyboard.as | 6 +++--- Source/Settings.as | 32 ++++++++++++++++---------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 5e7aa4f..913a8a4 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -139,9 +139,9 @@ class DashboardPadGamepad : IDashboardPad // Up & Down texts if (Setting_Gamepad_UpDownSymbols) { nvg::BeginPath(); - nvg::FontFace(g_font); - nvg::FontSize(midSize / 2); - nvg::FillColor(Setting_Gamepad_TextColor); + nvg::FontFace(m_font); + nvg::FontSize(Setting_Gamepad_FontSize * 1.5f); + nvg::FillColor(Setting_Gamepad_FontColor); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); nvg::TextBox(midX, topSize / 2, midSize, Icons::AngleUp); nvg::TextBox(midX, bottomY + bottomSize / 2, midSize, Icons::AngleDown); @@ -150,8 +150,8 @@ class DashboardPadGamepad : IDashboardPad // Steering percentage if (Setting_Gamepad_SteerPercentage) { nvg::FontFace(m_font); - nvg::FontSize(Setting_Gamepad_SteerPercentageSize); - nvg::FillColor(Setting_Gamepad_TextColor); + nvg::FontSize(Setting_Gamepad_FontSize); + nvg::FillColor(Setting_Gamepad_FontColor); // Left if (steerLeft > 0) { diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index 738e81a..c00cc17 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -117,20 +117,20 @@ class DashboardPadKeyboard : IDashboardPad } nvg::Stroke(); - vec4 textColor = Setting_Keyboard_TextColor; + vec4 textColor = Setting_Keyboard_FontColor; textColor.w *= fillAlpha; nvg::BeginPath(); nvg::FontFace(m_font); - nvg::FontSize(size.x / 2); nvg::FillColor(textColor); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); if (Setting_Keyboard_SteerPercentage && fillDir != 0) { if (value > 0.0f) { - nvg::FontSize(Setting_Keyboard_SteerPercentageSize); + nvg::FontSize(Setting_Keyboard_FontSize); nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, Text::Format("%.f%%", value * 100.0f)); } } else if (Setting_Keyboard_ArrowSymbols) { + nvg::FontSize(Setting_Keyboard_FontSize * 1.5f); nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, text); } } diff --git a/Source/Settings.as b/Source/Settings.as index f6df0ff..64d1e35 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -128,18 +128,18 @@ bool Setting_Gamepad_CateyeUseSimpleSteer = false; [Setting category="Gamepad" name="Display steer percentage" if="Setting_Gamepad_Style Uniform"] bool Setting_Gamepad_SteerPercentage = false; +[Setting category="Gamepad" name="Font" if="Setting_Gamepad_Style Uniform"] +string Setting_Gamepad_Font = "DroidSans.ttf"; + [Setting category="Gamepad" - name="Steer percentage size" - drag min=2 max=40 + name="Font size" + min=2 max=40 if="Setting_Gamepad_Style Uniform"] -int Setting_Gamepad_SteerPercentageSize = 16; - -[Setting category="Gamepad" name="Font" if="Setting_Gamepad_Style Uniform"] -string Setting_Gamepad_Font = "DroidSans.ttf"; +int Setting_Gamepad_FontSize = 16; -[Setting category="Gamepad" name="Text and symbol color" color if="Setting_Gamepad_Style Uniform"] -vec4 Setting_Gamepad_TextColor = vec4(1, 1, 1, 1); +[Setting category="Gamepad" name="Font color" color if="Setting_Gamepad_Style Uniform"] +vec4 Setting_Gamepad_FontColor = vec4(1, 1, 1, 1); @@ -192,17 +192,17 @@ bool Setting_Keyboard_ArrowSymbols = true; [Setting category="Keyboard" name="Display steer percentage" description="Overrides left/right arrows of setting above"] bool Setting_Keyboard_SteerPercentage = false; -[Setting - category="Keyboard" - name="Steer percentage size" - drag min=2 max=40] -int Setting_Keyboard_SteerPercentageSize = 16; - [Setting category="Keyboard" name="Font"] string Setting_Keyboard_Font = "DroidSans.ttf"; -[Setting category="Keyboard" name="Text and symbol color" color] -vec4 Setting_Keyboard_TextColor = vec4(1, 1, 1, 1); +[Setting + category="Keyboard" + name="Font size" + min=2 max=40] +int Setting_Keyboard_FontSize = 16; + +[Setting category="Keyboard" name="Font color" color] +vec4 Setting_Keyboard_FontColor = vec4(1, 1, 1, 1); From c8ed4052b638cf24f657c79018fe32eb908cd422 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 6 Sep 2025 14:48:52 -0600 Subject: [PATCH 09/21] show steer percentage on gamepad classic --- Source/Pads/Gamepad.as | 21 +++++++++++++++++++++ Source/Settings.as | 8 ++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 913a8a4..8553076 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -238,6 +238,27 @@ class DashboardPadGamepad : IDashboardPad nvg::FillColor(WithAlpha(Setting_Gamepad_ClassicDownColor, pedalBrake > 0.1f ? 1.0f : Setting_Gamepad_OffAlpha)); nvg::Fill(); nvg::ResetScissor(); + + // Steering percentage + if (Setting_Gamepad_SteerPercentage) { + nvg::FontFace(m_font); + nvg::FontSize(Setting_Gamepad_FontSize); + nvg::FillColor(Setting_Gamepad_FontColor); + + // Left + if (steerLeft > 0) { + nvg::BeginPath(); + nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); + nvg::TextBox(0, size.y / 2, leftSize - Setting_Gamepad_Spacing, Text::Format("%.f%%", steerLeft * 100.0f)); + } + + // Right + if (steerRight > 0) { + nvg::BeginPath(); + nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); + nvg::TextBox(rightX + Setting_Gamepad_Spacing, size.y / 2, rightSize, Text::Format("%.f%%", steerRight * 100.0f)); + } + } } void RenderCateye(const vec2 &in size, CSceneVehicleVisState@ vis) diff --git a/Source/Settings.as b/Source/Settings.as index 64d1e35..8b40da3 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -125,20 +125,20 @@ bool Setting_Gamepad_UpDownSymbols = true; [Setting category="Gamepad" name="Cateye use simple steer" if="Setting_Gamepad_Style Cateye"] bool Setting_Gamepad_CateyeUseSimpleSteer = false; -[Setting category="Gamepad" name="Display steer percentage" if="Setting_Gamepad_Style Uniform"] +[Setting category="Gamepad" name="Display steer percentage" if="!Setting_Gamepad_Style Cateye"] bool Setting_Gamepad_SteerPercentage = false; -[Setting category="Gamepad" name="Font" if="Setting_Gamepad_Style Uniform"] +[Setting category="Gamepad" name="Font" if="!Setting_Gamepad_Style Cateye"] string Setting_Gamepad_Font = "DroidSans.ttf"; [Setting category="Gamepad" name="Font size" min=2 max=40 - if="Setting_Gamepad_Style Uniform"] + if="!Setting_Gamepad_Style Cateye"] int Setting_Gamepad_FontSize = 16; -[Setting category="Gamepad" name="Font color" color if="Setting_Gamepad_Style Uniform"] +[Setting category="Gamepad" name="Font color" color if="!Setting_Gamepad_Style Cateye"] vec4 Setting_Gamepad_FontColor = vec4(1, 1, 1, 1); From c6f6d2cd40eb3d4631d4c5308c187185c1f7da68 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 6 Sep 2025 15:03:59 -0600 Subject: [PATCH 10/21] more steer percentage settings --- Source/Pads/Gamepad.as | 28 ++++++++++++++++++++++++---- Source/Pads/Keyboard.as | 7 ++++++- Source/Settings.as | 9 +++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 8553076..19b6838 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -157,14 +157,24 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::TextBox(0, size.y / 2, leftSize - Setting_Gamepad_Spacing, Text::Format("%.f%%", steerLeft * 100.0f)); + nvg::TextBox( + -Setting_Gamepad_SteerPercentageSpacing, + size.y / 2, + leftSize - Setting_Gamepad_Spacing, + Text::Format("%.f" + (Setting_Gamepad_SteerPercentageSymbol ? "%%" : ""), steerLeft * 100.0f) + ); } // Right if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::TextBox(rightX + Setting_Gamepad_Spacing, size.y / 2, rightSize, Text::Format("%.f%%", steerRight * 100.0f)); + nvg::TextBox( + Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, + size.y / 2, + rightSize, + Text::Format("%.f" + (Setting_Gamepad_SteerPercentageSymbol ? "%%" : ""), steerRight * 100.0f) + ); } } } @@ -249,14 +259,24 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::TextBox(0, size.y / 2, leftSize - Setting_Gamepad_Spacing, Text::Format("%.f%%", steerLeft * 100.0f)); + nvg::TextBox( + -Setting_Gamepad_SteerPercentageSpacing, + size.y / 2, + leftSize - Setting_Gamepad_Spacing, + Text::Format("%.f" + (Setting_Gamepad_SteerPercentageSymbol ? "%%" : ""), steerLeft * 100.0f) + ); } // Right if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::TextBox(rightX + Setting_Gamepad_Spacing, size.y / 2, rightSize, Text::Format("%.f%%", steerRight * 100.0f)); + nvg::TextBox( + Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, + size.y / 2, + rightSize, + Text::Format("%.f" + (Setting_Gamepad_SteerPercentageSymbol ? "%%" : ""), steerRight * 100.0f) + ); } } } diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index c00cc17..2f37cd3 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -127,7 +127,12 @@ class DashboardPadKeyboard : IDashboardPad if (Setting_Keyboard_SteerPercentage && fillDir != 0) { if (value > 0.0f) { nvg::FontSize(Setting_Keyboard_FontSize); - nvg::TextBox(pos.x, pos.y + size.y / 2, size.x, Text::Format("%.f%%", value * 100.0f)); + nvg::TextBox( + pos.x, + pos.y + size.y / 2, + size.x, + Text::Format("%.f" + (Setting_Keyboard_SteerPercentageSymbol ? "%%" : ""), value * 100.0f) + ); } } else if (Setting_Keyboard_ArrowSymbols) { nvg::FontSize(Setting_Keyboard_FontSize * 1.5f); diff --git a/Source/Settings.as b/Source/Settings.as index 8b40da3..71c00ae 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -128,6 +128,12 @@ bool Setting_Gamepad_CateyeUseSimpleSteer = false; [Setting category="Gamepad" name="Display steer percentage" if="!Setting_Gamepad_Style Cateye"] bool Setting_Gamepad_SteerPercentage = false; +[Setting category="Gamepad" name="Display steer percentage symbol" if="!Setting_Gamepad_Style Cateye"] +bool Setting_Gamepad_SteerPercentageSymbol = true; + +[Setting category="Gamepad" name="Steer percentage spacing" min=-100 max=100 if="!Setting_Gamepad_Style Cateye"] +float Setting_Gamepad_SteerPercentageSpacing = 0.0f; + [Setting category="Gamepad" name="Font" if="!Setting_Gamepad_Style Cateye"] string Setting_Gamepad_Font = "DroidSans.ttf"; @@ -192,6 +198,9 @@ bool Setting_Keyboard_ArrowSymbols = true; [Setting category="Keyboard" name="Display steer percentage" description="Overrides left/right arrows of setting above"] bool Setting_Keyboard_SteerPercentage = false; +[Setting category="Keyboard" name="Display steer percentage symbol"] +bool Setting_Keyboard_SteerPercentageSymbol = true; + [Setting category="Keyboard" name="Font"] string Setting_Keyboard_Font = "DroidSans.ttf"; From dcb0335d56bd65bc1ec235ea715dd92c9daf97f4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 6 Sep 2025 15:14:02 -0600 Subject: [PATCH 11/21] apply alpha on gamepad uniform steer text --- Source/Pads/Gamepad.as | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 19b6838..60bb174 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -77,6 +77,12 @@ class DashboardPadGamepad : IDashboardPad nvg::Fill(); nvg::ResetScissor(); } + float fillAlphaLeft = Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerLeft); + if (Setting_Gamepad_UseBorderGradient) { + nvg::StrokePaint(Setting_Gamepad_BorderGradient.GetPaint(vec2(), size, fillAlphaLeft)); + } else { + nvg::StrokeColor(Setting_Gamepad_BorderColor); + } nvg::Stroke(); // Right @@ -98,6 +104,12 @@ class DashboardPadGamepad : IDashboardPad nvg::Fill(); nvg::ResetScissor(); } + float fillAlphaRight = Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerRight); + if (Setting_Gamepad_UseBorderGradient) { + nvg::StrokePaint(Setting_Gamepad_BorderGradient.GetPaint(vec2(), size, fillAlphaRight)); + } else { + nvg::StrokeColor(Setting_Gamepad_BorderColor); + } nvg::Stroke(); // Up @@ -116,6 +128,12 @@ class DashboardPadGamepad : IDashboardPad nvg::Fill(); nvg::ResetScissor(); } + float fillAlphaUp = pedalGas > 0.1f ? 1.0f : Setting_Gamepad_OffAlpha; + if (Setting_Gamepad_UseBorderGradient) { + nvg::StrokePaint(Setting_Gamepad_BorderGradient.GetPaint(vec2(), size, fillAlphaUp)); + } else { + nvg::StrokeColor(Setting_Gamepad_BorderColor); + } nvg::Stroke(); // Down @@ -134,6 +152,12 @@ class DashboardPadGamepad : IDashboardPad nvg::Fill(); nvg::ResetScissor(); } + float fillAlphaDown = pedalBrake > 0.1f ? 1.0f : Setting_Gamepad_OffAlpha; + if (Setting_Gamepad_UseBorderGradient) { + nvg::StrokePaint(Setting_Gamepad_BorderGradient.GetPaint(vec2(), size, fillAlphaDown)); + } else { + nvg::StrokeColor(Setting_Gamepad_BorderColor); + } nvg::Stroke(); // Up & Down texts @@ -141,9 +165,10 @@ class DashboardPadGamepad : IDashboardPad nvg::BeginPath(); nvg::FontFace(m_font); nvg::FontSize(Setting_Gamepad_FontSize * 1.5f); - nvg::FillColor(Setting_Gamepad_FontColor); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); + nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaUp)); nvg::TextBox(midX, topSize / 2, midSize, Icons::AngleUp); + nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaDown)); nvg::TextBox(midX, bottomY + bottomSize / 2, midSize, Icons::AngleDown); } @@ -151,12 +176,12 @@ class DashboardPadGamepad : IDashboardPad if (Setting_Gamepad_SteerPercentage) { nvg::FontFace(m_font); nvg::FontSize(Setting_Gamepad_FontSize); - nvg::FillColor(Setting_Gamepad_FontColor); // Left if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); + nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaLeft)); nvg::TextBox( -Setting_Gamepad_SteerPercentageSpacing, size.y / 2, @@ -169,6 +194,7 @@ class DashboardPadGamepad : IDashboardPad if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); + nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaRight)); nvg::TextBox( Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, size.y / 2, From e11c64a89a5786cd246aafdd07494dfb12aa613e Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 6 Sep 2025 15:19:01 -0600 Subject: [PATCH 12/21] alpha on classic steer text --- Source/Pads/Gamepad.as | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 60bb174..a1ebdc5 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -279,12 +279,12 @@ class DashboardPadGamepad : IDashboardPad if (Setting_Gamepad_SteerPercentage) { nvg::FontFace(m_font); nvg::FontSize(Setting_Gamepad_FontSize); - nvg::FillColor(Setting_Gamepad_FontColor); // Left if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); + nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerLeft))); nvg::TextBox( -Setting_Gamepad_SteerPercentageSpacing, size.y / 2, @@ -297,6 +297,7 @@ class DashboardPadGamepad : IDashboardPad if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); + nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerRight))); nvg::TextBox( Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, size.y / 2, From 6314bb9a2ec55d9d4b63477ae2a88763a0e68165 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 7 Sep 2025 12:06:20 -0600 Subject: [PATCH 13/21] new line brace --- Source/Things/PadHost.as | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Things/PadHost.as b/Source/Things/PadHost.as index 99cb17b..32e597b 100644 --- a/Source/Things/PadHost.as +++ b/Source/Things/PadHost.as @@ -118,7 +118,8 @@ class DashboardPadHost : DashboardThing } } - void OnSettingsChanged() override { + void OnSettingsChanged() override + { if (m_pad !is null) { m_pad.OnSettingsChanged(); } From cc90272916410779d3b06024c55caa7bb03e86d3 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 7 Sep 2025 12:09:15 -0600 Subject: [PATCH 14/21] hide setting conditionally --- Source/Settings.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Settings.as b/Source/Settings.as index 71c00ae..a5dc101 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -198,7 +198,7 @@ bool Setting_Keyboard_ArrowSymbols = true; [Setting category="Keyboard" name="Display steer percentage" description="Overrides left/right arrows of setting above"] bool Setting_Keyboard_SteerPercentage = false; -[Setting category="Keyboard" name="Display steer percentage symbol"] +[Setting category="Keyboard" name="Display steer percentage symbol" if="Setting_Keyboard_SteerPercentage"] bool Setting_Keyboard_SteerPercentageSymbol = true; [Setting category="Keyboard" name="Font"] From 8fa27a5e64416afb1b396fcbf455920bb31c9972 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 7 Sep 2025 12:19:41 -0600 Subject: [PATCH 15/21] rename FontColor settings back to TextColor --- Source/Pads/Gamepad.as | 12 ++++++------ Source/Pads/Keyboard.as | 2 +- Source/Settings.as | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index a1ebdc5..8d8688a 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -166,9 +166,9 @@ class DashboardPadGamepad : IDashboardPad nvg::FontFace(m_font); nvg::FontSize(Setting_Gamepad_FontSize * 1.5f); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); - nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaUp)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaUp)); nvg::TextBox(midX, topSize / 2, midSize, Icons::AngleUp); - nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaDown)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaDown)); nvg::TextBox(midX, bottomY + bottomSize / 2, midSize, Icons::AngleDown); } @@ -181,7 +181,7 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaLeft)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaLeft)); nvg::TextBox( -Setting_Gamepad_SteerPercentageSpacing, size.y / 2, @@ -194,7 +194,7 @@ class DashboardPadGamepad : IDashboardPad if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, fillAlphaRight)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaRight)); nvg::TextBox( Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, size.y / 2, @@ -284,7 +284,7 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerLeft))); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerLeft))); nvg::TextBox( -Setting_Gamepad_SteerPercentageSpacing, size.y / 2, @@ -297,7 +297,7 @@ class DashboardPadGamepad : IDashboardPad if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::FillColor(WithAlpha(Setting_Gamepad_FontColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerRight))); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerRight))); nvg::TextBox( Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, size.y / 2, diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index 2f37cd3..9068922 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -117,7 +117,7 @@ class DashboardPadKeyboard : IDashboardPad } nvg::Stroke(); - vec4 textColor = Setting_Keyboard_FontColor; + vec4 textColor = Setting_Keyboard_TextColor; textColor.w *= fillAlpha; nvg::BeginPath(); diff --git a/Source/Settings.as b/Source/Settings.as index a5dc101..146ba18 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -144,8 +144,8 @@ string Setting_Gamepad_Font = "DroidSans.ttf"; if="!Setting_Gamepad_Style Cateye"] int Setting_Gamepad_FontSize = 16; -[Setting category="Gamepad" name="Font color" color if="!Setting_Gamepad_Style Cateye"] -vec4 Setting_Gamepad_FontColor = vec4(1, 1, 1, 1); +[Setting category="Gamepad" name="Text color" color if="!Setting_Gamepad_Style Cateye"] +vec4 Setting_Gamepad_TextColor = vec4(1, 1, 1, 1); @@ -210,8 +210,8 @@ string Setting_Keyboard_Font = "DroidSans.ttf"; min=2 max=40] int Setting_Keyboard_FontSize = 16; -[Setting category="Keyboard" name="Font color" color] -vec4 Setting_Keyboard_FontColor = vec4(1, 1, 1, 1); +[Setting category="Keyboard" name="Text color" color] +vec4 Setting_Keyboard_TextColor = vec4(1, 1, 1, 1); From 6b0758ebf38577c79cb689117d530238c0e9c63e Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 13 Feb 2026 13:26:10 -0700 Subject: [PATCH 16/21] toggle alpha on gamepad text --- Source/Pads/Gamepad.as | 14 ++++++++------ Source/Settings.as | 5 ++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index 8d8688a..bc32d1f 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -166,9 +166,9 @@ class DashboardPadGamepad : IDashboardPad nvg::FontFace(m_font); nvg::FontSize(Setting_Gamepad_FontSize * 1.5f); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Center); - nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaUp)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Setting_Gamepad_OffAlphaText ? fillAlphaUp : 1.0f)); nvg::TextBox(midX, topSize / 2, midSize, Icons::AngleUp); - nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaDown)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Setting_Gamepad_OffAlphaText ? fillAlphaDown : 1.0f)); nvg::TextBox(midX, bottomY + bottomSize / 2, midSize, Icons::AngleDown); } @@ -181,7 +181,7 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaLeft)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Setting_Gamepad_OffAlphaText ? fillAlphaLeft : 1.0f)); nvg::TextBox( -Setting_Gamepad_SteerPercentageSpacing, size.y / 2, @@ -194,7 +194,7 @@ class DashboardPadGamepad : IDashboardPad if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, fillAlphaRight)); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Setting_Gamepad_OffAlphaText ? fillAlphaRight : 1.0f)); nvg::TextBox( Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, size.y / 2, @@ -275,6 +275,8 @@ class DashboardPadGamepad : IDashboardPad nvg::Fill(); nvg::ResetScissor(); + float textAlpha = Setting_Gamepad_OffAlphaText ? Setting_Gamepad_OffAlpha : 1.0f; + // Steering percentage if (Setting_Gamepad_SteerPercentage) { nvg::FontFace(m_font); @@ -284,7 +286,7 @@ class DashboardPadGamepad : IDashboardPad if (steerLeft > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); - nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerLeft))); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(textAlpha, 1.0f, steerLeft))); nvg::TextBox( -Setting_Gamepad_SteerPercentageSpacing, size.y / 2, @@ -297,7 +299,7 @@ class DashboardPadGamepad : IDashboardPad if (steerRight > 0) { nvg::BeginPath(); nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); - nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(Setting_Gamepad_OffAlpha, 1.0f, steerRight))); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(textAlpha, 1.0f, steerRight))); nvg::TextBox( Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, size.y / 2, diff --git a/Source/Settings.as b/Source/Settings.as index 146ba18..675ddd1 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -116,9 +116,12 @@ vec4 Setting_Gamepad_ClassicUpColor = vec4(0.2f, 1, 0.6f, 1); [Setting category="Gamepad" name="Classic down color" color if="Setting_Gamepad_Style Classic"] vec4 Setting_Gamepad_ClassicDownColor = vec4(1, 0.6f, 0.2f, 1); -[Setting category="Gamepad" name="Classic off alpha" drag min=0 max=1 if="Setting_Gamepad_Style Classic"] +[Setting category="Gamepad" name="Inactive alpha" drag min=0 max=1] float Setting_Gamepad_OffAlpha = 0.33f; +[Setting category="Gamepad" name="Use inactive alpha for text"] +bool Setting_Gamepad_OffAlphaText = true; + [Setting category="Gamepad" name="Display up/down arrow symbols" if="Setting_Gamepad_Style Uniform"] bool Setting_Gamepad_UpDownSymbols = true; From 45907b67c1413b928c51d8a90e423965ee6ed5ad Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 13 Feb 2026 13:29:21 -0700 Subject: [PATCH 17/21] add steer percentage to cateye --- Source/Pads/Gamepad.as | 40 ++++++++++++++++++++++++++++++++++++++++ Source/Settings.as | 8 ++++---- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Source/Pads/Gamepad.as b/Source/Pads/Gamepad.as index bc32d1f..ad66ab6 100644 --- a/Source/Pads/Gamepad.as +++ b/Source/Pads/Gamepad.as @@ -393,6 +393,46 @@ class DashboardPadGamepad : IDashboardPad nvg::FillColor(pedalBrake > 0.1f ? Setting_Gamepad_FillColor : Setting_Gamepad_EmptyFillColor); FillInflectedTriangle(posMidBot, posBotInflection, posMidLeft, posMidRight); StrokeInflectedTriangle(posMidBot, posBotInflection, posMidLeft, posMidRight); + + float textAlpha = Setting_Gamepad_OffAlphaText ? Setting_Gamepad_OffAlpha : 1.0f; + + float leftSize = size.x * (0.5f - Setting_Gamepad_MiddleScale / 2) - Setting_Gamepad_Spacing; + float midX = leftSize + Setting_Gamepad_Spacing; + float midSize = size.x * Setting_Gamepad_MiddleScale; + float rightX = midX + midSize + Setting_Gamepad_Spacing; + float rightSize = size.x - rightX; + + // Steering percentage + if (Setting_Gamepad_SteerPercentage) { + nvg::FontFace(m_font); + nvg::FontSize(Setting_Gamepad_FontSize); + + // Left + if (steerLeft > 0) { + nvg::BeginPath(); + nvg::TextAlign(nvg::Align::Middle | nvg::Align::Right); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(textAlpha, 1.0f, steerLeft))); + nvg::TextBox( + -Setting_Gamepad_SteerPercentageSpacing, + size.y / 2, + leftSize - Setting_Gamepad_Spacing, + Text::Format("%.f" + (Setting_Gamepad_SteerPercentageSymbol ? "%%" : ""), steerLeft * 100.0f) + ); + } + + // Right + if (steerRight > 0) { + nvg::BeginPath(); + nvg::TextAlign(nvg::Align::Middle | nvg::Align::Left); + nvg::FillColor(WithAlpha(Setting_Gamepad_TextColor, Math::Lerp(textAlpha, 1.0f, steerRight))); + nvg::TextBox( + Setting_Gamepad_SteerPercentageSpacing + rightX + Setting_Gamepad_Spacing, + size.y / 2, + rightSize, + Text::Format("%.f" + (Setting_Gamepad_SteerPercentageSymbol ? "%%" : ""), steerRight * 100.0f) + ); + } + } } private void FillInflectedTriangle(const vec2 &in posApex, const vec2 &in posInflection, const vec2 &in posSide1, const vec2 &in posSide2) diff --git a/Source/Settings.as b/Source/Settings.as index 675ddd1..69c3f3b 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -128,16 +128,16 @@ bool Setting_Gamepad_UpDownSymbols = true; [Setting category="Gamepad" name="Cateye use simple steer" if="Setting_Gamepad_Style Cateye"] bool Setting_Gamepad_CateyeUseSimpleSteer = false; -[Setting category="Gamepad" name="Display steer percentage" if="!Setting_Gamepad_Style Cateye"] +[Setting category="Gamepad" name="Display steer percentage"] bool Setting_Gamepad_SteerPercentage = false; -[Setting category="Gamepad" name="Display steer percentage symbol" if="!Setting_Gamepad_Style Cateye"] +[Setting category="Gamepad" name="Display steer percentage symbol" if="Setting_Gamepad_SteerPercentage"] bool Setting_Gamepad_SteerPercentageSymbol = true; -[Setting category="Gamepad" name="Steer percentage spacing" min=-100 max=100 if="!Setting_Gamepad_Style Cateye"] +[Setting category="Gamepad" name="Steer percentage spacing" min=-100 max=100] float Setting_Gamepad_SteerPercentageSpacing = 0.0f; -[Setting category="Gamepad" name="Font" if="!Setting_Gamepad_Style Cateye"] +[Setting category="Gamepad" name="Font"] string Setting_Gamepad_Font = "DroidSans.ttf"; [Setting From 482f2cde0a99a8ecfb9dfe6bc9fa2c09818c017b Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 13 Feb 2026 13:33:11 -0700 Subject: [PATCH 18/21] toggle alpha on keyboard text --- Source/Pads/Keyboard.as | 4 +++- Source/Settings.as | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Pads/Keyboard.as b/Source/Pads/Keyboard.as index 9068922..11d36fc 100644 --- a/Source/Pads/Keyboard.as +++ b/Source/Pads/Keyboard.as @@ -118,7 +118,9 @@ class DashboardPadKeyboard : IDashboardPad nvg::Stroke(); vec4 textColor = Setting_Keyboard_TextColor; - textColor.w *= fillAlpha; + if (Setting_Gamepad_InactiveAlphaText) { + textColor.w *= fillAlpha; + } nvg::BeginPath(); nvg::FontFace(m_font); diff --git a/Source/Settings.as b/Source/Settings.as index 69c3f3b..001dda8 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -195,6 +195,9 @@ float Setting_Keyboard_Spacing = 10.0f; [Setting category="Keyboard" name="Inactive alpha" drag min=0 max=1] float Setting_Keyboard_InactiveAlpha = 1.0f; +[Setting category="Keyboard" name="Use inactive alpha for text"] +bool Setting_Gamepad_InactiveAlphaText = true; + [Setting category="Keyboard" name="Display arrow symbols"] bool Setting_Keyboard_ArrowSymbols = true; From 08360c9b28a7f7259d73a22fe54b00c5beb66814 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 13 Feb 2026 13:40:29 -0700 Subject: [PATCH 19/21] show text color setting for cateye --- Source/Settings.as | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Settings.as b/Source/Settings.as index 001dda8..a3c3be8 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -147,7 +147,7 @@ string Setting_Gamepad_Font = "DroidSans.ttf"; if="!Setting_Gamepad_Style Cateye"] int Setting_Gamepad_FontSize = 16; -[Setting category="Gamepad" name="Text color" color if="!Setting_Gamepad_Style Cateye"] +[Setting category="Gamepad" name="Text color" color] vec4 Setting_Gamepad_TextColor = vec4(1, 1, 1, 1); From fad15ded6bbb53609c5aa61f09997896e4a60217 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 13 Feb 2026 13:41:37 -0700 Subject: [PATCH 20/21] show font size setting for cateye --- Source/Settings.as | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Source/Settings.as b/Source/Settings.as index a3c3be8..d7bab65 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -140,11 +140,7 @@ float Setting_Gamepad_SteerPercentageSpacing = 0.0f; [Setting category="Gamepad" name="Font"] string Setting_Gamepad_Font = "DroidSans.ttf"; -[Setting - category="Gamepad" - name="Font size" - min=2 max=40 - if="!Setting_Gamepad_Style Cateye"] +[Setting category="Gamepad" name="Font size" min=2 max=40] int Setting_Gamepad_FontSize = 16; [Setting category="Gamepad" name="Text color" color] From 683198f5bd2a1068fa9897794ff37904c60d8a01 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 13 Feb 2026 13:42:17 -0700 Subject: [PATCH 21/21] consistent formatting --- Source/Settings.as | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Settings.as b/Source/Settings.as index d7bab65..bf4fc75 100644 --- a/Source/Settings.as +++ b/Source/Settings.as @@ -206,10 +206,7 @@ bool Setting_Keyboard_SteerPercentageSymbol = true; [Setting category="Keyboard" name="Font"] string Setting_Keyboard_Font = "DroidSans.ttf"; -[Setting - category="Keyboard" - name="Font size" - min=2 max=40] +[Setting category="Keyboard" name="Font size" min=2 max=40] int Setting_Keyboard_FontSize = 16; [Setting category="Keyboard" name="Text color" color]