From c744ce6affcff307eef705bfbb8b7969cacaa8e7 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 21 Sep 2023 22:35:38 +0200 Subject: [PATCH] put more into containers in fs_manage_quest_steps --- fs_manage_quest_steps.lua | 69 +++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/fs_manage_quest_steps.lua b/fs_manage_quest_steps.lua index 0622ef7..402f3de 100644 --- a/fs_manage_quest_steps.lua +++ b/fs_manage_quest_steps.lua @@ -259,8 +259,19 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param) -- find out the next quest step local required_for = yl_speak_up.quest_step_required_for(step_data, selected) + -- middle (this quest step) + table.insert(formspec, "container[6,2.7;12,10.8]".. + "label[0.2,0.5;This quest step:]".. + "box[0.7,0.7;17,0.7;#000000]".. + "label[0.8,1.1;") + table.insert(formspec, minetest.colorize("#AAFFAA", minetest.formspec_escape(selected))) + table.insert(formspec, "]") + table.insert(formspec, "container_end[]") + + -- left side (previous quest step) - table.insert(formspec, "label[0.2,2.0;"..em("Required previous").."]".. + table.insert(formspec, "container[0,0;5.8,13.5]".. + "label[0.2,2.0;"..em("Required previous").."]".. "label[0.2,2.4;quest step(s):]".. "style[insert_before_next_step,insert_after_prev_step,".. "add_to_one_needed,add_to_all_needed;bgcolor=blue;textcolor=yellow]".. @@ -293,34 +304,8 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param) "The quest steps listed here can be done in "..em("any order")..".\n".. "They have "..em("all").." to be achieved first in order for this current\n".. "quest step to become available.\n".. - "Usually this list is empty.]") - table.insert(formspec, "container_end[]") - - - -- right side (next quest step) - table.insert(formspec, "label[24.4,2.0;Achieving this quest step]".. - "label[24.4,2.4;"..em("helps").." the quester to:]".. - "container[24.2,2.7;5.6,10.8]".. - "box[0,0;5.6,8.5;#666666]".. - "label[0.1,0.5;get these quest step(s) "..em("next")..":]") - yl_speak_up.quest_step_show_table(formspec, "0.1,0.7;5.4,7.7;next_steps_show;", - required_for or {}) - table.insert(formspec, "tooltip[next_steps_show;".. - "Once the current quest step has been achieved by the\n".. - "player, the player can strive to achieve these next\n".. - "quest step(s).\n".. - "If this is empty, then it's either the/a last step (quest\n".. - "solved!) - or the quest is not properly set up.]") - table.insert(formspec, "container_end[]") - - -- middle (this quest step) - table.insert(formspec, "container[6,2.7;12,10.8]".. - "label[0.2,0.5;This quest step:]".. - "dropdown[0.7,0.7;17,0.7;curr_step_show;") - table.insert(formspec, minetest.formspec_escape(selected)) - table.insert(formspec, ";1;]") - table.insert(formspec, "container_end[]") - + "Usually this list is empty.]".. + "container_end[]") if( #step_data[selected].one_step_required > 0 or #step_data[selected].all_steps_required > 0) then if( #step_data[selected].one_step_required @@ -348,11 +333,32 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param) "Note: This only makes sense if there's just one or no\n".. " previous step.]") end + table.insert(formspec, "container_end[]") + + + -- right side (next quest step) + table.insert(formspec, "container[23.8,0;5.8,13.5]".. + "label[0.6,2.0;Achieving this quest step]".. + "label[0.6,2.4;"..em("helps").." the quester to:]".. + "container[0.4,2.7;5.6,10.8]".. + "box[0,0;5.6,8.5;#666666]".. + "label[0.2,0.5;get these quest step(s) "..em("next")..":]") + yl_speak_up.quest_step_show_table(formspec, "0.1,0.7;5.4,7.7;next_steps_show;", + required_for or {}) + table.insert(formspec, "tooltip[next_steps_show;".. + "Once the current quest step has been achieved by the\n".. + "player, the player can strive to achieve these next\n".. + "quest step(s).\n".. + "If this is empty, then it's either the/a last step (quest\n".. + "solved!) - or the quest is not properly set up.]") + table.insert(formspec, "container_end[]") + + if(required_for and #required_for > 0) then if(#required_for > 1) then table.insert(formspec, "style[show_next_step;bgcolor=red]") end - table.insert(formspec, "button[23.8,1.7;0.6,7.0;show_next_step;>]".. + table.insert(formspec, "button[0,1.7;0.6,7.0;show_next_step;>]".. "tooltip[show_next_step;Show the next step according to ".. em("your quest logic")..".\n".. "The button turns "..minetest.colorize("#FF0000", "red").. @@ -363,7 +369,7 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param) end if(#required_for <= 1) then table.insert(formspec, - "button[23.8,8.7;0.6,2.6;insert_before_next_step;+]".. + "button[0,8.7;0.6,2.6;insert_before_next_step;+]".. "tooltip[insert_before_next_step;".. "Insert a new quest step between "..em("current step").. " (shown\nin the middle) ".. @@ -371,6 +377,7 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param) "Note: This only makes sense if there's just one or no\n".. " next step.]") end + table.insert(formspec, "container_end[]") return table.concat(formspec, "") end