Fixed missing columns in edit gp screen

This commit is contained in:
Deve 2018-10-23 00:55:43 +02:00
parent 5b1a016b13
commit b4524e1db6
2 changed files with 14 additions and 6 deletions

View File

@ -58,12 +58,6 @@ void EditGPScreen::loadedFromFile()
{
if (m_icon_bank == NULL)
m_icon_bank = new irr::gui::STKModifiedSpriteBank(GUIEngine::getGUIEnv());
m_list = getWidget<ListWidget>("tracks");
assert(m_list != NULL);
m_list->addColumn(_("Track"), 3);
m_list->addColumn(_("Laps"), 1);
m_list->addColumn(_("Reversed"), 1);
} // loadedFromFile
// -----------------------------------------------------------------------------
@ -147,6 +141,17 @@ void EditGPScreen::eventCallback(GUIEngine::Widget* widget,
}
} // eventCallback
// -----------------------------------------------------------------------------
void EditGPScreen::beforeAddingWidget()
{
m_list = getWidget<ListWidget>("tracks");
assert(m_list != NULL);
m_list->clearColumns();
m_list->addColumn(_("Track"), 3);
m_list->addColumn(_("Laps"), 1);
m_list->addColumn(_("Reversed"), 1);
}
// -----------------------------------------------------------------------------
void EditGPScreen::init()
{

View File

@ -79,6 +79,9 @@ public:
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
const int playerID) OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void beforeAddingWidget() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void init() OVERRIDE;