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
|
||||
*** v0.0.2
|
||||
**** [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
|
||||
*xpro doesn't show total level ? Maybe write a show_level mod ?*
|
||||
- [X] First create our own mod/nint.lua with depends description etc...
|
||||
- [ ] Must get xpro mod and register two handler
|
||||
- [ ] one for add XP
|
||||
- [ ] One for remove
|
||||
- [ ] 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] Must get xpro mod and register two handler
|
||||
- [X] one for add XP
|
||||
- [X] One for remove
|
||||
- [X] Find a way to permanently print the player's level
|
||||
- [X] Multiplayer test
|
||||
- [X] Now remove all errors
|
||||
- [ ] No XP when digging zinc and lead
|
||||
**** DONE Try an XP+levels mod
|
||||
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...*
|
||||
|
|
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 ???,???
|
||||
- show_level mod works
|
||||
- Printed show_level first text
|
||||
- Trying an XP/level mod
|
||||
|
|
|
@ -8,20 +8,18 @@ local update_level = function(playername)
|
|||
|
||||
if elemid == nil then
|
||||
-- Create HUD element
|
||||
minetest.log("error", "[show_level] Creating level HUD for "..playername)
|
||||
elemid = player:hud_add({
|
||||
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},
|
||||
text = level,
|
||||
alignment = {x = 0, y = 0}, -- center aligned
|
||||
scale = {x = 100, y = 30}, -- covered later
|
||||
alignment = {x = 0, y = 0}, -- center aligned
|
||||
scale = {x = 100, y = 30}, -- one line of text
|
||||
number = 0x00FF00,
|
||||
})
|
||||
else
|
||||
-- Update
|
||||
minetest.log("error", "[show_level] Updating level for "..playername)
|
||||
player:hud_change(elementid, "text", level)
|
||||
player:hud_change(elemid, "text", level)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -31,10 +29,12 @@ minetest.register_on_joinplayer(function(player)
|
|||
update_level(name)
|
||||
end)
|
||||
|
||||
-- Update when adding XPs
|
||||
xpro.register_on_add_xp(function(name, xp_added, lvl_changed)
|
||||
update_level(name)
|
||||
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)
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue