Skip to content

Commit

Permalink
Update incompatible mods and notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed Dec 17, 2017
1 parent d62a4b1 commit e7fb32a
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 14 deletions.
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---------------------------------------------------------------------------------------------------
Version: 0.8.1
Date: 18. 12. 2017
Added:
- New warning for incompatibilities when Picker Tweaks mod is installed
Changed:
- Improved handling when mods add signal colours that may conflict with those already added by Dectorio
- Improved notifications for conflicting mods with more information on how to resolve the conflict
---------------------------------------------------------------------------------------------------
Version: 0.8.0
Date: 15. 12. 2017
Added:
Expand Down
9 changes: 5 additions & 4 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ DECT.CONFIG.BASE_WATER_TILES = {"water", "water-green"}
DECT.CONFIG.BASE_ROCKS = {"rock-huge", "rock-big", "sand-rock-big"}

DECT.INCOMPATIBLE = {}
DECT.INCOMPATIBLE.REASONS = {
["signals"] = "dect-notify.reason-signals",
["tech"] = "dect-notify.reason-tech",
}
DECT.INCOMPATIBLE.MODS = {
["Expanded_Color_Lamps"] = {
name = "Expanded_Color_Lamps",
Expand Down Expand Up @@ -151,6 +147,11 @@ DECT.INCOMPATIBLE.MODS = {
component = "walls",
reason = "disable"
},
["PickerTweaks"] = {
name = "PickerTweaks",
component = "signals",
reason = "item"
},
}

return DECT
3 changes: 2 additions & 1 deletion control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ local function incompability_detected()
incompatible = DECT.INCOMPATIBLE.MODS[mod]
if DECT.ENABLED[incompatible.component] then
notification({"dect-notify.incompatible", {"dect-notify.dectorio"}})
notification({"dect-notify.reason-"..incompatible.reason, {"dect-notify.dectorio"}, incompatible.name})
notification({"dect-notify.recommended-action", {"dect-notify.dectorio"}, incompatible.name, incompatible.component})
notification({"dect-notify.mod-portal", {"dect-notify.dectorio"}})
notification({DECT.INCOMPATIBLE.REASONS[incompatible.reason], {"dect-notify.dectorio"}, incompatible.name})
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

require("prototypes.style.gui")

require("prototypes.entity.signs-icons")
require("prototypes.entity.signs-icons")

require("prototypes.signal.final-fixes")
4 changes: 2 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "Dectorio",
"version": "0.8.0",
"version": "0.8.1",
"title": "Dectorio",
"author": "PantherX",
"contact": "",
"homepage": "https://github.com/jpanther/Dectorio",
"factorio_version": "0.16",
"dependencies": ["base >= 0.16", "? alien-biomes >= 0.2.7"],
"dependencies": ["base >= 0.16", "? alien-biomes >= 0.2.7", "? PickerTweaks >= 1.0.1"],
"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."
}
10 changes: 6 additions & 4 deletions locale/en/dectorio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ sign-cancel=Cancel
[dect-notify]
dectorio=Dectorio
version=[__1__] Version __2__ installed.
new-version=[__1__] Updated from version __2__ to version __3__.
new-version=[__1__] Updated from version __2__ to version __3__. Refer to the changelog for details (Mods > Dectorio > Changelog).
incompatible=[__1__] Warning: An incompatible mod has been detected!
reason-signals=[__1__] Reason: '__2__' overwrites signal data. It is recommended to disable '__2__'.
reason-tech=[__1__] Reason: '__2__' duplicates technology that is already in Dectorio. It is recommended to disable '__2__'.
reason-disable=[__1__] Reason: '__2__' disables functionality that is added by Dectorio. It is recommended to disable '__2__'.
reason-signals=[__1__] Reason: '__2__' overwrites signal data.
reason-tech=[__1__] Reason: '__2__' duplicates technology that is already in Dectorio.
reason-item=[__1__] Reason: '__2__' duplicates an item that is already in Dectorio.
reason-disable=[__1__] Reason: '__2__' disables functionality that is added by Dectorio.
recommended-action=[__1__] Either remove '__2__' or disable the __3__ component in Dectorio mod startup settings.
mod-portal=[__1__] Refer to the mod portal for further details.
supported-mod-added=[__1__] Added support for __2__ mod.
supported-mod-removed=[__1__] Removed support for __2__ mod.
Expand Down
19 changes: 19 additions & 0 deletions prototypes/signal/final-fixes.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- signal/final-fixes

if DECT.ENABLED["signals"] then

-- Get signals and update mappings (in case some new ones are added by other mods)
local colors = DECT.CONFIG.SIGNALS
for _, signal in pairs(data.raw["virtual-signal"]) do
if not signal.order:find("colors") and signal.color then
table.insert(colors, {type=signal.type, name=signal.name, color=signal.color})
end
end

local lamp = data.raw.lamp["small-lamp"]
lamp.signal_to_color_mapping = colors

local lamp_glow = data.raw.lamp["dect-small-lamp-glow"]
lamp_glow.signal_to_color_mapping = colors

end
4 changes: 2 additions & 2 deletions prototypes/signal/signals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if DECT.ENABLED["signals"] then
-- Get signals
local colors = DECT.CONFIG.SIGNALS

-- Clear out any existing signals
-- Clear out any existing signals that conflict
for name, signal in pairs(data.raw["virtual-signal"]) do
if signal.order:find("colors") then
data.raw["virtual-signal"][name] = nil
Expand All @@ -38,7 +38,7 @@ if DECT.ENABLED["signals"] then
end
end

-- Reset black signal to correct icon
-- Reset black signal to 'correct' icon
if data.raw["virtual-signal"]["signal-black"] then
local black = data.raw["virtual-signal"]["signal-black"]
black.icons[1].tint = {r=0.16,g=0.16,b=0.16,a=0.70}
Expand Down

0 comments on commit e7fb32a

Please sign in to comment.