Skip to content

Commit

Permalink
Merge pull request #35 from jpanther/mod-support
Browse files Browse the repository at this point in the history
Add third party mod support
  • Loading branch information
jpanther authored Oct 20, 2017
2 parents 9976213 + 76a0f79 commit 23f5e57
Show file tree
Hide file tree
Showing 78 changed files with 1,066 additions and 911 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ The latest stable release is available at <https://github.com/jpanther/Dectorio/

### Added
* New in-game settings for configuring Dectorio (replaces the old settings that were configured via config.lua)
* Landscaping support for Alien Biomes mod

### Changed
* Concrete recipe no longer requires iron sticks and reverts to the vanilla iron ore recipe
* Concrete walls now require iron sticks to craft
* Adjusted flooring layer priority so they appear correctly when placed adjacent to each other (order is now ground > gravel > stone path > wood floor > concrete)
* Tweaked minimap colours for some flooring styles

## v0.6.2 - 2017-10-10

Expand Down
6 changes: 6 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ DECT.CONFIG.SETTINGS = {
DECT.CONFIG.PAINT_VARIANTS = {"danger", "emergency", "caution", "radiation", "defect", "operations", "safety"}
DECT.CONFIG.SIGN_CATEGORIES = {"item", "fluid", "tool", "ammo", "armor", "capsule", "gun", "mining-tool", "module"}
DECT.CONFIG.SIGN_BLACKLIST = {"barrel", "loader", "simple%-entity", "player%-port", "computer", "coin", "small%-plane", "railgun", "vehicle%-machine%-gun", "tank%-machine%-gun", "factory%-1%-", "factory%-2%-", "factory%-3%-"}
DECT.CONFIG.BASE_TILES = {"dirt", "sand", "sand-dark", "grass", "grass-dry", "red-desert", "red-desert-dark", "water", "water-green"}

DECT.INCOMPATIBLE = {}
DECT.INCOMPATIBLE.REASONS = {
Expand Down Expand Up @@ -138,6 +139,11 @@ DECT.INCOMPATIBLE.MODS = {
component = "walls",
reason = "tech"
},
["no-walls"] = {
name = "no-walls",
component = "walls",
reason = "disable"
},
}

return DECT
75 changes: 2 additions & 73 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,79 +76,8 @@ end
-- Check if any technologies or recipes need to be enabled
local function unlock_tech_and_recipes()
for _,force in pairs(game.forces) do

local tech = force.technologies
local rec = force.recipes

if DECT.ENABLED["landscaping"] then
if rec["dect-base-dirt"].enabled then
tech["dect-landscaping"].researched = true
end
if tech["dect-landscaping"].researched then
rec["dect-base-dirt"].enabled = true
rec["dect-base-sand"].enabled = true
rec["dect-base-sand-dark"].enabled = true
rec["dect-base-grass"].enabled = true
rec["dect-base-grass-dry"].enabled = true
rec["dect-base-red-desert"].enabled = true
rec["dect-base-red-desert-dark"].enabled = true
end
if tech["landfill"].researched then
rec["dect-base-water"].enabled = true
rec["dect-base-water-green"].enabled = true
end
end
if DECT.ENABLED["wood-floor"] then
if rec["dect-wood-floor"].enabled then
tech["dect-wood-floor"].researched = true
end
if tech["dect-wood-floor"].researched then
rec["dect-wood-floor"].enabled = true
end
end
if DECT.ENABLED["painted-concrete"] then
if rec["dect-paint-emergency"].enabled then
tech["dect-concrete-paint"].researched = true
end
if tech["dect-concrete-paint"].researched then
for _, variant in pairs(DECT.CONFIG.PAINT_VARIANTS) do
rec["dect-paint-"..variant].enabled = true
end
rec["hazard-concrete"].enabled = true
end
end
if DECT.ENABLED["walls"] then
if rec["stone-wall"].enabled then
tech["stone-walls"].researched = true
end
if rec["dect-concrete-wall"].enabled then
tech["dect-advanced-walls"].researched = true
end
if tech["stone-walls"].researched then
rec["dect-wood-wall"].enabled = true
rec["stone-wall"].enabled = true
end
if tech["dect-advanced-walls"].researched then
rec["dect-chain-wall"].enabled = true
rec["dect-concrete-wall"].enabled = true
rec["dect-concrete-wall-from-stone-wall"].enabled = true
end
if tech["gates"].researched then
rec["dect-hazard-gate"].enabled = true
end
end
if DECT.ENABLED["signs"] then
if rec["dect-sign-wood"].enabled then
tech["dect-signs"].researched = true
end
if tech["dect-signs"].researched then
rec["dect-sign-wood"].enabled = true
rec["dect-sign-steel"].enabled = true
end
end
if tech["optics"].researched then
rec["dect-small-lamp-glow"].enabled = true
end
force.reset_recipes()
force.reset_technologies()
end
end

Expand Down
5 changes: 3 additions & 2 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- data-final-fixes.lua

require("prototypes.style")
require("prototypes.entity.sign-icons")
require("prototypes.style.gui")

require("prototypes.entity.signs-icons")
3 changes: 3 additions & 0 deletions data-updates.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- data-updates.lua

require("prototypes.third-party.alien-biomes")
30 changes: 25 additions & 5 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,29 @@
-- data.lua

DECT = require("config")
require("prototypes.entity.entities")
require("prototypes.item.items")
require("prototypes.recipe.recipes")

require("prototypes.entity.lamp")
require("prototypes.entity.signs")
require("prototypes.entity.walls")

require("prototypes.item.flooring")
require("prototypes.item.lamp")
require("prototypes.item.landscaping")
require("prototypes.item.signs")
require("prototypes.item.walls")

require("prototypes.recipe.flooring")
require("prototypes.recipe.lamp")
require("prototypes.recipe.landscaping")
require("prototypes.recipe.signs")
require("prototypes.recipe.walls")

require("prototypes.tile.tiles")
require("prototypes.technology.technology")
require("prototypes.signal.signal")

require("prototypes.technology.flooring")
require("prototypes.technology.lamp")
require("prototypes.technology.landscaping")
require("prototypes.technology.signs")
require("prototypes.technology.walls")

require("prototypes.signal.signals")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/third-party/alien-biomes/icons/dirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/third-party/alien-biomes/icons/grass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/third-party/alien-biomes/icons/sand.png
Binary file added graphics/third-party/alien-biomes/icons/snow.png
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contact": "",
"homepage": "https://github.com/jpanther/Dectorio",
"factorio_version": "0.15",
"dependencies": ["base >= 0.15"],
"dependencies": ["base >= 0.15", "? alien-biomes >= 0.2.7"],
"license": "GNU GPLv3",
"description": "Adds decorative elements to beautify your factory. Currently includes coloured signals, wooden, chain-link, stone and concrete walls, hazard gates, signs, wooden floorboards, gravel and painted concrete styles."
}
1 change: 1 addition & 0 deletions locale/en/notifications.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dect-notify-newversion=[__1__] Updated from version __2__ to version __3__.
dect-notify-incompatible=[__1__] Warning: An incompatible mod has been detected!
dect-notify-reason-signals=[__1__] Reason: '__2__' overwrites signal data. It is recommended to disable '__2__'.
dect-notify-reason-tech=[__1__] Reason: '__2__' duplicates technology that is already in Dectorio. It is recommended to disable '__2__'.
dect-notify-reason-disable=[__1__] Reason: '__2__' disables functionality that is added by Dectorio. It is recommended to disable '__2__'.
dect-notify-modportal=[__1__] Refer to the mod portal for further details.
2 changes: 1 addition & 1 deletion migrations/0.5.3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for index, force in pairs(game.forces) do
local rec = force.recipes

if settings.startup["dectorio-landscaping"].value then
if tech["dect-landscaping"].researched then
if tech["dect-landscaping"].researched and rec["dect-base-dirt"] then
rec["dect-base-dirt"].enabled = true
rec["dect-base-sand"].enabled = true
rec["dect-base-sand-dark"].enabled = true
Expand Down
2 changes: 1 addition & 1 deletion migrations/0.5.8.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for index, force in pairs(game.forces) do
local rec = force.recipes

if settings.startup["dectorio-landscaping"].value then
if tech["landfill"].researched then
if tech["landfill"].researched and rec["dect-base-water"] then
rec["dect-base-water"].enabled = true
rec["dect-base-water-green"].enabled = true
end
Expand Down
22 changes: 22 additions & 0 deletions migrations/0.7.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
for index, force in pairs(game.forces) do

force.reset_recipes()
force.reset_technologies()

local tech = force.technologies
local rec = force.recipes

if settings.startup["dectorio-landscaping"].value then
if tech["dect-landscaping"].researched and data.raw["tree"]["coral-lava-01"] then
alien_biomes = {
"grass-red","grass-orange","grass-yellow","grass-yellow-fade","grass-dry","grass-medium","grass","grass-blue-fade","grass-blue","grass-purple-fade","grass-purple",
"dirt-red","dirt-brown","dirt-tan","dirt","dirt-dull","dirt-grey","dirt-red-dark","dirt-brown-dark","dirt-tan-dark","dirt-dark","dirt-dull-dark","dirt-grey-dark",
"sand-red","sand-orange","sand-gold","sand","sand-dull","sand-grey","sand-red-dark","sand-orange-dark","sand-gold-dark","sand-dark","sand-dull-dark","sand-grey-dark",
"snow","volcanic-cool","volcanic-medium","volcanic-hot"
}
for _, tile in pairs(alien_biomes) do
rec["dect-alien-biomes-"..tile].enabled = true
end
end
end
end
13 changes: 13 additions & 0 deletions prototypes/entity/lamp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- entity/lamp

-- Add glowing coloured lamp
local lamp = util.table.deepcopy(data.raw["lamp"]["small-lamp"])
lamp.name = "dect-small-lamp-glow"
lamp.icon = "__Dectorio__/graphics/icons/small-lamp-glow.png"
lamp.minable.result = "dect-small-lamp-glow"
lamp.glow_size = 25
lamp.glow_color_intensity = 0.8
lamp.glow_render_mode = "multiplicative"
lamp.light_when_colored.size = 0
lamp.light_when_colored.intensity = 0
data:extend({lamp})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- sign-icons.lua
-- entity/sign-icons

if DECT.ENABLED["signs"] then

Expand Down
56 changes: 56 additions & 0 deletions prototypes/entity/signs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
-- entity/signs

if DECT.ENABLED["signs"] then

data:extend({
{
type = "simple-entity",
name = "dect-sign-wood",
icon = "__Dectorio__/graphics/icons/sign-wood.png",
flags = {"placeable-neutral"},
render_layer = "object",
minable = {mining_time = 1, result = "dect-sign-wood", count = 1},
max_health = 40,
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
drawing_box = {{-0.5, -1.6}, {0.5, 0.5}},
repair_sound = { filename = "__base__/sound/manual-repair-simple.ogg" },
mined_sound = { filename = "__Dectorio__/sound/deconstruct-wood.ogg" },
vehicle_impact_sound = {filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0},
pictures = {
{
filename = "__Dectorio__/graphics/entity/sign-wood/sign-wood.png",
priority = "extra-high",
width = 85,
height = 65,
shift = {0.8, -0.45}
}
}
},
{
type = "simple-entity",
name = "dect-sign-steel",
icon = "__Dectorio__/graphics/icons/sign-steel.png",
flags = {"placeable-neutral"},
render_layer = "object",
minable = {mining_time = 1, result = "dect-sign-steel", count = 1},
max_health = 40,
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
drawing_box = {{-0.5, -1.6}, {0.5, 0.5}},
repair_sound = { filename = "__base__/sound/manual-repair-simple.ogg" },
mined_sound = { filename = "__base__/sound/deconstruct-bricks.ogg" },
vehicle_impact_sound = {filename = "__base__/sound/car-metal-impact.ogg", volume = 1.0},
pictures = {
{
filename = "__Dectorio__/graphics/entity/sign-steel/sign-steel.png",
priority = "extra-high",
width = 85,
height = 65,
shift = {0.77, -0.45}
}
}
}
})

end
71 changes: 2 additions & 69 deletions prototypes/entity/entities.lua → prototypes/entity/walls.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- entities.lua
-- entity/walls

if DECT.ENABLED["walls"] then

Expand Down Expand Up @@ -1263,71 +1263,4 @@ if DECT.ENABLED["walls"] then
dect_hazard_gate.horizontal_rail_animation_right.layers[1].filename = "__Dectorio__/graphics/entity/hazard-gate/gate-rail-horizontal-right.png"
data:extend({dect_hazard_gate})

end

if DECT.ENABLED["signs"] then

data:extend({
{
type = "simple-entity",
name = "dect-sign-wood",
icon = "__Dectorio__/graphics/icons/sign-wood.png",
flags = {"placeable-neutral"},
render_layer = "object",
minable = {mining_time = 1, result = "dect-sign-wood", count = 1},
max_health = 40,
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
drawing_box = {{-0.5, -1.6}, {0.5, 0.5}},
repair_sound = { filename = "__base__/sound/manual-repair-simple.ogg" },
mined_sound = { filename = "__Dectorio__/sound/deconstruct-wood.ogg" },
vehicle_impact_sound = {filename = "__base__/sound/car-wood-impact.ogg", volume = 1.0},
pictures = {
{
filename = "__Dectorio__/graphics/entity/sign-wood/sign-wood.png",
priority = "extra-high",
width = 85,
height = 65,
shift = {0.8, -0.45}
}
}
},
{
type = "simple-entity",
name = "dect-sign-steel",
icon = "__Dectorio__/graphics/icons/sign-steel.png",
flags = {"placeable-neutral"},
render_layer = "object",
minable = {mining_time = 1, result = "dect-sign-steel", count = 1},
max_health = 40,
collision_box = {{-0.15, -0.15}, {0.15, 0.15}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
drawing_box = {{-0.5, -1.6}, {0.5, 0.5}},
repair_sound = { filename = "__base__/sound/manual-repair-simple.ogg" },
mined_sound = { filename = "__base__/sound/deconstruct-bricks.ogg" },
vehicle_impact_sound = {filename = "__base__/sound/car-metal-impact.ogg", volume = 1.0},
pictures = {
{
filename = "__Dectorio__/graphics/entity/sign-steel/sign-steel.png",
priority = "extra-high",
width = 85,
height = 65,
shift = {0.77, -0.45}
}
}
}
})

end

-- Add glowing coloured lamp
local lamp = util.table.deepcopy(data.raw["lamp"]["small-lamp"])
lamp.name = "dect-small-lamp-glow"
lamp.icon = "__Dectorio__/graphics/icons/small-lamp-glow.png"
lamp.minable.result = "dect-small-lamp-glow"
lamp.glow_size = 25
lamp.glow_color_intensity = 0.8
lamp.glow_render_mode = "multiplicative"
lamp.light_when_colored.size = 0
lamp.light_when_colored.intensity = 0
data:extend({lamp})
end
Loading

0 comments on commit 23f5e57

Please sign in to comment.