entity e = me.quitGameButton;
e.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
e.setText(e, quitGameButton_getText(e));
+ setZonedTooltip(e, quitGameButton_getTooltip(e), string_null);
SUPER(XonoticServerCreateTab).draw(me);
}
entity e = me.disconnectButton;
e.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
e.setText(e, quitGameButton_getText(e));
+ setZonedTooltip(e, quitGameButton_getTooltip(e), string_null);
SUPER(XonoticQuitDialog).draw(me);
}
entity e = me.quitGameButton;
e.disabled = !(gamestatus & (GAME_ISSERVER | GAME_CONNECTED));
e.setText(e, quitGameButton_getText(e));
+ setZonedTooltip(e, quitGameButton_getTooltip(e), string_null);
SUPER(XonoticSingleplayerDialog).draw(me);
}
return _("Quit multiplayer");
}
+string quitGameButton_getTooltip(entity btn)
+{
+ if (btn.disabled)
+ return "-";
+ else if(cvar("g_campaign"))
+ return "-";
+ else if (cvar_string("net_address") == "127.0.0.1" && cvar_string("net_address_ipv6") == "::1")
+ return "-";
+ else
+ return _("Quit multiplayer / Disconnect from the server");
+}
+
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha)
{
if(startAlpha < targetAlpha)
void makeServerSingleplayer();
string quitGameButton_getText(entity btn);
+string quitGameButton_getTooltip(entity btn);
float getFadedAlpha(float currentAlpha, float startAlpha, float targetAlpha);