The Battle for Wesnoth  1.19.7+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 select_teleport() override;
52  virtual void kill_unit() override;
53  virtual void label_terrain(bool) override;
54  virtual void clear_labels() override;
55  virtual void label_settings() override;
56  virtual void continue_move() override;
57  virtual void unit_hold_position() override;
58  virtual void end_unit_turn() override;
59  virtual void user_command() override;
60  virtual void custom_command() override;
61  virtual void ai_formula() override;
62  virtual void clear_messages() override;
63  // Whiteboard hotkeys
64  virtual void whiteboard_toggle() override;
65  virtual void whiteboard_execute_action() override;
66  virtual void whiteboard_execute_all_actions() override;
67  virtual void whiteboard_delete_action() override;
68  virtual void whiteboard_bump_up_action() override;
69  virtual void whiteboard_bump_down_action() override;
70  virtual void whiteboard_suppose_dead() override;
71 
72  //replay
74  {
77  }
78  virtual void stop_replay() override
79  { return get_replay_controller().stop_replay(); }
80  virtual void play_replay() override
81  { return get_replay_controller().play_replay(); }
82  virtual void replay_next_turn() override
84  virtual void replay_next_side() override
86  virtual void replay_next_move() override
88  virtual void replay_show_everything() override
90  virtual void replay_show_each() override
92  virtual void replay_show_team1() override
94  virtual void reset_replay() override
96  virtual void replay_exit() override;
97  virtual void load_autosave(const std::string& filename, bool start_replay = false) override;
98  virtual hotkey::ACTION_STATE get_action_state(const hotkey::ui_command&) const override;
99 };
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.
std::string filename
Filename.
Used as the main paramneter for can_execute_command/do_execute_command These functions are used to ex...