-
Notifications
You must be signed in to change notification settings - Fork 1
/
gui_manager.h
84 lines (72 loc) · 3.09 KB
/
gui_manager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* Copyright (c) 2012 Cheese and Bacon Games, LLC */
/* This file is licensed under the MIT License. */
/* See the file docs/LICENSE.txt for the full license text. */
#ifndef gui_manager_h
#define gui_manager_h
#include "gui_object.h"
#include "sprite.h"
#include "coords.h"
#include "button.h"
#include "information.h"
#include <vector>
#include <string>
class GUI_Manager {
private:
static bool initialized;
public:
// -1 if no object is selected
static int gui_selected_object;
// Possible values:
// mouse
// keyboard
// controller
static std::string gui_mode;
static bool hide_gui;
static std::vector<GUI_Selector_Chaser> gui_selector_chasers;
static std::string gui_axis_nav_last_direction;
static int counter_gui_scroll_axis;
static Sprite text_selector;
static void initialize();
static void deinitialize();
// Check if we need to scroll the scrolling button list
static void gui_check_scrolling_button();
static void reset_gui_selector_chasers();
static void reset_gui_selected_object();
static void set_gui_mode(std::string new_gui_mode);
// Returns the number of GUI objects on the currently focused window
// Returns 0 if no window is currently in focus
static int get_gui_object_count();
static void change_gui_selected_object(std::string direction);
// Returns a GUI_Object for the selected GUI object
// If there is no selected GUI object, the GUI_Object's type will equal none
static GUI_Object get_gui_selected_object();
// Returns a Engine_Rect with the position and size of the selected GUI object
// If there is no selected GUI object, returns a Engine_Rect of all -1's
static Engine_Rect get_gui_selected_object_pos();
static bool is_gui_object_selected(Button* button_to_check);
static bool is_gui_object_selected(Information* info_to_check);
// Activates the currently selected GUI object
static void confirm_gui_object();
static void scroll_gui_object_up();
static void scroll_gui_object_down();
// Only used by Android hardware buttons (I think...)
static void gui_nav_back_android();
static void gui_nav_toggle_menu_android();
// Only used by controller mode:
static void gui_nav_back_controller();
static void gui_nav_toggle_menu_controller();
// Only used by mouse and keyboard modes:
static void gui_nav_back_keyboard_and_mouse();
// Used by all control modes:
static void gui_nav_confirm(std::string gui_type);
static void gui_nav_up(std::string gui_type);
static void gui_nav_down(std::string gui_type);
static void gui_nav_left();
static void gui_nav_right();
static void gui_scroll_up(std::string gui_type);
static void gui_scroll_down(std::string gui_type);
static void animate_gui_selector_chasers();
static void animate();
static void render_gui_selector();
};
#endif