1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Stabilize vcmi (#488)

* Shared statusbar
* Fixed server fails on client disconnected
This commit is contained in:
KasyanDiGris
2018-08-26 19:09:56 +03:00
committed by Alexander Shishkin
parent 96494332a2
commit fa5a14e2d8
13 changed files with 53 additions and 44 deletions

View File

@@ -351,7 +351,6 @@ void CGStatusBar::clear()
CGStatusBar::CGStatusBar(std::shared_ptr<CPicture> background_, EFonts Font, EAlignment Align, const SDL_Color & Color)
: CLabel(background_->pos.x, background_->pos.y, Font, Align, Color, "")
{
init();
background = background_;
addChild(background.get());
pos = background->pos;
@@ -363,7 +362,6 @@ CGStatusBar::CGStatusBar(int x, int y, std::string name, int maxw)
: CLabel(x, y, FONT_SMALL, CENTER)
{
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
init();
background = std::make_shared<CPicture>(name);
pos = background->pos;
if((unsigned int)maxw < pos.w)
@@ -387,7 +385,7 @@ void CGStatusBar::show(SDL_Surface * to)
void CGStatusBar::init()
{
oldStatusBar = GH.statusbar;
GH.statusbar = this;
GH.statusbar = shared_from_this();
}
Point CGStatusBar::getBorderSize()