Skip to content

Commit e164c4f

Browse files
committed
🎮 Converted editor scripts to gadgets.
This should make the mature tools (script editor, road editor) a lot more accessible and advertised via TopMenubar/Tools menu/[Browse gadgets...] button. Most of the scripts are alpha prototypes (previously example_*.as scripts), but they're something to show anyway.
1 parent d6e7307 commit e164c4f

26 files changed

+140
-1
lines changed
271 KB
Loading
File renamed without changes.

resources/gadgets/engine_tool.gadget

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "Engine Tool (alpha)"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "In-game engine diag and adjustment."
15+
16+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
17+
gadget_category 301
377 KB
Loading

resources/gadgets/odef_browser.gadget

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "ODEF browser (alpha)"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "Lists .odef files from 'resources/meshes.zip' and sorts/displays/spawns/deletes them."
15+
16+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
17+
gadget_category 302
404 KB
Loading
File renamed without changes.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "Overlay editor (alpha)"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "Shows how OGRE overlays can be created dynamically."
15+
16+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
17+
gadget_category 300

resources/gadgets/rig_editor-mini.png

328 KB
Loading

resources/gadgets/rig_editor.gadget

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "Rig editor (alpha)"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "In-game editing of rig definition (aka truck) files."
15+
16+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
17+
gadget_category 301
609 KB
Loading
File renamed without changes.

resources/gadgets/road_editor.gadget

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "Road editor"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "Interactive editor of procedural roads.
15+
You must enter editor mode (Ctrl+Y) to use it."
16+
17+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
18+
gadget_category 302
465 KB
Loading
File renamed without changes.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "Script editor"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "Handy text editor with error highlighting, code folding, examples, tutorial."
15+
16+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
17+
gadget_category 300

resources/gadgets/shock_tool-mini.png

307 KB
Loading
File renamed without changes.

resources/gadgets/shock_tool.gadget

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "Shock Tool (alpha)"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "Shows spring/damp of shocks as adjustable graphs"
15+
16+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
17+
gadget_category 301
217 KB
Loading
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; This is a .gadget mod - basically a script wrapped as a modcache entry.
2+
; The .gadget file must be present (even if empty) to get recognized.
3+
; The script must have same base filename, i.e. 'foo.gadget' -> 'foo.as'
4+
; Any extra include scripts or other resources can be bundled.
5+
; -----------------------------------------------------------------------
6+
7+
; Name to display in Selector UI.
8+
gadget_name "TerrnBatcher (alpha)"
9+
10+
; Authors (Syntax: <credit>, <forumID>, <name>, [<email>]) - multiple authors can be given.
11+
gadget_author "base script" 351 ohlidalp
12+
13+
; Description to display in Selector UI.
14+
gadget_description "Tool to merge static meshes & materials for FPS boost.
15+
PROTOTYPE: displays UI, implements selection but not the batching yet."
16+
17+
; Category for Selector UI (300 = Generic gadgets, 301 = Actor gadgets, 302 = Terrain gadgets).
18+
gadget_category 302

resources/scripts/README.txt

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ FOR DEVELOPERS: Visit https://developer.rigsofrods.org/ and click "Script-side A
77

88
Conventions:
99
* Scripts named 'example_*.as' are short introductory scripts that perform one thing, usually showing UI with tips and controls. You can run them using 'loadscript'.
10-
* Scripts named '*_editor.as' are complete tools. You can run them using 'loadscript'.
1110
* Scripts named '*_utils.as' are includes - running them via 'loadscript' does nothing, they are to be `#include`-d into other scripts.
1211

1312
Special scripts:

source/main/resources/ContentManager.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ void ContentManager::InitModCache(CacheValidity validity)
278278
ResourceGroupManager::getSingleton().addResourceLocation(PathCombine(App::sys_process_dir->getStr(), "content") , "FileSystem", RGN_CONTENT);
279279
std::string objects = PathCombine("resources", "beamobjects.zip");
280280
ResourceGroupManager::getSingleton().addResourceLocation(PathCombine(App::sys_process_dir->getStr(), objects) , "Zip" , RGN_CONTENT);
281+
std::string gadgets = PathCombine("resources", "gadgets.zip");
282+
ResourceGroupManager::getSingleton().addResourceLocation(PathCombine(App::sys_process_dir->getStr(), gadgets), "Zip", RGN_CONTENT);
281283

282284
// Create RGN_TEMP in recursive mode to find all subdirectories.
283285

0 commit comments

Comments
 (0)