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:
committed by
Alexander Shishkin
parent
96494332a2
commit
fa5a14e2d8
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user