forked from your-land-mirror/yl_speak_up
		
	show_fs: add/do_trade_simple
This commit is contained in:
		
							parent
							
								
									e27809d4d7
								
							
						
					
					
						commit
						9f44bb1961
					
				| @ -285,3 +285,20 @@ yl_speak_up.input_add_trade_simple = function(player, formname, fields, input_to | ||||
| 	end | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| yl_speak_up.get_fs_add_trade_simple_wrapper = function(player, param) | ||||
| 	local pname = player:get_player_name() | ||||
| 	-- the optional parameter param is the trade_id | ||||
| 	if(not(param) and yl_speak_up.speak_to[pname]) then | ||||
| 		param = yl_speak_up.speak_to[pname].trade_id | ||||
| 	end | ||||
| 	return yl_speak_up.get_fs_add_trade_simple(player, param) | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| yl_speak_up.register_fs("add_trade_simple", | ||||
| 	yl_speak_up.input_add_trade_simple, | ||||
| 	yl_speak_up.get_fs_add_trade_simple_wrapper, | ||||
| 	-- force formspec version 1: | ||||
| 	1 | ||||
| ) | ||||
|  | ||||
| @ -409,3 +409,20 @@ yl_speak_up.get_fs_do_trade_simple = function(player, trade_id) | ||||
| 		"label[6.0,1.5;"..trades_done.."]" | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| yl_speak_up.get_fs_do_trade_simple_wrapper = function(player, param) | ||||
| 	local pname = player:get_player_name() | ||||
| 	-- the optional parameter param is the trade_id | ||||
| 	if(not(param) and yl_speak_up.speak_to[pname]) then | ||||
| 		param = yl_speak_up.speak_to[pname].trade_id | ||||
| 	end | ||||
| 	return yl_speak_up.get_fs_do_trade_simple(player, param) | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| yl_speak_up.register_fs("do_trade_simple", | ||||
| 	yl_speak_up.input_do_trade_simple, | ||||
| 	yl_speak_up.get_fs_do_trade_simple_wrapper, | ||||
| 	-- force formspec version 1: | ||||
| 	1 | ||||
| ) | ||||
|  | ||||
							
								
								
									
										24
									
								
								show_fs.lua
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								show_fs.lua
									
									
									
									
									
								
							| @ -48,18 +48,10 @@ yl_speak_up.input_handler = function(player, formname, fields) | ||||
| 	elseif formname == "yl_speak_up:player_offers_item" then | ||||
| 		yl_speak_up.input_player_offers_item(player, formname, fields) | ||||
| 		return true | ||||
| 	-- handled in fs/fs_do_trade_simple.lua | ||||
| 	elseif formname == "yl_speak_up:do_trade_simple" then | ||||
| 		yl_speak_up.input_do_trade_simple(player, formname, fields) | ||||
| 		return true | ||||
| 	-- handled in fs_trade_via_buy_button.lua | ||||
| 	elseif formname == "yl_speak_up:trade_via_buy_button" then | ||||
| 		yl_speak_up.input_trade_via_buy_button(player, formname, fields) | ||||
| 		return true | ||||
| 	-- (as above - also handled in trade_simple.lua) | ||||
| 	elseif formname == "yl_speak_up:add_trade_simple" then | ||||
| 		yl_speak_up.input_add_trade_simple(player, formname, fields) | ||||
| 		return true | ||||
| 	-- handled in fs_initial_config.lua | ||||
| 	elseif formname == "yl_speak_up:initial_config" then | ||||
| 		yl_speak_up.input_fs_initial_config(player, formname, fields) | ||||
| @ -232,14 +224,6 @@ yl_speak_up.show_fs = function(player, fs_name, param) | ||||
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:player_offers_item", | ||||
| 			yl_speak_up.get_fs_player_offers_item(player, param), 1) | ||||
| 
 | ||||
| 	elseif(fs_name == "trade_simple") then | ||||
| 		-- the optional parameter param is the trade_id | ||||
| 		if(not(param) and yl_speak_up.speak_to[pname]) then | ||||
| 			param = yl_speak_up.speak_to[pname].trade_id | ||||
| 		end | ||||
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:do_trade_simple", | ||||
| 			yl_speak_up.get_fs_do_trade_simple(player, param), 1) | ||||
| 
 | ||||
| 	elseif(fs_name == "trade_via_buy_button") then | ||||
| 		-- the optional parameter param is the trade_id | ||||
| 		if(not(param) and yl_speak_up.speak_to[pname]) then | ||||
| @ -248,14 +232,6 @@ yl_speak_up.show_fs = function(player, fs_name, param) | ||||
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:trade_via_buy_button", | ||||
| 			yl_speak_up.get_fs_trade_via_buy_button(player, param), 1) | ||||
| 
 | ||||
| 	elseif(fs_name == "add_trade_simple") then | ||||
| 		-- the optional parameter param is the trade_id | ||||
| 		if(not(param) and yl_speak_up.speak_to[pname]) then | ||||
| 			param = yl_speak_up.speak_to[pname].trade_id | ||||
| 		end | ||||
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:add_trade_simple", | ||||
| 			yl_speak_up.get_fs_add_trade_simple(player, param), 1) | ||||
| 
 | ||||
| 	elseif(fs_name == "initial_config") then | ||||
| 		if(not(param)) then | ||||
| 			param = {} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user