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) if (m_icon_bank == NULL)
m_icon_bank = new irr::gui::STKModifiedSpriteBank(GUIEngine::getGUIEnv()); 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 } // loadedFromFile
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -147,6 +141,17 @@ void EditGPScreen::eventCallback(GUIEngine::Widget* widget,
} }
} // eventCallback } // 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() void EditGPScreen::init()
{ {

View File

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