From 1321b3aadd647dfc603286e8b82e01c554fc4565 Mon Sep 17 00:00:00 2001 From: npc-strider Date: Sun, 14 Apr 2019 15:16:32 +0800 Subject: [PATCH] 0.7.0: AAI support, autogen shortcuts. See changelog.txt for rest of changes --- LICENSE.txt | 21 + Shortcuts/changelog.txt | 13 + Shortcuts/control.lua | 100 +- Shortcuts/data-updates.lua | 324 ++-- .../path-remote-control-x24-white.png | Bin 0 -> 599 bytes .../graphics/path-remote-control-x24.png | Bin 0 -> 582 bytes .../path-remote-control-x32-white.png | Bin 0 -> 627 bytes .../graphics/path-remote-control-x32.png | Bin 0 -> 671 bytes .../unit-remote-control-x24-white.png | Bin 0 -> 501 bytes .../graphics/unit-remote-control-x24.png | Bin 0 -> 493 bytes .../unit-remote-control-x32-white.png | Bin 0 -> 532 bytes .../graphics/unit-remote-control-x32.png | Bin 0 -> 539 bytes Shortcuts/info.json | 4 +- Shortcuts/settings.lua | 192 ++- Shortcuts/shortcuts.lua | 1365 +++++++++-------- 15 files changed, 1244 insertions(+), 775 deletions(-) create mode 100644 LICENSE.txt create mode 100644 Shortcuts/graphics/path-remote-control-x24-white.png create mode 100644 Shortcuts/graphics/path-remote-control-x24.png create mode 100644 Shortcuts/graphics/path-remote-control-x32-white.png create mode 100644 Shortcuts/graphics/path-remote-control-x32.png create mode 100644 Shortcuts/graphics/unit-remote-control-x24-white.png create mode 100644 Shortcuts/graphics/unit-remote-control-x24.png create mode 100644 Shortcuts/graphics/unit-remote-control-x32-white.png create mode 100644 Shortcuts/graphics/unit-remote-control-x32.png diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..2d6eeda --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 npc_strider + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Shortcuts/changelog.txt b/Shortcuts/changelog.txt index df0bf05..5637ad1 100644 --- a/Shortcuts/changelog.txt +++ b/Shortcuts/changelog.txt @@ -1,3 +1,16 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.7.0 +Date: 2019-04-14 + Features: + - Add mod support for AAI vehicles + - Ability to selectively disable/enable individaul settings from mod settings startup panel + - Dynamically generate shortcuts for any selection-tool + - Make use of "only-in-cursor" flag and remove relevant scripts (Should offer an insignificant performance boost when opening inventory) + - Added LICENSE.txt + Bugfixes: + - Add hidden flag (not property!) to automatically generated 'disabled' items (artillery and equipment) + - Fixed startup crash with technologies containing modded recipe effects + --------------------------------------------------------------------------------------------------- Version: 0.6.0 Date: 2019-03-29 diff --git a/Shortcuts/control.lua b/Shortcuts/control.lua index 98059a6..6099620 100644 --- a/Shortcuts/control.lua +++ b/Shortcuts/control.lua @@ -80,39 +80,53 @@ local function toggle_rail(player) end end -local function update_inventory(event) -- removes spare remotes - local item_prototypes = game.item_prototypes - local inventory = game.players[event.player_index].get_inventory(defines.inventory.player_main) - if inventory and inventory.valid then - inventory.remove("artillery-targeting-remote") - inventory.remove("artillery-jammer-tool") - inventory.remove("discharge-defense-remote") - inventory.remove("shortcuts-deconstruction-planner") - if item_prototypes["resource-monitor"] then - inventory.remove("resource-monitor") - end - if item_prototypes["outpost-builder"] then - inventory.remove("outpost-builder") - end - if item_prototypes["ion-cannon-targeter"] then - inventory.remove("ion-cannon-targeter") - end - if item_prototypes["max-rate-calculator"] then - inventory.remove("max-rate-calculator") - end - if item_prototypes["module-inserter"] then - inventory.remove("module-inserter") - end - end -end +-- local function update_inventory(event) -- removes spare remotes + -- local item_prototypes = game.item_prototypes + -- local inventory = game.players[event.player_index].get_inventory(defines.inventory.player_main) + -- if inventory and inventory.valid then + -- if settings.startup["artillery-targeting-remote"].value == true then + -- inventory.remove("artillery-targeting-remote") + -- end + -- if settings.startup["artillery-jammer-remote"].value == true then + -- inventory.remove("artillery-jammer-tool") + -- end + -- if settings.startup["discharge-defense-remote"].value == true then + -- inventory.remove("discharge-defense-remote") + -- end + -- if settings.startup["tree-killer"].value == true then + -- inventory.remove("shortcuts-deconstruction-planner") + -- end + -- if item_prototypes["resource-monitor"] and settings.startup["resource-monitor"].value == true then + -- inventory.remove("resource-monitor") + -- end + -- if item_prototypes["outpost-builder"] and settings.startup["outpost-builder"].value == true then + -- inventory.remove("outpost-builder") + -- end + -- if item_prototypes["ion-cannon-targeter"] and settings.startup["ion-cannon-targeter"].value == true then + -- inventory.remove("ion-cannon-targeter") + -- end + -- if item_prototypes["max-rate-calculator"] and settings.startup["max-rate-calculator"].value == true then + -- inventory.remove("max-rate-calculator") + -- end + -- if item_prototypes["module-inserter"] and settings.startup["module-inserter"].value == true then + -- inventory.remove("module-inserter") + -- end + -- end +-- end local function false_shortcuts(player) -- disables things - player.set_shortcut_available("night-vision-equipment", false) - player.set_shortcut_toggled("night-vision-equipment", false) - player.set_shortcut_available("belt-immunity-equipment", false) - player.set_shortcut_toggled("belt-immunity-equipment", false) - player.set_shortcut_available("active-defense-equipment", false) - player.set_shortcut_toggled("active-defense-equipment", false) + if settings.startup["night-vision-equipment"].value == true then + player.set_shortcut_available("night-vision-equipment", false) + player.set_shortcut_toggled("night-vision-equipment", false) + end + if settings.startup["active-defense-equipment"].value == true then + player.set_shortcut_available("active-defense-equipment", false) + player.set_shortcut_toggled("active-defense-equipment", false) + end + if settings.startup["belt-immunity-equipment"].value == true then + player.set_shortcut_available("belt-immunity-equipment", false) + player.set_shortcut_toggled("belt-immunity-equipment", false) + end end local function enable_it(player, equipment, grid, type) -- enables things @@ -387,7 +401,7 @@ local function shortcut_type(event) end elseif prototype_name == "flashlight-toggle" then toggle_light(game.players[event.player_index]) - elseif prototype_name == "rail-block-visualization-toggle" then + elseif prototype_name == "rail-block-visualization-toggle" then toggle_rail(game.players[event.player_index]) elseif prototype_name == "signal-flare" then local player = game.players[event.player_index] @@ -401,16 +415,26 @@ end script.on_event(defines.events.on_lua_shortcut, shortcut_type) -script.on_event(defines.events.on_player_main_inventory_changed, update_inventory) +-- script.on_event(defines.events.on_player_main_inventory_changed, update_inventory) script.on_event(defines.events.on_player_created, function(event) local player = game.players[event.player_index] - player.set_shortcut_toggled("flashlight-toggle", true) - player.set_shortcut_toggled("rail-block-visualization-toggle", false) + if settings.startup["flashlight-toggle"].value == true then + player.set_shortcut_toggled("flashlight-toggle", true) + end + if settings.startup["rail-block-visualization-toggle"].value == true then + player.set_shortcut_toggled("rail-block-visualization-toggle", false) + end if not game.active_mods["Nanobots"] then - player.set_shortcut_available("night-vision-equipment", false) - player.set_shortcut_available("belt-immunity-equipment", false) - player.set_shortcut_available("active-defense-equipment", false) + if settings.startup["night-vision-equipment"].value == true then + player.set_shortcut_available("night-vision-equipment", false) + end + if settings.startup["active-defense-equipment"].value == true then + player.set_shortcut_available("active-defense-equipment", false) + end + if settings.startup["belt-immunity-equipment"].value == true then + player.set_shortcut_available("belt-immunity-equipment", false) + end else player.print("WARNING: Shortcuts for modular equipment disabled as Nanobots is installed") player.print("> Use the Nanobots hotkeys instead: \"Ctrl F1 - F7 Will toggle specific modular armor equipment on or off\"") diff --git a/Shortcuts/data-updates.lua b/Shortcuts/data-updates.lua index 1a0be8f..80f0a78 100644 --- a/Shortcuts/data-updates.lua +++ b/Shortcuts/data-updates.lua @@ -1,88 +1,122 @@ require("shortcuts") -local function hide_the_remote(recipe, technology) - data.raw["recipe"][recipe].hidden = true - data.raw["recipe"][recipe].ingredients ={{"iron-plate", 1}} - if technology ~= nil then - local effect = data.raw["technology"][technology].effects - for i=1,(#effect) do - if effect[i].type == "unlock-recipe" then - if effect[i].recipe == recipe then - table.remove(effect, i) +local function hide_the_remote(recipe, technology, item) + if item then + if item.flags then + item.flags[#item.flags+1] = "only-in-cursor" + else + item.flags = {"only-in-cursor"} + end + end + local recipe_prototype = data.raw["recipe"][recipe] + local tech_prototype = data.raw["technology"][technology] + if recipe_prototype then + recipe_prototype.hidden = true + recipe_prototype.ingredients ={{"iron-plate", 1}} + if technology ~= nil and tech_prototype then + local effect = tech_prototype.effects + for i=1,(#effect) do + if effect[i].type == "unlock-recipe" then + if effect[i].recipe == recipe then + table.remove(effect, i) + return + end end end end end end -hide_the_remote("artillery-targeting-remote", "artillery") -hide_the_remote("discharge-defense-remote", "discharge-defense-equipment") -if mods["YARM"] and data.raw["item"]["resource-monitor"] and data.raw["technology"]["resource-monitoring"] then - hide_the_remote("resource-monitor", "resource-monitoring") +if settings.startup["artillery-targeting-remote"].value == true then + hide_the_remote("artillery-targeting-remote", "artillery", data.raw["capsule"]["artillery-targeting-remote"]) end -if mods["OutpostPlanner"] and mods["PlannerCore"] and data.raw["selection-tool"]["outpost-builder"] then - hide_the_remote("outpost-builder", nil) +if settings.startup["discharge-defense-remote"].value == true then + hide_the_remote("discharge-defense-remote", "discharge-defense-equipment", data.raw["capsule"]["discharge-defense-remote"]) end -if mods["Orbital Ion Cannon"] and data.raw["item"]["ion-cannon-targeter"] and data.raw["technology"]["orbital-ion-cannon"] then - hide_the_remote("ion-cannon-targeter", "orbital-ion-cannon") +if mods["YARM"] and data.raw["item"]["resource-monitor"] and data.raw["technology"]["resource-monitoring"] and settings.startup["resource-monitor"].value == true then + hide_the_remote("resource-monitor", "resource-monitoring", data.raw["item"]["resource-monitor"]) +end +if mods["OutpostPlanner"] and mods["PlannerCore"] and data.raw["selection-tool"]["outpost-builder"] and settings.startup["outpost-builder"].value == true then + hide_the_remote("outpost-builder", nil, data.raw["selection-tool"]["outpost-builder"]) +end +if mods["Orbital Ion Cannon"] and data.raw["item"]["ion-cannon-targeter"] and data.raw["technology"]["orbital-ion-cannon"] and settings.startup["ion-cannon-targeter"].value == true then + hide_the_remote("ion-cannon-targeter", "orbital-ion-cannon", data.raw["item"]["ion-cannon-targeter"]) +end +if mods["ModuleInserter"] and data.raw["selection-tool"]["module-inserter"] and settings.startup["module-inserter"].value == true then + hide_the_remote("module-inserter", "construction-robotics", data.raw["selection-tool"]["module-inserter"]) +end +if mods["aai-programmable-vehicles"] then + if settings.startup["unit-remote-control"].value == true and data.raw["selection-tool"]["unit-remote-control"] then + hide_the_remote("unit-remote-control", nil, data.raw["selection-tool"]["unit-remote-control"]) + end + if settings.startup["path-remote-control"].value == true and data.raw["selection-tool"]["path-remote-control"] then + hide_the_remote("path-remote-control", nil, data.raw["selection-tool"]["path-remote-control"]) + end end local disabled_equipment = {} local disabled_equipment_item = {} -local equipment_list = { - "night-vision-equipment", - "belt-immunity-equipment", - "active-defense-equipment", -} -if mods["Nanobots"] then - equipment_list = {} +local equipment_list = {} + +if settings.startup["night-vision-equipment"].value == true then + equipment_list[#equipment_list+1] = "night-vision-equipment" +end +if settings.startup["belt-immunity-equipment"].value == true then + equipment_list[#equipment_list+1] = "belt-immunity-equipment" +end +if settings.startup["active-defense-equipment"].value == true then + equipment_list[#equipment_list+1] = "active-defense-equipment" end -for i=1,(#equipment_list) do - for _, equipment in pairs(data.raw[equipment_list[i]]) do - local i = #disabled_equipment+1 - disabled_equipment[i] = util.table.deepcopy(equipment) - local name = disabled_equipment[i].name - if (equipment.type == "active-defense-equipment" and equipment.automatic == true) or equipment.type ~= "active-defense-equipment" then - disabled_equipment[i].name = "disabled-" .. name - disabled_equipment[i].localised_name = {"", {"equipment-name." .. name}, " (", {"gui-constant.off"}, ")"} - elseif (equipment.type == "active-defense-equipment" and equipment.automatic == false) then - disabled_equipment[i].name = "disabledinactive-" .. name - disabled_equipment[i].localised_name = {"equipment-name." .. name} - end - disabled_equipment[i].energy_input = "0kW" - disabled_equipment[i].take_result = name - if equipment_list[i] == "belt-immunity-equipment" or (equipment.type == "active-defense-equipment" and equipment.automatic == true) then - disabled_equipment[i].energy_source.input_flow_limit = "0kW" - disabled_equipment[i].energy_source.buffer_capacity = "0kJ" - disabled_equipment[i].energy_source.drain = "1kW" - end - - if not data.raw["item"][equipment_list[i]] then --for mods which have a different item name compared to equipment name - disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"]["night-vision-equipment"]) +if not mods["Nanobots"] then + + for i=1,(#equipment_list) do + for _, equipment in pairs(data.raw[equipment_list[i]]) do + local i = #disabled_equipment+1 + disabled_equipment[i] = util.table.deepcopy(equipment) + local name = disabled_equipment[i].name + if (equipment.type == "active-defense-equipment" and equipment.automatic == true) or equipment.type ~= "active-defense-equipment" then + disabled_equipment[i].name = "disabled-" .. name + disabled_equipment[i].localised_name = {"", {"equipment-name." .. name}, " (", {"gui-constant.off"}, ")"} + elseif (equipment.type == "active-defense-equipment" and equipment.automatic == false) then + disabled_equipment[i].name = "disabledinactive-" .. name + disabled_equipment[i].localised_name = {"equipment-name." .. name} + end + disabled_equipment[i].energy_input = "0kW" + disabled_equipment[i].take_result = name + if equipment_list[i] == "belt-immunity-equipment" or (equipment.type == "active-defense-equipment" and equipment.automatic == true) then + disabled_equipment[i].energy_source.input_flow_limit = "0kW" + disabled_equipment[i].energy_source.buffer_capacity = "0kJ" + disabled_equipment[i].energy_source.drain = "1kW" + end + + if not data.raw["item"][equipment_list[i]] then --for mods which have a different item name compared to equipment name + disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"]["night-vision-equipment"]) + disabled_equipment_item[i].name = "disabled-" .. name + disabled_equipment_item[i].flags = {"hidden"} + disabled_equipment_item[i].placed_as_equipment_result = name + end + + disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"][equipment_list[i]]) -- LEGACY ITEM (Disable for release) + if not disabled_equipment_item[i] then + disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"]["night-vision-equipment"]) + end + disabled_equipment_item[i].name = "disabled-" .. name - disabled_equipment_item[i].hidden = true + disabled_equipment_item[i].flags = {"hidden"} + -- disabled_equipment_item[i].localised_name = {"", {"equipment-name." .. name}, " (", {"gui-constant.off"}, ")"} + disabled_equipment_item[i].localised_description = {"item-description." .. name} disabled_equipment_item[i].placed_as_equipment_result = name end - - disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"][equipment_list[i]]) -- LEGACY ITEM (Disable for release) - if not disabled_equipment_item[i] then - disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"]["night-vision-equipment"]) + end + + for i=1,(#disabled_equipment),1 do + data:extend({disabled_equipment[i]}) + if disabled_equipment_item[i] then + data:extend({disabled_equipment_item[i]}) end - - disabled_equipment_item[i].name = "disabled-" .. name - disabled_equipment_item[i].hidden = true - -- disabled_equipment_item[i].localised_name = {"", {"equipment-name." .. name}, " (", {"gui-constant.off"}, ")"} - disabled_equipment_item[i].localised_description = {"item-description." .. name} - disabled_equipment_item[i].placed_as_equipment_result = name end -end -for i=1,(#disabled_equipment),1 do - data:extend({disabled_equipment[i]}) - if disabled_equipment_item[i] then - data:extend({disabled_equipment_item[i]}) - end end data:extend({ @@ -94,7 +128,6 @@ data:extend({ icon_size = 64, subgroup = "virtual-signal-color", order = "d[colors]-[9danger]", - hidden = true, }, { type = "virtual-signal", @@ -104,7 +137,6 @@ data:extend({ icon_size = 64, subgroup = "virtual-signal-color", order = "d[colors]-[9disabled]", - hidden = true, } }) @@ -113,51 +145,131 @@ local disabled_turret_item = {} local disabled_gun = {} local disable_turret_list = {} -if settings.startup["artillery-toggle"].value == "both" then - disable_turret_list = {"artillery-wagon", "artillery-turret",} -elseif settings.startup["artillery-toggle"].value == "artillery-wagon" then - disable_turret_list = {"artillery-wagon"} -elseif settings.startup["artillery-toggle"].value == "artillery-turret" then - disable_turret_list = {"artillery-turret"} -end - -for i=1,(#disable_turret_list) do - for _, entity in pairs(data.raw[disable_turret_list[i]]) do - local i = #disabled_turret+1 - disabled_turret[i] = util.table.deepcopy(entity) - local name = disabled_turret[i].name - local gun = disabled_turret[i].gun - disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"][name]) - if disabled_turret_item[i] == nil then - disabled_turret_item[i] = util.table.deepcopy(data.raw["item"][name]) +if settings.startup["artillery-jammer-remote"].value == true then + if settings.startup["artillery-toggle"].value == "both" then + disable_turret_list = {"artillery-wagon", "artillery-turret",} + elseif settings.startup["artillery-toggle"].value == "artillery-wagon" then + disable_turret_list = {"artillery-wagon"} + elseif settings.startup["artillery-toggle"].value == "artillery-turret" then + disable_turret_list = {"artillery-turret"} + end + + for i=1,(#disable_turret_list) do + for _, entity in pairs(data.raw[disable_turret_list[i]]) do + local i = #disabled_turret+1 + disabled_turret[i] = util.table.deepcopy(entity) + local name = disabled_turret[i].name + local gun = disabled_turret[i].gun + disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"][name]) + if disabled_turret_item[i] == nil then + disabled_turret_item[i] = util.table.deepcopy(data.raw["item"][name]) + end + if disabled_turret_item[i] == nil then + disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"]["artillery-wagon"]) + end + disabled_turret_item[i].name = "disabled-" .. name + disabled_turret_item[i].place_result = "disabled-" .. name + disabled_turret_item[i].flags = {"hidden"} + disabled_turret[i].name = "disabled-" .. name + disabled_turret[i].flags = {"hidden"} + disabled_turret[i].localised_name = {"", {"entity-name." .. entity.name}, " (", {"gui-constant.off"}, ")"} + disabled_gun[i] = util.table.deepcopy(data.raw["gun"][gun]) + disabled_gun[i].name = "disabled-" .. gun + disabled_gun[i].flags = {"hidden"} + disabled_gun[i].tint = { r = 1.0, g = 0.0, b = 0.0, a = 1.0 } + disabled_gun[i].attack_parameters.range = 0 + disabled_gun[i].attack_parameters.min_range = 0 + disabled_turret[i].gun = disabled_gun[i].name end - if disabled_turret_item[i] == nil then - disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"]["artillery-wagon"]) + end + + for i=1,(#disabled_turret),1 do + data:extend({disabled_turret[i]}) + if disabled_gun[i] then + data:extend({disabled_gun[i]}) + end + if disabled_turret_item[i] then + data:extend({disabled_turret_item[i]}) end - disabled_turret_item[i].name = "disabled-" .. name - disabled_turret_item[i].place_result = "disabled-" .. name - disabled_turret[i].name = "disabled-" .. name - disabled_turret[i].localised_name = {"", {"entity-name." .. entity.name}, " (", {"gui-constant.off"}, ")"} - disabled_gun[i] = util.table.deepcopy(data.raw["gun"][gun]) - disabled_gun[i].name = "disabled-" .. gun - disabled_gun[i].tint = { r = 1.0, g = 0.0, b = 0.0, a = 1.0 } - disabled_gun[i].attack_parameters.range = 0 - disabled_gun[i].attack_parameters.min_range = 0 - disabled_turret[i].gun = disabled_gun[i].name end + end -for i=1,(#disabled_turret),1 do - data:extend({disabled_turret[i]}) - if disabled_gun[i] then - data:extend({disabled_gun[i]}) - end - if disabled_turret_item[i] then - data:extend({disabled_turret_item[i]}) - end +if settings.startup["tree-killer"].value == true then + local decon_spec = util.table.deepcopy(data.raw["deconstruction-item"]["deconstruction-planner"]) + decon_spec.name = "shortcuts-deconstruction-planner" + decon_spec.localised_name = {"item-name.deconstruction-planner"} + decon_spec.flags = {"only-in-cursor"} + data:extend({decon_spec}) end -local decon_spec = util.table.deepcopy(data.raw["deconstruction-item"]["deconstruction-planner"]) -decon_spec.name = "shortcuts-deconstruction-planner" -decon_spec.localised_name = {"item-name.deconstruction-planner"} -data:extend({decon_spec}) \ No newline at end of file +if settings.startup["autogen"].value == true then + + -- create a post on the discussion page if you want your shortcut to be added to this blacklist. + local shortcut_blacklist = { + "selection-tool", + "max-rate-calculator", + "module-inserter", + "path-remote-control", + "unit-remote-control", + } + + for _, tool in pairs(data.raw["selection-tool"]) do + local name = tool.name + local continue = true + for j, blacklist in pairs(shortcut_blacklist) do + if name == blacklist then + continue = false + break + end + end + if continue == true then + local create = true + for i, shortcut in pairs(data.raw["shortcut"]) do + if shortcut.action == "create-blueprint-item" and shortcut.item_to_create == name then + create = false + break + end + end + if create == true then + local shortcut = { + type = "shortcut", + name = name, + order = tool.order, + action = "create-blueprint-item", + localised_name = {"item-name." .. name}, + item_to_create = name, + style = "default", + icon = + { + filename = tool.icon, + priority = "extra-high-no-scale", + size = tool.icon_size, + scale = 1, + flags = {"icon"} + }, + small_icon = + { + filename = tool.icon, + priority = "extra-high-no-scale", + size = tool.icon_size, + scale = 1, + flags = {"icon"} + }, + disabled_small_icon = + { + filename = tool.icon, + priority = "extra-high-no-scale", + size = tool.icon_size, + scale = 1, + flags = {"icon"} + }, + } + + data:extend({shortcut}) + hide_the_remote(name, name, tool) -- only attempts to hide the selection-tool if the recipe/tech name matches the tool name - does not search all recipes for mention of the tool. + end + end + end + +end \ No newline at end of file diff --git a/Shortcuts/graphics/path-remote-control-x24-white.png b/Shortcuts/graphics/path-remote-control-x24-white.png new file mode 100644 index 0000000000000000000000000000000000000000..391b76fc8be5db7f69906c38d4e4d3efb652782c GIT binary patch literal 599 zcmV-d0;v6oP)N2bZe?^J zG%hhNHDpIvQUCw})k#D_R7gwhmCGwdQ544Sb-i7$Bm)z9<&}Yfgp`4a zi85n`A^(DbfkH_X6Hx{RBzU-0!M%PTOL>&%G4s{0@0_*QUVHCzPV2b-^`{C3 zgYl3a2m}i8ay$JBk}c${ zC|nEsf3|?VgAzR2Le7f?Qehg3Eaa>xTnc-z4w;U%ok!>zAA?oUkLI4SAij+yJSP8E6w-T20xhH-roWj^qsQe)_tn>;XMP2G lENby<;D>5$z*3RR^#HZ4OTRD6+1>yE002ovPDHLkV1o4M0XzTz literal 0 HcmV?d00001 diff --git a/Shortcuts/graphics/path-remote-control-x24.png b/Shortcuts/graphics/path-remote-control-x24.png new file mode 100644 index 0000000000000000000000000000000000000000..78bf75c0c94ec69765c88d5293463c7682592e38 GIT binary patch literal 582 zcmV-M0=fN(P)N2bZe?^J zG%hhNHDpIvQUCw}#7RU!R7gwhmAfxPVHk&7)l!$Lh!`y57PlBWh`2=}>10Aos7{E) zV6jMSY-QwMFc>5y5g}m_5`%#VNr^!zBH|Vc&rd6@zf$Th7(-Bj(wP59A|RJ@(E2m z3g!5IxP$@XbnG}>z!b6m5eZ3K)z_uoz7J!{VHaT!uHgnW`2#F)J>lZ9(#qA}wX<2+ z2K{JWNWEeYu{uwNNbe#qGLd?i{$|>Z9+x5A*FrHp^Lx-^QH$S!AhZ!jeO)Hg8{Cmb UEt8*dT>t<807*qoM6N<$g4#9mAOHXW literal 0 HcmV?d00001 diff --git a/Shortcuts/graphics/path-remote-control-x32-white.png b/Shortcuts/graphics/path-remote-control-x32-white.png new file mode 100644 index 0000000000000000000000000000000000000000..439698ae3377ac2d429bca44e2182b83e6106983 GIT binary patch literal 627 zcmV-(0*w8MP)N2bZe?^J zG%hhNHDpIvQUCw}@kvBMR9HvtmM>5OK@^7x1OtI!Fc1s|f`MQl5)B3dfnXpI37))9W21X4AoiP#&1_OS-^(}K8DjeReg>U8?*ZueQb|1Hwn=vB< z{eFK=TDgTsc!AHZLz*z@GH&9b4}zj;?Fv4?4VnhVE?^z^@C@5le}Hj5aLd|jD&rcK zRhI|`HL#0uI@Yd$Q7_t5y{j0_*Y+ zdLJaerP6@Fx>m(2hF=6h3#fz?T13T~!a>mJB3f4cEA$)OBj2Gm^|61)L+3o!tz5)& zthvS*)K^h?qeYJ_LUq=rK2@up90uuw#G{FtIJlZA>(k7CAq_1;WvdhFll)cBAnkyz z<{otz>ND3wpFGVeS_NLVrAurf@l7-LgReERb+#ZVn};b&rtCeFDHv5*z)u-iH7H N002ovPDHLkV1hc!0owoo literal 0 HcmV?d00001 diff --git a/Shortcuts/graphics/path-remote-control-x32.png b/Shortcuts/graphics/path-remote-control-x32.png new file mode 100644 index 0000000000000000000000000000000000000000..51eb4238bd913c581b39953eaea02bb27ca22baf GIT binary patch literal 671 zcmV;Q0$}}#P)N2bZe?^J zG%hhNHDpIvQUCw~9Z5t%R9HvFmM=5~K@^8K2!il}AP9o+f*=T@CQIKAgdmd&6JACSVQrAWXt@!lK1BxkR8iz)!(OU>>&N1Xj$y z3!Mo9AFyum8EKe;&S_;u`o6HcU5Rpg2y%bw)5P=O$dhf%){*5^ta- z-hm|;FW&zXd}mmub5J94YcUnnBz*Z)y-;=}$tY;g)Od#@&{L;X+;2J}Nv2@Pvik9si?Hq+V>H!QZM-24pkE_ z_Mw6FEvS=xqfZ}~Ug(JM*}Z|;Y=^4ph;VpF=zGx2cB+zmBOI#|FLfo6Z%~Awf{aN_ zX5&>*cI1;-F2+5u_BrCAnEJRe*U8%e^QIec3Nyui7M}*yjgl@UA)m$6XSx(GI*MTW zA(0RoXc5{+Gp1j&_=l8BLfU+4s88urpKEwvS^*u+uONre(=1qg7)nVPT_;cP_naP> z5?O^fXj-7yF({!+h)LeVmFX`h7q0U=u+fZGeMorRLDv)3b@mFTPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E;VFFSW*B00cJ@=K~zXf?UOxA13?gmPb^|YtJoSuNF!ot zD#1ntYXv(cpn?*yNRdhlyHqIxexXGQTMO;AidZU^78dydiXVi;+~t{dlndcbyK%%y)+juK#U^ZbqO;UnGH#&c0RtFHZ zRXJfC%H(UrITuf`0mom<|1WAygE82LL314yxjeJ(8xR*6WQe`Gw^3*f_&I|G82$z? zNqm4%Zt%?D5$;^vLmfi7K~3`xh1LL?Ag9j3EUZEW*1@v@-Y48Z7Nl-lb6fqN2C`WS zWWx(6z&NDAuYnwD0(L;^wwO-Bwfd&P3Cx2u_)wz(@_AyUE5xz~o3IQoAbN*Mm;v#N z`Y6q_oPwq_5Ha3U%U7)1g}Tfc1ofYd=h^yqY?zsRy$DVhX}cNy~i00000NkvXXu0mjf>gLG< literal 0 HcmV?d00001 diff --git a/Shortcuts/graphics/unit-remote-control-x24.png b/Shortcuts/graphics/unit-remote-control-x24.png new file mode 100644 index 0000000000000000000000000000000000000000..52a5cbcec6564d46e3b0788e3a384c874a39ff7a GIT binary patch literal 493 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E;VFFSW*B00bWT&K~zXf?UTPt0$~`(?{FxkrdpE_S|S>2 z3R)^?E^sq~3XGz`p{a(priP$j)ZpOSP`ge_W762r&>v9rgRs;-&wKC5MR%UcJKh&Q zexD!j^FDW?RwNVJwQc*ZM{e~U!Q#*<*6amlpYisJ7T`*=B*$>(Mc2=9-wVQERxOAV z-06-B$}PVUdC?_|%PW$P)L#3UNMwO~}A2G~k2tQ}`T6|A@S$ z847jWeYyix4H4(|p++b(@>Qpu&VTjOyn;6Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E;VFFSW*B00fk9KK~z{r?bSOkLvb9&@oF`8BBA24xy1|c z7DO4Pi^bv%6q86aY3w4b1~x`EgN02(jG}{(u(<_^`abRNH0PY4JxTwG#CeiWbNavj z&ZVb`IB}w+TrMx-poz9^>Bho@9W*l~Te`6@Aub>;z+C}+naA!gI^m`O4%%^xCCr9g zLm7ax0&+M*s?y*KZF*rSZVKQdjbr3(&p>E*Uceyk(PeuELc8+KD53+fdZZ}i6nY4 ziWK^Bi6{k}pc}0iK@YU<1YY4KP{67^^?DdJ=p9-}Z^?0F&`1F~kuh}O6k11ZTDJuS zc&QYyj!o!YKa5ZKvjLrn%wemJf}M!g^ydRZ=z}-5sIj%sFpY4ItUFSecV3+yNY1*y z4+C_sbh-Rlw(dw_-b!_PElfwJq05-Iu1H~Co6Xn8SIAmdoH&0eiNqJl WQ;zyPTEW)<0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02p*dSaefwW^{L9 za%BK;VQFr3E^cLXAT%y9E;VFFSW*B00gOpRK~z{r?bf+U15p&l@wj2H2rjsEZukJc zg1D5D#>U1MaH&L45PK1AEws~8I}01_1jSOc5C!erP{Hy41qSZK!^8=>*TNk575C)K znUma`NpevX{V6jUl9>$2Ooo&-=5bI#+sG6<(Abr7gG^B!pgMrp0cNn9q6OXtXu=&9 zFjeFlD(-=|0rEIQU160BJup=4ZGZ+GV^#|zybsWe2efKog!chfp_|ldVZ}`Ns zTwo5`2A6((9-(4y1H3wkH2-6OckE#j<5l1O+we22|LP%`$&k!sNM