mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Center update info text, add -DINFORM_UPDATE flag
to be used for Steam release, since autoupdates are enforced anyway and players don't need to be reminded to update
This commit is contained in:
parent
eb725f800e
commit
ebb4e3debe
|
@ -89,6 +89,7 @@ endif()
|
|||
option(WEBSOCKETS "Enable websockets support" OFF)
|
||||
option(MYSQL "Enable mysql support" OFF)
|
||||
option(AUTOUPDATE "Enable the autoupdater" OFF)
|
||||
option(INFORM_UPDATE "Inform about available updates" ON)
|
||||
option(VIDEORECORDER "Enable video recording support via FFmpeg" OFF)
|
||||
option(UPNP "Enable UPnP support" OFF)
|
||||
option(ANTIBOT "Enable support for a dynamic anticheat library" OFF)
|
||||
|
@ -2615,6 +2616,9 @@ foreach(target ${TARGETS_OWN})
|
|||
if(AUTOUPDATE)
|
||||
target_compile_definitions(${target} PRIVATE CONF_AUTOUPDATE)
|
||||
endif()
|
||||
if(INFORM_UPDATE)
|
||||
target_compile_definitions(${target} PRIVATE CONF_INFORM_UPDATE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(target ${TARGETS_DEP})
|
||||
|
|
|
@ -160,14 +160,15 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
}
|
||||
|
||||
// render version
|
||||
CUIRect Version;
|
||||
MainView.HSplitBottom(30.0f, 0, &Version);
|
||||
MainView.HSplitBottom(20.0f, 0, &Version);
|
||||
Version.VSplitLeft(VMargin, 0, &Version);
|
||||
Version.VSplitRight(50.0f, &Version, 0);
|
||||
char aBuf[64];
|
||||
CUIRect VersionUpdate, CurVersion;
|
||||
MainView.HSplitBottom(30.0f, 0, 0);
|
||||
MainView.HSplitBottom(20.0f, 0, &VersionUpdate);
|
||||
|
||||
VersionUpdate.VSplitRight(50.0f, &CurVersion, 0);
|
||||
VersionUpdate.VMargin(VMargin, &VersionUpdate);
|
||||
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
char aBuf[64];
|
||||
CUIRect Part;
|
||||
int State = Updater()->GetCurrentState();
|
||||
bool NeedUpdate = str_comp(Client()->LatestVersion(), "0");
|
||||
|
@ -196,10 +197,10 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
str_format(aBuf, sizeof(aBuf), Localize("DDNet Client updated!"));
|
||||
TextRender()->TextColor(1.0f, 0.4f, 0.4f, 1.0f);
|
||||
}
|
||||
UI()->DoLabel(&Version, aBuf, 14.0f, -1);
|
||||
UI()->DoLabel(&VersionUpdate, aBuf, 14.0f, -1);
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
Version.VSplitLeft(TextRender()->TextWidth(0, 14.0f, aBuf, -1, -1.0f) + 10.0f, 0, &Part);
|
||||
VersionUpdate.VSplitLeft(TextRender()->TextWidth(0, 14.0f, aBuf, -1, -1.0f) + 10.0f, 0, &Part);
|
||||
|
||||
if(State == IUpdater::CLEAN && NeedUpdate)
|
||||
{
|
||||
|
@ -233,17 +234,18 @@ void CMenus::RenderStartMenu(CUIRect MainView)
|
|||
ProgressBar.w = clamp((float)Updater()->GetCurrentPercent(), 10.0f, 100.0f);
|
||||
RenderTools()->DrawUIRect(&ProgressBar, vec4(1.0f, 1.0f, 1.0f, 0.5f), CUI::CORNER_ALL, 5.0f);
|
||||
}
|
||||
#else
|
||||
#elif defined(CONF_INFORM_UPDATE)
|
||||
if(str_comp(Client()->LatestVersion(), "0") != 0)
|
||||
{
|
||||
char aBuf[64];
|
||||
str_format(aBuf, sizeof(aBuf), Localize("DDNet %s is out!"), Client()->LatestVersion());
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
UI()->DoLabel(&Version, aBuf, 14.0f, -1);
|
||||
UI()->DoLabel(&VersionUpdate, aBuf, 14.0f, 0);
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
UI()->DoLabel(&Version, GAME_RELEASE_VERSION, 14.0f, 1);
|
||||
UI()->DoLabel(&CurVersion, GAME_RELEASE_VERSION, 14.0f, 1);
|
||||
|
||||
if(NewPage != -1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue