Skip to content

Commit

Permalink
Merge pull request #36 from jpanther/terrain
Browse files Browse the repository at this point in the history
New traffic bollard, gravel and landscaping items
  • Loading branch information
jpanther authored Oct 26, 2017
2 parents 653d40f + 6ee051a commit f95f89e
Show file tree
Hide file tree
Showing 48 changed files with 354 additions and 35 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

The latest stable release is available at <https://github.com/jpanther/Dectorio/releases/latest>

## v0.7.2 - Unreleased (coming soon)

### Added
* New gravel styles - Iron, Copper and Coal Gravel (placed using raw iron, copper and coal ores)
* New _Traffic bollard_ decorative item (unlocked via _Plastics_ technology)
* Landscaping technology now allows placement of decorative rock entities
* Better handling for when third party mods that affect Dectorio are added or removed

### Bugfixes
* Added some additional locale strings to fix issues with Creative Mode mod

## v0.7.1 - 2017-10-21

### Bugfixes
* Fixed migration error for existing saves without Alien Biomes
* Fixed migration error for existing saves without Alien Biomes mod

## v0.7.0 - 2017-10-20

Expand Down
1 change: 1 addition & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ DECT.ENABLED = {
["gravel"] = settings.startup["dectorio-flooring"].value,
["painted-concrete"] = settings.startup["dectorio-painted-concrete"].value,
["signs"] = settings.startup["dectorio-signs"].value,
["decoratives"] = settings.startup["dectorio-decoratives"].value,
}

DECT.CONFIG.SETTINGS = {
Expand Down
38 changes: 38 additions & 0 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,44 @@ local function on_configuration_changed(data)
incompability_detected()
end
end

-- Check if Alien Biomes was added
if data.mod_changes ~= nil and data.mod_changes["alien-biomes"] ~= nil and data.mod_changes["alien-biomes"].old_version == nil then
if DECT.ENABLED["landscaping"] then
for _,force in pairs(game.forces) do
local tech = force.technologies
local rec = force.recipes
if tech["dect-landscaping"].researched and rec["dect-alien-biomes-grass-red"] then
local 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
notification({"dect-notify-supportedmod-added", {"dect-notify-dectorio"}, "Alien Biomes"})
end
end
end
end

-- Check if Alien Biomes was removed
if data.mod_changes ~= nil and data.mod_changes["alien-biomes"] ~= nil and data.mod_changes["alien-biomes"].new_version == nil then
if DECT.ENABLED["landscaping"] then
for _,force in pairs(game.forces) do
local tech = force.technologies
local rec = force.recipes
if tech["dect-landscaping"].researched then
for _, tile in pairs(DECT.CONFIG.BASE_TILES) do
rec["dect-base-"..tile].enabled = true
end
notification({"dect-notify-supportedmod-removed", {"dect-notify-dectorio"}, "Alien Biomes"})
end
end
end
end
end

local function on_built_entity(event)
Expand Down
4 changes: 4 additions & 0 deletions data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ DECT = require("config")
require("prototypes.entity.lamp")
require("prototypes.entity.signs")
require("prototypes.entity.walls")
require("prototypes.entity.decoratives")

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

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

require("prototypes.tile.tiles")

Expand All @@ -47,5 +50,6 @@ require("prototypes.technology.lamp")
require("prototypes.technology.landscaping")
require("prototypes.technology.signs")
require("prototypes.technology.walls")
require("prototypes.technology.decoratives")

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.
Binary file added graphics/icons/traffic-bollard.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.
Binary file added graphics/terrain/coal/gravel/coal-o.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.
Binary file added graphics/terrain/coal/gravel/coal-side.png
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/terrain/coal/gravel/coal-u.png
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/terrain/coal/gravel/coal1.png
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/terrain/coal/gravel/coal2.png
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/terrain/coal/gravel/coal4.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.
Binary file added graphics/terrain/copper/gravel/copper-o.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.
Binary file added graphics/terrain/copper/gravel/copper-side.png
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/terrain/copper/gravel/copper-u.png
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/terrain/copper/gravel/copper1.png
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/terrain/copper/gravel/copper2.png
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/terrain/copper/gravel/copper4.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.
Binary file added graphics/terrain/iron/gravel/iron-o.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.
Binary file added graphics/terrain/iron/gravel/iron-side.png
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/terrain/iron/gravel/iron-u.png
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/terrain/iron/gravel/iron1.png
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/terrain/iron/gravel/iron2.png
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/terrain/iron/gravel/iron4.png
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dectorio",
"version": "0.7.1",
"version": "0.7.2",
"title": "Dectorio",
"author": "PantherX",
"contact": "",
Expand Down
8 changes: 8 additions & 0 deletions locale/de/de.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,21 @@ dect-small-lamp-glow=Glühende Lampe

[tile-name]
hazard-concrete-left=Beton mit Gefahrenmarkierung
hazard-concrete-right=Beton mit Gefahrenmarkierung
dect-paint-emergency-left=Beton mit Notfallmarkierung
dect-paint-emergency-right=Beton mit Notfallmarkierung
dect-paint-radiation-left=Beton mit Strahlungswarnung
dect-paint-radiation-right=Beton mit Strahlungswarnung
dect-paint-safety-left=Beton mit Sicherheitsmarkierung
dect-paint-safety-right=Beton mit Sicherheitsmarkierung
dect-paint-caution-left=Beton mit Warnungsmarkierung
dect-paint-caution-right=Beton mit Warnungsmarkierung
dect-paint-danger-left=Beton mit Gefahrenmarkierung
dect-paint-danger-right=Beton mit Gefahrenmarkierung
dect-paint-defect-left=Beton mit Beschädigung
dect-paint-defect-right=Beton mit Beschädigung
dect-paint-operations-left=Beton mit Betriebsmarkierung
dect-paint-operations-right=Beton mit Betriebsmarkierung
dect-wood-floor=Holzboden
dect-gravel=Kies

Expand Down
12 changes: 12 additions & 0 deletions locale/en/en.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,30 @@ dect-hazard-gate=Hazard gate
dect-sign-wood=Wooden sign
dect-sign-steel=Steel sign
dect-small-lamp-glow=Glowing lamp
dect-traffic-bollard=Traffic bollard

[tile-name]
hazard-concrete-left=Hazard concrete
hazard-concrete-right=Hazard concrete
dect-paint-emergency-left=Emergency concrete
dect-paint-emergency-right=Emergency concrete
dect-paint-radiation-left=Radiation hazard concrete
dect-paint-radiation-right=Radiation hazard concrete
dect-paint-safety-left=Safety concrete
dect-paint-safety-right=Safety concrete
dect-paint-caution-left=Caution concrete
dect-paint-caution-right=Caution concrete
dect-paint-danger-left=Danger concrete
dect-paint-danger-right=Danger concrete
dect-paint-defect-left=Defect concrete
dect-paint-defect-right=Defect concrete
dect-paint-operations-left=Operations concrete
dect-paint-operations-right=Operations concrete
dect-wood-floor=Wooden floorboards
dect-gravel=Gravel
dect-iron-gravel=Iron Gravel
dect-copper-gravel=Copper Gravel
dect-coal-gravel=Coal Gravel

[technology-name]
dect-landscaping=Landscaping
Expand Down
4 changes: 3 additions & 1 deletion locale/en/notifications.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ 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.
dect-notify-modportal=[__1__] Refer to the mod portal for further details.
dect-notify-supportedmod-added=[__1__] Added support for __2__ mod.
dect-notify-supportedmod-removed=[__1__] Removed support for __2__ mod.
2 changes: 2 additions & 0 deletions locale/en/settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dectorio-landscaping=Enable Landscaping
dectorio-flooring=Enable Floorings
dectorio-painted-concrete=Enable Painted Concrete
dectorio-signs=Enable Signs
dectorio-decoratives=Enable Decoratives
dectorio-vanilla-hazard-concrete-style=Use default Factorio Hazard concrete style
dectorio-landscaping-blueprintable=Landscaping items are blueprintable
dectorio-decorative-removal-probability=Decoration removal probability
Expand All @@ -19,6 +20,7 @@ dectorio-landscaping=Enables the ability to craft sand, dirt, grass, red desert
dectorio-flooring=Enables the ability to craft flooring types including wooden floorboards and gravel
dectorio-painted-concrete=Enables painted concrete styles that replace the base Hazard concrete
dectorio-signs=Enables the ability to place signs
dectorio-decoratives=Enables the ability to craft decorative items for your factory
dectorio-vanilla-hazard-concrete-style=When enabled, Painted Hazard concrete will look like the default Factorio Hazard concrete when placed (requires Painted Concrete to be enabled)
dectorio-landscaping-blueprintable=When enabled, blueprints will include landscaping features as tiles
dectorio-decorative-removal-probability=The probability that decorations, such as bushes and grasses, are removed when flooring tiles are placed (1 = 100% are removed (default), 0.5 = 50%, 0 = none are removed)
Expand Down
8 changes: 8 additions & 0 deletions locale/pl/pl.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,21 @@ dect-small-lamp-glow=Świecąca lampa

[tile-name]
hazard-concrete-left=Beton z pasami ostrzegawczymi
hazard-concrete-right=Beton z pasami ostrzegawczymi
dect-paint-emergency-left=Beton z przekazem awaryjnym
dect-paint-emergency-right=Beton z przekazem awaryjnym
dect-paint-radiation-left=Beton z przekazem o promieniowaniu
dect-paint-radiation-right=Beton z przekazem o promieniowaniu
dect-paint-safety-left=Beton z zabezpieczeniem
dect-paint-safety-right=Beton z zabezpieczeniem
dect-paint-caution-left=Betn z przekazem ostrzegawczym
dect-paint-caution-right=Betn z przekazem ostrzegawczym
dect-paint-danger-left=Beton z przekazem o niebezpieczeństwie
dect-paint-danger-right=Beton z przekazem o niebezpieczeństwie
dect-paint-defect-left=Uszkodzony beton
dect-paint-defect-right=Uszkodzony beton
dect-paint-operations-left=Beton operacyjny
dect-paint-operations-right=Beton operacyjny
dect-wood-floor=Drewniane podłoże
dect-gravel=Żwir

Expand Down
22 changes: 0 additions & 22 deletions migrations/0.7.1.lua

This file was deleted.

22 changes: 22 additions & 0 deletions migrations/0.7.2.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-decoratives"].value then
if tech["plastics"].researched then
rec["dect-traffic-bollard"].enabled = true
end
end
if settings.startup["dectorio-landscaping"].value then
if tech["dect-landscaping"].researched then
rec["dect-base-stone-rock"].enabled = true
rec["dect-base-red-desert-rock-big-01"].enabled = true
rec["dect-base-red-desert-rock-huge-01"].enabled = true
rec["dect-base-red-desert-rock-huge-02"].enabled = true
end
end
end
32 changes: 32 additions & 0 deletions prototypes/entity/decoratives.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- entity/decoratives

if DECT.ENABLED["decoratives"] then

data:extend({
{
type = "simple-entity",
name = "dect-traffic-bollard",
icon = "__Dectorio__/graphics/icons/traffic-bollard.png",
flags = {"placeable-neutral"},
render_layer = "object",
minable = {mining_time = 1, result = "dect-traffic-bollard", count = 1},
max_health = 120,
collision_box = {{-0.15, -0.15}, {0.25, 0.15}},
selection_box = {{-0.25, -1.4}, {0.25, 0.16}},
drawing_box = {{-0.2, -1}, {0.2, 0.1}},
repair_sound = { filename = "__base__/sound/manual-repair-simple.ogg" },
mined_sound = { filename = "__core__/sound/deconstruct-small.ogg" },
vehicle_impact_sound = {filename = "__base__/sound/car-metal-impact.ogg", volume = 0.7},
pictures = {
{
filename = "__Dectorio__/graphics/decoratives/traffic-bollard/traffic-bollard.png",
priority = "extra-high",
width = 35,
height = 42,
shift = {0.4, -0.6}
}
}
}
})

end
30 changes: 30 additions & 0 deletions prototypes/item/decoratives.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- item/decoratives

if DECT.ENABLED["decoratives"] then

-- -- Add subgroup for decoratives
-- data:extend({
-- {
-- type = "item-subgroup",
-- name = "decoratives",
-- group = "logistics",
-- order = "g-b"
-- }
-- })

data:extend({
{
type = "item",
name = "dect-traffic-bollard",
icon = "__Dectorio__/graphics/icons/traffic-bollard.png",
flags = {"goes-to-quickbar"},
-- subgroup = "decoratives",
-- order = "a[traffic-bollard]",
subgroup = "terrain",
order = "w[traffic-bollard]",
place_result = "dect-traffic-bollard",
stack_size = 50
}
})

end
23 changes: 22 additions & 1 deletion prototypes/item/flooring.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,33 @@ end

if DECT.ENABLED["gravel"] then

-- Allow stone to be placed as gravel
-- Allow ores to be placed as gravel
local base_stone = data.raw["item"]["stone"]
base_stone.place_as_tile = {
result = "dect-gravel",
condition_size = 4,
condition = { "water-tile" }
}

local base_iron = data.raw["item"]["iron-ore"]
base_iron.place_as_tile = {
result = "dect-iron-gravel",
condition_size = 4,
condition = { "water-tile" }
}

local base_copper = data.raw["item"]["copper-ore"]
base_copper.place_as_tile = {
result = "dect-copper-gravel",
condition_size = 4,
condition = { "water-tile" }
}

local base_coal = data.raw["item"]["coal"]
base_coal.place_as_tile = {
result = "dect-coal-gravel",
condition_size = 4,
condition = { "water-tile" }
}

end
Loading

0 comments on commit f95f89e

Please sign in to comment.