forked from TheSuperHackers/GeneralsGameCode
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathGeneralsOnline_Settings.h
More file actions
144 lines (115 loc) · 4.42 KB
/
GeneralsOnline_Settings.h
File metadata and controls
144 lines (115 loc) · 4.42 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#pragma once
#include "libcurl/curl.h"
enum EHTTPVersion
{
HTTP_VERSION_AUTO,
HTTP_VERSION_1_0,
HTTP_VERSION_1_1,
HTTP_VERSION_2_0,
HTTP_VERSION_3_0
};
class GenOnlineSettings
{
public:
GenOnlineSettings();
float Camera_MoveSpeedRatio() const { return m_Camera_MoveSpeedRatio; }
float Camera_GetMinHeight() const { return m_Camera_MinHeight; }
float Camera_GetMaxHeight_WhenLobbyHost() const { return m_Camera_MaxHeight_LobbyHost; }
float DetermineCameraMaxHeight();
void Graphics_SetFPS(int fpsLimit, bool bLimitFramerate)
{
m_Render_FramerateLimit_FPSVal = fpsLimit;
m_Render_LimitFramerate = bLimitFramerate;
Save();
}
void Save_Camera_MaxHeight_WhenLobbyHost(float maxHeight)
{
if (maxHeight >= GENERALS_ONLINE_MIN_LOBBY_CAMERA_ZOOM || maxHeight <= GENERALS_ONLINE_MAX_LOBBY_CAMERA_ZOOM)
{
m_Camera_MaxHeight_LobbyHost = maxHeight;
Save();
}
}
bool Graphics_DrawStatsOverlay() const { return m_Render_DrawStatsOverlay; }
bool Graphics_LimitFramerate() const { return m_Render_LimitFramerate; }
bool LobbyList_AlternateColors() const { return m_LobbyList_AlternateColors; }
int Graphics_GetFPSLimit() const
{
if (!m_Render_LimitFramerate)
{
return 1000000;
}
return m_Render_FramerateLimit_FPSVal;
}
bool Social_Notifications_FriendComesOnline_Menus() { return m_Social_Notification_FriendComesOnline_Menus; }
bool Social_Notifications_FriendComesOnline_Gameplay() { return m_Social_Notification_FriendComesOnline_Gameplay; }
bool Social_Notifications_FriendGoesOffline_Menus() { return m_Social_Notification_FriendGoesOffline_Menus; }
bool Social_Notifications_FriendGoesOffline_Gameplay() { return m_Social_Notification_FriendGoesOffline_Gameplay; }
bool Social_Notifications_PlayerAcceptsRequest_Menus() { return m_Social_Notification_PlayerAcceptsRequest_Menus; }
bool Social_Notifications_PlayerAcceptsRequest_Gameplay() { return m_Social_Notification_PlayerAcceptsRequest_Gameplay; }
bool Social_Notifications_PlayerSendsRequest_Menus() { return m_Social_Notification_PlayerSendsRequest_Menus; }
bool Social_Notifications_PlayerSendsRequest_Gameplay() { return m_Social_Notification_PlayerSendsRequest_Gameplay; }
bool Debug_VerboseLogging() const { return m_bVerbose; }
int GetChatLifeSeconds() const { return std::max<int>(m_Chat_LifeSeconds, 10); }
void Initialize()
{
m_bInitialized = true;
Load();
}
bool Network_UseAlternativeEndpoint() const { return m_Network_UseAlternativeEndpoint; }
EHTTPVersion Network_GetHTTPVersion() const { return m_Network_HTTPVersion; }
int Network_GetHTTPVersionForCurl() const
{
switch (m_Network_HTTPVersion)
{
case HTTP_VERSION_AUTO:
{
return CURL_HTTP_VERSION_NONE;
}
case HTTP_VERSION_1_0:
{
return CURL_HTTP_VERSION_1_0;
}
case HTTP_VERSION_1_1:
{
return CURL_HTTP_VERSION_1_1;
}
case HTTP_VERSION_2_0:
{
return CURL_HTTP_VERSION_2_0;
}
case HTTP_VERSION_3_0:
{
return CURL_HTTP_VERSION_3;
}
}
return CURL_HTTP_VERSION_NONE;
}
private:
void Load(void);
void Save();
private:
// NOTE: This also works as the default creation (since we just call Save)
const float m_Camera_MinHeight_default = 100.f;
float m_Camera_MinHeight = m_Camera_MinHeight_default;
const float m_Camera_MoveSpeedRatio_default = 1.f;
float m_Camera_MoveSpeedRatio = m_Camera_MoveSpeedRatio_default;
float m_Camera_MaxHeight_LobbyHost = GENERALS_ONLINE_DEFAULT_LOBBY_CAMERA_ZOOM;
bool m_bInitialized = false;
bool m_bVerbose = false;
bool m_Render_DrawStatsOverlay = true;
bool m_Render_LimitFramerate = true;
int m_Render_FramerateLimit_FPSVal = 60;
int m_Chat_LifeSeconds = 30;
bool m_Social_Notification_FriendComesOnline_Menus = true;
bool m_Social_Notification_FriendComesOnline_Gameplay = true;
bool m_Social_Notification_FriendGoesOffline_Menus = true;
bool m_Social_Notification_FriendGoesOffline_Gameplay = true;
bool m_Social_Notification_PlayerAcceptsRequest_Menus = true;
bool m_Social_Notification_PlayerAcceptsRequest_Gameplay = true;
bool m_Social_Notification_PlayerSendsRequest_Menus = true;
bool m_Social_Notification_PlayerSendsRequest_Gameplay = true;
bool m_LobbyList_AlternateColors = true;
EHTTPVersion m_Network_HTTPVersion = EHTTPVersion::HTTP_VERSION_AUTO;
bool m_Network_UseAlternativeEndpoint = false;
};