-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.default.lua
71 lines (61 loc) · 2.08 KB
/
settings.default.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
settings = {}
style_presets = {
above_hotbar = {
-- move 50% left, move 100% down
position = { x = 0.5, y = 1.0 },
-- center on x, move 100px up
offset = { x = 0, y = -100 },
-- center on x and y
alignment = { x = 0, y = 0 },
-- 100px width, 30px height
scale = { x = 100, y = 30 },
-- light grey, defined in hex with RRGGBB arrangement
color = 0xcfcfcf,
},
right_bottom_corner = {
-- move 100% left, move 100% down
position = { x = 1.0, y = 1.0 },
-- move 10px left, move 30px up
offset = { x = -10, y = -30 },
-- align to the left
alignment = { x = -1, y = 0 },
-- 100px width, 30px height
scale = { x = 100, y = 30 },
-- light grey, defined in hex with RRGGBB arrangement
color = 0xcfcfcf,
},
left_bottom_corner = {
-- move 0% left, move 100% down
position = { x = 0.0, y = 1.0 },
-- move 10px right, move 30px up
offset = { x = 10, y = -30 },
-- align to the right
alignment = { x = 1, y = 0 },
-- 100px width, 30px height
scale = { x = 100, y = 30 },
-- light grey, defined in hex with RRGGBB arrangement
color = 0xcfcfcf,
},
-- details on the values can be read from https://rubenwardy.com/minetest_modding_book/en/chapters/hud.html
}
-- choosing style
settings.style = style_presets.above_hotbar
-- update every 250ms, the bigger this value is, the more it will lag on changes, the less it is, the more cpu is used
settings.update_time = 0.25
-- [[ DO NOT CHANGE CODE BELOW ]] --
local function file_exists(name)
local file = io.open(name, "r")
if file ~= nil then
io.close(file)
return true
end
return false
end
local mod_name = minetest.get_current_modname()
local custom_settings_filename = minetest.get_modpath(mod_name).."/settings.lua"
if file_exists(custom_settings_filename) then
minetest.log("info", "Loading custom settings ...")
dofile(custom_settings_filename)
else
minetest.log("warning", "WARNING! No custom settings found in "..custom_settings_filename..". Using defaults!")
end