100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
background[-0.25,-0.25;8.5,9;sorcery_enchanter_bg.png;true]
image[2.13,0;4.35,4;sorcery_enchanter_glyphs.png]
list[context;foci;3.5,0;1,1;0]
list[context;item;3.5,1.2;1,1;]
list[context;foci;2.5,2;1,1;1]
list[context;foci;4.5,2;1,1;2]
list[current_player;main;0,4.7;8,4;]
listring[current_player;main]
listring[context;item]
]] .. slots)
end
sorcery.enchant = {} do
sorcery.enchant.update_enchanter = enchanter_update
local m = sorcery.lib.marshal
local ench_t = m.g.struct {
................................................................................
-- so i'm just compromising and setting delta to a
-- constant :/
minetest.after(delta, function()
if not sorcery.ctx.stat(user) then return end
local u = sorcery.ctx.get(user)
local h = u.hud_ench
if not h then return end
print('timeleft,delta',h.timeleft,delta)
if h.timeleft - delta <= 0 then
user:hud_remove(h.id)
u.hud_ench = nil
else
h.timeleft = h.timeleft - delta
h.fn = false
enchpwrhud(user, false, h.fac)
|
|
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
378
379
380
381
382
383
384
385
386
387
388
389
390
391
|
background[-0.25,-0.25;8.5,9;sorcery_enchanter_bg.png;true]
image[2.13,0;4.35,4;sorcery_enchanter_glyphs.png]
list[context;foci;3.5,0;1,1;0]
list[context;item;3.5,1.2;1,1;]
list[context;foci;2.5,2;1,1;1]
list[context;foci;4.5,2;1,1;2]
list[current_player;main;0,4.7;8,4;]
listring[context;foci]
listring[current_player;main]
listring[context;item]
listring[current_player;main]
]] .. slots)
end
sorcery.enchant = {} do
sorcery.enchant.update_enchanter = enchanter_update
local m = sorcery.lib.marshal
local ench_t = m.g.struct {
................................................................................
-- so i'm just compromising and setting delta to a
-- constant :/
minetest.after(delta, function()
if not sorcery.ctx.stat(user) then return end
local u = sorcery.ctx.get(user)
local h = u.hud_ench
if not h then return end
if h.timeleft - delta <= 0 then
user:hud_remove(h.id)
u.hud_ench = nil
else
h.timeleft = h.timeleft - delta
h.fn = false
enchpwrhud(user, false, h.fac)
|