mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-29 13:53:43 +01:00
Use content_offset on pagenum button
This commit is contained in:
parent
b8bf923125
commit
6c59066f89
6
init.lua
6
init.lua
@ -1179,7 +1179,7 @@ local function get_title_fs(query_item, favs, fs, spacing)
|
||||
fs[#fs + 1] = fmt(FMT.label, 8.75, spacing - 0.1, nice_strip(ESC(get_desc(query_item)), 45))
|
||||
fs[#fs + 1] = "style_type[label;font=mono;font_size=+0]"
|
||||
fs[#fs + 1] = fmt(FMT.label, 8.75, spacing + 0.3, clr("#7bf", nice_strip(query_item, 35)))
|
||||
fs[#fs + 1] = "style_type[label;font=normal;font_size=+0]"
|
||||
fs[#fs + 1] = "style_type[label;font=normal;font_size=]"
|
||||
|
||||
fs[#fs + 1] = fmt(FMT.hypertext,
|
||||
13.8, spacing - 0.15, 1.1, 1.3,
|
||||
@ -1313,6 +1313,8 @@ local function make_fs(data)
|
||||
|
||||
data.pagemax = max(1, ceil(#data.items / IPP))
|
||||
|
||||
fs[#fs + 1] = "style[pagenum;content_offset=0]"
|
||||
|
||||
fs[#fs + 1] = fmt(FMT.button,
|
||||
5.97, -0.06, 1.36, 0.85, "pagenum",
|
||||
fmt("%s / %u", clr("#ff0", data.pagenum), data.pagemax))
|
||||
@ -1657,7 +1659,7 @@ local function fields(player, _f)
|
||||
data.pagenum = 1
|
||||
search(data)
|
||||
|
||||
elseif _f.prev_page or _f.next_page or _f.pagenum then
|
||||
elseif _f.prev_page or _f.next_page then
|
||||
if data.pagemax == 1 then return end
|
||||
data.pagenum = data.pagenum - (_f.prev_page and 1 or -1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user