[Widelands-cvs] widelands/src/editor/ui_menus event_message_box_option_menu.cc,1.6,1.7
Status: Beta
Brought to you by:
sirver
From: Holger R. <si...@us...> - 2004-08-31 15:11:05
|
Update of /cvsroot/widelands/widelands/src/editor/ui_menus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13077/src/editor/ui_menus Modified Files: event_message_box_option_menu.cc Log Message: small editor bug fixes Index: event_message_box_option_menu.cc =================================================================== RCS file: /cvsroot/widelands/widelands/src/editor/ui_menus/event_message_box_option_menu.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- event_message_box_option_menu.cc 31 Aug 2004 08:57:21 -0000 1.6 +++ event_message_box_option_menu.cc 31 Aug 2004 15:10:54 -0000 1.7 @@ -63,11 +63,7 @@ m_buttons[3].name="Button 3"; m_buttons[0].trigger=m_buttons[1].trigger=m_buttons[2].trigger=m_buttons[3].trigger=-1; - for(int i=0; i<m_event->get_nr_buttons(); i++) { - m_buttons[i].name=m_event->get_button_name(i); - m_buttons[i].trigger=m_parent->get_map()->get_trigger_index(m_event->get_button_trigger(i)); - } - + // Name editbox new UITextarea(this, spacing, posy, 50, 20, "Name:", Align_CenterLeft); m_name=new UIEdit_Box(this, spacing+60, posy, get_inner_w()/2-60-2*spacing, 20, 0, 0); @@ -173,6 +169,13 @@ m_null_triggers.push_back(i); } + for(int i=0; i<m_event->get_nr_buttons(); i++) { + m_buttons[i].name=m_event->get_button_name(i); + for(int j=0; j<((int)m_null_triggers.size()); j++) + if(m_parent->get_map()->get_trigger_index(m_event->get_button_trigger(i))==m_null_triggers[j]) + m_buttons[i].trigger=j; + } + center_to_parent(); update(); } @@ -230,7 +233,7 @@ for(int i=0; i<m_nr_buttons; i++) { m_event->set_button_name(i, m_buttons[i].name.c_str()); if(m_buttons[i].trigger!=-1) { - m_event->set_button_trigger(i, static_cast<Trigger_Null*>(m_parent->get_map()->get_trigger(m_buttons[i].trigger)), m_parent->get_map()); + m_event->set_button_trigger(i, static_cast<Trigger_Null*>(m_parent->get_map()->get_trigger(m_null_triggers[m_buttons[i].trigger])), m_parent->get_map()); } else { m_event->set_button_trigger(i, 0, m_parent->get_map()); } @@ -334,7 +337,7 @@ if(m_buttons[m_ls_selected].trigger==-1) m_current_trigger_ta->set_text("none"); else - m_current_trigger_ta->set_text(m_parent->get_map()->get_trigger(m_buttons[m_ls_selected].trigger)->get_name()); + m_current_trigger_ta->set_text(m_parent->get_map()->get_trigger(m_null_triggers[m_buttons[m_ls_selected].trigger])->get_name()); } else { m_current_trigger_ta->set_text("---"); m_buttons[0].trigger=-1; |