mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-22 19:03:43 +01:00
New next/prev textures
This commit is contained in:
parent
7d9ddcb397
commit
6cb4888722
21
init.lua
21
init.lua
@ -109,7 +109,6 @@ local fs_elements = {
|
|||||||
animated_image = "animated_image[%f,%f;%f,%f;;%s;%u;%u]",
|
animated_image = "animated_image[%f,%f;%f,%f;;%s;%u;%u]",
|
||||||
scrollbar = "scrollbar[%f,%f;%f,%f;horizontal;%s;%u]",
|
scrollbar = "scrollbar[%f,%f;%f,%f;horizontal;%s;%u]",
|
||||||
item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]",
|
item_image_button = "item_image_button[%f,%f;%f,%f;%s;%s;%s]",
|
||||||
arrow = "image_button[%f,%f;0.7,0.7;%s;%s;;;false;%s]",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local styles = sprintf([[
|
local styles = sprintf([[
|
||||||
@ -1135,9 +1134,9 @@ local function get_output_fs(fs, data, rcp, is_recipe, shapeless, right, btn_siz
|
|||||||
|
|
||||||
local _name = sprintf("_%s", name)
|
local _name = sprintf("_%s", name)
|
||||||
|
|
||||||
fs(fmt("item_image_button", X + 0.1, Y, ITEM_BTN_SIZE, ITEM_BTN_SIZE,
|
fs(fmt("item_image_button",
|
||||||
sprintf("%s %u", name,
|
X + 0.1, Y, ITEM_BTN_SIZE, ITEM_BTN_SIZE,
|
||||||
count * (is_recipe and data.scrbar_rcp or data.scrbar_usg or 1)),
|
sprintf("%s %u", name, count * (is_recipe and data.scrbar_rcp or data.scrbar_usg or 1)),
|
||||||
_name, ""))
|
_name, ""))
|
||||||
|
|
||||||
local def = reg_items[name]
|
local def = reg_items[name]
|
||||||
@ -1293,11 +1292,11 @@ local function get_rcp_lbl(fs, data, panel, rn, is_recipe)
|
|||||||
local btn_suffix = is_recipe and "recipe" or "usage"
|
local btn_suffix = is_recipe and "recipe" or "usage"
|
||||||
local prev_name = sprintf("prev_%s", btn_suffix)
|
local prev_name = sprintf("prev_%s", btn_suffix)
|
||||||
local next_name = sprintf("next_%s", btn_suffix)
|
local next_name = sprintf("next_%s", btn_suffix)
|
||||||
local x_arrow = data.xoffset + 4.9
|
local x_arrow = data.xoffset + 5.1
|
||||||
local y_arrow = data.yoffset + 3
|
local y_arrow = data.yoffset + 3.2
|
||||||
|
|
||||||
fs(fmt("arrow", x_arrow - shift, y_arrow, PNG.prev, prev_name, ""),
|
fs(fmt("image_button", x_arrow - shift, y_arrow, 0.3, 0.3, "", prev_name, ""),
|
||||||
fmt("arrow", x_arrow + 2.3, y_arrow, PNG.next, next_name, ""))
|
fmt("image_button", x_arrow + 2.3, y_arrow, 0.3, 0.3, "", next_name, ""))
|
||||||
end
|
end
|
||||||
|
|
||||||
local rcp = is_recipe and panel.rcp[data.rnum] or panel.rcp[data.unum]
|
local rcp = is_recipe and panel.rcp[data.rnum] or panel.rcp[data.unum]
|
||||||
@ -1539,13 +1538,13 @@ local function make_fs(data)
|
|||||||
|
|
||||||
fs(fmt("image_button", 4.25, 0.32, 0.35, 0.35, "", "search", ""))
|
fs(fmt("image_button", 4.25, 0.32, 0.35, 0.35, "", "search", ""))
|
||||||
|
|
||||||
fs(fmt("image_button", data.xoffset - 3.2, 0.15, 0.7, 0.7, "", "prev_page", ""),
|
fs(fmt("image_button", data.xoffset - 2.73, 0.3, 0.35, 0.35, "", "prev_page", ""),
|
||||||
fmt("image_button", data.xoffset - 0.7, 0.15, 0.7, 0.7, "", "next_page", ""))
|
fmt("image_button", data.xoffset - 0.55, 0.3, 0.35, 0.35, "", "next_page", ""))
|
||||||
|
|
||||||
data.pagemax = max(1, ceil(#data.items / IPP))
|
data.pagemax = max(1, ceil(#data.items / IPP))
|
||||||
|
|
||||||
fs(fmt("button",
|
fs(fmt("button",
|
||||||
data.xoffset - 2.53, 0.15, 1.88, 0.7, "pagenum",
|
data.xoffset - 2.4, 0.14, 1.88, 0.7, "pagenum",
|
||||||
sprintf("%s / %u", clr("#ff0", data.pagenum), data.pagemax)))
|
sprintf("%s / %u", clr("#ff0", data.pagenum), data.pagemax)))
|
||||||
|
|
||||||
if #data.items == 0 then
|
if #data.items == 0 then
|
||||||
|
@ -27,8 +27,6 @@ THE SOFTWARE.
|
|||||||
Licenses of media (textures)
|
Licenses of media (textures)
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
Copyright © Diego Martínez (kaeza): craftguide_*_icon.png (CC BY-SA 3.0)
|
|
||||||
|
|
||||||
paramat (CC BY-SA 3.0):
|
paramat (CC BY-SA 3.0):
|
||||||
sfinv_crafting_arrow.png - derived from a texture by BlockMen (CC BY-SA 3.0)
|
sfinv_crafting_arrow.png - derived from a texture by BlockMen (CC BY-SA 3.0)
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 6.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 5.4 KiB |
Loading…
Reference in New Issue
Block a user