1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

use player.zoom_to_world in toasts

This commit is contained in:
grilledham 2019-03-08 17:30:28 +00:00
parent a59089c496
commit c9cc32a1c0

View File

@ -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
)