forked from your-land-mirror/yl_speak_up
manage variables/quests: made local functions with fun_ prefix distinct from the input_ function
This commit is contained in:
parent
f37f07c722
commit
abbb8cf123
@ -1,6 +1,6 @@
|
||||
-- helper functions for yl_speak_up.input_fs_manage_quests(..)
|
||||
-- returns the index of the new quest
|
||||
yl_speak_up.input_fs_manage_quests_add_new_entry = function(pname, entry_name)
|
||||
yl_speak_up.fun_input_fs_manage_quests_add_new_entry = function(pname, entry_name)
|
||||
local res = yl_speak_up.add_quest(pname, entry_name,
|
||||
"Name of your quest",
|
||||
"Enter a longer description here for describing the quest "..
|
||||
@ -18,7 +18,7 @@ end
|
||||
|
||||
-- helper functions for yl_speak_up.input_fs_manage_quests(..)
|
||||
-- returns a text describing if deleting the quest worked
|
||||
yl_speak_up.input_fs_manage_quests_del_old_entry = function(pname, entry_name)
|
||||
yl_speak_up.fun_input_fs_manage_quests_del_old_entry = function(pname, entry_name)
|
||||
-- get q_id from entry_name
|
||||
local q_id = yl_speak_up.get_quest_id_by_var_name(entry_name, pname)
|
||||
return yl_speak_up.del_quest(q_id, pname)
|
||||
@ -27,7 +27,7 @@ end
|
||||
-- helper functions for yl_speak_up.input_fs_manage_quests(..)
|
||||
-- implements all the functions that are specific to managing quests and not part of
|
||||
-- general item management
|
||||
yl_speak_up.input_fs_manage_quests_check_fields = function(player, formname, fields, quest_name, list_of_entries)
|
||||
yl_speak_up.fun_input_fs_manage_quests_check_fields = function(player, formname, fields, quest_name, list_of_entries)
|
||||
local pname = player:get_player_name()
|
||||
if(not(quest_name)) then
|
||||
quest_name = ""
|
||||
@ -69,10 +69,10 @@ yl_speak_up.input_fs_manage_quests = function(player, formname, fields)
|
||||
local res = yl_speak_up.input_fs_manage_general(player, formname, fields,
|
||||
-- what_is_the_list_about, min_length, max_length, function_add_new_entry,
|
||||
"quest", 2, 80,
|
||||
yl_speak_up.input_fs_manage_quests_add_new_entry,
|
||||
yl_speak_up.fun_input_fs_manage_quests_add_new_entry,
|
||||
quest_list,
|
||||
yl_speak_up.input_fs_manage_quests_del_old_entry,
|
||||
yl_speak_up.input_fs_manage_quests_check_fields)
|
||||
yl_speak_up.fun_input_fs_manage_quests_del_old_entry,
|
||||
yl_speak_up.fun_input_fs_manage_quests_check_fields)
|
||||
return true
|
||||
end
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
-- helper functions for yl_speak_up.input_fs_manage_variables(..)
|
||||
-- returns the index of the new variable
|
||||
yl_speak_up.input_fs_manage_variables_add_new_entry = function(pname, entry_name)
|
||||
yl_speak_up.fun_input_fs_manage_variables_add_new_entry = function(pname, entry_name)
|
||||
local res = yl_speak_up.add_quest_variable(pname, entry_name)
|
||||
if(not(res)) then
|
||||
return -1
|
||||
@ -15,7 +15,7 @@ end
|
||||
|
||||
-- helper functions for yl_speak_up.input_fs_manage_variables(..)
|
||||
-- returns a text describing if deleting the variable worked
|
||||
yl_speak_up.input_fs_manage_variables_del_old_entry = function(pname, entry_name)
|
||||
yl_speak_up.fun_input_fs_manage_variables_del_old_entry = function(pname, entry_name)
|
||||
-- delete (empty) variable
|
||||
return yl_speak_up.del_quest_variable(pname, entry_name, nil)
|
||||
end
|
||||
@ -23,7 +23,7 @@ end
|
||||
-- helper functions for yl_speak_up.input_fs_manage_variables(..)
|
||||
-- implements all the functions that are specific to managing variables and not part of
|
||||
-- general item management
|
||||
yl_speak_up.input_fs_manage_variables_check_fields = function(player, formname, fields, var_name, list_of_entries)
|
||||
yl_speak_up.fun_input_fs_manage_variables_check_fields = function(player, formname, fields, var_name, list_of_entries)
|
||||
local pname = player:get_player_name()
|
||||
if(not(var_name)) then
|
||||
var_name = ""
|
||||
@ -281,10 +281,10 @@ yl_speak_up.input_fs_manage_variables = function(player, formname, fields)
|
||||
local res = yl_speak_up.input_fs_manage_general(player, formname, fields,
|
||||
-- what_is_the_list_about, min_length, max_length, function_add_new_entry,
|
||||
"variable", 2, 30,
|
||||
yl_speak_up.input_fs_manage_variables_add_new_entry,
|
||||
yl_speak_up.fun_input_fs_manage_variables_add_new_entry,
|
||||
list_of_entries,
|
||||
yl_speak_up.input_fs_manage_variables_del_old_entry,
|
||||
yl_speak_up.input_fs_manage_variables_check_fields)
|
||||
yl_speak_up.fun_input_fs_manage_variables_del_old_entry,
|
||||
yl_speak_up.fun_input_fs_manage_variables_check_fields)
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user