ingame docu improved

master
Joachim Stolberg 2019-09-17 23:37:29 +02:00
parent 821e80fe88
commit 5baec009ca
3 changed files with 35 additions and 18 deletions

View File

@ -37,7 +37,7 @@ local function order_checkbox(pos, filter)
if cnt == 1 then
local order = M(pos):get_int("order") == 1 and "true" or "false"
return "checkbox[2,0;order;1:1;"..order.."]"..
"tooltip[2,0;1,1;"..S("Force order of filter items")..";#FFFFFF;#000000]"
"tooltip[2,0;1,1;"..S("Force order of filter items")..";#0C3D32;#FFFFFF]"
else
M(pos):set_int("order", 0) -- disable sequencing
end

View File

@ -79,20 +79,37 @@ local function get_ref(player_name)
return Categories[1], Categories[1]
end
local function tooltip(item)
if type(item) == "table" then
local img, name = item[1], item[2]
local ndef = minetest.registered_nodes[name]
if ndef and ndef.description then
return img, minetest.formspec_escape(ndef.description)
end
return img
end
return item
end
-- formspec images
local function plan(images)
local tbl = {}
if images == "none" then return "label[1,3;"..S("No plan available") end
for y=1,#images do
for x=1,#images[1] do
local img = images[y][x] or false
if img ~= false then
local item = images[y][x] or false
if item ~= false then
local img, tooltip = tooltip(item)
local x_offs, y_offs = (x-1) * 0.9, (y-1) * 0.9 + 0.8
if string.find(img, ":") then
tbl[#tbl+1] = "item_image["..x_offs..","..y_offs..";1,1;"..img.."]"
else
tbl[#tbl+1] = "image["..x_offs..","..y_offs..";1,1;"..img.."]"
end
if tooltip then
tbl[#tbl+1] = "tooltip["..x_offs..","..y_offs..";1,1;"..tooltip..";#0C3D32;#FFFFFF]"
end
end
end
end

View File

@ -14,21 +14,21 @@
local S = techage.S
local CONCR = "basic_materials_concrete_block.png"
local PIPEH = "techage_gaspipe.png"
local PIPEV = "techage_gaspipe.png^[transformR90"
local PN000 = "techage_gaspipe_knee.png"
local PN090 = "techage_gaspipe_knee.png^[transformR90"
local PN180 = "techage_gaspipe_knee.png^[transformR180"
local PN270 = "techage_gaspipe_knee.png^[transformR270"
local HEXR1 = "techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png"
local HEXR2 = "techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png"
local HEXR3 = "techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png"
local TURBN = "techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta4.png"
local GENER = "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png^[transformFX]"
local GRAVL = "default_gravel.png"
local INLET = "basic_materials_concrete_block.png^techage_gaspipe.png^[transformR90"
local GLASS = "default_obsidian_glass.png"
local CONCR = {"basic_materials_concrete_block.png", "basic_materials:concrete_block"}
local PIPEH = {"techage_gaspipe.png", "techage:ta4_pipeS"}
local PIPEV = {"techage_gaspipe.png^[transformR90", "techage:ta4_pipeS"}
local PN000 = {"techage_gaspipe_knee.png", "techage:ta4_pipeS"}
local PN090 = {"techage_gaspipe_knee.png^[transformR90", "techage:ta4_pipeS"}
local PN180 = {"techage_gaspipe_knee.png^[transformR180", "techage:ta4_pipeS"}
local PN270 = {"techage_gaspipe_knee.png^[transformR270", "techage:ta4_pipeS"}
local HEXR1 = {"techage_filling_ta4.png^techage_frameT_ta4.png^techage_appl_ribsT.png", "techage:heatexchanger3"}
local HEXR2 = {"techage_filling_ta4.png^techage_frameM_ta4.png^techage_appl_ribsB.png", "techage:heatexchanger2"}
local HEXR3 = {"techage_filling_ta4.png^techage_frameB_ta4.png^techage_appl_hole_electric.png", "techage:heatexchanger1"}
local TURBN = {"techage_filling_ta4.png^techage_appl_turbine.png^techage_frame_ta4.png", "techage:ta4_turbine"}
local GENER = {"techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png^[transformFX]", "techage:ta4_generator"}
local GRAVL = {"default_gravel.png", "default:gravel"}
local INLET = {"basic_materials_concrete_block.png^techage_gaspipe.png^[transformR90", "techage:ta4_pipe_inlet"}
local GLASS = {"default_obsidian_glass.png", "default:obsidian_glass"}
local Images = {
{false, false, false, false, false, false, false, false, false, false, false},