mirror of
https://github.com/kestral246/hud_compass.git
synced 2024-08-20 21:24:09 +02:00
Make default setting configuration option.
This commit is contained in:
parent
cbc71c0d94
commit
d32a75a014
@ -1,7 +1,7 @@
|
|||||||
HUD Compass [hud_compass]
|
HUD Compass [hud_compass]
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
A Minetest mod to optionally place a HUD compass and 24-hour clock on the screen.
|
A Minetest mod to optionally place a HUD compass and a 24-hour clock on the screen.
|
||||||
|
|
||||||
By David G (kestral246)
|
By David G (kestral246)
|
||||||
|
|
||||||
@ -34,6 +34,8 @@ In addition:
|
|||||||
|
|
||||||
**Note:** The clock is a 24-hour clock, with only one hand that displays the hours. Noon is at the top and midnight is at the bottom.
|
**Note:** The clock is a 24-hour clock, with only one hand that displays the hours. Noon is at the top and midnight is at the bottom.
|
||||||
|
|
||||||
|
**New:** The default initial state can now be set in minetest.conf using "compass\_default\_corner = n", where "n" can be one of the eight corner numbers above. If it's positive, the compass (or compass and clock) will be enabled at start, while if it's negative, they will start disabled.
|
||||||
|
|
||||||
Local mod storage is used to maintain the state and position of hud_compass display between sessions, per user.
|
Local mod storage is used to maintain the state and position of hud_compass display between sessions, per user.
|
||||||
|
|
||||||
|
|
||||||
|
5
init.lua
5
init.lua
@ -2,7 +2,7 @@
|
|||||||
-- Optionally place a compass and 24-hour clock on the screen.
|
-- Optionally place a compass and 24-hour clock on the screen.
|
||||||
-- A HUD version of my realcompass mod.
|
-- A HUD version of my realcompass mod.
|
||||||
-- By David_G (kestral246@gmail.com)
|
-- By David_G (kestral246@gmail.com)
|
||||||
-- 2019-12-30
|
-- 2019-12-31
|
||||||
|
|
||||||
local hud_compass = {}
|
local hud_compass = {}
|
||||||
local storage = minetest.get_mod_storage()
|
local storage = minetest.get_mod_storage()
|
||||||
@ -12,7 +12,8 @@ local storage = minetest.get_mod_storage()
|
|||||||
-- 5 = NE, 6 = SE, 7 = SW, 8 = NW (both compass and clock)
|
-- 5 = NE, 6 = SE, 7 = SW, 8 = NW (both compass and clock)
|
||||||
-- positive == enabled, negative == disabled
|
-- positive == enabled, negative == disabled
|
||||||
|
|
||||||
local default_corner = -2 -- SE corner, compass only, off by default
|
-- Define default (if not overridden): SE corner, compass only, off by default
|
||||||
|
local default_corner = tonumber(minetest.settings:get("compass_default_corner") or -2)
|
||||||
|
|
||||||
local lookup_compass = {
|
local lookup_compass = {
|
||||||
{hud_elem_type="image", text="", position={x=1,y=0}, scale={x=4,y=4}, alignment={x=-1,y=1}, offset={x=-8,y=4}},
|
{hud_elem_type="image", text="", position={x=1,y=0}, scale={x=4,y=4}, alignment={x=-1,y=1}, offset={x=-8,y=4}},
|
||||||
|
Loading…
Reference in New Issue
Block a user