Hotkey: removed unused basic_handler class
Not sure what this was used for, but it's not used for anything now and is just confusing being around.
This commit is contained in:
parent
3d8dbde03b
commit
bbfe46755e
3 changed files with 0 additions and 56 deletions
|
@ -217,11 +217,6 @@ void game_display::scroll_to_leader(int side, SCROLL_TYPE scroll_type,bool force
|
|||
unit_map::const_iterator leader = dc_->units().find_leader(side);
|
||||
|
||||
if(leader.valid()) {
|
||||
// YogiHH: I can't see why we need another key_handler here,
|
||||
// therefore I will comment it out :
|
||||
/*
|
||||
const hotkey::basic_handler key_events_handler(gui_);
|
||||
*/
|
||||
scroll_to_tile(leader->get_location(), scroll_type, true, force);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -481,42 +481,6 @@ void command_executor::get_menu_images(display& disp, std::vector<config>& items
|
|||
}
|
||||
}
|
||||
|
||||
basic_handler::basic_handler(command_executor* exec) : exec_(exec) {}
|
||||
|
||||
void basic_handler::handle_event(const SDL_Event& event)
|
||||
{
|
||||
|
||||
switch (event.type) {
|
||||
case SDL_KEYDOWN:
|
||||
case SDL_KEYUP:
|
||||
// If we're in a dialog we only want to handle items that are explicitly
|
||||
// handled by the executor.
|
||||
// If we're not in a dialog we can call the regular key event handler.
|
||||
if (!gui::in_dialog()) {
|
||||
key_event(event,exec_);
|
||||
} else if (exec_ != nullptr) {
|
||||
event_execute(event,exec_);
|
||||
}
|
||||
break;
|
||||
case SDL_JOYBUTTONDOWN:
|
||||
case SDL_JOYBUTTONUP:
|
||||
if (!gui::in_dialog()) {
|
||||
jbutton_event(event,exec_);
|
||||
} else if (exec_ != nullptr) {
|
||||
event_execute(event,exec_);
|
||||
}
|
||||
break;
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
case SDL_MOUSEBUTTONUP:
|
||||
if (!gui::in_dialog()) {
|
||||
mbutton_event(event,exec_);
|
||||
} else if (exec_ != nullptr) {
|
||||
event_execute(event,exec_);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void mbutton_event(const SDL_Event& event, command_executor* executor)
|
||||
{
|
||||
event_execute(event, executor);
|
||||
|
|
|
@ -166,19 +166,4 @@ void mbutton_event(const SDL_Event& event, command_executor* executor);
|
|||
//TODO
|
||||
void execute_command(const hotkey_command& command, command_executor* executor, int index=-1, bool press=true);
|
||||
|
||||
// Object which will ensure that basic keyboard events like escape
|
||||
// are handled properly for the duration of its lifetime.
|
||||
class basic_handler : public events::sdl_handler
|
||||
{
|
||||
public:
|
||||
basic_handler(command_executor* exec);
|
||||
|
||||
void handle_event(const SDL_Event& event);
|
||||
void handle_window_event(const SDL_Event&) {}
|
||||
|
||||
private:
|
||||
command_executor* exec_;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue