forked from Sokomine/yl_speak_up
added delete button to assign quest step in edit options menu
This commit is contained in:
parent
a334a2b989
commit
86f36dc26b
@ -38,6 +38,19 @@ yl_speak_up.input_fs_assign_quest_step = function(player, formname, fields)
|
||||
yl_speak_up.speak_to[pname][ "working_at" ] = "assign_quest_step"
|
||||
yl_speak_up.show_fs(player, "manage_quests", nil)
|
||||
return
|
||||
elseif(fields.delete and fields.delete ~= "") then
|
||||
dialog.n_dialogs[d_id].d_options[o_id].quest_id = nil
|
||||
dialog.n_dialogs[d_id].d_options[o_id].quest_step = nil
|
||||
if(not(yl_speak_up.npc_was_changed[ n_id ])) then
|
||||
yl_speak_up.npc_was_changed[ n_id ] = {}
|
||||
end
|
||||
table.insert(yl_speak_up.npc_was_changed[ n_id ],
|
||||
"Dialog "..d_id..": Option "..tostring(o_id)..
|
||||
" no longer provides quest step \""..
|
||||
tostring(fields.quest_step).."\" for quest \""..tostring(fields.quest_id).."\".")
|
||||
yl_speak_up.show_fs(player, "edit_option_dialog",
|
||||
{n_id = n_id, d_id = d_id, o_id = o_id})
|
||||
return
|
||||
elseif(not(fields) or not(fields.save)) then
|
||||
return
|
||||
end
|
||||
@ -109,6 +122,10 @@ yl_speak_up.get_fs_assign_quest_step = function(player, param)
|
||||
selected = i
|
||||
end
|
||||
end
|
||||
local delete_button = ""
|
||||
if(quest_step and quest_step ~= "" and quest_id and quest_id ~= "") then
|
||||
delete_button = "button[4.0,3.0;2.0,0.8;delete;Delete]"
|
||||
end
|
||||
return "size[14,4]"..
|
||||
"label[4.0,0.5;Using this option/answer shall be a quest step.]"..
|
||||
"label[0.2,1.4;Select a quest:]"..
|
||||
@ -119,6 +136,7 @@ yl_speak_up.get_fs_assign_quest_step = function(player, param)
|
||||
"field[4.0,2.0;9.5,0.8;quest_step;;"..
|
||||
minetest.formspec_escape(quest_step).."]"..
|
||||
"button[0.2,3.0;3.6,0.8;manage_quests;Manage Quests]"..
|
||||
delete_button..
|
||||
"button[6.5,3.0;2.0,0.8;save;Save]"..
|
||||
"button[9.0,3.0;2.0,0.8;back;Abort]"..
|
||||
"button[11.5,3.0;2.0,0.8;back;Back]"
|
||||
|
Loading…
Reference in New Issue
Block a user