slightly less color in tooltips in fs_manage_quest_steps

This commit is contained in:
Sokomine 2023-09-21 20:36:43 +02:00
parent b451432b84
commit 6a24488ac2

View File

@ -331,16 +331,23 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param)
table.insert(formspec, ";1;]")
table.insert(formspec, "container_end[]")
if( (step_data[selected].one_step_required and #step_data[selected].one_step_required > 0)
or(step_data[selected].all_steps_required and #step_data[selected].all_steps_required > 0)) then
if( #step_data[selected].one_step_required > 0
or #step_data[selected].all_steps_required > 0) then
if( #step_data[selected].one_step_required
+ #step_data[selected].all_steps_required > 1) then
table.insert(formspec, "style[show_prev_step;bgcolor=red]")
end
table.insert(formspec, "button[5.6,1.7;0.6,7.0;show_prev_step;<]"..
"tooltip[show_prev_step;Show the previous step according to "..
em("your quest logic")..".\n"..
"The button turns "..minetest.colorize("#FF0000", "red")..
" if there is more than one option. In such\na case "..
"the alphabeticly first previous quest step is choosen.\n"..
"The other "..em("< Prev").." button shows the previous step "..
"in\n"..em("alphabetical order")..".]")
end
-- add buttons for inserting steps between this and the prev/next one
if(not(step_data[selected].one_step_required) or #step_data[selected].one_step_required <= 1) then
if(#step_data[selected].one_step_required <= 1) then
table.insert(formspec,
"button[5.6,8.7;0.6,2.6;insert_after_prev_step;+]"..
"tooltip[insert_after_prev_step;"..
@ -352,9 +359,15 @@ yl_speak_up.get_fs_manage_quest_steps = function(player, param)
" previous step.]")
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;>]"..
"tooltip[show_next_step;Show the next step according to "..
em("your quest logic")..".\n"..
"The button turns "..minetest.colorize("#FF0000", "red")..
" if there is more than one option. In such\na case "..
"the alphabeticly first next quest step is choosen.\n"..
"The other "..em("Next >").." button shows the next step "..
"in\n"..em("alphabetical order")..".]")
end