Hi
I thought it would be nice if modders would put in a mod changing menu, just like the one ETPro has. So here it is. This solution is just client side.
It turned out to be pretty simple. The source code already has everything you need, so no need to recompile it :-). You just need one new file and edit some others.
Create a new file etmain/ui/mods.menu, and copy-paste this content
#include "ui/menudef.h"
// CHRUKER: Revived mods menu
// Defines //
#define WINDOW_X 16
#define WINDOW_Y 16
//#define WINDOW_WIDTH 400
#define WINDOW_WIDTH 252
#define WINDOW_HEIGHT 152
#define GROUP_NAME "grpMods"
// Macros //
#include "ui/menumacros.h"
// Mods Menu //
menuDef {
name "mods"
visible 0
fullscreen 0
rect WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
style WINDOW_STYLE_FILLED
onOpen {
uiScript LoadMods
}
onESC {
close mods ;
open main
}
// Window //
WINDOW( "MODS", 150 )
// Mods List //
itemDef {
name "modsList"
group GROUP_NAME
rect 6 32 240 90
type ITEM_TYPE_LISTBOX
textfont UI_FONT_COURBD_21
textscale .2
textaligny -3
forecolor .6 .6 .6 1
outlinecolor .5 .5 .5 .4
border WINDOW_BORDER_FULL
bordercolor .1 .1 .1 .5
feeder FEEDER_MODS
elementtype LISTBOX_TEXT
elementwidth 200
elementheight 12
columns 1 0 200 33
visible 1
tooltip "Select the game mod to play with"
doubleClick {
uiScript RunMod
}
}
// Buttons //
BUTTON( 6, WINDOW_HEIGHT-24, .33*(WINDOW_WIDTH-24), 18, "BACK", .3, 14, close mods ; open main )
BUTTON( 6+.33*(WINDOW_WIDTH-24)+6+.34*(WINDOW_WIDTH-24)+6, WINDOW_HEIGHT-24, .33*(WINDOW_WIDTH-24), 18, "CHANGE", .3, 14, uiScript RunMod )
}
Now edit etmain/ui/main.menu
At the top, make sure to add 24 to the window height. It will look like this if you haven't modified your menus yet:
#define WINDOW_HEIGHT 224
At the bottom of the file it looks like this, if you haven't modified your menus yet:
BUTTON( 6, 104, WINDOW_WIDTH-12, 18, "OPTIONS", .3, 14, close main ; open options )
BUTTON( 6, 128, WINDOW_WIDTH-12, 18, "PROFILE", .3, 14, close main ; open profile )
BUTTON( 6, 152, WINDOW_WIDTH-12, 18, "CREDITS", .3, 14, close main ; open credits_splashdamage )
BUTTON( 6, 176, WINDOW_WIDTH-12, 18, "EXIT GAME", .3, 14, clearFocus ; open quit )
Add the one line with the mods command, and make sure to update the y-coords:
BUTTON( 6, 104, WINDOW_WIDTH-12, 18, "OPTIONS", .3, 14, close main ; open options )
BUTTON( 6, 128, WINDOW_WIDTH-12, 18, "PROFILE", .3, 14, close main ; open profile )
BUTTON( 6, 152, WINDOW_WIDTH-12, 18, "MODS", .3, 14, close main ; open mods ) // CHRUKER: Revived mods menu
BUTTON( 6, 176, WINDOW_WIDTH-12, 18, "CREDITS", .3, 14, close main ; open credits_splashdamage )
BUTTON( 6, 200, WINDOW_WIDTH-12, 18, "EXIT GAME", .3, 14, clearFocus ; open quit )
Finally edit etmain/ui/menus.txt
Add this single line:
Line 30: loadMenu { "ui/options_system_gamma.menu" }
loadMenu { "ui/mods.menu" } // CHRUKER: Revived mods menu
loadMenu { "ui/credits_splashdamage.menu" }
That should be it. You now have a mods menu in the UI.