-
Notifications
You must be signed in to change notification settings - Fork 0
/
demoModPrefs.lua
48 lines (39 loc) · 915 Bytes
/
demoModPrefs.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
require '_cliSugar'
require '_testData'
require 'fs22ModPrefSaver'
require 'fs22Logger'
printWarning("Demo Script - Mod Preferences")
print("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
local myLoggerPrefs = FS22Log:new(
"demoSample",
FS22Log.DEBUG_MODE.VERBOSE
--{"getValue"}
)
function saveFunction()
print("save Function ran")
end
local myPrefs = FS22PrefSaver:new(
"demoSample",
"demoSample.xml",
false,
nil,
nil,
saveFunction,
myLoggerPrefs
)
myPrefs:addDefaults({
displayOrder = "someOrder",
displayMode = { 1, "int" },
displayMode5X = 2.5,
displayMode5Y = 0.8,
displayMe = true
})
--myPrefs:dumpDefaults()
print(myPrefs:getValue("displayOrder"))
print(myPrefs:getValue("badSetting"))
myPrefs:setValue("displayOrder", "howdy")
print(myPrefs:getValue("displayOrder"))
--myPrefs:saveSettings()
myPrefs:loadSettings()
print(myPrefs:getValue("displayMode5X"))
-- myPrefs:dumpSettings()