mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-19 01:02:20 +00:00
Compare commits
9 commits
36542327b0
...
28c7b01b96
Author | SHA1 | Date | |
---|---|---|---|
28c7b01b96 | |||
3d30ce4bf2 | |||
c89509bc4b | |||
306d3c7b58 | |||
9832288983 | |||
fc058fa432 | |||
3b22a3e02f | |||
ed1ef4e694 | |||
9103332e36 |
|
@ -1,15 +1,40 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:installLocation="auto">
|
||||||
|
|
||||||
<!-- Vulkan 1.1.0 is used if supported -->
|
<!-- Vulkan 1.1.0 is used if supported -->
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.vulkan.version"
|
android:name="android.hardware.vulkan.version"
|
||||||
android:required="false"
|
android:required="false"
|
||||||
android:version="0x00401000" />
|
android:version="0x00401000" />
|
||||||
<!-- android:glEsVersion is not specified as OpenGL ES 1.0 is supported as fallback -->
|
<!-- android:glEsVersion is not specified as OpenGL ES 1.0 is supported as fallback -->
|
||||||
|
|
||||||
|
<!-- Only playable in landscape mode -->
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.screen.landscape"
|
android:name="android.hardware.screen.landscape"
|
||||||
android:required="true" />
|
android:required="true" />
|
||||||
|
|
||||||
|
<!-- Touchscreen support -->
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.touchscreen"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
|
<!-- Game controller support -->
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.bluetooth"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.gamepad"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.usb.host"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
|
<!-- External mouse input events -->
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.type.pc"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
<!-- Teeworlds does broadcasts over local networks -->
|
<!-- Teeworlds does broadcasts over local networks -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
|
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
|
||||||
|
@ -25,17 +50,24 @@
|
||||||
android:isGame="true"
|
android:isGame="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||||
|
android:hardwareAccelerated="true">
|
||||||
<activity
|
<activity
|
||||||
android:name="org.ddnet.client.NativeMain"
|
android:name="org.ddnet.client.NativeMain"
|
||||||
|
android:alwaysRetainTaskState="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
|
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
|
||||||
|
android:preferMinimalPostProcessing="true"
|
||||||
android:screenOrientation="landscape"
|
android:screenOrientation="landscape"
|
||||||
android:launchMode="singleInstance">
|
android:launchMode="singleInstance">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<!-- Let Android know that we can handle some USB devices and should receive this event -->
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
|
||||||
|
</intent-filter>
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.app.lib_name"
|
android:name="android.app.lib_name"
|
||||||
android:value="DDNet" />
|
android:value="DDNet" />
|
||||||
|
|
|
@ -163,7 +163,7 @@ public:
|
||||||
|
|
||||||
// dummy
|
// dummy
|
||||||
virtual void DummyDisconnect(const char *pReason) = 0;
|
virtual void DummyDisconnect(const char *pReason) = 0;
|
||||||
virtual void DummyConnect() = 0;
|
virtual void DummyConnect(bool Force = false) = 0;
|
||||||
virtual bool DummyConnected() const = 0;
|
virtual bool DummyConnected() const = 0;
|
||||||
virtual bool DummyConnecting() const = 0;
|
virtual bool DummyConnecting() const = 0;
|
||||||
virtual bool DummyConnectingDelayed() const = 0;
|
virtual bool DummyConnectingDelayed() const = 0;
|
||||||
|
|
|
@ -668,10 +668,7 @@ void CClient::DisconnectWithReason(const char *pReason)
|
||||||
m_CurrentServerCurrentPingTime = -1;
|
m_CurrentServerCurrentPingTime = -1;
|
||||||
m_CurrentServerNextPingTime = -1;
|
m_CurrentServerNextPingTime = -1;
|
||||||
|
|
||||||
ResetMapDownload();
|
ResetMapDownload(true);
|
||||||
m_aMapdownloadFilename[0] = '\0';
|
|
||||||
m_aMapdownloadFilenameTemp[0] = '\0';
|
|
||||||
m_aMapdownloadName[0] = '\0';
|
|
||||||
|
|
||||||
// clear the current server info
|
// clear the current server info
|
||||||
mem_zero(&m_CurrentServerInfo, sizeof(m_CurrentServerInfo));
|
mem_zero(&m_CurrentServerInfo, sizeof(m_CurrentServerInfo));
|
||||||
|
@ -710,7 +707,7 @@ bool CClient::DummyConnectingDelayed() const
|
||||||
return !DummyConnected() && !DummyConnecting() && m_LastDummyConnectTime > 0.0f && m_LastDummyConnectTime + 5.0f > GlobalTime();
|
return !DummyConnected() && !DummyConnecting() && m_LastDummyConnectTime > 0.0f && m_LastDummyConnectTime + 5.0f > GlobalTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::DummyConnect()
|
void CClient::DummyConnect(bool Force)
|
||||||
{
|
{
|
||||||
if(m_aNetClient[CONN_MAIN].State() != NETSTATE_ONLINE)
|
if(m_aNetClient[CONN_MAIN].State() != NETSTATE_ONLINE)
|
||||||
{
|
{
|
||||||
|
@ -728,7 +725,7 @@ void CClient::DummyConnect()
|
||||||
log_info("client", "Dummy is already connected/connecting.");
|
log_info("client", "Dummy is already connected/connecting.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(DummyConnectingDelayed())
|
if(!Force && DummyConnectingDelayed())
|
||||||
{
|
{
|
||||||
log_info("client", "Wait before connecting dummy again.");
|
log_info("client", "Wait before connecting dummy again.");
|
||||||
return;
|
return;
|
||||||
|
@ -1528,7 +1525,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
||||||
DummyDisconnect(0);
|
DummyDisconnect(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetMapDownload();
|
ResetMapDownload(true);
|
||||||
|
|
||||||
SHA256_DIGEST *pMapSha256 = nullptr;
|
SHA256_DIGEST *pMapSha256 = nullptr;
|
||||||
const char *pMapUrl = nullptr;
|
const char *pMapUrl = nullptr;
|
||||||
|
@ -1652,9 +1649,24 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(Conn == CONN_MAIN && (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_MAP_RELOAD)
|
||||||
|
{
|
||||||
|
if(m_DummyConnected)
|
||||||
|
{
|
||||||
|
m_DummyReconnectOnLoad = true;
|
||||||
|
m_DummySwapOnReconnect = g_Config.m_ClDummy == 1 ? false : true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_DummySwapOnReconnect = false;
|
||||||
|
}
|
||||||
else if(Conn == CONN_MAIN && (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_CON_READY)
|
else if(Conn == CONN_MAIN && (pPacket->m_Flags & NET_CHUNKFLAG_VITAL) != 0 && Msg == NETMSG_CON_READY)
|
||||||
{
|
{
|
||||||
GameClient()->OnConnected();
|
GameClient()->OnConnected();
|
||||||
|
if(m_DummyReconnectOnLoad)
|
||||||
|
{
|
||||||
|
m_DummyReconnectOnLoad = false;
|
||||||
|
DummyConnect(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(Conn == CONN_DUMMY && Msg == NETMSG_CON_READY)
|
else if(Conn == CONN_DUMMY && Msg == NETMSG_CON_READY)
|
||||||
{
|
{
|
||||||
|
@ -2196,7 +2208,7 @@ int CClient::UnpackAndValidateSnapshot(CSnapshot *pFrom, CSnapshot *pTo)
|
||||||
return Builder.Finish(pTo);
|
return Builder.Finish(pTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::ResetMapDownload()
|
void CClient::ResetMapDownload(bool ResetActive)
|
||||||
{
|
{
|
||||||
if(m_pMapdownloadTask)
|
if(m_pMapdownloadTask)
|
||||||
{
|
{
|
||||||
|
@ -2215,19 +2227,24 @@ void CClient::ResetMapDownload()
|
||||||
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
|
Storage()->RemoveFile(m_aMapdownloadFilenameTemp, IStorage::TYPE_SAVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_MapdownloadChunk = 0;
|
if(ResetActive)
|
||||||
m_MapdownloadSha256Present = false;
|
{
|
||||||
m_MapdownloadSha256 = SHA256_ZEROED;
|
m_MapdownloadChunk = 0;
|
||||||
m_MapdownloadCrc = 0;
|
m_MapdownloadSha256Present = false;
|
||||||
m_MapdownloadTotalsize = -1;
|
m_MapdownloadSha256 = SHA256_ZEROED;
|
||||||
m_MapdownloadAmount = 0;
|
m_MapdownloadCrc = 0;
|
||||||
|
m_MapdownloadTotalsize = -1;
|
||||||
|
m_MapdownloadAmount = 0;
|
||||||
|
m_aMapdownloadFilename[0] = '\0';
|
||||||
|
m_aMapdownloadFilenameTemp[0] = '\0';
|
||||||
|
m_aMapdownloadName[0] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CClient::FinishMapDownload()
|
void CClient::FinishMapDownload()
|
||||||
{
|
{
|
||||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", "download complete, loading map");
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", "download complete, loading map");
|
||||||
|
|
||||||
const int PrevMapdownloadTotalsize = m_MapdownloadTotalsize;
|
|
||||||
SHA256_DIGEST *pSha256 = m_MapdownloadSha256Present ? &m_MapdownloadSha256 : nullptr;
|
SHA256_DIGEST *pSha256 = m_MapdownloadSha256Present ? &m_MapdownloadSha256 : nullptr;
|
||||||
|
|
||||||
bool FileSuccess = true;
|
bool FileSuccess = true;
|
||||||
|
@ -2236,7 +2253,6 @@ void CClient::FinishMapDownload()
|
||||||
FileSuccess &= Storage()->RenameFile(m_aMapdownloadFilenameTemp, m_aMapdownloadFilename, IStorage::TYPE_SAVE);
|
FileSuccess &= Storage()->RenameFile(m_aMapdownloadFilenameTemp, m_aMapdownloadFilename, IStorage::TYPE_SAVE);
|
||||||
if(!FileSuccess)
|
if(!FileSuccess)
|
||||||
{
|
{
|
||||||
ResetMapDownload();
|
|
||||||
char aError[128 + IO_MAX_PATH_LENGTH];
|
char aError[128 + IO_MAX_PATH_LENGTH];
|
||||||
str_format(aError, sizeof(aError), Localize("Could not save downloaded map. Try manually deleting this file: %s"), m_aMapdownloadFilename);
|
str_format(aError, sizeof(aError), Localize("Could not save downloaded map. Try manually deleting this file: %s"), m_aMapdownloadFilename);
|
||||||
DisconnectWithReason(aError);
|
DisconnectWithReason(aError);
|
||||||
|
@ -2246,19 +2262,17 @@ void CClient::FinishMapDownload()
|
||||||
const char *pError = LoadMap(m_aMapdownloadName, m_aMapdownloadFilename, pSha256, m_MapdownloadCrc);
|
const char *pError = LoadMap(m_aMapdownloadName, m_aMapdownloadFilename, pSha256, m_MapdownloadCrc);
|
||||||
if(!pError)
|
if(!pError)
|
||||||
{
|
{
|
||||||
ResetMapDownload();
|
ResetMapDownload(true);
|
||||||
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", "loading done");
|
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "client/network", "loading done");
|
||||||
SendReady(CONN_MAIN);
|
SendReady(CONN_MAIN);
|
||||||
}
|
}
|
||||||
else if(m_pMapdownloadTask) // fallback
|
else if(m_pMapdownloadTask) // fallback
|
||||||
{
|
{
|
||||||
ResetMapDownload();
|
ResetMapDownload(false);
|
||||||
m_MapdownloadTotalsize = PrevMapdownloadTotalsize;
|
|
||||||
SendMapRequest();
|
SendMapRequest();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ResetMapDownload();
|
|
||||||
DisconnectWithReason(pError);
|
DisconnectWithReason(pError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2747,6 +2761,16 @@ void CClient::Update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(m_DummySwapOnReconnect && g_Config.m_ClDummy == 1)
|
||||||
|
{
|
||||||
|
m_DummySwapOnReconnect = false;
|
||||||
|
g_Config.m_ClDummy = 0;
|
||||||
|
}
|
||||||
|
else if(!m_DummyConnected && m_DummySwapOnReconnect)
|
||||||
|
{
|
||||||
|
m_DummySwapOnReconnect = false;
|
||||||
|
}
|
||||||
|
|
||||||
m_LastDummy = (bool)g_Config.m_ClDummy;
|
m_LastDummy = (bool)g_Config.m_ClDummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2784,7 +2808,7 @@ void CClient::Update()
|
||||||
else if(m_pMapdownloadTask->State() == EHttpState::ERROR || m_pMapdownloadTask->State() == EHttpState::ABORTED)
|
else if(m_pMapdownloadTask->State() == EHttpState::ERROR || m_pMapdownloadTask->State() == EHttpState::ABORTED)
|
||||||
{
|
{
|
||||||
dbg_msg("webdl", "http failed, falling back to gameserver");
|
dbg_msg("webdl", "http failed, falling back to gameserver");
|
||||||
ResetMapDownload();
|
ResetMapDownload(false);
|
||||||
SendMapRequest();
|
SendMapRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,6 +182,8 @@ class CClient : public IClient, public CDemoPlayer::IListener
|
||||||
bool m_DummyConnecting = false;
|
bool m_DummyConnecting = false;
|
||||||
bool m_DummyConnected = false;
|
bool m_DummyConnected = false;
|
||||||
float m_LastDummyConnectTime = 0.0f;
|
float m_LastDummyConnectTime = 0.0f;
|
||||||
|
bool m_DummyReconnectOnLoad = false;
|
||||||
|
bool m_DummySwapOnReconnect = false;
|
||||||
|
|
||||||
// graphs
|
// graphs
|
||||||
CGraph m_InputtimeMarginGraph;
|
CGraph m_InputtimeMarginGraph;
|
||||||
|
@ -319,7 +321,7 @@ public:
|
||||||
void Disconnect() override;
|
void Disconnect() override;
|
||||||
|
|
||||||
void DummyDisconnect(const char *pReason) override;
|
void DummyDisconnect(const char *pReason) override;
|
||||||
void DummyConnect() override;
|
void DummyConnect(bool Force = false) override;
|
||||||
bool DummyConnected() const override;
|
bool DummyConnected() const override;
|
||||||
bool DummyConnecting() const override;
|
bool DummyConnecting() const override;
|
||||||
bool DummyConnectingDelayed() const override;
|
bool DummyConnectingDelayed() const override;
|
||||||
|
@ -360,7 +362,7 @@ public:
|
||||||
|
|
||||||
int UnpackAndValidateSnapshot(CSnapshot *pFrom, CSnapshot *pTo);
|
int UnpackAndValidateSnapshot(CSnapshot *pFrom, CSnapshot *pTo);
|
||||||
|
|
||||||
void ResetMapDownload();
|
void ResetMapDownload(bool ResetActive);
|
||||||
void FinishMapDownload();
|
void FinishMapDownload();
|
||||||
|
|
||||||
void RequestDDNetInfo() override;
|
void RequestDDNetInfo() override;
|
||||||
|
|
|
@ -3510,6 +3510,8 @@ void CServer::ConStopRecord(IConsole::IResult *pResult, void *pUser)
|
||||||
void CServer::ConMapReload(IConsole::IResult *pResult, void *pUser)
|
void CServer::ConMapReload(IConsole::IResult *pResult, void *pUser)
|
||||||
{
|
{
|
||||||
((CServer *)pUser)->m_MapReload = true;
|
((CServer *)pUser)->m_MapReload = true;
|
||||||
|
CMsgPacker Msg(NETMSG_MAP_RELOAD, true);
|
||||||
|
((CServer *)pUser)->SendMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_FLUSH, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CServer::ConLogout(IConsole::IResult *pResult, void *pUser)
|
void CServer::ConLogout(IConsole::IResult *pResult, void *pUser)
|
||||||
|
|
|
@ -35,3 +35,4 @@ UUID(NETMSG_CHECKSUM_ERROR, "checksum-error@ddnet.tw")
|
||||||
UUID(NETMSG_REDIRECT, "redirect@ddnet.org")
|
UUID(NETMSG_REDIRECT, "redirect@ddnet.org")
|
||||||
UUID(NETMSG_RCON_CMD_GROUP_START, "rcon-cmd-group-start@ddnet.org")
|
UUID(NETMSG_RCON_CMD_GROUP_START, "rcon-cmd-group-start@ddnet.org")
|
||||||
UUID(NETMSG_RCON_CMD_GROUP_END, "rcon-cmd-group-end@ddnet.org")
|
UUID(NETMSG_RCON_CMD_GROUP_END, "rcon-cmd-group-end@ddnet.org")
|
||||||
|
UUID(NETMSG_MAP_RELOAD, "map-reload@ddnet.org")
|
||||||
|
|
|
@ -93,6 +93,7 @@ MAYBE_UNUSED static const char *FONT_ICON_EARTH_AMERICAS = "\xEF\x95\xBD";
|
||||||
MAYBE_UNUSED static const char *FONT_ICON_NETWORK_WIRED = "\xEF\x9B\xBF";
|
MAYBE_UNUSED static const char *FONT_ICON_NETWORK_WIRED = "\xEF\x9B\xBF";
|
||||||
MAYBE_UNUSED static const char *FONT_ICON_LIST_UL = "\xEF\x83\x8A";
|
MAYBE_UNUSED static const char *FONT_ICON_LIST_UL = "\xEF\x83\x8A";
|
||||||
MAYBE_UNUSED static const char *FONT_ICON_INFO = "\xEF\x84\xA9";
|
MAYBE_UNUSED static const char *FONT_ICON_INFO = "\xEF\x84\xA9";
|
||||||
|
MAYBE_UNUSED static const char *FONT_ICON_TERMINAL = "\xEF\x84\xA0";
|
||||||
|
|
||||||
MAYBE_UNUSED static const char *FONT_ICON_SLASH = "\xEF\x9C\x95";
|
MAYBE_UNUSED static const char *FONT_ICON_SLASH = "\xEF\x9C\x95";
|
||||||
MAYBE_UNUSED static const char *FONT_ICON_PLAY = "\xEF\x81\x8B";
|
MAYBE_UNUSED static const char *FONT_ICON_PLAY = "\xEF\x81\x8B";
|
||||||
|
|
|
@ -160,8 +160,6 @@ class CGameConsole : public CComponent
|
||||||
static const ColorRGBA ms_SearchHighlightColor;
|
static const ColorRGBA ms_SearchHighlightColor;
|
||||||
static const ColorRGBA ms_SearchSelectedColor;
|
static const ColorRGBA ms_SearchSelectedColor;
|
||||||
|
|
||||||
void Toggle(int Type);
|
|
||||||
|
|
||||||
static void PossibleCommandsRenderCallback(int Index, const char *pStr, void *pUser);
|
static void PossibleCommandsRenderCallback(int Index, const char *pStr, void *pUser);
|
||||||
static void ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData);
|
||||||
static void ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData);
|
static void ConToggleRemoteConsole(IConsole::IResult *pResult, void *pUserData);
|
||||||
|
@ -196,6 +194,7 @@ public:
|
||||||
virtual bool OnInput(const IInput::CEvent &Event) override;
|
virtual bool OnInput(const IInput::CEvent &Event) override;
|
||||||
void Prompt(char (&aPrompt)[32]);
|
void Prompt(char (&aPrompt)[32]);
|
||||||
|
|
||||||
|
void Toggle(int Type);
|
||||||
bool IsClosed() { return m_ConsoleState == CONSOLE_CLOSED; }
|
bool IsClosed() { return m_ConsoleState == CONSOLE_CLOSED; }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
|
|
||||||
|
using namespace FontIcons;
|
||||||
|
|
||||||
void CMenus::RenderStartMenu(CUIRect MainView)
|
void CMenus::RenderStartMenu(CUIRect MainView)
|
||||||
{
|
{
|
||||||
GameClient()->m_MenuBackground.ChangePosition(CMenuBackground::POS_START);
|
GameClient()->m_MenuBackground.ChangePosition(CMenuBackground::POS_START);
|
||||||
|
@ -186,13 +188,27 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
||||||
}
|
}
|
||||||
|
|
||||||
// render version
|
// render version
|
||||||
CUIRect VersionUpdate, CurVersion;
|
CUIRect CurVersion, ConsoleButton;
|
||||||
MainView.HSplitBottom(20.0f, nullptr, &VersionUpdate);
|
MainView.HSplitBottom(45.0f, nullptr, &CurVersion);
|
||||||
VersionUpdate.VSplitRight(50.0f, &CurVersion, nullptr);
|
CurVersion.VSplitRight(40.0f, &CurVersion, nullptr);
|
||||||
VersionUpdate.VMargin(VMargin, &VersionUpdate);
|
CurVersion.HSplitTop(20.0f, &ConsoleButton, &CurVersion);
|
||||||
|
CurVersion.HSplitTop(5.0f, nullptr, &CurVersion);
|
||||||
|
ConsoleButton.VSplitRight(40.0f, nullptr, &ConsoleButton);
|
||||||
Ui()->DoLabel(&CurVersion, GAME_RELEASE_VERSION, 14.0f, TEXTALIGN_MR);
|
Ui()->DoLabel(&CurVersion, GAME_RELEASE_VERSION, 14.0f, TEXTALIGN_MR);
|
||||||
|
|
||||||
|
static CButtonContainer s_ConsoleButton;
|
||||||
|
TextRender()->SetFontPreset(EFontPreset::ICON_FONT);
|
||||||
|
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
|
||||||
|
if(DoButton_Menu(&s_ConsoleButton, FONT_ICON_TERMINAL, 0, &ConsoleButton, nullptr, IGraphics::CORNER_ALL, 5.0f, 0.0f, ColorRGBA(0.0f, 0.0f, 0.0f, 0.1f)))
|
||||||
|
{
|
||||||
|
GameClient()->m_GameConsole.Toggle(CGameConsole::CONSOLETYPE_LOCAL);
|
||||||
|
}
|
||||||
|
TextRender()->SetRenderFlags(0);
|
||||||
|
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
|
||||||
|
|
||||||
|
CUIRect VersionUpdate;
|
||||||
|
MainView.HSplitBottom(20.0f, nullptr, &VersionUpdate);
|
||||||
|
VersionUpdate.VMargin(VMargin, &VersionUpdate);
|
||||||
#if defined(CONF_AUTOUPDATE)
|
#if defined(CONF_AUTOUPDATE)
|
||||||
CUIRect UpdateButton;
|
CUIRect UpdateButton;
|
||||||
VersionUpdate.VSplitRight(100.0f, &VersionUpdate, &UpdateButton);
|
VersionUpdate.VSplitRight(100.0f, &VersionUpdate, &UpdateButton);
|
||||||
|
|
|
@ -3216,15 +3216,19 @@ void CGameContext::ConHotReload(IConsole::IResult *pResult, void *pUserData)
|
||||||
if(!pSelf->GetPlayerChar(i))
|
if(!pSelf->GetPlayerChar(i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
CCharacter *pChar = pSelf->GetPlayerChar(i);
|
||||||
|
|
||||||
// Save the tee individually
|
// Save the tee individually
|
||||||
pSelf->m_apSavedTees[i] = new CSaveTee();
|
pSelf->m_apSavedTees[i] = new CSaveTee();
|
||||||
pSelf->m_apSavedTees[i]->Save(pSelf->GetPlayerChar(i), false);
|
pSelf->m_apSavedTees[i]->Save(pChar, false);
|
||||||
|
|
||||||
if(pSelf->m_apPlayers[i])
|
if(pSelf->m_apPlayers[i])
|
||||||
pSelf->m_apSavedTeleTees[i] = new CSaveTee(pSelf->m_apPlayers[i]->m_LastTeleTee);
|
pSelf->m_apSavedTeleTees[i] = new CSaveTee(pSelf->m_apPlayers[i]->m_LastTeleTee);
|
||||||
|
|
||||||
// Save the team state
|
// Save the team state
|
||||||
pSelf->m_aTeamMapping[i] = pSelf->GetDDRaceTeam(i);
|
pSelf->m_aTeamMapping[i] = pSelf->GetDDRaceTeam(i);
|
||||||
|
if(pSelf->m_aTeamMapping[i] == TEAM_SUPER)
|
||||||
|
pSelf->m_aTeamMapping[i] = pChar->m_TeamBeforeSuper;
|
||||||
|
|
||||||
if(pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]])
|
if(pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]])
|
||||||
continue;
|
continue;
|
||||||
|
@ -3233,6 +3237,8 @@ void CGameContext::ConHotReload(IConsole::IResult *pResult, void *pUserData)
|
||||||
pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]]->Save(pSelf, pSelf->m_aTeamMapping[i], true, true);
|
pSelf->m_apSavedTeams[pSelf->m_aTeamMapping[i]]->Save(pSelf, pSelf->m_aTeamMapping[i], true, true);
|
||||||
}
|
}
|
||||||
pSelf->Server()->ReloadMap();
|
pSelf->Server()->ReloadMap();
|
||||||
|
CMsgPacker Msg(NETMSG_MAP_RELOAD, true);
|
||||||
|
pSelf->Server()->SendMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_FLUSH, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData)
|
void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
Loading…
Reference in a new issue