mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-09-16 09:16:22 +02:00
-implemented map style framework
-Removed all map styles from map_layout -Converted rail_grid.lua to be compatible with the framework
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
mymodule = {}
|
||||
|
||||
local function rot_pos(pos, rot)
|
||||
local ctr = {x = 15, y = 15}
|
||||
return {
|
||||
@@ -101,11 +103,8 @@ local function disable_items()
|
||||
force.recipes["express-underground-belt"].enabled = false
|
||||
end
|
||||
|
||||
local function on_init()
|
||||
global.map_gen_rng = game.create_random_generator()
|
||||
end
|
||||
|
||||
local function on_chunk_generated(event)
|
||||
function mymodule.on_chunk_generated(event)
|
||||
local bd_box = event.area
|
||||
local surface = event.surface
|
||||
local chunk_size = 32
|
||||
@@ -131,6 +130,6 @@ local function on_chunk_generated(event)
|
||||
end
|
||||
end
|
||||
|
||||
Event.register(defines.events.on_chunk_generated, on_chunk_generated)
|
||||
Event.register(defines.events.on_research_finished, disable_items)
|
||||
Event.register(-1, on_init)
|
||||
|
||||
|
||||
return mymodule
|
||||
|
26
locale/map_layout/sample.lua
Normal file
26
locale/map_layout/sample.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
--[[
|
||||
This is a sample file for a map style. You may register new events, but not on_chunk_generated.
|
||||
|
||||
Author: Valansch
|
||||
]]--
|
||||
|
||||
|
||||
--This is contains the module (Do not remove)
|
||||
local module = {}
|
||||
|
||||
local example_variable = "foo"
|
||||
|
||||
local function helper_function()
|
||||
--helper function code here
|
||||
end
|
||||
|
||||
--This function is called by the framework if the style is enabled.
|
||||
function mymodule.on_chunk_generated(event)
|
||||
game.print("Chunk was generated")
|
||||
end
|
||||
|
||||
|
||||
|
||||
--(Do not remove)
|
||||
return module
|
||||
--any code past this point will obviously not be executed
|
1861
map_layout.lua
1861
map_layout.lua
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user