477
478
479
480
481
482
483
484
485
486
487
488
489
490
|
-- handle page change request
if fields.nextpage or fields.prevpage then
local page = math.max(1,bm:get_int('pagenr'))
if fields.nextpage then page = page + 1
elseif fields.prevpage then page = page - 1 end
bm:set_int('pagenr',math.max(1,page))
changed = true
end
-- handle retitle request
if fields.title then
if fields.title ~= bm:get_string('description') then
if charge_ink(constants.op_cost_retitle) then
|
|
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
|
-- handle page change request
if fields.nextpage or fields.prevpage then
local page = math.max(1,bm:get_int('pagenr'))
if fields.nextpage then page = page + 1
elseif fields.prevpage then page = page - 1 end
bm:set_int('pagenr',math.max(1,page))
minetest.sound_play('sorcery_pgturn', { pos = pos, gain = 0.6 })
changed = true
end
-- handle retitle request
if fields.title then
if fields.title ~= bm:get_string('description') then
if charge_ink(constants.op_cost_retitle) then
|