forked from Sokomine/yl_speak_up
looks more, but almost only identation in the new functions was corrected
This commit is contained in:
parent
506db0ea67
commit
e693af302c
@ -1234,7 +1234,7 @@ yl_speak_up.get_fs_edit_option_related = function(player, table_click_result,
|
|||||||
and ((id_prefix == "a_" and data.what == 7)
|
and ((id_prefix == "a_" and data.what == 7)
|
||||||
or (id_prefix == "p_" and data.what == 8)
|
or (id_prefix == "p_" and data.what == 8)
|
||||||
or (id_prefix == "r_" and data.what == 11))) then
|
or (id_prefix == "r_" and data.what == 11))) then
|
||||||
return yl_speak_up.get_fs_edit_option_action_custom(
|
return yl_speak_up.get_fs_edit_option_all_custom(
|
||||||
pname, dialog, formspec, data, id_prefix, save_button, e)
|
pname, dialog, formspec, data, id_prefix, save_button, e)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1286,8 +1286,7 @@ yl_speak_up.get_fs_edit_option_p_and_e_state = function(pname, dialog, formspec,
|
|||||||
end
|
end
|
||||||
var_list_text = var_list_text..","..minetest.formspec_escape(tostring(var_name))
|
var_list_text = var_list_text..","..minetest.formspec_escape(tostring(var_name))
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.3;"..text_variable.."]"..
|
||||||
"label[0.2,3.3;"..text_variable.."]"..
|
|
||||||
"label[0.2,4.3;Name of variable:]"..
|
"label[0.2,4.3;Name of variable:]"..
|
||||||
"dropdown[0.2,4.8;6.5,0.6;select_variable;"..
|
"dropdown[0.2,4.8;6.5,0.6;select_variable;"..
|
||||||
var_list_text..";"..
|
var_list_text..";"..
|
||||||
@ -1374,8 +1373,7 @@ yl_speak_up.get_fs_edit_option_p_and_e_block = function(pname, dialog, formspec,
|
|||||||
-- not enough selected yet for saving
|
-- not enough selected yet for saving
|
||||||
save_button = ""
|
save_button = ""
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.3;"..text_block_position.."]"..
|
||||||
"label[0.2,3.3;"..text_block_position.."]"..
|
|
||||||
"dropdown[4.0,3.5;16.0,0.6;select_block;"..
|
"dropdown[4.0,3.5;16.0,0.6;select_block;"..
|
||||||
table.concat(check_block, ",")..";"..
|
table.concat(check_block, ",")..";"..
|
||||||
tostring(data.block)..";]"..
|
tostring(data.block)..";]"..
|
||||||
@ -1404,8 +1402,7 @@ yl_speak_up.get_fs_edit_option_precondition_trade = function(pname, dialog, form
|
|||||||
-- not enough selected yet for saving
|
-- not enough selected yet for saving
|
||||||
save_button = ""
|
save_button = ""
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.3;If the action is a trade, the following shall be true:]"..
|
||||||
"label[0.2,3.3;If the action is a trade, the following shall be true:]"..
|
|
||||||
"dropdown[4.0,3.5;16.0,0.6;select_trade;"..
|
"dropdown[4.0,3.5;16.0,0.6;select_trade;"..
|
||||||
table.concat(check_trade, ",")..";"..
|
table.concat(check_trade, ",")..";"..
|
||||||
tostring(data.trade)..";]"..
|
tostring(data.trade)..";]"..
|
||||||
@ -1423,8 +1420,7 @@ yl_speak_up.get_fs_edit_option_precondition_inv = function(pname, dialog, formsp
|
|||||||
-- not enough selected yet for saving
|
-- not enough selected yet for saving
|
||||||
save_button = ""
|
save_button = ""
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.0;The following shall be true about the inventory:]"..
|
||||||
"label[0.2,3.0;The following shall be true about the inventory:]"..
|
|
||||||
"dropdown[4.0,3.2;16.0,0.6;select_inv;"..
|
"dropdown[4.0,3.2;16.0,0.6;select_inv;"..
|
||||||
table.concat(check_inv, ",")..";"..
|
table.concat(check_inv, ",")..";"..
|
||||||
tostring(data.inv)..";]"..
|
tostring(data.inv)..";]"..
|
||||||
@ -1452,8 +1448,7 @@ yl_speak_up.get_fs_edit_option_effect_give_item_or_take_item = function(pname, d
|
|||||||
text = "The following item shall be removed from the player's inventory and "..
|
text = "The following item shall be removed from the player's inventory and "..
|
||||||
"be destroyed:"
|
"be destroyed:"
|
||||||
end
|
end
|
||||||
formspec = formspec..
|
return "label[0.2,3.0;"..text.."]"..
|
||||||
"label[0.2,3.0;"..text.."]"..
|
|
||||||
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
||||||
"\"npc_master\" priv!]"..
|
"\"npc_master\" priv!]"..
|
||||||
"label[0.2,4.2;Name of the item(stack):]"..
|
"label[0.2,4.2;Name of the item(stack):]"..
|
||||||
@ -1481,8 +1476,7 @@ yl_speak_up.get_fs_edit_option_effect_move = function(pname, dialog, formspec, d
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.0;Move the player to this position:]"..
|
||||||
"label[0.2,3.0;Move the player to this position:]"..
|
|
||||||
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
||||||
"\"npc_master\" priv!]"..
|
"\"npc_master\" priv!]"..
|
||||||
"label[0.2,5.3;X:]"..
|
"label[0.2,5.3;X:]"..
|
||||||
@ -1502,8 +1496,7 @@ yl_speak_up.get_fs_edit_option_p_and_e_function = function(pname, dialog, formsp
|
|||||||
data.lua_code = e[ id_prefix.."value" ]
|
data.lua_code = e[ id_prefix.."value" ]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.0;Execute the following Lua code (ought to return true or false):]"..
|
||||||
"label[0.2,3.0;Execute the following Lua code (ought to return true or false):]"..
|
|
||||||
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
||||||
"\"npc_master\" priv!]"..
|
"\"npc_master\" priv!]"..
|
||||||
"textarea[0.2,4.5;20,4.0;lua_code;;"..
|
"textarea[0.2,4.5;20,4.0;lua_code;;"..
|
||||||
@ -1530,8 +1523,7 @@ yl_speak_up.get_fs_edit_option_effect_craft = function(pname, dialog, formspec,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return
|
return "label[8,2.6;Your invnetory:]"..
|
||||||
"label[8,2.6;Your invnetory:]"..
|
|
||||||
"list[current_player;main;8,3;8,4;]"..
|
"list[current_player;main;8,3;8,4;]"..
|
||||||
"label[1,3.1;Your craft grid:]"..
|
"label[1,3.1;Your craft grid:]"..
|
||||||
"list[current_player;craft;1,3.5;3,3;]"..
|
"list[current_player;craft;1,3.5;3,3;]"..
|
||||||
@ -1570,8 +1562,7 @@ yl_speak_up.get_fs_edit_option_effect_on_failure = function(pname, dialog, forms
|
|||||||
":]",
|
":]",
|
||||||
"button_edit_effect_on_failure_text_change")
|
"button_edit_effect_on_failure_text_change")
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.3;If the *previous* effect failed,]"..
|
||||||
"label[0.2,3.3;If the *previous* effect failed,]"..
|
|
||||||
"label[0.2,3.8;switch to the following dialog:]"..
|
"label[0.2,3.8;switch to the following dialog:]"..
|
||||||
"dropdown[5.0,3.5;6.5,0.6;select_on_failure;"..
|
"dropdown[5.0,3.5;6.5,0.6;select_on_failure;"..
|
||||||
table.concat(sorted_dialog_list, ",")..";"..
|
table.concat(sorted_dialog_list, ",")..";"..
|
||||||
@ -1587,8 +1578,7 @@ yl_speak_up.get_fs_edit_option_effect_chat_all = function(pname, dialog, formspe
|
|||||||
end
|
end
|
||||||
local default_text = "$NPC_NAME$ (owned by $OWNER_NAME$) announces: $PLAYER_NAME$ "..
|
local default_text = "$NPC_NAME$ (owned by $OWNER_NAME$) announces: $PLAYER_NAME$ "..
|
||||||
"- example; please enter the text -"
|
"- example; please enter the text -"
|
||||||
return
|
return "label[0.2,3.3;Send the following chat message to *all* players:]"..
|
||||||
"label[0.2,3.3;Send the following chat message to *all* players:]"..
|
|
||||||
"label[0.2,4.1;Message:]"..
|
"label[0.2,4.1;Message:]"..
|
||||||
"field[2.0,3.8;16.0,0.6;chat_msg_text;;"..
|
"field[2.0,3.8;16.0,0.6;chat_msg_text;;"..
|
||||||
minetest.formspec_escape(
|
minetest.formspec_escape(
|
||||||
@ -1626,8 +1616,7 @@ yl_speak_up.get_fs_edit_option_action_trade = function(pname, dialog, formspec,
|
|||||||
"item_image[5.15,4.35;0.7,0.7;"..tostring(data.pay).."]"
|
"item_image[5.15,4.35;0.7,0.7;"..tostring(data.pay).."]"
|
||||||
end
|
end
|
||||||
yl_speak_up.speak_to[pname].trade_id = data.trade_id
|
yl_speak_up.speak_to[pname].trade_id = data.trade_id
|
||||||
return
|
return "label[8,2.6;Your invnetory:]"..
|
||||||
"label[8,2.6;Your invnetory:]"..
|
|
||||||
"list[current_player;main;8,3;8,4;]"..
|
"list[current_player;main;8,3;8,4;]"..
|
||||||
"label[0.2,3.1;Configure trade with "..minetest.formspec_escape(dialog.n_npc)..":]"..
|
"label[0.2,3.1;Configure trade with "..minetest.formspec_escape(dialog.n_npc)..":]"..
|
||||||
"label[0.5,3.8;The customer pays:]"..
|
"label[0.5,3.8;The customer pays:]"..
|
||||||
@ -1649,8 +1638,7 @@ yl_speak_up.get_fs_edit_option_action_npc_gives = function(pname, dialog, formsp
|
|||||||
if(data and data.item_string) then
|
if(data and data.item_string) then
|
||||||
bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]"
|
bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]"
|
||||||
end
|
end
|
||||||
return
|
return "label[8,2.6;Your inventory:]"..
|
||||||
"label[8,2.6;Your inventory:]"..
|
|
||||||
"list[current_player;main;8,3;8,4;]"..
|
"list[current_player;main;8,3;8,4;]"..
|
||||||
"label[1,3.1;"..minetest.formspec_escape(dialog.n_npc or "?").." gives:]"..
|
"label[1,3.1;"..minetest.formspec_escape(dialog.n_npc or "?").." gives:]"..
|
||||||
"list[detached:yl_speak_up_player_"..pname..";npc_gives;2,3.5;1,1;]"..
|
"list[detached:yl_speak_up_player_"..pname..";npc_gives;2,3.5;1,1;]"..
|
||||||
@ -1696,8 +1684,7 @@ yl_speak_up.get_fs_edit_option_action_npc_wants = function(pname, dialog, formsp
|
|||||||
if(data and data.item_string) then
|
if(data and data.item_string) then
|
||||||
bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]"
|
bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]"
|
||||||
end
|
end
|
||||||
return
|
return "label[8,2.6;Your inventory:]"..
|
||||||
"label[8,2.6;Your inventory:]"..
|
|
||||||
"list[current_player;main;8,3;8,4;]"..
|
"list[current_player;main;8,3;8,4;]"..
|
||||||
"label[1,3.1;"..minetest.formspec_escape(dialog.n_npc or "?").." wants:]"..
|
"label[1,3.1;"..minetest.formspec_escape(dialog.n_npc or "?").." wants:]"..
|
||||||
"list[detached:yl_speak_up_player_"..pname..";npc_wants;2,3.5;1,1;]"..
|
"list[detached:yl_speak_up_player_"..pname..";npc_wants;2,3.5;1,1;]"..
|
||||||
@ -1734,8 +1721,7 @@ yl_speak_up.get_fs_edit_option_action_text_input = function(pname, dialog, forms
|
|||||||
data.action_failure_dialog = math.max(1,
|
data.action_failure_dialog = math.max(1,
|
||||||
table.indexof(sorted_dialog_list, e[ "a_on_failure" ]))
|
table.indexof(sorted_dialog_list, e[ "a_on_failure" ]))
|
||||||
end
|
end
|
||||||
return
|
return "label[0.2,3.3;What to ask the player and which answer to expect:]"..
|
||||||
"label[0.2,3.3;What to ask the player and which answer to expect:]"..
|
|
||||||
"label[0.2,4.0;Question to show:]"..
|
"label[0.2,4.0;Question to show:]"..
|
||||||
"field[4.0,3.8;10.0,0.6;quest_question;;"..
|
"field[4.0,3.8;10.0,0.6;quest_question;;"..
|
||||||
minetest.formspec_escape(
|
minetest.formspec_escape(
|
||||||
@ -1766,7 +1752,7 @@ yl_speak_up.get_fs_edit_option_action_text_input = function(pname, dialog, forms
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
yl_speak_up.get_fs_edit_option_action_custom = function(pname, dialog, formspec, data, id_prefix, save_button, e)
|
yl_speak_up.get_fs_edit_option_all_custom = function(pname, dialog, formspec, data, id_prefix, save_button, e)
|
||||||
if(e) then
|
if(e) then
|
||||||
data.custom_param = e[ id_prefix.."value" ]
|
data.custom_param = e[ id_prefix.."value" ]
|
||||||
if(id_prefix == "a_") then
|
if(id_prefix == "a_") then
|
||||||
|
Loading…
Reference in New Issue
Block a user