2018-11-18 18:12:00 +02:00
|
|
|
local Event = require 'utils.event'
|
|
|
|
|
|
|
|
local SetupPlayer = {}
|
|
|
|
|
|
|
|
global.SetupPlayer = {
|
|
|
|
first_player_spawned = false,
|
|
|
|
}
|
|
|
|
|
|
|
|
function SetupPlayer.register(config)
|
2019-01-16 20:44:55 +02:00
|
|
|
Event.add(defines.events.on_player_created, function ()
|
2018-12-08 22:52:40 +02:00
|
|
|
local redmew_player_create = global.config.player_create
|
2018-11-18 18:12:00 +02:00
|
|
|
|
2018-12-08 22:52:40 +02:00
|
|
|
if #config.starting_items > 0 then
|
|
|
|
redmew_player_create.starting_items = config.starting_items
|
|
|
|
end
|
|
|
|
|
|
|
|
local cheats = config.cheats
|
|
|
|
local redmew_cheats = redmew_player_create.cheats
|
|
|
|
redmew_cheats.manual_mining_speed_modifier = cheats.manual_mining_speed_modifier
|
|
|
|
redmew_cheats.character_inventory_slots_bonus = cheats.character_inventory_slots_bonus
|
|
|
|
redmew_cheats.character_running_speed_modifier = cheats.character_running_speed_modifier
|
|
|
|
redmew_cheats.character_health_bonus = cheats.character_health_bonus
|
|
|
|
|
|
|
|
if #cheats.starting_items > 0 then
|
|
|
|
redmew_cheats.starting_items = cheats.starting_items
|
|
|
|
end
|
2018-11-18 18:12:00 +02:00
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
return SetupPlayer
|