-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariable.lua
More file actions
149 lines (135 loc) · 3.78 KB
/
Copy pathvariable.lua
File metadata and controls
149 lines (135 loc) · 3.78 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
145
146
147
148
149
-- UMF
#include "assets/umf/umf_meta.lua"
#include "assets/umf/umf_utils.lua"
-- Utility
#include "assets/utility/general.lua"
-- Interface
#include "assets/interface/interface.lua"
-- Modules
#include "assets/module/general.lua"
#include "assets/module/counter.lua"
#include "assets/module/debris.lua"
#include "assets/module/fire.lua"
#include "assets/module/light.lua"
#include "assets/module/fog.lua"
#include "assets/module/render.lua"
name = "Performance Mod"
author = "CoolJWB"
version = 3.1
options = {
general = {
enabled = true,
keybind = "p",
theme = "dark",
advanced = true,
speedrun = false,
hidden = true,
experimental = false,
debug = false
},
counter = {
enabled = false,
position = {0, 0},
size = 1,
textSize = 16,
textColor = {1, 1, 1, 1},
backColor = {0, 0, 0, 0.5},
accuracy = 2,
frequency = 10,
duration = 60,
background = true,
graph = false,
estimate = false,
frameCount = true,
frameCountMax = true,
frameCountMin = true,
bodyCount = false,
shapeCount = false,
fireCount = false
},
debris = {
enabled = false,
smart = true,
cleaner = true,
particle = false,
stabilizer = false,
collider = true,
collideLevel = true,
cleanerVoxelCount = 50,
particleAmount = 2,
stabilizerVoxelCount = 50,
stabilizerRadius = 20,
stabilizerForce = 0.1,
colliderVoxelCount = 100
},
fire = {
enabled = false,
performance = false,
fireLimit = 200,
fireSpread = 1
},
light = {
enabled = false,
shadowLimit = 32,
lampLimit = 1,
lampColor = {1, 1, 1, 1}
},
fog = {
enabled = false,
fogStart = 50,
fogEnd = 200,
fogAmount = 0.9,
fogExponent = 8
},
render = {
enabled = false,
renderDistance = 2
}
}
local default = Clone(options)
-- Check if the user uses a version before 3.0 or invalid version number (version number shouldn't be less then 3.0).
-- If true then switch over to use the post 3.0 system.
if (HasKey("savegame.mod.version") == false or GetFloat("savegame.mod.version") < 3.0) or (HasKey("savegame.mod.options") == false or GetString("savegame.mod.options") == "") then
ClearKey("savegame.mod")
SetFloat("savegame.mod.version", version)
SetString("savegame.mod.options", util.serialize(options))
end
-- Overwrite existing options with those found in the savegame.
-- This is done so that new options don't get overwritten on new version launch.
if HasKey("savegame.mod.options") then
local unserialized = util.unserialize(GetString("savegame.mod.options"))
for name, option in pairs(unserialized) do
options[name] = option
end
SetFloat("savegame.mod.version", version)
SetString("savegame.mod.options", util.serialize(options))
end
modules = {
Merge(general, { options = options.general, default = default.general, data = {} }),
Merge(counter, { options = options.counter, default = default.counter, data = {} }),
Merge(debris, { options = options.debris, default = default.debris, data = {} }),
Merge(fire, { options = options.fire, default = default.fire, data = {} }),
Merge(light, { options = options.light, default = default.light, data = {} }),
Merge(fog, { options = options.fog, default = default.fog, data = {} }),
Merge(render, { options = options.render, default = default.render, data = {} }),
}
-- This is a list of themes available.
themes = {
light = {
background = {0, 0, 0, 0.75}, top_bar = { 0, 0, 0, 0.9 }, left_bar = { 0, 0, 0, 0.5 }, text = { 1, 1, 1, 1 }
},
dark = {
background = {0, 0, 0, 0.75},
top_bar = { 0, 0, 0, 0.9 },
left_bar = { 0, 0, 0, 0.5 },
text = { 1, 1, 1, 1 },
textEnabled = { 0, 1, 0, 1 },
textDisabled = { 1, 0, 0, 1 },
textFont = "MOD/assets/font/libsans.ttf",
textFontBold = "MOD/assets/font/libsans_bold.ttf",
button = { 0, 0, 0, 0.5 },
buttonPressed = { 0.05, 0.05, 0.05, 0.5 },
buttonReset = { 0.5, 0, 0, 0.5 }
}
}
theme = themes.dark