Can't autoupdate on OSX and Android.

This commit is contained in:
Learath Lea 2015-02-27 23:08:34 +02:00
parent 8ee294a412
commit 488db9b4fb
2 changed files with 23 additions and 2 deletions

View file

@ -2485,7 +2485,9 @@ void CClient::RegisterInterfaces()
Kernel()->RegisterInterface(static_cast<IDemoPlayer*>(&m_DemoPlayer));
Kernel()->RegisterInterface(static_cast<IServerBrowser*>(&m_ServerBrowser));
Kernel()->RegisterInterface(static_cast<IFetcher*>(&m_Fetcher));
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
Kernel()->RegisterInterface(static_cast<IAutoUpdate*>(&m_AutoUpdate));
#endif
Kernel()->RegisterInterface(static_cast<IFriends*>(&m_Friends));
}
@ -2501,7 +2503,9 @@ void CClient::InitInterfaces()
m_pMap = Kernel()->RequestInterface<IEngineMap>();
m_pMasterServer = Kernel()->RequestInterface<IEngineMasterServer>();
m_pFetcher = Kernel()->RequestInterface<IFetcher>();
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
m_pAutoUpdate = Kernel()->RequestInterface<IAutoUpdate>();
#endif
m_pStorage = Kernel()->RequestInterface<IStorage>();
m_DemoEditor.Init(m_pGameClient->NetVersion(), &m_SnapshotDelta, m_pConsole, m_pStorage);
@ -2509,7 +2513,10 @@ void CClient::InitInterfaces()
m_ServerBrowser.SetBaseInfo(&m_NetClient[2], m_pGameClient->NetVersion());
m_Fetcher.Init();
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
m_AutoUpdate.Init();
#endif
m_Friends.Init();
@ -2645,8 +2652,9 @@ void CClient::Run()
// update input
if(Input()->Update())
break; // SDL_QUIT
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
AutoUpdate()->Update();
#endif
// update sound
Sound()->Update();

View file

@ -1271,6 +1271,7 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
StatusBox.HSplitTop(5.0f, 0, &StatusBox);
// version note
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
StatusBox.HSplitBottom(15.0f, &StatusBox, &Button);
char aBuf[64];
int State = AutoUpdate()->GetCurrentState();
@ -1319,7 +1320,19 @@ void CMenus::RenderServerbrowser(CUIRect MainView)
ProgressBar.w = (float)AutoUpdate()->GetCurrentPercent();
RenderTools()->DrawUIRect(&ProgressBar, vec4(1.0f, 1.0f, 1.0f, 0.5f), CUI::CORNER_ALL, 5.0f);
}
#else
StatusBox.HSplitBottom(15.0f, &StatusBox, &Button);
char aBuf[64];
if(str_comp(Client()->LatestVersion(), "0") != 0)
{
str_format(aBuf, sizeof(aBuf), Localize("DDNet %s is out! Download it at ddnet.tw!"), Client()->LatestVersion());
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
}
else
str_format(aBuf, sizeof(aBuf), Localize("Current Version: %s"), GAME_VERSION);
UI()->DoLabelScaled(&Button, aBuf, 14.0f, -1);
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
#endif
// button area
//StatusBox.VSplitRight(80.0f, &StatusBox, 0);
StatusBox.VSplitRight(170.0f, &StatusBox, &ButtonArea);