-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared_state.h
More file actions
77 lines (67 loc) · 2.21 KB
/
Copy pathshared_state.h
File metadata and controls
77 lines (67 loc) · 2.21 KB
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
#pragma once
#include <string>
#include <vector>
#include <map>
#include <chrono>
#include <cvardef.h>
#define IMGUI_DEFINE_MATH_OPERATORS
#include "../IMGUIExtension/thirdparty/imgui/imgui.h"
struct RadialMenuEntry {
std::string label;
std::string command;
std::string submenu;
std::string symbolic_icon;
float icon_scale = 1.0f;
bool is_center = false;
int close_override_type = 0; // 0 = default, 1 = close: false, 2 = close: true
bool disabled = false;
std::string description;
ImU32 icon_color = IM_COL32_WHITE;
ImU32 description_color = IM_COL32_WHITE;
ImU32 color_override = 0;
ImU32 hover_color_override = 0;
bool has_icon_color = false;
bool has_description_color = false;
};
struct RadialMenu {
RadialMenuEntry center;
RadialMenuEntry center_left;
RadialMenuEntry center_right;
bool center_split = false;
std::vector<RadialMenuEntry> items;
int close_default_type = 0; // 0 = default, 1 = close: false, 2 = close: true
};
struct StyleConfig {
ImU32 hover_color = IM_COL32(255, 160, 0, 250);
ImU32 sector_color = IM_COL32(45, 45, 45, 200);
ImU32 service_color = IM_COL32(70, 80, 95, 220);
ImU32 service_hover_color = IM_COL32(100, 120, 140, 250);
float deadzone_ratio = 0.4f;
float radius_min = 55.0f;
float radius_max = 190.0f;
float pagination_arrow_offset = 40.0f; // px beyond radius_max, symmetric left(-)/right(+)
float pagination_arrow_radius = 22.0f; // hit-test radius of each external pagination button
int click_cooldown_ms = 100;
int animation_duration_ms = 75;
float move_threshold_px = 15.0f;
};
extern std::map<std::string, RadialMenu> g_Menus;
extern std::vector<std::string> g_MenuHistory;
extern std::string g_ActiveMenuName;
extern bool g_bConfigLoaded;
extern bool s_bWarpOnOpen;
extern bool g_bRadialMenuVisible;
extern bool g_bOpenedViaHold;
extern std::chrono::steady_clock::time_point g_MenuOpenTime;
extern std::string g_JsonErrorMsg;
extern cvar_t* cl_radialmenu_close_on_select;
extern ImVec2 g_vStickOffset;
extern int g_iSelectedSector;
extern bool g_bMouseMovedSinceOpen;
extern StyleConfig g_Style;
extern int g_CurrentMenuPage;
extern int glwidth;
extern int glheight;
void DebugLog(const char* fmt, ...);
HWND GetGameHWND();
std::string GetFirstUTF8Char(const std::string& str);