mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
-Fixed Pyramid bug and incorrect behaviour of specific banks
-Commited some old scraps of better InfoWindow with scrollbar
This commit is contained in:
@@ -368,10 +368,6 @@ SDL_Surface * CMessage::drawBoxTextBitmapSub( int player, std::string text, SDL_
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CMessage::drawIWindow(CInfoWindow * ret, std::string text, int player, int charperline)
|
void CMessage::drawIWindow(CInfoWindow * ret, std::string text, int player, int charperline)
|
||||||
{
|
{
|
||||||
SDL_Surface * _or = NULL;
|
SDL_Surface * _or = NULL;
|
||||||
@@ -415,22 +411,26 @@ void CMessage::drawIWindow(CInfoWindow * ret, std::string text, int player, int
|
|||||||
|
|
||||||
// Clip window size
|
// Clip window size
|
||||||
amax(txts.second, 50);
|
amax(txts.second, 50);
|
||||||
if (txts.second > conf.cc.resy - 150)
|
|
||||||
ret->slider = new CSlider(ret->pos.x + ret->pos.w, ret->pos.y, txts.second, boost::bind (&CInfoWindow::sliderMoved, ret, _1), txts.second, txts.second, 0, false, 0);
|
|
||||||
else
|
|
||||||
ret->slider = NULL;
|
|
||||||
amax(txts.first, 80);
|
amax(txts.first, 80);
|
||||||
amax(txts.first, comps.w);
|
amax(txts.first, comps.w);
|
||||||
amax(txts.first, bw);
|
amax(txts.first, bw);
|
||||||
|
|
||||||
amin(txts.first, conf.cc.resx - 150);
|
amin(txts.first, conf.cc.resx - 150);
|
||||||
amin(txts.second, conf.cc.resy - 150);
|
|
||||||
|
|
||||||
ret->bitmap = drawBox1 (txts.first + 2*SIDE_MARGIN, txts.second + 2*SIDE_MARGIN, player);
|
ret->bitmap = drawBox1 (txts.first + 2*SIDE_MARGIN, txts.second + 2*SIDE_MARGIN, player);
|
||||||
ret->pos.h=ret->bitmap->h;
|
ret->pos.h=ret->bitmap->h;
|
||||||
ret->pos.w=ret->bitmap->w;
|
ret->pos.w=ret->bitmap->w;
|
||||||
ret->pos.x=screen->w/2-(ret->pos.w/2);
|
ret->pos.x=screen->w/2-(ret->pos.w/2);
|
||||||
ret->pos.y=screen->h/2-(ret->pos.h/2);
|
ret->pos.y=screen->h/2-(ret->pos.h/2);
|
||||||
|
if (txts.second > conf.cc.resy - 150)
|
||||||
|
{
|
||||||
|
amin(txts.second, conf.cc.resy - 150);
|
||||||
|
ret->slider = new CSlider(ret->pos.x + ret->pos.w - SIDE_MARGIN, ret->pos.y + SIDE_MARGIN,
|
||||||
|
ret->pos.h - 2*SIDE_MARGIN, boost::bind (&CInfoWindow::sliderMoved, ret, _1), brtext->size(), brtext->size(), brtext->size()-1, false, 0);
|
||||||
|
//ret->bitmap->w -= ret->slider->pos.w; //crop text so that slider has more place for itself
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ret->slider = NULL;
|
||||||
|
|
||||||
int curh = SIDE_MARGIN;
|
int curh = SIDE_MARGIN;
|
||||||
blitTextOnSur (txtg, fontHeight, curh, ret->bitmap);
|
blitTextOnSur (txtg, fontHeight, curh, ret->bitmap);
|
||||||
|
@@ -661,6 +661,8 @@ void CInfoWindow::show(SDL_Surface * to)
|
|||||||
CSimpleWindow::show(to);
|
CSimpleWindow::show(to);
|
||||||
for(int i=0;i<buttons.size();i++)
|
for(int i=0;i<buttons.size();i++)
|
||||||
buttons[i]->show(to);
|
buttons[i]->show(to);
|
||||||
|
if (slider)
|
||||||
|
slider->show(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
CInfoWindow::~CInfoWindow()
|
CInfoWindow::~CInfoWindow()
|
||||||
@@ -686,6 +688,10 @@ void CInfoWindow::activate()
|
|||||||
}
|
}
|
||||||
void CInfoWindow::sliderMoved(int to)
|
void CInfoWindow::sliderMoved(int to)
|
||||||
{
|
{
|
||||||
|
/*slider->moveTo(to);
|
||||||
|
if(!slider) return; //ignore spurious call when slider is being created
|
||||||
|
*/
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
void CInfoWindow::deactivate()
|
void CInfoWindow::deactivate()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user