2018-11-15 21:53:28 +02:00
|
|
|
local Game = require 'utils.game'
|
|
|
|
local Event = require 'utils.event'
|
2018-11-16 00:58:21 +02:00
|
|
|
|
|
|
|
local info = require 'features.gui.info'
|
2018-11-17 13:56:03 +02:00
|
|
|
local join_msgs = require 'resources.join_messages'
|
2018-11-15 21:53:28 +02:00
|
|
|
|
|
|
|
local function player_created(event)
|
|
|
|
local player = Game.get_player_by_index(event.player_index)
|
|
|
|
|
|
|
|
if not player or not player.valid then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if (global.scenario.config.fish_market.enable) then
|
|
|
|
player.insert {name = MARKET_ITEM, count = 10}
|
|
|
|
end
|
|
|
|
player.insert {name = 'iron-gear-wheel', count = 8}
|
|
|
|
player.insert {name = 'iron-plate', count = 16}
|
2018-11-16 00:58:21 +02:00
|
|
|
|
2018-11-17 13:56:03 +02:00
|
|
|
player.print('Welcome to this map created by the RedMew team. You can join our discord at: redmew.com/discord')
|
|
|
|
player.print('Click the question mark in the top left corner for server infomation and map details.')
|
2018-11-17 16:46:14 +02:00
|
|
|
player.print(table.get_random_weighted(join_msgs, 1, 2))
|
2018-11-15 21:53:28 +02:00
|
|
|
|
|
|
|
local gui = player.gui
|
|
|
|
gui.top.style = 'slot_table_spacing_horizontal_flow'
|
|
|
|
gui.left.style = 'slot_table_spacing_vertical_flow'
|
2018-11-16 00:58:21 +02:00
|
|
|
if info ~= nil then
|
|
|
|
info.show_info({player = player})
|
|
|
|
end
|
2018-11-15 21:53:28 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Event.add(defines.events.on_player_created, player_created)
|