mirror of
https://gitea.your-land.de/Sokomine/yl_speak_up.git
synced 2025-08-12 15:25:49 +02:00
completed get_fs_edit_option_p_and_e_block
This commit is contained in:
parent
1d00232341
commit
2fbb0384cb
@ -1063,10 +1063,6 @@ yl_speak_up.get_fs_edit_option_related = function(player, table_click_result,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- did the player get here through punching a block in the meantime?
|
|
||||||
local block_pos = yl_speak_up.speak_to[pname].block_punched
|
|
||||||
yl_speak_up.speak_to[pname].block_punched = nil
|
|
||||||
|
|
||||||
local data = yl_speak_up.speak_to[pname][ tmp_data_cache ]
|
local data = yl_speak_up.speak_to[pname][ tmp_data_cache ]
|
||||||
if(not(data) or not(data.what)) then
|
if(not(data) or not(data.what)) then
|
||||||
data = { what = 1}
|
data = { what = 1}
|
||||||
@ -1158,7 +1154,8 @@ yl_speak_up.get_fs_edit_option_related = function(player, table_click_result,
|
|||||||
-- (block is the third offered option in both preconditions and effects list)
|
-- (block is the third offered option in both preconditions and effects list)
|
||||||
elseif(data.what and data.what == 3 and id_prefix ~= "a_") then
|
elseif(data.what and data.what == 3 and id_prefix ~= "a_") then
|
||||||
return yl_speak_up.get_fs_edit_option_p_and_e_block(
|
return yl_speak_up.get_fs_edit_option_p_and_e_block(
|
||||||
pname, dialog, formspec, data, id_prefix, save_button, e)
|
pname, dialog, formspec, data, id_prefix, save_button, e,
|
||||||
|
text_block_position, values_block, check_block)
|
||||||
|
|
||||||
-- "a trade", -- 4
|
-- "a trade", -- 4
|
||||||
-- (trade - only for preconditions; effects have something else here)
|
-- (trade - only for preconditions; effects have something else here)
|
||||||
@ -1249,8 +1246,8 @@ end
|
|||||||
|
|
||||||
-- "an internal state (i.e. of a quest)", -- 2
|
-- "an internal state (i.e. of a quest)", -- 2
|
||||||
-- (state is the second offered option in both preconditions and effects list)
|
-- (state is the second offered option in both preconditions and effects list)
|
||||||
yl_speak_up.get_fs_edit_option_p_and_e_state = function(pname, dialog, formspec, data, id_prefix,
|
yl_speak_up.get_fs_edit_option_p_and_e_state = function(
|
||||||
save_button, e,
|
pname, dialog, formspec, data, id_prefix, save_button, e,
|
||||||
text_variable, text_select_value, text_select_operator,
|
text_variable, text_select_value, text_select_operator,
|
||||||
values_operator, check_operator, get_sorted_player_var_list_function )
|
values_operator, check_operator, get_sorted_player_var_list_function )
|
||||||
|
|
||||||
@ -1318,8 +1315,15 @@ yl_speak_up.get_fs_edit_option_p_and_e_state = function(pname, dialog, formspec,
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- TODO: block_pos as parameter?, values_block
|
-- "a block somewhere", -- 3
|
||||||
yl_speak_up.get_fs_edit_option_p_and_e_block = function(pname, dialog, formspec, data, id_prefix, save_button, e)
|
-- (block is the third offered option in both preconditions and effects list)
|
||||||
|
yl_speak_up.get_fs_edit_option_p_and_e_block = function(
|
||||||
|
pname, dialog, formspec, data, id_prefix, save_button, e,
|
||||||
|
text_block_position, values_block, check_block)
|
||||||
|
|
||||||
|
-- did the player get here through punching a block in the meantime?
|
||||||
|
local block_pos = yl_speak_up.speak_to[pname].block_punched
|
||||||
|
yl_speak_up.speak_to[pname].block_punched = nil
|
||||||
if(e) then
|
if(e) then
|
||||||
data.block = math.max(1,table.indexof(values_block, e[ id_prefix.."value" ]))
|
data.block = math.max(1,table.indexof(values_block, e[ id_prefix.."value" ]))
|
||||||
data.node_data = {}
|
data.node_data = {}
|
||||||
@ -1380,7 +1384,8 @@ 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 "label[0.2,3.3;"..text_block_position.."]"..
|
return formspec..
|
||||||
|
"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)..";]"..
|
||||||
|
Loading…
Reference in New Issue
Block a user