I am trying to figure out how to set a UI menu button for quick joining a server from main menu. I made the quick join button but the function does not work. It always sets the connect IP to the localhost 192.168.0.0 I don’t have any source code so I can just work with the UI menu files. I’m not able to change the UI.scripts itself…
It looks like this
itemDef {
name playselection
text “QuickGame”
type 1
style 0
textstyle 0
rect 80 210 140 30
textalign 1
textalignx 70
textaligny 22
textscale .333
forecolor 0.55 0.73 0.53 .8
visible 0
action { play “sound/misc/menu2.wav” ;
close main ;
exec “set connect 51.15.26.38:27950”}
I found out that when I first enter the multiplayer (serverlist menu) and then go back to main menu the quick join button is working fine. I figured that I can take the information on the serverlist / joinserver.menu - uiScript UpdateFilter and then run the uiScript JoinServer.
itemDef {
name playselection
text “QuickGame”
type 1
style 0
textstyle 0
rect 80 210 140 30
textalign 1 // center
textalignx 70
textaligny 22
textscale .333
forecolor 0.55 0.73 0.53 .8
visible 0
action { play “sound/misc/menu2.wav” ;
uiScript UpdateFilter ; <--------------
close main ;
open { uiScript JoinServer }
}