mirror of
https://gitea.your-land.de/Sokomine/yl_speak_up.git
synced 2025-06-19 13:48:02 +02:00
moved add_trade_simple in editor/ into fs/ subfolder
This commit is contained in:
parent
c0c3cae460
commit
7482061868
@ -148,6 +148,7 @@ yl_speak_up.add_to_command_help_text = yl_speak_up.add_to_command_help_text..
|
|||||||
-- -- trade one item(stack) against one other item(stack)
|
-- -- trade one item(stack) against one other item(stack)
|
||||||
-- dofile(modpath .. "api/api_trade_inv.lua")
|
-- dofile(modpath .. "api/api_trade_inv.lua")
|
||||||
dofile(modpath .. "trade_in_edit_mode.lua")
|
dofile(modpath .. "trade_in_edit_mode.lua")
|
||||||
|
dofile(modpath .. "fs/fs_add_trade_simple_in_edit_mode.lua")
|
||||||
-- dofile(modpath .. "fs/fs_do_trade_simple.lua")
|
-- dofile(modpath .. "fs/fs_do_trade_simple.lua")
|
||||||
-- handle back button diffrently when editing a trade as an action:
|
-- handle back button diffrently when editing a trade as an action:
|
||||||
dofile(modpath .. "fs/fs_do_trade_simple_in_edit_mode.lua")
|
dofile(modpath .. "fs/fs_do_trade_simple_in_edit_mode.lua")
|
||||||
|
31
editor/fs/fs_add_trade_simple_in_edit_mode.lua
Normal file
31
editor/fs/fs_add_trade_simple_in_edit_mode.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
-- override fs/fs_add_trade_simple.lua:
|
||||||
|
-- (this is kept here as it is trade related and does not change the formspec as such)
|
||||||
|
|
||||||
|
local old_input_add_trade_simple = yl_speak_up.input_add_trade_simple
|
||||||
|
yl_speak_up.input_add_trade_simple = function(player, formname, fields, input_to)
|
||||||
|
if(not(player)) then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
local pname = player:get_player_name()
|
||||||
|
|
||||||
|
input_to = "add_trade_simple"
|
||||||
|
-- are we editing an action of the type trade?
|
||||||
|
if( yl_speak_up.speak_to[pname][ "tmp_action" ]
|
||||||
|
and yl_speak_up.speak_to[pname][ "tmp_action" ].what == 3
|
||||||
|
and yl_speak_up.in_edit_mode(pname)
|
||||||
|
and yl_speak_up.edit_mode[pname] == n_id) then
|
||||||
|
input_to = "edit_actions"
|
||||||
|
end
|
||||||
|
|
||||||
|
return old_input_add_trade_simple(player, formname, fields, input_to)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
yl_speak_up.register_fs("add_trade_simple",
|
||||||
|
-- the input function is a new one now
|
||||||
|
yl_speak_up.input_add_trade_simple,
|
||||||
|
-- the get_fs function stays the same
|
||||||
|
yl_speak_up.get_fs_add_trade_simple_wrapper,
|
||||||
|
-- force formspec version 1 (not changed):
|
||||||
|
1
|
||||||
|
)
|
@ -68,36 +68,3 @@ yl_speak_up.delete_trade_simple = function(player, trade_id)
|
|||||||
end
|
end
|
||||||
return old_delete_trade_simple(player, trade_id)
|
return old_delete_trade_simple(player, trade_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- override fs/fs_add_trade_simple.lua:
|
|
||||||
-- (this is kept here as it is trade related and does not change the formspec as such)
|
|
||||||
|
|
||||||
local old_input_add_trade_simple = yl_speak_up.input_add_trade_simple
|
|
||||||
yl_speak_up.input_add_trade_simple = function(player, formname, fields, input_to)
|
|
||||||
if(not(player)) then
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
local pname = player:get_player_name()
|
|
||||||
|
|
||||||
input_to = "add_trade_simple"
|
|
||||||
-- are we editing an action of the type trade?
|
|
||||||
if( yl_speak_up.speak_to[pname][ "tmp_action" ]
|
|
||||||
and yl_speak_up.speak_to[pname][ "tmp_action" ].what == 3
|
|
||||||
and yl_speak_up.in_edit_mode(pname)
|
|
||||||
and yl_speak_up.edit_mode[pname] == n_id) then
|
|
||||||
input_to = "edit_actions"
|
|
||||||
end
|
|
||||||
|
|
||||||
return old_input_add_trade_simple(player, formname, fields, input_to)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
yl_speak_up.register_fs("add_trade_simple",
|
|
||||||
-- the input function is a new one now
|
|
||||||
yl_speak_up.input_add_trade_simple,
|
|
||||||
-- the get_fs function stays the same
|
|
||||||
yl_speak_up.get_fs_add_trade_simple_wrapper,
|
|
||||||
-- force formspec version 1 (not changed):
|
|
||||||
1
|
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user