forked from your-land-mirror/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)
|
||||
or (id_prefix == "p_" and data.what == 8)
|
||||
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)
|
||||
end
|
||||
|
||||
@ -1286,8 +1286,7 @@ yl_speak_up.get_fs_edit_option_p_and_e_state = function(pname, dialog, formspec,
|
||||
end
|
||||
var_list_text = var_list_text..","..minetest.formspec_escape(tostring(var_name))
|
||||
end
|
||||
return
|
||||
"label[0.2,3.3;"..text_variable.."]"..
|
||||
return "label[0.2,3.3;"..text_variable.."]"..
|
||||
"label[0.2,4.3;Name of variable:]"..
|
||||
"dropdown[0.2,4.8;6.5,0.6;select_variable;"..
|
||||
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
|
||||
save_button = ""
|
||||
end
|
||||
return
|
||||
"label[0.2,3.3;"..text_block_position.."]"..
|
||||
return "label[0.2,3.3;"..text_block_position.."]"..
|
||||
"dropdown[4.0,3.5;16.0,0.6;select_block;"..
|
||||
table.concat(check_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
|
||||
save_button = ""
|
||||
end
|
||||
return
|
||||
"label[0.2,3.3;If the action is a trade, the following shall be true:]"..
|
||||
return "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;"..
|
||||
table.concat(check_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
|
||||
save_button = ""
|
||||
end
|
||||
return
|
||||
"label[0.2,3.0;The following shall be true about the inventory:]"..
|
||||
return "label[0.2,3.0;The following shall be true about the inventory:]"..
|
||||
"dropdown[4.0,3.2;16.0,0.6;select_inv;"..
|
||||
table.concat(check_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 "..
|
||||
"be destroyed:"
|
||||
end
|
||||
formspec = formspec..
|
||||
"label[0.2,3.0;"..text.."]"..
|
||||
return "label[0.2,3.0;"..text.."]"..
|
||||
"label[0.2,3.5;Note: You can *save* this effect only if you have the "..
|
||||
"\"npc_master\" priv!]"..
|
||||
"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
|
||||
return
|
||||
"label[0.2,3.0;Move the player to this position:]"..
|
||||
return "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 "..
|
||||
"\"npc_master\" priv!]"..
|
||||
"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" ]
|
||||
end
|
||||
end
|
||||
return
|
||||
"label[0.2,3.0;Execute the following Lua code (ought to return true or false):]"..
|
||||
return "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 "..
|
||||
"\"npc_master\" priv!]"..
|
||||
"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
|
||||
return
|
||||
"label[8,2.6;Your invnetory:]"..
|
||||
return "label[8,2.6;Your invnetory:]"..
|
||||
"list[current_player;main;8,3;8,4;]"..
|
||||
"label[1,3.1;Your craft grid:]"..
|
||||
"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")
|
||||
end
|
||||
return
|
||||
"label[0.2,3.3;If the *previous* effect failed,]"..
|
||||
return "label[0.2,3.3;If the *previous* effect failed,]"..
|
||||
"label[0.2,3.8;switch to the following dialog:]"..
|
||||
"dropdown[5.0,3.5;6.5,0.6;select_on_failure;"..
|
||||
table.concat(sorted_dialog_list, ",")..";"..
|
||||
@ -1587,8 +1578,7 @@ yl_speak_up.get_fs_edit_option_effect_chat_all = function(pname, dialog, formspe
|
||||
end
|
||||
local default_text = "$NPC_NAME$ (owned by $OWNER_NAME$) announces: $PLAYER_NAME$ "..
|
||||
"- example; please enter the text -"
|
||||
return
|
||||
"label[0.2,3.3;Send the following chat message to *all* players:]"..
|
||||
return "label[0.2,3.3;Send the following chat message to *all* players:]"..
|
||||
"label[0.2,4.1;Message:]"..
|
||||
"field[2.0,3.8;16.0,0.6;chat_msg_text;;"..
|
||||
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).."]"
|
||||
end
|
||||
yl_speak_up.speak_to[pname].trade_id = data.trade_id
|
||||
return
|
||||
"label[8,2.6;Your invnetory:]"..
|
||||
return "label[8,2.6;Your invnetory:]"..
|
||||
"list[current_player;main;8,3;8,4;]"..
|
||||
"label[0.2,3.1;Configure trade with "..minetest.formspec_escape(dialog.n_npc)..":]"..
|
||||
"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
|
||||
bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]"
|
||||
end
|
||||
return
|
||||
"label[8,2.6;Your inventory:]"..
|
||||
return "label[8,2.6;Your inventory:]"..
|
||||
"list[current_player;main;8,3;8,4;]"..
|
||||
"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;]"..
|
||||
@ -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
|
||||
bg_img = "item_image[2.15,3.65;0.7,0.7;"..tostring(data.item_string).."]"
|
||||
end
|
||||
return
|
||||
"label[8,2.6;Your inventory:]"..
|
||||
return "label[8,2.6;Your inventory:]"..
|
||||
"list[current_player;main;8,3;8,4;]"..
|
||||
"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;]"..
|
||||
@ -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,
|
||||
table.indexof(sorted_dialog_list, e[ "a_on_failure" ]))
|
||||
end
|
||||
return
|
||||
"label[0.2,3.3;What to ask the player and which answer to expect:]"..
|
||||
return "label[0.2,3.3;What to ask the player and which answer to expect:]"..
|
||||
"label[0.2,4.0;Question to show:]"..
|
||||
"field[4.0,3.8;10.0,0.6;quest_question;;"..
|
||||
minetest.formspec_escape(
|
||||
@ -1766,7 +1752,7 @@ yl_speak_up.get_fs_edit_option_action_text_input = function(pname, dialog, forms
|
||||
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
|
||||
data.custom_param = e[ id_prefix.."value" ]
|
||||
if(id_prefix == "a_") then
|
||||
|
Loading…
Reference in New Issue
Block a user