Garry's Mod

Garry's Mod

36 vurderinger
Garry's Mod Custom Main Menu
Af VMan_2002
How to customize the Garry's Mod main menu!
   
Pris
Føj til foretrukne
Gjort til foretrukken
Fjern som foretrukken
This guide seems to be outdated nope im dumb
Changes have seemingly been made to the menu format since the time this guide was initially posted (25 Mar, 2018)

nope im dumb i just misread my own guide
Getting Started
The menu works by using a .html file, which can be found at:
  • steam/SteamApps/common/GarrysMod/garrysmod/html/menu.html
Unless you want to do major design changes to the menu, unlike what's in this guide, you should not edit menu.html, and instead enter templates folder.

You should backup the entire html folder in case you make an irreversible mistake.

There will be 6 .html files inside, but the one we want to edit is called "main.html"
Right click, and choose 'Edit'
You can also use Notepad++, which you can find here[notepad-plus-plus.org] and choose 'Edit with Notepad++' instead of 'Edit'

The line highlighted in blue is one that I added, to move to a new custom menu. You can do what you want instead, but note this is how you do it:
Directory:
<li><a ng-href="#/directory/" ng-♥♥♥♥♥♥="'ButtonText'"></a></li>
Game Command:
<li><a ng-click="MenuOption( this, 'engine gamecommand')" ng-♥♥♥♥♥♥="'ButtonText'"></a></li>

Example with Command:
<li><a ng-click="MenuOption( this, 'engine toggleconsole')" ng-♥♥♥♥♥♥="'Show Console'"></a></li>
Defining Your New Menu Directory
If you wanted to make a new menu directory, you'll first need to define it. Go to
html/js/menu/menuApp.js
then right click and choose 'Edit' (or 'Edit with Notepad++' if it is visible).

The line in blue is the new one I added.
Example:
$routeProvider.when('/testcustom/', { templateUrl: 'template/testcustom.html' } );
Now that your menu is defined, you also need to create it!
Making Your Menu Directory
Now copy + paste main.html which can be found at html/template
and name it how what you see as "testcustom.html" in this:
$routeProvider.when('/testcustom/', { templateUrl: 'template/testcustom.html' } );
so I named mine
testcustom.html
and fill it with what you want.

Example
<div class="page" ng-controller="ControllerMain"> <div class="options"> <ul> <li><h2 style="color:DodgerBlue">Custom Menu</h2></li> <li>&nbsp;</li> <li><a ng-href="#/" ng-♥♥♥♥♥♥="'Back'"></a></li> <li>&nbsp;</li> <li><a ng-click="MenuOption( this, 'engine toggleconsole')" ng-♥♥♥♥♥♥="'Show Console'"></a></li> <li>&nbsp;</li> <li><a ng-click="MenuOption( this, 'engine map gm_construct')" ng-♥♥♥♥♥♥="'Play GM_Construct'"></a></li> <li><a ng-click="MenuOption( this, 'engine echo Test in Menu')" ng-♥♥♥♥♥♥="'Test Custom Option'"></a></li> <li>&nbsp;</li> <li><a ng-click="MenuOption( this, 'engine custom_test')" ng-♥♥♥♥♥♥="'Custom Test'"></a></li> <li><a ng-click="MenuOption( this, 'engine echo red')" ng-♥♥♥♥♥♥="'Option Red'" style="color:Red"></a></li> <li><a ng-click="MenuOption( this, 'engine echo palegoldenrod')" ng-♥♥♥♥♥♥="'Option PaleGoldenrod'" style="color:PaleGoldenrod"></a></li> <li><h2><a ng-click="MenuOption( this, 'engine echo header')" ng-♥♥♥♥♥♥="'Custom Header'"></h2></a></li> <li><a ng-click="MenuOption( this, 'engine echo font')" ng-♥♥♥♥♥♥="'Font Times New Roman'" style="font-family: 'Times New Roman'"></a></li> <li><h6>https://htmlcolorcodes.com/color-names/</h6></li> <li>&nbsp;</li> <li ng-show="InGame"> <a ng-click="MenuOption( this, 'engine disconnect');" ng-♥♥♥♥♥♥="'disconnect'"></a> </li> <li><a ng-click="MenuOption( this, 'engine quit')" ng-♥♥♥♥♥♥="'quit'"></a></li> </ul> </div> </div>
Result:
https://htmlcolorcodes.com/color-names/ for HTML color names (like Red or PaleGoldenrod or DodgerBlue)
One Final Important Note
Garry's Mod likes to overwrite the menu after updating, so inside a new folder outside of your Steam directory, you should make a batch file similar to this one:
xcopy "new/html" "C:\Program Files\Steam\SteamApps\common\GarrysMod\garrysmod\html" /V /C /F /R /J /S /I /Y
Save it and name it 'copy.bat', and make this folder structure:
  • new
  •   html
  • copy.bat
where html is inside new.

Then copy all of your custom html files inside the new html folder.
19 kommentarer
MARK2580 17. mar. kl. 9:15 
As I understand it, rubat broke something again, now the engine commands don’t work, an error just appears in the console, for example “Not running engine cmd incrementvar net_graph 0 4 1”
guccibuckethat 20. aug. 2023 kl. 20:30 
where gordon stares at me
guccibuckethat 20. aug. 2023 kl. 20:30 
I want a half life custom menu
Pecel 23. juli 2023 kl. 0:10 
how do i allow autoplay music?
chel.chopokayfu 15. juli 2023 kl. 2:07 
Good guidance, thank you! I would like to know how to change the color of the selection from yellow (when you hover the mouse) to another color
professional whatever 10. nov. 2022 kl. 20:32 
where are the main parts for editing the menu. i have notepad++ open rn and i have no idea where the main stuff for the custom menu is
CRD716 | civilnetworks.net 9. maj 2022 kl. 14:30 
To anyone with those hearts, just ctrl f for "ng-" and then you'll see what steam is censoring (slur for transgenders)
cactusninja 8. maj 2022 kl. 2:09 
♥♥♥♥♥♥="'disconnect'"></a> it looks like that for me can anyone help?
blackskytf2 22. apr. 2022 kl. 8:09 
thanks, but how to add not only buttons but sliders or checkboxes?
Mr. Vita 6. juni 2021 kl. 10:41 
ok well that make sense when i was testing commands ingame