The Battle for Wesnoth  1.19.0-dev
hotkey_handler_sp.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2024
3  by Chris Beck <render787@gmail.com>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 /**
17  * @file
18  * An extension of play_controller::hotkey_handler, which has support for
19  * SP wesnoth features like whiteboard, end turn, etc.
20  */
21 
22 #pragma once
23 
25 
27 #include "replay_controller.hpp"
29 
30 protected:
32 
33  std::shared_ptr<wb::manager> whiteboard_manager_;
34 
35  bool is_observer() const;
36 
37 public:
40 
41  virtual void recruit() override;
42  virtual void repeat_recruit() override;
43  virtual void recall() override;
44  virtual bool can_execute_command(const hotkey::ui_command& cmd) const override;
45  virtual void toggle_shroud_updates() override;
46  virtual void update_shroud_now() override;
47  virtual void end_turn() override;
48  virtual void rename_unit() override;
49  virtual void create_unit() override;
50  virtual void change_side() override;
51  virtual void kill_unit() override;
52  virtual void label_terrain(bool) override;
53  virtual void clear_labels() override;
54  virtual void label_settings() override;
55  virtual void continue_move() override;
56  virtual void unit_hold_position() override;
57  virtual void end_unit_turn() override;
58  virtual void user_command() override;
59  virtual void custom_command() override;
60  virtual void ai_formula() override;
61  virtual void clear_messages() override;
62  // Whiteboard hotkeys
63  virtual void whiteboard_toggle() override;
64  virtual void whiteboard_execute_action() override;
65  virtual void whiteboard_execute_all_actions() override;
66  virtual void whiteboard_delete_action() override;
67  virtual void whiteboard_bump_up_action() override;
68  virtual void whiteboard_bump_down_action() override;
69  virtual void whiteboard_suppose_dead() override;
70 
71  //replay
73  {
76  }
77  virtual void stop_replay() override
78  { return get_replay_controller().stop_replay(); }
79  virtual void play_replay() override
80  { return get_replay_controller().play_replay(); }
81  virtual void replay_next_turn() override
83  virtual void replay_next_side() override
85  virtual void replay_next_move() override
87  virtual void replay_show_everything() override
89  virtual void replay_show_each() override
91  virtual void replay_show_team1() override
93  virtual void reset_replay() override
95  virtual void replay_exit() override;
96  virtual void load_autosave(const std::string& filename, bool start_replay = false) override;
97  virtual hotkey::ACTION_STATE get_action_state(const hotkey::ui_command&) const override;
98 };
virtual void toggle_shroud_updates() override
std::shared_ptr< wb::manager > whiteboard_manager_
virtual void whiteboard_suppose_dead() override
hotkey_handler(playsingle_controller &, saved_game &)
virtual void replay_show_everything() override
virtual bool can_execute_command(const hotkey::ui_command &cmd) const override
Check if a command can be executed.
virtual void whiteboard_delete_action() override
virtual void whiteboard_execute_action() override
virtual void label_terrain(bool) override
virtual void load_autosave(const std::string &filename, bool start_replay=false) override
playsingle_controller & playsingle_controller_
virtual void whiteboard_bump_up_action() override
virtual hotkey::ACTION_STATE get_action_state(const hotkey::ui_command &) const override
virtual void whiteboard_bump_down_action() override
virtual void whiteboard_execute_all_actions() override
replay_controller * get_replay_controller() const override
This file implements all the hotkey handling and menu details for play controller.
Used as the main paramneter for can_execute_command/do_execute_command These functions are used to ex...