localcmd("\n");
localcmd("disconnect\nmaxplayers 16\n");
MapInfo_LoadMap(campaign_mapname[n], 1);
+ #ifdef MENUQC
+ makeServerSingleplayer();
+ #endif
}
{
entity e = me.quitGameButton;
e.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
- if(cvar("g_campaign"))
- e.setText(e, _("Quit campaign"));
- else
- e.setText(e, _("Quit current game"));
+ e.setText(e, quitGameButton_getText(e));
SUPER(XonoticServerCreateTab).draw(me);
}
{
entity e = me.disconnectButton;
e.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
- if(cvar("g_campaign"))
- e.setText(e, _("Quit campaign"));
- else
- e.setText(e, _("Quit current game"));
+ e.setText(e, quitGameButton_getText(e));
SUPER(XonoticQuitDialog).draw(me);
}
localcmd("disconnect\n");
localcmd("g_campaign 0\n");
+ makeServerSingleplayer();
+
MapInfo_LoadMap(s, 1);
// configure bots
{
entity e = me.quitGameButton;
e.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
- if(cvar("g_campaign"))
- e.setText(e, _("Quit campaign"));
- else
- e.setText(e, _("Quit current game"));
+ e.setText(e, quitGameButton_getText(e));
SUPER(XonoticSingleplayerDialog).draw(me);
}
e.configureXonoticTextSliderValues(e);
}
+void makeServerSingleplayer()
+{
+ localcmd("defer 0.1 \"sv_cmd settemp net_address 127.0.0.1\"\n");
+ localcmd("defer 0.1 \"sv_cmd settemp net_address_ipv6 ::1\"\n");
+}
+
+string quitGameButton_getText(entity btn)
+{
+ if (btn.disabled)
+ return _("Quit current game");
+ else if(cvar("g_campaign"))
+ return _("Quit campaign");
+ else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
+ return _("Quit singleplayer");
+ else
+ return _("Quit multiplayer");
+}
+
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha)
{
if(startAlpha < targetAlpha)
void dialog_hudpanel_main_checkbox(entity me, string panelname);
void dialog_hudpanel_main_settings(entity me, string panelname);
+void makeServerSingleplayer();
+string quitGameButton_getText(entity btn);
+
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha);
string _Nex_ExtResponseSystem_BannedServers;