Fix label scrolling

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8117 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-03-30 13:35:10 +00:00
parent 008109a254
commit 1ba9c8f6e7
2 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,7 @@ LabelWidget::LabelWidget(bool title, bool bright) : Widget(WTYPE_LABEL)
m_title_font = title;
m_has_color = false;
m_scroll_speed = 0;
m_scroll_offset = 0;
if (bright)
{
@ -61,7 +62,7 @@ void LabelWidget::add()
EGUI_ALIGNMENT valign = EGUIA_CENTER ; //TODO: make label v-align configurable through XML file?
IGUIStaticText* irrwidget;
if (m_scroll_offset)
if (m_scroll_speed != 0)
{
IGUIElement* container = GUIEngine::getGUIEnv()->addButton(widget_size, m_parent, -1);
irrwidget = GUIEngine::getGUIEnv()->addStaticText(message.c_str(), core::rect<s32>( core::position2di(0,0), widget_size.getSize()),

View File

@ -70,6 +70,9 @@ void MainMenuScreen::loadedFromFile()
RibbonWidget* r = this->getWidget<RibbonWidget>("menu_toprow");
if (r != NULL) r->deleteChild("addons");
#endif
LabelWidget* w = this->getWidget<LabelWidget>("info_addons");
w->setScrollSpeed(15);
}
// ------------------------------------------------------------------------------------------------------
@ -104,9 +107,6 @@ void MainMenuScreen::init()
w->setDeactivated();
}
#endif
LabelWidget* w = this->getWidget<LabelWidget>("info_addons");
w->setScrollSpeed(15);
}
// ------------------------------------------------------------------------------------------------------