Skip to content

Commit

Permalink
Fix load stage emptying
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jan 19, 2018
1 parent 98b708c commit efe3718
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/xrGame/GamePersistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ void CGamePersistent::OnFrame()
{
if (Device.dwPrecacheFrame == 5 && m_intro_event.empty())
{
SetLoadStageTitle("");
SetLoadStageTitle();
m_intro_event.bind(this, &CGamePersistent::game_loaded);
}

Expand Down Expand Up @@ -840,10 +840,14 @@ void CGamePersistent::LoadTitle(bool change_tip, shared_str map_name)

void CGamePersistent::SetLoadStageTitle(pcstr ls_title)
{
string512 buff;
constexpr pcstr dots = "..."; // if title is empty don't insert dots
sprintf_s(buff, "%s%s", CStringTable().translate(ls_title).c_str(), ls_title ? dots : "");
pApp->SetLoadStageTitle(buff);
string256 buff;
if (ls_title)
{
xr_sprintf(buff, "%s%s", CStringTable().translate(ls_title).c_str(), "...");
pApp->SetLoadStageTitle(buff);
}
else
pApp->SetLoadStageTitle("");
}

bool CGamePersistent::CanBePaused() { return IsGameTypeSingle() || (g_pGameLevel && Level().IsDemoPlay()); }
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/GamePersistent.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CGamePersistent : public IGame_Persistent, public IEventReceiver
virtual void OnRenderPPUI_main();
virtual void OnRenderPPUI_PP();
virtual void LoadTitle(bool change_tip = false, shared_str map_name = "");
void SetLoadStageTitle(pcstr /*ls_title*/) override;
void SetLoadStageTitle(pcstr ls_title = nullptr) override;

virtual bool CanBePaused();

Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/Level_network_start_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ bool CLevel::net_start_client1()
CStringTable().translate("st_client_connecting_to").c_str(),
name_of_server);

g_pGamePersistent->SetLoadStageTitle(temp);
g_pGamePersistent->LoadTitle();
pApp->SetLoadStageTitle(temp);
pApp->LoadStage();
return true;
}

Expand Down

0 comments on commit efe3718

Please sign in to comment.