Merge branch 'master' into travis

This commit is contained in:
Alexander van Gessel 2013-05-19 22:43:04 +02:00
commit d990b3e88d
4 changed files with 8 additions and 13 deletions

View file

@ -93,7 +93,7 @@ void controller_base::handle_event(const SDL_Event& event)
case SDL_MOUSEBUTTONUP:
get_mouse_handler_base().mouse_press(event.button, browse_);
if (get_mouse_handler_base().get_show_menu()){
show_menu(get_display().get_theme().context_menu()->items(),event.button.x,event.button.y,true);
show_menu(get_display().get_theme().context_menu()->items(),event.button.x,event.button.y,true, get_display());
}
break;
case SDL_ACTIVEEVENT:
@ -199,7 +199,7 @@ void controller_base::play_slice(bool is_delay_enabled)
const theme::menu* const m = get_display().menu_pressed();
if(m != NULL) {
const SDL_Rect& menu_loc = m->location(get_display().screen_area());
show_menu(m->items(),menu_loc.x+1,menu_loc.y + menu_loc.h + 1,false);
show_menu(m->items(),menu_loc.x+1,menu_loc.y + menu_loc.h + 1,false, get_display());
return;
}
@ -273,7 +273,7 @@ void controller_base::slice_end()
//no action by default
}
void controller_base::show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu)
void controller_base::show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp)
{
std::vector<std::string> items = items_arg;
hotkey::HOTKEY_COMMAND command;
@ -289,7 +289,7 @@ void controller_base::show_menu(const std::vector<std::string>& items_arg, int x
}
if(items.empty())
return;
command_executor::show_menu(items, xloc, yloc, context_menu, get_display());
command_executor::show_menu(items, xloc, yloc, context_menu, disp);
}
void controller_base::execute_action(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu)

View file

@ -103,7 +103,7 @@ protected:
*/
virtual void process_keyup_event(const SDL_Event& event);
virtual void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu);
virtual void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp);
virtual void execute_action(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu);
virtual bool in_context_menu(hotkey::HOTKEY_COMMAND command) const;

View file

@ -833,7 +833,7 @@ void editor_controller::show_help()
help::show_help(*gui_);
}
void editor_controller::show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu)
void editor_controller::show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp)
{
if (context_menu) {
if (!context_manager_->get_map().on_board_with_border(gui().hex_clicked_on(xloc, yloc))) {
@ -893,7 +893,7 @@ void editor_controller::show_menu(const std::vector<std::string>& items_arg, int
}
}
command_executor::show_menu(items, xloc, yloc, context_menu, gui());
command_executor::show_menu(items, xloc, yloc, context_menu, disp);
}
void editor_controller::preferences()

View file

@ -115,13 +115,8 @@ class editor_controller : public controller_base,
/** command_executor override */
bool execute_command(hotkey::HOTKEY_COMMAND command, int index = -1);
/** command_executor override */
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& /*gui*/) {
show_menu(items_arg, xloc, yloc, context_menu);
}
/** controller_base override */
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu);
void show_menu(const std::vector<std::string>& items_arg, int xloc, int yloc, bool context_menu, display& disp);
void show_help();
void status_table();