From c9cc32a1c043f464710edf49a69e39ca71028f6d Mon Sep 17 00:00:00 2001 From: grilledham Date: Fri, 8 Mar 2019 17:30:28 +0000 Subject: [PATCH] use player.zoom_to_world in toasts --- map_gen/maps/crash_site/crash_site_toast.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/map_gen/maps/crash_site/crash_site_toast.lua b/map_gen/maps/crash_site/crash_site_toast.lua index 746ee09f..87e2dcb9 100644 --- a/map_gen/maps/crash_site/crash_site_toast.lua +++ b/map_gen/maps/crash_site/crash_site_toast.lua @@ -9,7 +9,6 @@ local market_signal = {type = 'virtual', name = 'signal-O'} local find_outpost_name = Gui.uid_name() function Public.do_outpost_toast(market, outpost_name, message) - local data = {market = market, outpost_name = outpost_name} Toast.toast_all_players_template( 15, function(container) @@ -21,7 +20,7 @@ function Public.do_outpost_toast(market, outpost_name, message) style = 'slot_button' } - Gui.set_data(sprite, data) + Gui.set_data(sprite, market.position) local label = container.add { @@ -41,11 +40,9 @@ Gui.on_click( function(event) local player = event.player local element = event.element - local data = Gui.get_data(element) - local market = data.market - local outpost_name = data.outpost_name + local position = Gui.get_data(element) - player.add_custom_alert(market, market_signal, outpost_name, true) + player.zoom_to_world(position, 0.5) end )