mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix progress bar
This commit is contained in:
parent
45f13c7964
commit
a60d503078
@ -52,6 +52,7 @@ public:
|
||||
virtual void visitLobbyClientDisconnected(LobbyClientDisconnected & pack) override;
|
||||
virtual void visitLobbyChatMessage(LobbyChatMessage & pack) override;
|
||||
virtual void visitLobbyGuiAction(LobbyGuiAction & pack) override;
|
||||
virtual void visitLobbyStartGame(LobbyStartGame & pack) override;
|
||||
virtual void visitLobbyLoadProgress(LobbyLoadProgress & pack) override;
|
||||
virtual void visitLobbyUpdateState(LobbyUpdateState & pack) override;
|
||||
virtual void visitLobbyShowMessage(LobbyShowMessage & pack) override;
|
||||
|
@ -128,6 +128,17 @@ void ApplyOnLobbyHandlerNetPackVisitor::visitLobbyStartGame(LobbyStartGame & pac
|
||||
handler.startGameplay(pack.initializedGameState);
|
||||
}
|
||||
|
||||
void ApplyOnLobbyScreenNetPackVisitor::visitLobbyStartGame(LobbyStartGame & pack)
|
||||
{
|
||||
if(auto w = GH.windows().topWindow<CLoadingScreen>())
|
||||
{
|
||||
w->finish();
|
||||
w->redraw();
|
||||
}
|
||||
else
|
||||
GH.windows().createAndPushWindow<CLoadingScreen>();
|
||||
}
|
||||
|
||||
void ApplyOnLobbyScreenNetPackVisitor::visitLobbyLoadProgress(LobbyLoadProgress & pack)
|
||||
{
|
||||
if(auto w = GH.windows().topWindow<CLoadingScreen>())
|
||||
|
@ -614,7 +614,7 @@ void CLoadingScreen::showAll(Canvas & to)
|
||||
//CSDL_Ext::fillRect(to, rect, Colors::TRANSPARENCY);
|
||||
if(!progressBlocks.empty())
|
||||
{
|
||||
int status = float(get()) / (2.55f * progressBlocks.size());
|
||||
int status = float(get()) / 255.f * progressBlocks.size();
|
||||
|
||||
for(int i = 0; i < status; ++i)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user