diff --git a/README.md b/README.md index 20ccacb..0f69128 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,10 @@ discussion page, and messages posted there will likely be ignored.** ## Changelog +### 0.2.1 (2018-04-24) +* Actually correctly flip splitters like we said we do. Somehow in optimizing the original code I completely forgot + to actually implement this. + ### 0.2.0 (2018-04-23) * Added and reworked the blueprint flipping and turning functionality in the Blueprint Flipper and Turner mod, including a fix to priority splitters. diff --git a/changelog.txt b/changelog.txt index 737f92a..7f8dd80 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.2.1 +Date: 23. 04. 2018 + Bugfixes: + - Actually flip splitter priorities upon mirroring like we said we would. + --------------------------------------------------------------------------------------------------- Version: 0.2.0 Date: 23. 04. 2018 diff --git a/info.json b/info.json index 37976b9..8319e69 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "BlueprintExtensions", - "version": "0.2.0", + "version": "0.2.1", "title": "Blueprint Extensions", "author": "Dewin", "contact": "https://github.com/dewiniaid/BlueprintExtensions", diff --git a/modules/flip.lua b/modules/flip.lua index acd8f33..0be715c 100644 --- a/modules/flip.lua +++ b/modules/flip.lua @@ -1,4 +1,5 @@ Flip = { + enabled = true, translations = { v = { axis = 'y', @@ -34,11 +35,15 @@ Flip = { [4] = 1, }, } + }, + sides = { + left = 'right', + right = 'left' } } function Flip.setup_gui(player) - local show = (not game.active_mods["Blueprint_Flip_Turn"]) and player.mod_settings["BlueprintExtensions_show-buttons"].value + local show = (Flip.enabled and player.mod_settings["BlueprintExtensions_show-buttons"].value) local top = player.gui.top if show and not top["BPEX_Flow"] then @@ -52,9 +57,15 @@ end function Flip.check_for_other_mods() +-- if game.active_mods["PickerExtended"] then +-- game.print("[Blueprint Extensions] Picker Extended is installed. Disabling our version of blueprint flipping.") +-- Flip.enabled = false if game.active_mods["Blueprint_Flip_Turn"] then game.print("[Blueprint Extensions] Blueprint Flipper and Turner is installed. Disabling our version of blueprint flipping.") game.print("Blueprint Extensions now includes some improved functionality when flipping blueprints, such as correctly flipping splitter priorities. To enable this functionality, disable Blueprint Flipper and Turner.") + Flip.enabled = false + else + Flip.enabled = true end end @@ -106,6 +117,14 @@ function Flip.flip(player_index, translate) if ent.pickup_position ~= nil then ent.pickup_position[axis] = -ent.pickup_position[axis] end + + if Flip.sides[ent.input_priority] then + ent.input_priority = Flip.sides[ent.input_priority] + end + if Flip.sides[ent.output_priority] then + ent.output_priority = Flip.sides[ent.output_priority] + end + end bp.set_blueprint_entities(ents) end @@ -126,6 +145,8 @@ end script.on_event(defines.events.on_runtime_mod_setting_changed, function(event) + Flip.check_for_other_mods() + if game.active_mods["Blueprint_Flip_Turn"] then return end if event.setting_type == "runtime-per-user" and event.setting == "BlueprintExtensions_show-buttons" then