diff --git a/changelog.txt b/changelog.txt index f4fa129..39539d5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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: diff --git a/config.lua b/config.lua index 2c8b543..60d0813 100644 --- a/config.lua +++ b/config.lua @@ -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", @@ -151,6 +147,11 @@ DECT.INCOMPATIBLE.MODS = { component = "walls", reason = "disable" }, + ["PickerTweaks"] = { + name = "PickerTweaks", + component = "signals", + reason = "item" + }, } return DECT diff --git a/control.lua b/control.lua index 6ecf855..4c83e14 100644 --- a/control.lua +++ b/control.lua @@ -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 diff --git a/data-final-fixes.lua b/data-final-fixes.lua index fa7d345..0e2921a 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -2,4 +2,6 @@ require("prototypes.style.gui") -require("prototypes.entity.signs-icons") \ No newline at end of file +require("prototypes.entity.signs-icons") + +require("prototypes.signal.final-fixes") diff --git a/info.json b/info.json index c3b7c6a..1e42780 100644 --- a/info.json +++ b/info.json @@ -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." } diff --git a/locale/en/dectorio.cfg b/locale/en/dectorio.cfg index 42ed7f4..62aa7ce 100644 --- a/locale/en/dectorio.cfg +++ b/locale/en/dectorio.cfg @@ -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. diff --git a/prototypes/signal/final-fixes.lua b/prototypes/signal/final-fixes.lua new file mode 100755 index 0000000..e34f374 --- /dev/null +++ b/prototypes/signal/final-fixes.lua @@ -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 diff --git a/prototypes/signal/signals.lua b/prototypes/signal/signals.lua index c1fe44f..6177baa 100755 --- a/prototypes/signal/signals.lua +++ b/prototypes/signal/signals.lua @@ -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 @@ -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}