SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gui_definitions.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 
10 #include <QtCore/QString>
11 #include <stdint.h>
12 #include <vector>
13 #include <array>
14 #include <cassert>
15 
16 #include <QDebug>
17 
18 enum WindowIDX : uint32_t {
23  wdw_Chat = 4,
25  wdw_Team = 6,
27  wdw_Map = 8,
33  wdw_Emails = 14,
37  wdw_Clues = 18,
39  wdw_Quit = 20,
40  wdw_Info = 21,
41  wdw_Help = 22,
45  wdw_Search = 26,
54 };
55 
56 enum WindowVisibility : uint32_t {
62 };
63 
64 enum ChatWindowMasks : uint32_t { // top bottom bottom top
65  ch_TopMask = 0x4001, // 16385 0
66  ch_Damage = 0x4, // 16389 4 0000000000000000100 0000100000000000101
67  ch_Combat = 0x2, // 16387 2 0000000000000000010 0000100000000000011
68  ch_System = 0x18048, // 114761 98376 0011000000001001000 0011100000001001001
69  ch_NPCDialog = 0x40030, // 278577 262192 1000000000000110000 1000100000000110001
70  ch_PrivateMsg = 0x80, // 16513 128 0000000000010000000 0000100000010000001
71  ch_Team = 0x100, // 16641 256 0000000000100000000 0000100000100000001
72  ch_SuperGroup = 0x200, // 16897 512 0000000001000000000 0000100001000000001
73  ch_Local = 0x400, // 17409 1024 0000000010000000000 0000100010000000001
74  ch_Broadcast = 0x800, // 18433 2048 0000000100000000000 0000100100000000001
75  ch_Request = 0x1000, // 20481 4096 0000001000000000000 0000101000000000001
76  ch_Friends = 0x2000, // 24577 8192 0000010000000000000 0000110000000000001
77  ch_Emotes = 0x20000, // 147457 131072 0100000000000000000 0100100000000000001
78 };
79 
80 class GUIWindow
81 {
82 public:
83  GUIWindow() { }
84 
85  // GUI Window Params
88  bool m_draggable_frame = false;
89  uint32_t m_posx = 0;
90  uint32_t m_posy = 0;
91  uint32_t m_width = 0;
92  uint32_t m_height = 0;
93  uint32_t m_locked = 0;
94  uint32_t m_color = 0x3399FF99; // 0x3399FF99 (light blue with 60% transparency)
95  uint32_t m_alpha = 0x88; // default 136 (0x88)
96 
97  void guiWindowDump() const
98  {
99  qDebug().noquote() << "GUIWindow:" << m_idx
100  << "\n\t" << "posx:" << m_posx
101  << "\n\t" << "posy:" << m_posy
102  << "\n\t" << "width:" << m_width
103  << "\n\t" << "height:" << m_height
104  << "\n\t" << "draggable_frame:" << m_draggable_frame
105  << "\n\t" << "locked:" << m_locked
106  << "\n\t" << "mode:" << m_mode
107  << "\n\t" << "color:" << m_color
108  << "\n\t" << "alpha:" << m_alpha;
109  }
110 
112 };
113 
115 {
116 public:
118 
119 // GUISettings serialization class version
120 static const constexpr uint32_t class_version = 1;
121 
122  // List of Windows
123  std::array<GUIWindow, 35> m_wnds;
124 
125  // Other GUI flags
126  bool m_team_buffs = false;
127  uint8_t m_cur_chat_channel = 10; // Default is local (10)
128  bool m_powers_tray_mode = false;
129  bool m_insps_tray_mode = false;
130  int m_tray1_number = 1;
131  int m_tray2_number = 2;
132  int m_tray3_number = 3;
133  int m_chat_top_flags = 0x5D87F; // orig: (1<<19)-1
134  int m_chat_bottom_flags = 0x22780;
135  float m_chat_divider_pos = 0.5f;
136 
137  void guiDump() const
138  {
139  qDebug().noquote() << "Debugging GUISettings:"
140  << "\n\t" << "TeamBuffs:" << m_team_buffs
141  << "\n\t" << "ChatChannel:" << m_cur_chat_channel
142  << "\n\t" << "PowersTray Mode:" << m_powers_tray_mode
143  << "\n\t" << "InspTray Mode:" << m_insps_tray_mode
144  << "\n\t" << "Tray1 Page:" << m_tray1_number
145  << "\n\t" << "Tray2 Page:" << m_tray2_number
146  << "\n\t" << "Tray3 Page:" << m_tray3_number
147  << "\n\t" << "Chat Window Masks Top:" << m_chat_top_flags
148  << "\n\t" << "Chat Window Masks Bottom:" << m_chat_bottom_flags
149  << "\n\t" << "Chat Divider Position:" << m_chat_divider_pos;
150 
151  for(const auto &wnd : m_wnds)
152  wnd.guiWindowDump();
153  }
154 };
int m_tray3_number
Definition: gui_definitions.h:132
Definition: gui_definitions.h:76
Definition: gui_definitions.h:52
Definition: gui_definitions.h:21
float m_chat_divider_pos
Definition: gui_definitions.h:135
Definition: gui_definitions.h:37
Definition: gui_definitions.h:59
Definition: gui_definitions.h:74
bool m_team_buffs
Definition: gui_definitions.h:126
Definition: gui_definitions.h:22
Definition: gui_definitions.h:58
Definition: gui_definitions.h:24
Definition: gui_definitions.h:32
int m_chat_bottom_flags
Definition: gui_definitions.h:134
void guiWindowDump() const
Definition: gui_definitions.h:97
Definition: gui_definitions.h:69
Definition: gui_definitions.h:34
Definition: gui_definitions.h:53
int m_tray2_number
Definition: gui_definitions.h:131
bool m_draggable_frame
Definition: gui_definitions.h:88
Definition: gui_definitions.h:30
Definition: gui_definitions.h:26
WindowVisibility m_mode
Definition: gui_definitions.h:87
Definition: gui_definitions.h:114
Definition: gui_definitions.h:71
Definition: gui_definitions.h:57
bool m_powers_tray_mode
Definition: gui_definitions.h:128
int m_tray1_number
Definition: gui_definitions.h:130
Definition: gui_definitions.h:39
Definition: gui_definitions.h:49
Definition: gui_definitions.h:20
Definition: gui_definitions.h:60
uint32_t m_width
Definition: gui_definitions.h:91
GUIWindow()
Definition: gui_definitions.h:83
Definition: gui_definitions.h:41
Definition: gui_definitions.h:19
WindowVisibility
Definition: gui_definitions.h:56
Definition: gui_definitions.h:80
Definition: gui_definitions.h:72
uint32_t m_alpha
Definition: gui_definitions.h:95
Definition: gui_definitions.h:67
WindowIDX m_idx
Definition: gui_definitions.h:86
Definition: gui_definitions.h:35
Definition: gui_definitions.h:68
Definition: gui_definitions.h:23
GUISettings()
Definition: gui_definitions.h:117
Definition: gui_definitions.h:77
uint32_t m_posx
Definition: gui_definitions.h:89
Definition: gui_definitions.h:38
bool m_insps_tray_mode
Definition: gui_definitions.h:129
Definition: gui_definitions.h:70
int m_chat_top_flags
Definition: gui_definitions.h:133
Definition: gui_definitions.h:51
uint32_t m_color
Definition: gui_definitions.h:94
std::array< GUIWindow, 35 > m_wnds
Definition: gui_definitions.h:123
Definition: gui_definitions.h:65
Definition: gui_definitions.h:31
WindowIDX
Definition: gui_definitions.h:18
uint32_t m_height
Definition: gui_definitions.h:92
Definition: gui_definitions.h:36
Definition: gui_definitions.h:61
uint32_t m_posy
Definition: gui_definitions.h:90
ChatWindowMasks
Definition: gui_definitions.h:64
uint8_t m_cur_chat_channel
Definition: gui_definitions.h:127
Definition: gui_definitions.h:40
Definition: gui_definitions.h:27
Definition: gui_definitions.h:47
Definition: gui_definitions.h:43
Definition: gui_definitions.h:73
Definition: gui_definitions.h:44
Definition: gui_definitions.h:46
Definition: gui_definitions.h:28
Definition: gui_definitions.h:29
Definition: gui_definitions.h:75
Definition: gui_definitions.h:42
Definition: gui_definitions.h:50
Definition: gui_definitions.h:33
Definition: gui_definitions.h:45
Definition: gui_definitions.h:66
void setWindowVisibility(WindowVisibility val)
Definition: gui_definitions.h:111
Definition: gui_definitions.h:48
Definition: gui_definitions.h:25
uint32_t m_locked
Definition: gui_definitions.h:93
void guiDump() const
Definition: gui_definitions.h:137
static const constexpr uint32_t class_version
Definition: gui_definitions.h:120