2010-05-05 15:35:52 +03:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "dialog.h"
|
|
|
|
#include "gmenu2x.h"
|
|
|
|
#include "asfont.h"
|
|
|
|
|
|
|
|
Dialog::Dialog(GMenu2X *gmenu2x) : gmenu2x(gmenu2x)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void Dialog::drawTitleIcon(const std::string &icon, bool skinRes, Surface *s)
|
|
|
|
{
|
|
|
|
if (s==NULL)
|
|
|
|
s = gmenu2x->s;
|
|
|
|
|
|
|
|
Surface *i = NULL;
|
|
|
|
if (!icon.empty()) {
|
|
|
|
if (skinRes)
|
|
|
|
i = gmenu2x->sc.skinRes(icon);
|
|
|
|
else
|
|
|
|
i = gmenu2x->sc[icon];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i==NULL)
|
|
|
|
i = gmenu2x->sc.skinRes("icons/generic.png");
|
|
|
|
|
|
|
|
i->blit(s,4,(gmenu2x->skinConfInt["topBarHeight"]-32)/2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Dialog::writeTitle(const std::string &title, Surface *s)
|
|
|
|
{
|
|
|
|
if (s==NULL)
|
|
|
|
s = gmenu2x->s;
|
2011-05-09 06:17:25 +03:00
|
|
|
s->write(gmenu2x->font, title, 40, gmenu2x->skinConfInt["topBarHeight"]/4, ASFont::HAlignLeft, ASFont::VAlignMiddle);
|
2010-05-05 15:35:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void Dialog::writeSubTitle(const std::string &subtitle, Surface *s)
|
|
|
|
{
|
|
|
|
if (s==NULL)
|
|
|
|
s = gmenu2x->s;
|
2011-05-09 06:17:25 +03:00
|
|
|
s->write(gmenu2x->font, subtitle, 40, gmenu2x->skinConfInt["topBarHeight"]/4*3, ASFont::HAlignLeft, ASFont::VAlignMiddle);
|
2010-05-05 15:35:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|