Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
controls_bar.h
Go to the documentation of this file.
1#ifndef CONTROLS_BAR_H
2#define CONTROLS_BAR_H
3
4#ifndef LOGIC_ONLY
5
6#include "ccfwd.h"
8#include "screen_rect.h"
9
10// The bar at the bottom of the screen
12{
13public:
14
16
17 void draw();
18
20 void set_draw_enter(const bool b) noexcept { m_draw_enter = b; }
21
23 void set_draw_invert(const bool b) noexcept { m_draw_invert = b; }
24
25 void set_draw_player_controls(const bool b) noexcept { m_draw_player_controls = b; }
26
28 void set_draw_left_right_increase_descrease(const bool b) noexcept { m_draw_left_right_increase_descrease = b; }
29 void set_draw_up_down(const bool b) noexcept { m_draw_up_down = b; }
30 void set_draw_select(const bool b) noexcept { m_draw_select = b; }
31
32 void set_screen_rect(const screen_rect& r) noexcept { m_background = r; }
33
35 void set_escape_button_text(const std::string& s) { m_escape_button_text = s; }
36
37private:
38
39 screen_rect m_background;
40
41 bool m_draw_enter{false};
42 bool m_draw_invert{false};
43 bool m_draw_left_right_increase_descrease{false};
44 bool m_draw_player_controls{true};
45 bool m_draw_select{true};
46 bool m_draw_up_down{true};
47
48 std::string m_escape_button_text{"Quit"};
49
51};
52
55screen_rect create_controls_bar_area(const screen_coordinate& window_size) noexcept;
56
57#endif // LOGIC_ONLY
58
59#endif // CONTROLS_BAR_H
Definition controls_bar.h:12
void set_draw_invert(const bool b) noexcept
Show that there is a way to invert a direction, by pressing shift.
Definition controls_bar.h:23
void set_draw_enter(const bool b) noexcept
Draw the Enter key, showing the text 'Accept'.
Definition controls_bar.h:20
void set_draw_up_down(const bool b) noexcept
Definition controls_bar.h:29
void set_draw_left_right_increase_descrease(const bool b) noexcept
Draw the arrows to left and right, with the texts 'decrease' and 'increase'.
Definition controls_bar.h:28
void draw()
Definition controls_bar.cpp:20
void set_escape_button_text(const std::string &s)
Set the text for the escape button, e.g. 'Quit'.
Definition controls_bar.h:35
void set_draw_select(const bool b) noexcept
Definition controls_bar.h:30
void set_screen_rect(const screen_rect &r) noexcept
Definition controls_bar.h:32
void set_draw_player_controls(const bool b) noexcept
Definition controls_bar.h:25
The physical controllers used by all players.
Definition physical_controllers.h:12
The coordinate on a screen.
Definition screen_coordinate.h:12
A rectangle-shaped area on the screen.
Definition screen_rect.h:15
screen_rect create_controls_bar_area(const screen_coordinate &window_size) noexcept
At the bottom of each window, there is a bar for the controls.
Definition controls_bar.cpp:190