Skip to content

Commit

Permalink
🎮 New mod type: '.dashboard'
Browse files Browse the repository at this point in the history
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, resizing preview images is disabled for dashboards 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').
  • Loading branch information
ohlidalp committed Feb 17, 2025
1 parent 6428a1d commit 15f3ac0
Show file tree
Hide file tree
Showing 29 changed files with 1,263 additions and 1,125 deletions.
Binary file added resources/dashboards/default_boat-mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions resources/dashboards/default_boat.dashboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; 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>
;
; Custom fonts are supported via .resource files (XML, same syntax as MyGui_FontsDash.xml in 'dashboards.zip').
;
; 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 "Default - Boat"
dashboard_description "Default dashboard for boats"
dashboard_category 202
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="ImageBox" skin="ImageBox" position="0 114 1024 795" align="Strech" layer="Back" name="_Main">
<Widget type="ImageBox" skin="ImageBox" position="770 544 250 250" align="Right Bottom" layer="Back" name="SpeedoGauge">
<Property key="ImageTexture" value="speedo_boat.png"/>
<UserString key="link" value="water_speed"/>
<Widget type="TextBox" skin="TextBox" position="89 175 72 27" name="textdepth">
<Property key="TextColour" value="1 1 1"/>
<Property key="TextAlign" value="Right VCenter"/>
<Property key="FontHeight" value="18"/>
<Property key="Caption" value="123"/>
<Property key="FontName" value="Digital-7-18"/>
<UserString key="link" value="water_depth"/>
<UserString key="anim" value="textformat"/>
<UserString key="format" value="%2.1f"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="156 107 35 35" name="ign">
<Property key="ImageTexture" value="ign_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="texture" value="ign_v2"/>
<UserString key="link" value="engine_ignition"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="108 76 35 35" name="lightsBattery">
<Property key="ImageTexture" value="batt_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="texture" value="batt_v2"/>
<UserString key="link" value="engine_battery"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="147 78 25 25" name="lightsLocked">
<Property key="ImageTexture" value="secured_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="texture" value="secured_v2"/>
<UserString key="link" value="locked"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="74 77 28 28" name="lightsTies">
<Property key="ImageTexture" value="locked_v2-0.png"/>
<UserString key="texture" value="locked_v2"/>
<UserString key="link" value="ties_mode"/>
<UserString key="anim" value="series"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="55 107 35 35" name="lightsFrontLights">
<Property key="ImageTexture" value="lights_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="link" value="lights"/>
<UserString key="texture" value="lights_v2"/>
</Widget>
</Widget>
<Widget type="ImageBox" skin="RotatingSkin" style="Overlapped" position="769 538 258 258" align="Right Bottom" layer="Middle" name="SpeedoNeedle">
<Property key="ImageTexture" value="redneedle_v2.png"/>
<UserString key="anim" value="rotate"/>
<UserString key="link" value="water_speed"/>
<UserString key="vmax" value="60"/>
<UserString key="vmin" value="-60"/>
<UserString key="min" value="-135"/>
<UserString key="max" value="135"/>
<Widget type="ImageBox" skin="ImageBox" position="113 113 32 32">
<Property key="ImageTexture" value="needle_prt2.png"/>
</Widget>
</Widget>
<Widget type="ImageBox" skin="RotatingSkin" position="461 644 150 150" align="HCenter Bottom" name="steerrudder">
<Property key="ImageTexture" value="shipsteer.dds"/>
<UserString key="anim" value="rotate"/>
<UserString key="max" value="360"/>
<UserString key="min" value="-360"/>
<UserString key="link" value="screw_steer_0"/>
<UserString key="vmax" value="-1"/>
<UserString key="vmin" value="1"/>
</Widget>
</Widget>
</MyGUI>
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="ImageBox" skin="ImageBox" position="0 114 1024 795" align="Strech" layer="Back" name="_Main">
<Widget type="ImageBox" skin="ImageBox" position="770 544 250 250" align="Right Bottom" layer="Back" name="SpeedoGauge">
<Property key="ImageTexture" value="speedo_boat.png"/>
<UserString key="link" value="water_speed"/>
<Widget type="TextBox" skin="TextBox" position="89 175 72 27" name="textdepth">
<Property key="TextColour" value="1 1 1"/>
<Property key="TextAlign" value="Right VCenter"/>
<Property key="FontHeight" value="18"/>
<Property key="Caption" value="123"/>
<Property key="FontName" value="Digital-7-18"/>
<UserString key="link" value="water_depth"/>
<UserString key="anim" value="textformat"/>
<UserString key="format" value="%2.1f"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="156 107 35 35" name="ign">
<Property key="ImageTexture" value="ign_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="texture" value="ign_v2"/>
<UserString key="link" value="engine_ignition"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="108 76 35 35" name="lightsBattery">
<Property key="ImageTexture" value="batt_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="texture" value="batt_v2"/>
<UserString key="link" value="engine_battery"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="147 78 25 25" name="lightsLocked">
<Property key="ImageTexture" value="secured_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="texture" value="secured_v2"/>
<UserString key="link" value="locked"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="74 77 28 28" name="lightsTies">
<Property key="ImageTexture" value="locked_v2-0.png"/>
<UserString key="texture" value="locked_v2"/>
<UserString key="link" value="ties_mode"/>
<UserString key="anim" value="series"/>
</Widget>
<Widget type="ImageBox" skin="ImageBox" position="55 107 35 35" name="lightsFrontLights">
<Property key="ImageTexture" value="lights_v2-off.png"/>
<UserString key="anim" value="lamp"/>
<UserString key="link" value="lights"/>
<UserString key="texture" value="lights_v2"/>
</Widget>
</Widget>
<Widget type="ImageBox" skin="RotatingSkin" style="Overlapped" position="769 538 258 258" align="Right Bottom" layer="Middle" name="SpeedoNeedle">
<Property key="ImageTexture" value="redneedle_v2.png"/>
<UserString key="anim" value="rotate"/>
<UserString key="link" value="water_speed"/>
<UserString key="vmax" value="60"/>
<UserString key="vmin" value="-60"/>
<UserString key="min" value="-135"/>
<UserString key="max" value="135"/>
<Widget type="ImageBox" skin="ImageBox" position="113 113 32 32">
<Property key="ImageTexture" value="needle_prt2.png"/>
</Widget>
</Widget>
<Widget type="ImageBox" skin="RotatingSkin" position="461 644 150 150" align="HCenter Bottom" name="steerrudder">
<Property key="ImageTexture" value="shipsteer.dds"/>
<UserString key="anim" value="rotate"/>
<UserString key="max" value="360"/>
<UserString key="min" value="-360"/>
<UserString key="link" value="screw_steer_0"/>
<UserString key="vmax" value="-1"/>
<UserString key="vmin" value="1"/>
</Widget>
</Widget>
</MyGUI>
128 changes: 0 additions & 128 deletions resources/dashboards/default_dashboard.layout

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions resources/dashboards/default_truck_analog.dashboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; 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>
;
; Custom fonts are supported via .resource files (XML, same syntax as MyGui_FontsDash.xml in 'dashboards.zip').
;
; 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 "Default - Truck analog"
dashboard_description "Default dashboard with analog speedometer"
dashboard_author "7000 RPM tacho" -1 "Klink"
dashboard_category 201
Loading

0 comments on commit 15f3ac0

Please sign in to comment.