Update tooltips usage due to core changes.

This commit is contained in:
RealBadAngel 2014-06-24 12:39:12 +02:00
parent f800f39083
commit 0d777362f3
2 changed files with 50 additions and 42 deletions

@ -48,8 +48,9 @@ function unified_inventory.get_formspec(player, page)
formspec = formspec.."image_button["
..(0.65 * (i - 1))..",9;0.8,0.8;"
..minetest.formspec_escape(def.image)..";"
..minetest.formspec_escape(def.name)..";;;;;"
..tooltip.."]"
..minetest.formspec_escape(def.name)..";]"
.."tooltip["..minetest.formspec_escape(def.name)
..";"..tooltip.."]"
end
end
@ -65,30 +66,36 @@ function unified_inventory.get_formspec(player, page)
-- Controls to flip items pages
local start_x = 9.2
formspec = formspec .. "image_button[" .. (start_x + 0.6 * 0)
.. ",9;.8,.8;ui_skip_backward_icon.png;start_list;;;;;"
.. minetest.formspec_escape(S("First page")) .. "]"
formspec = formspec .. "image_button[" .. (start_x + 0.6 * 1)
.. ",9;.8,.8;ui_doubleleft_icon.png;rewind3;;;;;"
.. minetest.formspec_escape(S("Back three pages")) .. "]"
formspec = formspec .. "image_button[" .. (start_x + 0.6 * 2)
.. ",9;.8,.8;ui_left_icon.png;rewind1;;;;;"
.. minetest.formspec_escape(S("Back one page")) .. "]"
formspec = formspec .. "image_button[" .. (start_x + 0.6 * 3)
.. ",9;.8,.8;ui_right_icon.png;forward1;;;;;"
.. minetest.formspec_escape(S("Forward one page")) .. "]"
formspec = formspec .. "image_button[" .. (start_x + 0.6 * 4)
.. ",9;.8,.8;ui_doubleright_icon.png;forward3;;;;;"
.. minetest.formspec_escape(S("Forward three pages")) .. "]"
formspec = formspec .. "image_button[" .. (start_x + 0.6 * 5)
.. ",9;.8,.8;ui_skip_forward_icon.png;end_list;;;;;"
.. minetest.formspec_escape(S("Last page")) .. "]"
formspec = formspec
.. "image_button[" .. (start_x + 0.6 * 0)
.. ",9;.8,.8;ui_skip_backward_icon.png;start_list;]"
.. "tooltip[start_list;" .. minetest.formspec_escape(S("First page")) .. "]"
.. "image_button[" .. (start_x + 0.6 * 1)
.. ",9;.8,.8;ui_doubleleft_icon.png;rewind3;]"
.. "tooltip[rewind3;" .. minetest.formspec_escape(S("Back three pages")) .. "]"
.. "image_button[" .. (start_x + 0.6 * 2)
.. ",9;.8,.8;ui_left_icon.png;rewind1;]"
.. "tooltip[rewind1;" .. minetest.formspec_escape(S("Back one page")) .. "]"
.. "image_button[" .. (start_x + 0.6 * 3)
.. ",9;.8,.8;ui_right_icon.png;forward1;]"
.. "tooltip[forward1;" .. minetest.formspec_escape(S("Forward one page")) .. "]"
.. "image_button[" .. (start_x + 0.6 * 4)
.. ",9;.8,.8;ui_doubleright_icon.png;forward3;]"
.. "tooltip[forward3;" .. minetest.formspec_escape(S("Forward three pages")) .. "]"
.. "image_button[" .. (start_x + 0.6 * 5)
.. ",9;.8,.8;ui_skip_forward_icon.png;end_list;]"
.. "tooltip[end_list;" .. minetest.formspec_escape(S("Last page")) .. "]"
-- Search box
formspec = formspec .. "field[9.5,8.325;3,1;searchbox;;"
.. minetest.formspec_escape(unified_inventory.current_searchbox[player_name]) .. "]"
formspec = formspec .. "image_button[12.2,8.1;.8,.8;ui_search_icon.png;searchbutton;;;;;"
.. S("Search") .. "]"
formspec = formspec .. "image_button[12.2,8.1;.8,.8;ui_search_icon.png;searchbutton;]"
.. "tooltip[searchbutton;" ..S("Search") .. "]"
-- Items list
if #unified_inventory.filtered_items_list[player_name] == 0 then

@ -17,19 +17,19 @@ unified_inventory.hud_colors_max = #unified_inventory.hud_colors
unified_inventory.register_page("waypoints", {
get_formspec = function(player)
local waypoints = datastorage.get_container (player, "waypoints")
local formspec = "background[0,4.5;8,4;ui_main_inventory.png]"..
"image[0,0;1,1;ui_waypoints_icon.png]"..
"label[1,0;"..S("Waypoints").."]"
local formspec = "background[0,4.5;8,4;ui_main_inventory.png]" ..
"image[0,0;1,1;ui_waypoints_icon.png]" ..
"label[1,0;" .. S("Waypoints") .. "]"
-- Tabs buttons:
local i
for i = 1, 5, 1 do
formspec = formspec ..
"image_button[0.0,".. 0.2 + i*0.7 ..";.8,.8;"..
(i == waypoints.selected and "ui_blue_icon_background.png^" or "")..
"ui_"..i.."_icon.png;"..
"select_waypoint"..i..";;;;;"..
minetest.formspec_escape(S("Select Waypoint #%d"):format(i)).."]"
"image_button[0.0," .. 0.2 + i * 0.7 .. ";.8,.8;" ..
(i == waypoints.selected and "ui_blue_icon_background.png^" or "") ..
"ui_" .. i .. "_icon.png;" ..
"select_waypoint" .. i .. ";]" ..
"tooltip[select_waypoint" .. i .. ";" .. minetest.formspec_escape(S("Select Waypoint #%d"):format(i)).."]"
end
i = waypoints.selected
@ -38,31 +38,32 @@ unified_inventory.register_page("waypoints", {
formspec = formspec ..
"image_button[4.5,3.7;.8,.8;"..
"ui_waypoint_set_icon.png;"..
"set_waypoint"..i..";;;;;"..
minetest.formspec_escape(S("Set waypoint to current location")).."]"
"set_waypoint"..i..";]"..
"tooltip[set_waypoint" .. i .. ";" .. minetest.formspec_escape(S("Set waypoint to current location")).."]"
formspec = formspec ..
"image_button[5.2,3.7;.8,.8;"..
(waypoints[i].active and "ui_on_icon.png" or "ui_off_icon.png")..";"..
"toggle_waypoint"..i..";;;;;"..
minetest.formspec_escape(S("Make waypoint "..(waypoints[i].active and "invisible" or "visible"))).."]"
"toggle_waypoint"..i..";]"..
"tooltip[toggle_waypoint" .. i .. ";" .. minetest.formspec_escape(S("Make waypoint "..(waypoints[i].active and "invisible" or "visible"))).."]"
formspec = formspec ..
"image_button[5.9,3.7;.8,.8;"..
(waypoints[i].display_pos and "ui_green_icon_background.png" or "ui_red_icon_background.png").."^ui_xyz_icon.png;"..
"toggle_display_pos"..i..";;;;;"..
minetest.formspec_escape(S((waypoints[i].display_pos and "Disable" or "Enable").." display of waypoint coordinates")).."]"
"toggle_display_pos" .. i .. ";]"..
"tooltip[toggle_display_pos" .. i .. ";" .. minetest.formspec_escape(S((waypoints[i].display_pos and "Disable" or "Enable").." display of waypoint coordinates")).."]"
formspec = formspec ..
"image_button[6.6,3.7;.8,.8;"..
"ui_circular_arrows_icon.png;"..
"toggle_color"..i..";;;;;"..
minetest.formspec_escape(S("Change color of waypoint display")).."]"
"toggle_color"..i..";]"..
"tooltip[toggle_color" .. i .. ";" .. minetest.formspec_escape(S("Change color of waypoint display")).."]"
formspec = formspec ..
"image_button[7.3,3.7;.8,.8;"..
"ui_pencil_icon.png;"..
"rename_waypoint"..i..";;;;;"..
minetest.formspec_escape(S("Edit waypoint name")).."]"
"rename_waypoint"..i..";]"..
"tooltip[rename_waypoint" .. i .. ";" .. minetest.formspec_escape(S("Edit waypoint name")).."]"
-- Waypoint's info:
if waypoints[i].active then
@ -76,8 +77,8 @@ unified_inventory.register_page("waypoints", {
"field[1.3,3.2;6,.8;rename_box" .. i .. ";;"..waypoints[i].name.."]" ..
"image_button[7.3,2.9;.8,.8;"..
"ui_ok_icon.png;"..
"confirm_rename"..i.. ";;;;;"..
minetest.formspec_escape(S("Finish editing")).."]"
"confirm_rename"..i.. ";]"..
"tooltip[confirm_rename" .. i .. ";" .. minetest.formspec_escape(S("Finish editing")).."]"
end
formspec = formspec .. "label[1,1.3;"..S("World position")..": " ..