-
Notifications
You must be signed in to change notification settings - Fork 33
Ingame Menus
JK2MV 1.2 and higher come with a custom ingame "Setup" menu providing better access to new features. If you wish to add your own options you can simply override ui/jk2mp/ingame_setup.menu
but it will erase all JK2MV settings (they will be still accessible in the main menu). Alternatively you can take following steps to seamlessly merge your mod options:
JK2MV ingame "Setup" menu comes with an empty "Mod Options" submenu. It is conveniently loaded from a separate file ui/jk2mp/ingame_setup_modoptions.menu
which you can extract from assetsmv.pk3 and use as a template for your mod settings. If you also happen to override ui/jk2mpingame.txt
script, remember to add loadMenu { "ui/jk2mp/ingame_setup_modoptions.menu" }
line there.
Some fields in JK2MV ingame menus require special UI module support. If it's not available they will be greyed out. You can announce that your module supports these fields by setting ui_menulevel
cvar. Following patch shows how to implement and enable fields in menu level 1: aufau/SaberMod@c1f6d32
With these modifications original JK2 client shows default ingame menus without your custom mod options. If you'd like to provide a fallback for non-JK2MV clients you can take following steps:
- Create a modified
ingame_setup.menu
based on the original JK2 menu file and name itui/jk2mp/ingame_setup_fallback.menu
. - Copy
ui/jk2mpingame.txt
from original JK2 assets and call itui/jk2mpingame_fallback.txt
. Replace following line:loadMenu { "ui/jk2mp/ingame_setup.menu" }
withloadMenu { "ui/jk2mp/ingame_setup_fallback.menu" }
. - In your custom UI module, in
ui_main.c
file find lines loadingui/jk2mpingame.txt
script. Add JK2MV version check and if client is not JK2MV 1.2 or higher loadui/jk2mpingame_fallback.txt
instead.
Here you can see another approach to solve the same problem: https://github.com/aufau/SaberMod/commit/41ce9195b4c9e0a301a57faed1b218dad2562cc0
JK2MV
Client
Server
Modding
Development