void welcomeDialog_resetStrings(entity me)
{
- strcpy(me.serverinfo_name, "<NO HOSTNAME>");
- strcpy(me.serverinfo_MOTD, "<NO WELCOME MESSAGE>");
+ strcpy(me.serverinfo_name, _("Welcome"));
+ strcpy(me.serverinfo_MOTD, "");
}
float XonoticWelcomeDialog_keyDown(entity me, float key, float ascii, float shift)
}
}
+// the same implentation in mousePress apparently works, but for some reason if you try to open
+// the dialog again it doesn't show up and requires opening it a seconds time to show up
+bool XonoticWelcomeDialog_mouseRelease(entity me, vector pos)
+{
+ if (pos.x >= 0 && pos.y >= 0 && pos.x < 1 && pos.y < 1)
+ {
+ return SUPER(XonoticWelcomeDialog).mouseRelease(me, pos);
+ }
+ me.close(me);
+ return true;
+}
+
void XonoticWelcomeDialog_destroy(entity me)
{
cvar_set("_menu_welcome_dialog_available", "0");
strcpy(me.serverinfo_name, bufstr_get(argsbuf, ++i));
else if(s == "WELCOME")
strcpy(me.serverinfo_MOTD, bufstr_get(argsbuf, ++i));
+ else if(s == "RESET")
+ {
+ welcomeDialog_resetStrings(me);
+ break;
+ }
++i;
}
//me.serverinfo_name_ent.setText(me.serverinfo_name_ent, me.serverinfo_name);
me.frame.setText(me.frame, me.serverinfo_name);
}
+void XonoticWelcomeDialog_draw(entity me)
+{
+ SUPER(XonoticWelcomeDialog).draw(me);
+ if(me.serverinfo_MOTD == "" && gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
+ {
+ // if serverinfo_MOTD is empty while connected it means we are connected to an old server
+ // in this case show the csqc welcome message and instantly close the dialog
+ localcmd("\n+show_info0; defer 2 -show_info0\n");
+ me.close(me);
+ }
+}
+
void XonoticWelcomeDialog_fill(entity me)
{
registercvar("_menu_welcome_dialog_available", "0", 0);