-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
71 lines (56 loc) · 1.12 KB
/
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
require "class"
local Config = Class(function(self, options)
self.options = {}
if options then
self:SetOptions(options)
end
end)
function Config:SetOptions(options)
for k,v in pairs(options) do
self.options[k] = v
end
end
function Config:IsEnabled(option)
return self.options[option]
end
function Config:Enable(option)
self.options[option] = true
end
function Config:Disable(option)
self.options[option] = nil
end
function Config:__tostring()
local str = {}
table.insert(str, "PLATFORM CONFIGURATION OPTIONS")
for k,v in pairs (self.options) do
table.insert(str, string.format("%s = %s", tostring(k), tostring(v) ))
end
return table.concat(str, "\n")
end
-------------------------------------------------
local defaults =
{
hide_vignette = false,
force_netbookmode = false,
}
local platform_overrides =
{
NACL=
{
force_netbookmode = true,
},
ANDROID =
{
hide_vignette = true,
force_netbookmode = true,
},
IOS =
{
hide_vignette = true,
force_netbookmode = true,
},
}
TheConfig = Config(defaults)
if platform_overrides[PLATFORM] then
TheConfig:SetOptions(platform_overrides[PLATFORM])
end