forked from Sokomine/yl_speak_up
local function grey_if_zero
This commit is contained in:
parent
feae914e85
commit
2c28a0fc26
@ -1,3 +1,13 @@
|
|||||||
|
-- helper function to make unintresting zeros in tables less visible
|
||||||
|
local grey_if_zero = function(fs, n)
|
||||||
|
if(n and n == 0) then
|
||||||
|
table.insert(fs, "#444444")
|
||||||
|
else
|
||||||
|
table.insert(fs, "#FFFFFF")
|
||||||
|
end
|
||||||
|
table.insert(fs, minetest.formspec_escape(n))
|
||||||
|
end
|
||||||
|
|
||||||
-- This order imposed here on the quest steps is the one in which the
|
-- This order imposed here on the quest steps is the one in which the
|
||||||
-- quest steps have to be solved - as far as we can tell (the quest
|
-- quest steps have to be solved - as far as we can tell (the quest
|
||||||
-- may be in the process of beeing created and not logicly complete yet).
|
-- may be in the process of beeing created and not logicly complete yet).
|
||||||
@ -253,15 +263,6 @@ end
|
|||||||
-- small helper function for yl_speak_up.get_fs_add_quest_steps;
|
-- small helper function for yl_speak_up.get_fs_add_quest_steps;
|
||||||
-- lists all the quest steps found in liste in the order they occour there
|
-- lists all the quest steps found in liste in the order they occour there
|
||||||
yl_speak_up.quest_step_list_show_table = function(formspec, table_specs, liste, data, required_for_steps)
|
yl_speak_up.quest_step_list_show_table = function(formspec, table_specs, liste, data, required_for_steps)
|
||||||
local grey_if_zero = function(fs, n)
|
|
||||||
if(n and n == 0) then
|
|
||||||
table.insert(fs, "#444444")
|
|
||||||
else
|
|
||||||
table.insert(fs, "#FFFFFF")
|
|
||||||
end
|
|
||||||
table.insert(fs, minetest.formspec_escape(n))
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(formspec, "tablecolumns["..
|
table.insert(formspec, "tablecolumns["..
|
||||||
"color;text,align=right;".. -- #d.one_step_required
|
"color;text,align=right;".. -- #d.one_step_required
|
||||||
"color;text,align=right;".. -- #d.all_steps_required
|
"color;text,align=right;".. -- #d.all_steps_required
|
||||||
@ -324,15 +325,6 @@ end
|
|||||||
-- lists npc that are either already added or could be added
|
-- lists npc that are either already added or could be added
|
||||||
-- can also handle locations
|
-- can also handle locations
|
||||||
yl_speak_up.quest_npc_show_table = function(formspec, table_specs, liste, step_data, is_location_list)
|
yl_speak_up.quest_npc_show_table = function(formspec, table_specs, liste, step_data, is_location_list)
|
||||||
local grey_if_zero = function(fs, n)
|
|
||||||
if(n and n == 0) then
|
|
||||||
table.insert(fs, "#444444")
|
|
||||||
else
|
|
||||||
table.insert(fs, "#FFFFFF")
|
|
||||||
end
|
|
||||||
table.insert(fs, minetest.formspec_escape(n))
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(formspec, "tablecolumns["..
|
table.insert(formspec, "tablecolumns["..
|
||||||
"color;text,align=right;".. -- used in this many quest steps
|
"color;text,align=right;".. -- used in this many quest steps
|
||||||
"color;text,align=left;".. -- n_id (number, for NPC) or p_(-185,3,-146) (for locations)
|
"color;text,align=left;".. -- n_id (number, for NPC) or p_(-185,3,-146) (for locations)
|
||||||
|
Loading…
Reference in New Issue
Block a user