-
Notifications
You must be signed in to change notification settings - Fork 13
/
EasyFindConfiguration.h
122 lines (87 loc) · 3.33 KB
/
EasyFindConfiguration.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
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
#pragma once
#include <mq/Plugin.h>
#include <spdlog/common.h>
#include <yaml-cpp/yaml.h>
#include <memory>
enum class ConfiguredColor
{
AddedLocation = 0,
ModifiedLocation,
MaxColors,
};
const char* GetConfiguredColorName(ConfiguredColor color);
const char* GetConfiguredColorDescription(ConfiguredColor color);
enum class ConfiguredGroupPlugin
{
None = 0,
Auto,
EQBC,
Dannet,
Max,
};
const char* GetGroupPluginPreferenceString(ConfiguredGroupPlugin plugin);
namespace spdlog {
namespace sinks {
class sink;
}
}
class EasyFindConfiguration
{
public:
EasyFindConfiguration();
~EasyFindConfiguration();
void LoadSettings();
void SaveSettings();
void ReloadSettings();
void ResetSettings();
void SetColor(ConfiguredColor color, MQColor value);
MQColor GetColor(ConfiguredColor color) const;
MQColor GetDefaultColor(ConfiguredColor color) const;
void SetLogLevel(spdlog::level::level_enum level);
spdlog::level::level_enum GetLogLevel() const;
void SetNavLogLevel(spdlog::level::level_enum level);
spdlog::level::level_enum GetNavLogLevel() const;
void SetColoredFindWindowEnabled(bool colorize);
bool IsColoredFindWindowEnabled() const { return m_coloredFindWindowEnabled; }
void SetDistanceColumnEnabled(bool enable);
bool IsDistanceColumnEnabled() const { return m_distanceColumnEnabled; }
void SetSilentGroupCommands(bool silent);
bool IsSilentGroupCommands() const { return m_silentGroupCommands; }
void SetVerboseMessages(bool verbose);
bool IsVerboseMessages() const { return m_verboseMessages; }
void SetIgnoreZoneConnectionDataEnabled(bool ignore);
bool IsIgnoreZoneConnectionDataEnabled() const { return m_ignoreZoneConnectionDataEnabled; }
// transfer types
void RefreshTransferTypes();
bool IsSupportedTransferType(int transferTypeIndex) const;
bool IsDisabledTransferType(int transferTypeIndex) const;
void SetDisabledTransferType(int transferTypeIndex, bool disabled);
// group execution behaviors
bool IsEQBCLoaded() const { return m_eqbcLoaded; }
bool IsDannetLoaded() const { return m_dannetLoaded; }
ConfiguredGroupPlugin GetPreferredGroupPlugin() const; // returns user preference.
void SetPreferredGroupPlugin(ConfiguredGroupPlugin p);
ConfiguredGroupPlugin GetActiveGroupPlugin() const; // returns the actual thing to use.
void HandlePluginChange(std::string_view pluginName, bool loaded);
int GetNavDistance() const { return 15; }
private:
void LoadDisabledTransferTypes();
private:
std::string m_configFile;
YAML::Node m_configNode;
std::vector<std::string> m_disabledTransferTypesPrefs; // user pref
std::vector<bool> m_supportedTransferTypes; // hardcoded disabled, converted to index when data is loaded
std::vector<bool> m_disabledTransferTypes; // converted to index when data is loaded
std::shared_ptr<spdlog::sinks::sink> m_chatSink;
std::array<MQColor, (size_t)ConfiguredColor::MaxColors> m_configuredColors;
spdlog::level::level_enum m_navLogLevel = spdlog::level::err;
bool m_eqbcLoaded = false;
bool m_dannetLoaded = false;
ConfiguredGroupPlugin m_groupPluginSelection = ConfiguredGroupPlugin::Auto;
bool m_distanceColumnEnabled = true;
bool m_coloredFindWindowEnabled = true;
bool m_silentGroupCommands = true;
bool m_verboseMessages = false;
bool m_ignoreZoneConnectionDataEnabled = false;
};
extern EasyFindConfiguration* g_configuration;