File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -726,9 +726,11 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
726
726
gui::IGUIListBox *e = Environment->addListBox (rect, this ,
727
727
GUI_ID_WORLD_LISTBOX);
728
728
e->setDrawBackground (true );
729
- for (std::vector<WorldSpec>::const_iterator i = m_data->worlds .begin ();
730
- i != m_data->worlds .end (); i++){
731
- e->addItem (narrow_to_wide (i->name +" [" +i->gameid +" ]" ).c_str ());
729
+ m_world_indices.clear ();
730
+ for (size_t wi = 0 ; wi < m_data->worlds .size (); wi++){
731
+ const WorldSpec &spec = m_data->worlds [wi];
732
+ e->addItem (narrow_to_wide (spec.name +" [" +spec.gameid +" ]" ).c_str ());
733
+ m_world_indices.push_back (wi);
732
734
}
733
735
e->setSelected (m_data->selected_world );
734
736
}
@@ -1380,6 +1382,10 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
1380
1382
return true ;
1381
1383
}
1382
1384
}
1385
+ if (event.GUIEvent .EventType ==gui::EGET_LISTBOX_CHANGED)
1386
+ {
1387
+ readInput (m_data);
1388
+ }
1383
1389
if (event.GUIEvent .EventType ==gui::EGET_LISTBOX_SELECTED_AGAIN)
1384
1390
{
1385
1391
switch (event.GUIEvent .Caller ->getID ())
You can’t perform that action at this time.
0 commit comments