-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gatherer_Config.lua
134 lines (113 loc) · 3.14 KB
/
Gatherer_Config.lua
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
--[[
Saved Variables Configuration and management code
]]
Gatherer_Settings = {};
Gatherer_Configuration = {};
_G = getfenv(0);
local metatable = { __index = _G };
Gatherer_Configuration.global = _G;
Gatherer_Configuration._G = _G;
setmetatable( Gatherer_Configuration, metatable );
setfenv(1, Gatherer_Configuration);
Default_Settings = {
["minderTime"] = 5,
["maxDist"] = 20,
["alphaUnderMinIcon"] = 80,
["number"] = 10,
["mapMinder"] = false,
["showWorldMapFilters"] = 0,
["logInfo"] = "on",
["iconSet"] = "shaded",
--["Version"] = "2.2.3.1",
["ToggleWorldNotes"] = 0,
["IconSize"] = 12,
["useMinimapText"] = "on",
["disableWMFreezeWorkaround"] = 1,
["filter"] = "all",
-- Minimap Display Options
["NoIconOnMinDist"] = 0,
["HideIcon"] = 0,
["HideMiniNotes"] = 0,
["miniIconDist"] = 30, --old default of 40
["fadeDist"] = 60, --old default of 40
["fadePerc"] = 80,
--
["rareOre"] = 0,
-- MiniMap Icon Show Menu Options
["ShowOnMouse"] = 1,
["ShowOnClick"] = 0,
["ShowOnButton"] = 0,
["HideOnMouse"] = 1,
["HideOnClick"] = 0,
["HideOnButton"] = 0,
-- Minimap Icon Position
["Position"] = 12,
["Radius"] = 80,
-- location display
["useMainmap"] = true,
["useMinimap"] = true,
-- per gather type tables
-- these tables are filled in by the code immediately after this table definition
["interested"] = {},
["filterRecording"] = {},
["filters"] = {},
-- min skill filters
["minSetOreSkill"] = nil,
["minSetHerbSkill"] = nil,
-- debug
["debug"] = false,
['p2p'] = true,
}
--set per gather type defaults
for gatherType, nodeTypes in pairs(Gather_DB_IconIndex) do
Default_Settings.filterRecording[gatherType] = false;
Default_Settings.filters[gatherType] = "auto";
local interestedTypeTable = {};
for nodeType in pairs(nodeTypes) do
if ( nodeType ~= "default" ) then
interestedTypeTable[nodeType] = true;
end
end
Default_Settings.interested[gatherType] = interestedTypeTable;
end
--defines keys which are saved in the PerCharacter settings
PerCharacter = {
"interested",
"filterRecording",
"filters",
"minSetOreSkill",
"minSetHerbSkill",
}
--Load settings from the SavedVariables tables
function Load()
local Gatherer_Settings = Gatherer_Settings;
for key, value in pairs(Default_Settings) do
Gatherer_Settings[key] = value;
end
if ( Gatherer_SavedSettings_AccountWide ) then
for key, value in pairs(Gatherer_SavedSettings_AccountWide) do
Gatherer_Settings[key] = value;
end
end
if ( Gatherer_SavedSettings_PerCharacter ) then
for key, value in pairs(Gatherer_SavedSettings_PerCharacter) do
Gatherer_Settings[key] = value;
end
end
end
--Save settings to the SavedVariables tables
-- Call this when the PLAYER_LOGOUT event fires or saved settings
-- will not be updated
function Save()
local Gatherer_Settings = Gatherer_Settings;
local accountSettings = {};
for key in pairs(Gatherer_Settings) do
accountSettings[key] = Gatherer_Settings[key];
end
global.Gatherer_SavedSettings_AccountWide = accountSettings
local characterSettings = {};
for _, key in pairs(PerCharacter) do
characterSettings[key] = Gatherer_Settings[key];
end
global.Gatherer_SavedSettings_PerCharacter = characterSettings;
end