Printed show_level first text
parent
441dbfaff8
commit
43c05b20b2
1
ROADMAP
1
ROADMAP
|
@ -226,6 +226,7 @@ It's really fast. May be used on a website, to show the actual map.
|
||||||
- see https://github.com/chipgw/minetest-mumble-wrapper
|
- see https://github.com/chipgw/minetest-mumble-wrapper
|
||||||
*** v0.0.2
|
*** v0.0.2
|
||||||
**** [feature_showLevel] Our own mod
|
**** [feature_showLevel] Our own mod
|
||||||
|
CLOCK: [2018-12-30 dim. 19:23]
|
||||||
CLOCK: [2018-12-30 dim. 18:06]--[2018-12-30 dim. 18:40] => 0:34
|
CLOCK: [2018-12-30 dim. 18:06]--[2018-12-30 dim. 18:40] => 0:34
|
||||||
*xpro doesn't show total level ? Maybe write a show_level mod ?*
|
*xpro doesn't show total level ? Maybe write a show_level mod ?*
|
||||||
- [X] First create our own mod/nint.lua with depends description etc...
|
- [X] First create our own mod/nint.lua with depends description etc...
|
||||||
|
|
1
TODO
1
TODO
|
@ -11,4 +11,5 @@ minetest-solebull - LGPL-2.1 - A PVP/faction game for minetest based on Cobalt.
|
||||||
|
|
||||||
|
|
||||||
* v0.0.1-4 (29 Dec. 2018 - ???) CLOC ???,???
|
* v0.0.1-4 (29 Dec. 2018 - ???) CLOC ???,???
|
||||||
|
- Printed show_level first text
|
||||||
- Trying an XP/level mod
|
- Trying an XP/level mod
|
||||||
|
|
|
@ -51,13 +51,5 @@ dofile(path .. "/executable/node_registry.lua")
|
||||||
dofile(path .. "/occupations/occupations.lua")
|
dofile(path .. "/occupations/occupations.lua")
|
||||||
-- Load random data definitions
|
-- Load random data definitions
|
||||||
dofile(path .. "/info/info.lua")
|
dofile(path .. "/info/info.lua")
|
||||||
--dofile(path .. "/random_data.lua")
|
|
||||||
--dofile(path .. "/data/dialogues_data.lua")
|
|
||||||
--dofile(path .. "/data/gift_items_data.lua")
|
|
||||||
--dofile(path .. "/data/names_data.lua")
|
|
||||||
--dofile(path .. "/data/occupations/default.lua")
|
|
||||||
--dofile(path .. "/data/occupations/default_farmer.lua")
|
|
||||||
--dofile(path .. "/data/occupations/default_priest.lua")
|
|
||||||
--dofile(path .. "/data/occupations/default_miner.lua")
|
|
||||||
|
|
||||||
print (S("[Mod] Advanced NPC loaded"))
|
print (S("[Mod] Advanced NPC loaded"))
|
||||||
|
|
|
@ -1,18 +1,25 @@
|
||||||
-- Permanently shows the player's level
|
-- Permanently shows the player's level
|
||||||
|
|
||||||
|
local elemid = nil -- Needed to update existing HUD element
|
||||||
|
|
||||||
local update_level = function(playername)
|
local update_level = function(playername)
|
||||||
minetest.log("error", "[show_level] Updating level for "..playername)
|
|
||||||
local player = minetest.get_player_by_name(playername)
|
local player = minetest.get_player_by_name(playername)
|
||||||
local elemid = player:hud_add({
|
|
||||||
hud_elem_type = "text",
|
if elemid == nil then
|
||||||
position = {x = 0.5, y = 0.5},
|
-- Create HUD element
|
||||||
offset = {x = 0, y = 0},
|
minetest.log("error", "[show_level] Creating level HUD for "..playername)
|
||||||
text = "Hello world!",
|
elemid = player:hud_add({
|
||||||
alignment = {x = 0, y = 0}, -- center aligned
|
hud_elem_type = "text",
|
||||||
scale = {x = 100, y = 100}, -- covered later
|
position = {x = 0.5, y = 0.5},
|
||||||
})
|
offset = {x = 0, y = 0},
|
||||||
|
text = "Hello world!",
|
||||||
|
alignment = {x = 0, y = 0}, -- center aligned
|
||||||
|
scale = {x = 100, y = 30}, -- covered later
|
||||||
|
})
|
||||||
|
else
|
||||||
|
-- Update
|
||||||
|
minetest.log("error", "[show_level] Updating level for "..playername)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Showing level when a player join
|
-- Showing level when a player join
|
||||||
|
|
Loading…
Reference in New Issue