mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Removed no longer used class
This commit is contained in:
parent
54fefd34c7
commit
5419df1140
@ -232,84 +232,6 @@ std::string CInfoWindow::genText(std::string title, std::string description)
|
||||
return std::string("{") + title + "}" + "\n\n" + description;
|
||||
}
|
||||
|
||||
CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free)
|
||||
:free(Free),bitmap(Bitmap)
|
||||
{
|
||||
init(x, y);
|
||||
}
|
||||
|
||||
|
||||
CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, const Point &p, ETextAlignment alignment, bool Free)
|
||||
: free(Free),bitmap(Bitmap)
|
||||
{
|
||||
switch(alignment)
|
||||
{
|
||||
case ETextAlignment::BOTTOMRIGHT:
|
||||
init(p.x - Bitmap->w, p.y - Bitmap->h);
|
||||
break;
|
||||
case ETextAlignment::CENTER:
|
||||
init(p.x - Bitmap->w/2, p.y - Bitmap->h/2);
|
||||
break;
|
||||
case ETextAlignment::TOPLEFT:
|
||||
init(p.x, p.y);
|
||||
break;
|
||||
case ETextAlignment::TOPCENTER:
|
||||
init(p.x - Bitmap->w/2, p.y);
|
||||
break;
|
||||
default:
|
||||
assert(0); //not implemented
|
||||
}
|
||||
}
|
||||
|
||||
CInfoPopup::CInfoPopup(SDL_Surface *Bitmap, bool Free)
|
||||
{
|
||||
CCS->curh->hide();
|
||||
|
||||
free=Free;
|
||||
bitmap=Bitmap;
|
||||
|
||||
if(bitmap)
|
||||
{
|
||||
pos.x = GH.screenDimensions().x / 2 - bitmap->w / 2;
|
||||
pos.y = GH.screenDimensions().y / 2 - bitmap->h / 2;
|
||||
pos.h = bitmap->h;
|
||||
pos.w = bitmap->w;
|
||||
}
|
||||
}
|
||||
|
||||
void CInfoPopup::close()
|
||||
{
|
||||
if(free)
|
||||
SDL_FreeSurface(bitmap);
|
||||
WindowBase::close();
|
||||
}
|
||||
|
||||
void CInfoPopup::show(Canvas & to)
|
||||
{
|
||||
CSDL_Ext::blitAt(bitmap,pos.x,pos.y,to.getInternalSurface());
|
||||
}
|
||||
|
||||
CInfoPopup::~CInfoPopup()
|
||||
{
|
||||
CCS->curh->show();
|
||||
}
|
||||
|
||||
void CInfoPopup::init(int x, int y)
|
||||
{
|
||||
CCS->curh->hide();
|
||||
|
||||
pos.x = x;
|
||||
pos.y = y;
|
||||
pos.h = bitmap->h;
|
||||
pos.w = bitmap->w;
|
||||
|
||||
// Put the window back on screen if necessary
|
||||
vstd::amax(pos.x, 0);
|
||||
vstd::amax(pos.y, 0);
|
||||
vstd::amin(pos.x, GH.screenDimensions().x - bitmap->w);
|
||||
vstd::amin(pos.y, GH.screenDimensions().y - bitmap->h);
|
||||
}
|
||||
|
||||
bool CRClickPopup::isPopupWindow() const
|
||||
{
|
||||
return true;
|
||||
|
@ -97,21 +97,6 @@ public:
|
||||
virtual ~CRClickPopupInt();
|
||||
};
|
||||
|
||||
class CInfoPopup : public CRClickPopup
|
||||
{
|
||||
public:
|
||||
bool free; //TODO: comment me
|
||||
SDL_Surface * bitmap; //popup background
|
||||
void close() override;
|
||||
void show(Canvas & to) override;
|
||||
CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false);
|
||||
CInfoPopup(SDL_Surface * Bitmap, const Point &p, ETextAlignment alignment, bool Free=false);
|
||||
CInfoPopup(SDL_Surface * Bitmap = nullptr, bool Free = false);
|
||||
|
||||
void init(int x, int y);
|
||||
~CInfoPopup();
|
||||
};
|
||||
|
||||
/// popup on adventure map for town\hero and other objects with customized popup content
|
||||
class CInfoBoxPopup : public CWindowObject
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user