show_level mod works
parent
2a709f027d
commit
516297af42
14
ROADMAP
14
ROADMAP
|
@ -226,15 +226,17 @@ 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. 19:23]--[2018-12-30 dim. 20:51] => 1:28
|
||||||
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...
|
||||||
- [ ] Must get xpro mod and register two handler
|
- [X] Must get xpro mod and register two handler
|
||||||
- [ ] one for add XP
|
- [X] one for add XP
|
||||||
- [ ] One for remove
|
- [X] One for remove
|
||||||
- [ ] Find a way to permanently print the player's level
|
- [X] Find a way to permanently print the player's level
|
||||||
- [ ] Maybe using HUD monitor mod : https://forum.minetest.net/viewtopic.php?f=9&t=13795&p=202584
|
- [X] Multiplayer test
|
||||||
|
- [X] Now remove all errors
|
||||||
|
- [ ] No XP when digging zinc and lead
|
||||||
**** DONE Try an XP+levels mod
|
**** DONE Try an XP+levels mod
|
||||||
CLOCK: [2018-12-29 sam. 15:55]--[2018-12-29 sam. 16:17] => 0:22
|
CLOCK: [2018-12-29 sam. 15:55]--[2018-12-29 sam. 16:17] => 0:22
|
||||||
*level 2 : not showing it! but a cool annoucement with novice etc...*
|
*level 2 : not showing it! but a cool annoucement with novice etc...*
|
||||||
|
|
1
TODO
1
TODO
|
@ -11,5 +11,6 @@ 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 ???,???
|
||||||
|
- show_level mod works
|
||||||
- Printed show_level first text
|
- Printed show_level first text
|
||||||
- Trying an XP/level mod
|
- Trying an XP/level mod
|
||||||
|
|
|
@ -8,20 +8,18 @@ local update_level = function(playername)
|
||||||
|
|
||||||
if elemid == nil then
|
if elemid == nil then
|
||||||
-- Create HUD element
|
-- Create HUD element
|
||||||
minetest.log("error", "[show_level] Creating level HUD for "..playername)
|
|
||||||
elemid = player:hud_add({
|
elemid = player:hud_add({
|
||||||
hud_elem_type = "text",
|
hud_elem_type = "text",
|
||||||
position = {x = 0.5, y = 1},
|
position = {x = 0.5, y = 1}, -- from the screen bottom
|
||||||
offset = {x = 0, y = -160},
|
offset = {x = 0, y = -160},
|
||||||
text = level,
|
text = level,
|
||||||
alignment = {x = 0, y = 0}, -- center aligned
|
alignment = {x = 0, y = 0}, -- center aligned
|
||||||
scale = {x = 100, y = 30}, -- covered later
|
scale = {x = 100, y = 30}, -- one line of text
|
||||||
number = 0x00FF00,
|
number = 0x00FF00,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
-- Update
|
-- Update
|
||||||
minetest.log("error", "[show_level] Updating level for "..playername)
|
player:hud_change(elemid, "text", level)
|
||||||
player:hud_change(elementid, "text", level)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,10 +29,12 @@ minetest.register_on_joinplayer(function(player)
|
||||||
update_level(name)
|
update_level(name)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Update when adding XPs
|
||||||
xpro.register_on_add_xp(function(name, xp_added, lvl_changed)
|
xpro.register_on_add_xp(function(name, xp_added, lvl_changed)
|
||||||
update_level(name)
|
update_level(name)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
xpro.register_on_rem_xp(function(name, xp_added, lvl_changed)
|
-- Update when removing XPs
|
||||||
|
xpro.register_on_rem_xp(function(name, xp_removed, lvl_changed)
|
||||||
update_level(name)
|
update_level(name)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue