Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard modding #3227

Merged
merged 2 commits into from
Mar 1, 2025
Merged

Conversation

ohlidalp
Copy link
Member

@ohlidalp ohlidalp commented Feb 12, 2025

A new mod type was added: '.dashboard'. Usual modcache treatment: ZIP/directory under 'mods/', recorded in cache file 'mods.cache', viewable/searchable in SelectorUI, can have preview image.

Added new cvars 'ui_default_truck_dash', 'ui_default_boat_dash'.(string) - stores the name of default dashboard, you can change it via Settings (tab UI). For testing, I reused older demo dashboard "dashtut":
dashtut.zip
dashtut_w_font.zip

image

Example of the .dashboard file:

; A dashboard mod MUST contain a '.dashboard' file, even if just empty.
; Recognized parameters:
; * dashboard_name <string>
; * dashboard_description <string>
; * dashboard_author <string: credit> <int: forum ID> <string: name> <string: email>
; * dashboard_category <int: 200=Generic, 201=Truck, 202=Boat>
;
; All layout+resource files must start the same as the .dashboard file.
; For example: foo.dashboard -> foo_dashboard.layout, foo_dashboard.resource
; Optional layout filename tags:
; * '_Nrpm' ~ N is the redline RPM
; * '_Xph' ~ X is units (k=Kilometers | m=Miles)
; ------------------------------------------------------------

dashboard_name "dashtut_w_font"
dashboard_description "Tutorial Dashboard (with custom font!)"
dashboard_category 201

The dashboard spawning was fixed, using custom texturedashboards should not block HUD anymore.

@ohlidalp ohlidalp force-pushed the mark_dashboard_modding branch 4 times, most recently from 15f3ac0 to 4eb1a45 Compare February 17, 2025 22:10
Caused by bad material cleanup, introduced in 1cbf91f with the mouse-hover highlights.
Usual modcache treatment: recorded in cache file 'mods.cache', viewable/searchable in SelectorUI, can have preview image.
Removed cvar 'gfx_speedo_digital', made digital/analog separate .dashboard files
For examples, see files 'default_*.dashboard' (truck digital/analog, boat), added to 'dashboards.zip'.
Note: in the Selector UI, preview images for dashboards are only shrunk if needed but not enlarged so players see actual in-game size ~ suggested by Mark.

2 new cvars were added: 'ui_default_truck_dash', 'ui_default_boat_dash' (string) - these store the names of default dashboards, you can change them via Settings (tab UI).

Custom fonts are supported via .resource files (XML, same syntax as MyGui_FontsDash.xml in 'dashboards.zip').

    // determineTruckLayoutFromDashboardMod Algorithm:
    // A. Consider only layouts with matching Xph tag, find best RPM match (see below).
    // B. If no match found, consider also layouts without Xph tag, find best RPM match (see below).
    //
    // Best RPM matching:
    // 1. Consider just layouts with Xrpm tag, find one with with smallest RPM overshoot.
    // 2. If all undershoot, take one with least undershoot and log a warning
    // 3. If there's no layout with Xrpm tag, Consider layouts without Xrpm tag, pick random .
    // ---------------------------------------------------------------------------------------
@ohlidalp ohlidalp force-pushed the mark_dashboard_modding branch from 4b51036 to d038248 Compare March 1, 2025 13:37
@ohlidalp ohlidalp merged commit 8e5a521 into RigsOfRods:master Mar 1, 2025
2 checks passed
@ohlidalp ohlidalp deleted the mark_dashboard_modding branch March 1, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant