0.7.0: AAI support, autogen shortcuts.
See changelog.txt for rest of changes
21
LICENSE.txt
Normal file
|
@ -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.
|
|
@ -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
|
Version: 0.6.0
|
||||||
Date: 2019-03-29
|
Date: 2019-03-29
|
||||||
|
|
|
@ -80,39 +80,53 @@ local function toggle_rail(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function update_inventory(event) -- removes spare remotes
|
-- local function update_inventory(event) -- removes spare remotes
|
||||||
local item_prototypes = game.item_prototypes
|
-- local item_prototypes = game.item_prototypes
|
||||||
local inventory = game.players[event.player_index].get_inventory(defines.inventory.player_main)
|
-- local inventory = game.players[event.player_index].get_inventory(defines.inventory.player_main)
|
||||||
if inventory and inventory.valid then
|
-- if inventory and inventory.valid then
|
||||||
inventory.remove("artillery-targeting-remote")
|
-- if settings.startup["artillery-targeting-remote"].value == true then
|
||||||
inventory.remove("artillery-jammer-tool")
|
-- inventory.remove("artillery-targeting-remote")
|
||||||
inventory.remove("discharge-defense-remote")
|
-- end
|
||||||
inventory.remove("shortcuts-deconstruction-planner")
|
-- if settings.startup["artillery-jammer-remote"].value == true then
|
||||||
if item_prototypes["resource-monitor"] then
|
-- inventory.remove("artillery-jammer-tool")
|
||||||
inventory.remove("resource-monitor")
|
-- end
|
||||||
end
|
-- if settings.startup["discharge-defense-remote"].value == true then
|
||||||
if item_prototypes["outpost-builder"] then
|
-- inventory.remove("discharge-defense-remote")
|
||||||
inventory.remove("outpost-builder")
|
-- end
|
||||||
end
|
-- if settings.startup["tree-killer"].value == true then
|
||||||
if item_prototypes["ion-cannon-targeter"] then
|
-- inventory.remove("shortcuts-deconstruction-planner")
|
||||||
inventory.remove("ion-cannon-targeter")
|
-- end
|
||||||
end
|
-- if item_prototypes["resource-monitor"] and settings.startup["resource-monitor"].value == true then
|
||||||
if item_prototypes["max-rate-calculator"] then
|
-- inventory.remove("resource-monitor")
|
||||||
inventory.remove("max-rate-calculator")
|
-- end
|
||||||
end
|
-- if item_prototypes["outpost-builder"] and settings.startup["outpost-builder"].value == true then
|
||||||
if item_prototypes["module-inserter"] then
|
-- inventory.remove("outpost-builder")
|
||||||
inventory.remove("module-inserter")
|
-- end
|
||||||
end
|
-- if item_prototypes["ion-cannon-targeter"] and settings.startup["ion-cannon-targeter"].value == true then
|
||||||
end
|
-- inventory.remove("ion-cannon-targeter")
|
||||||
end
|
-- 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
|
local function false_shortcuts(player) -- disables things
|
||||||
player.set_shortcut_available("night-vision-equipment", false)
|
if settings.startup["night-vision-equipment"].value == true then
|
||||||
player.set_shortcut_toggled("night-vision-equipment", false)
|
player.set_shortcut_available("night-vision-equipment", false)
|
||||||
player.set_shortcut_available("belt-immunity-equipment", false)
|
player.set_shortcut_toggled("night-vision-equipment", false)
|
||||||
player.set_shortcut_toggled("belt-immunity-equipment", false)
|
end
|
||||||
player.set_shortcut_available("active-defense-equipment", false)
|
if settings.startup["active-defense-equipment"].value == true then
|
||||||
player.set_shortcut_toggled("active-defense-equipment", false)
|
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
|
end
|
||||||
|
|
||||||
local function enable_it(player, equipment, grid, type) -- enables things
|
local function enable_it(player, equipment, grid, type) -- enables things
|
||||||
|
@ -387,7 +401,7 @@ local function shortcut_type(event)
|
||||||
end
|
end
|
||||||
elseif prototype_name == "flashlight-toggle" then
|
elseif prototype_name == "flashlight-toggle" then
|
||||||
toggle_light(game.players[event.player_index])
|
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])
|
toggle_rail(game.players[event.player_index])
|
||||||
elseif prototype_name == "signal-flare" then
|
elseif prototype_name == "signal-flare" then
|
||||||
local player = game.players[event.player_index]
|
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_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)
|
script.on_event(defines.events.on_player_created, function(event)
|
||||||
local player = game.players[event.player_index]
|
local player = game.players[event.player_index]
|
||||||
player.set_shortcut_toggled("flashlight-toggle", true)
|
if settings.startup["flashlight-toggle"].value == true then
|
||||||
player.set_shortcut_toggled("rail-block-visualization-toggle", false)
|
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
|
if not game.active_mods["Nanobots"] then
|
||||||
player.set_shortcut_available("night-vision-equipment", false)
|
if settings.startup["night-vision-equipment"].value == true then
|
||||||
player.set_shortcut_available("belt-immunity-equipment", false)
|
player.set_shortcut_available("night-vision-equipment", false)
|
||||||
player.set_shortcut_available("active-defense-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
|
else
|
||||||
player.print("WARNING: Shortcuts for modular equipment disabled as Nanobots is installed")
|
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\"")
|
player.print("> Use the Nanobots hotkeys instead: \"Ctrl F1 - F7 Will toggle specific modular armor equipment on or off\"")
|
||||||
|
|
|
@ -1,88 +1,122 @@
|
||||||
require("shortcuts")
|
require("shortcuts")
|
||||||
|
|
||||||
local function hide_the_remote(recipe, technology)
|
local function hide_the_remote(recipe, technology, item)
|
||||||
data.raw["recipe"][recipe].hidden = true
|
if item then
|
||||||
data.raw["recipe"][recipe].ingredients ={{"iron-plate", 1}}
|
if item.flags then
|
||||||
if technology ~= nil then
|
item.flags[#item.flags+1] = "only-in-cursor"
|
||||||
local effect = data.raw["technology"][technology].effects
|
else
|
||||||
for i=1,(#effect) do
|
item.flags = {"only-in-cursor"}
|
||||||
if effect[i].type == "unlock-recipe" then
|
end
|
||||||
if effect[i].recipe == recipe then
|
end
|
||||||
table.remove(effect, i)
|
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
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
hide_the_remote("artillery-targeting-remote", "artillery")
|
if settings.startup["artillery-targeting-remote"].value == true then
|
||||||
hide_the_remote("discharge-defense-remote", "discharge-defense-equipment")
|
hide_the_remote("artillery-targeting-remote", "artillery", data.raw["capsule"]["artillery-targeting-remote"])
|
||||||
if mods["YARM"] and data.raw["item"]["resource-monitor"] and data.raw["technology"]["resource-monitoring"] then
|
|
||||||
hide_the_remote("resource-monitor", "resource-monitoring")
|
|
||||||
end
|
end
|
||||||
if mods["OutpostPlanner"] and mods["PlannerCore"] and data.raw["selection-tool"]["outpost-builder"] then
|
if settings.startup["discharge-defense-remote"].value == true then
|
||||||
hide_the_remote("outpost-builder", nil)
|
hide_the_remote("discharge-defense-remote", "discharge-defense-equipment", data.raw["capsule"]["discharge-defense-remote"])
|
||||||
end
|
end
|
||||||
if mods["Orbital Ion Cannon"] and data.raw["item"]["ion-cannon-targeter"] and data.raw["technology"]["orbital-ion-cannon"] then
|
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("ion-cannon-targeter", "orbital-ion-cannon")
|
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
|
end
|
||||||
|
|
||||||
local disabled_equipment = {}
|
local disabled_equipment = {}
|
||||||
local disabled_equipment_item = {}
|
local disabled_equipment_item = {}
|
||||||
local equipment_list = {
|
local equipment_list = {}
|
||||||
"night-vision-equipment",
|
|
||||||
"belt-immunity-equipment",
|
if settings.startup["night-vision-equipment"].value == true then
|
||||||
"active-defense-equipment",
|
equipment_list[#equipment_list+1] = "night-vision-equipment"
|
||||||
}
|
end
|
||||||
if mods["Nanobots"] then
|
if settings.startup["belt-immunity-equipment"].value == true then
|
||||||
equipment_list = {}
|
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
|
end
|
||||||
|
|
||||||
for i=1,(#equipment_list) do
|
if not mods["Nanobots"] then
|
||||||
for _, equipment in pairs(data.raw[equipment_list[i]]) do
|
|
||||||
local i = #disabled_equipment+1
|
for i=1,(#equipment_list) do
|
||||||
disabled_equipment[i] = util.table.deepcopy(equipment)
|
for _, equipment in pairs(data.raw[equipment_list[i]]) do
|
||||||
local name = disabled_equipment[i].name
|
local i = #disabled_equipment+1
|
||||||
if (equipment.type == "active-defense-equipment" and equipment.automatic == true) or equipment.type ~= "active-defense-equipment" then
|
disabled_equipment[i] = util.table.deepcopy(equipment)
|
||||||
disabled_equipment[i].name = "disabled-" .. name
|
local name = disabled_equipment[i].name
|
||||||
disabled_equipment[i].localised_name = {"", {"equipment-name." .. name}, " (", {"gui-constant.off"}, ")"}
|
if (equipment.type == "active-defense-equipment" and equipment.automatic == true) or equipment.type ~= "active-defense-equipment" then
|
||||||
elseif (equipment.type == "active-defense-equipment" and equipment.automatic == false) then
|
disabled_equipment[i].name = "disabled-" .. name
|
||||||
disabled_equipment[i].name = "disabledinactive-" .. name
|
disabled_equipment[i].localised_name = {"", {"equipment-name." .. name}, " (", {"gui-constant.off"}, ")"}
|
||||||
disabled_equipment[i].localised_name = {"equipment-name." .. name}
|
elseif (equipment.type == "active-defense-equipment" and equipment.automatic == false) then
|
||||||
end
|
disabled_equipment[i].name = "disabledinactive-" .. name
|
||||||
disabled_equipment[i].energy_input = "0kW"
|
disabled_equipment[i].localised_name = {"equipment-name." .. name}
|
||||||
disabled_equipment[i].take_result = name
|
end
|
||||||
if equipment_list[i] == "belt-immunity-equipment" or (equipment.type == "active-defense-equipment" and equipment.automatic == true) then
|
disabled_equipment[i].energy_input = "0kW"
|
||||||
disabled_equipment[i].energy_source.input_flow_limit = "0kW"
|
disabled_equipment[i].take_result = name
|
||||||
disabled_equipment[i].energy_source.buffer_capacity = "0kJ"
|
if equipment_list[i] == "belt-immunity-equipment" or (equipment.type == "active-defense-equipment" and equipment.automatic == true) then
|
||||||
disabled_equipment[i].energy_source.drain = "1kW"
|
disabled_equipment[i].energy_source.input_flow_limit = "0kW"
|
||||||
end
|
disabled_equipment[i].energy_source.buffer_capacity = "0kJ"
|
||||||
|
disabled_equipment[i].energy_source.drain = "1kW"
|
||||||
if not data.raw["item"][equipment_list[i]] then --for mods which have a different item name compared to equipment name
|
end
|
||||||
disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"]["night-vision-equipment"])
|
|
||||||
|
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].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
|
disabled_equipment_item[i].placed_as_equipment_result = name
|
||||||
end
|
end
|
||||||
|
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
|
for i=1,(#disabled_equipment),1 do
|
||||||
disabled_equipment_item[i] = util.table.deepcopy(data.raw["item"]["night-vision-equipment"])
|
data:extend({disabled_equipment[i]})
|
||||||
|
if disabled_equipment_item[i] then
|
||||||
|
data:extend({disabled_equipment_item[i]})
|
||||||
end
|
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
|
||||||
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
|
end
|
||||||
|
|
||||||
data:extend({
|
data:extend({
|
||||||
|
@ -94,7 +128,6 @@ data:extend({
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
subgroup = "virtual-signal-color",
|
subgroup = "virtual-signal-color",
|
||||||
order = "d[colors]-[9danger]",
|
order = "d[colors]-[9danger]",
|
||||||
hidden = true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "virtual-signal",
|
type = "virtual-signal",
|
||||||
|
@ -104,7 +137,6 @@ data:extend({
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
subgroup = "virtual-signal-color",
|
subgroup = "virtual-signal-color",
|
||||||
order = "d[colors]-[9disabled]",
|
order = "d[colors]-[9disabled]",
|
||||||
hidden = true,
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -113,51 +145,131 @@ local disabled_turret_item = {}
|
||||||
local disabled_gun = {}
|
local disabled_gun = {}
|
||||||
local disable_turret_list = {}
|
local disable_turret_list = {}
|
||||||
|
|
||||||
if settings.startup["artillery-toggle"].value == "both" then
|
if settings.startup["artillery-jammer-remote"].value == true then
|
||||||
disable_turret_list = {"artillery-wagon", "artillery-turret",}
|
if settings.startup["artillery-toggle"].value == "both" then
|
||||||
elseif settings.startup["artillery-toggle"].value == "artillery-wagon" then
|
disable_turret_list = {"artillery-wagon", "artillery-turret",}
|
||||||
disable_turret_list = {"artillery-wagon"}
|
elseif settings.startup["artillery-toggle"].value == "artillery-wagon" then
|
||||||
elseif settings.startup["artillery-toggle"].value == "artillery-turret" then
|
disable_turret_list = {"artillery-wagon"}
|
||||||
disable_turret_list = {"artillery-turret"}
|
elseif settings.startup["artillery-toggle"].value == "artillery-turret" then
|
||||||
end
|
disable_turret_list = {"artillery-turret"}
|
||||||
|
end
|
||||||
for i=1,(#disable_turret_list) do
|
|
||||||
for _, entity in pairs(data.raw[disable_turret_list[i]]) do
|
for i=1,(#disable_turret_list) do
|
||||||
local i = #disabled_turret+1
|
for _, entity in pairs(data.raw[disable_turret_list[i]]) do
|
||||||
disabled_turret[i] = util.table.deepcopy(entity)
|
local i = #disabled_turret+1
|
||||||
local name = disabled_turret[i].name
|
disabled_turret[i] = util.table.deepcopy(entity)
|
||||||
local gun = disabled_turret[i].gun
|
local name = disabled_turret[i].name
|
||||||
disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"][name])
|
local gun = disabled_turret[i].gun
|
||||||
if disabled_turret_item[i] == nil then
|
disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"][name])
|
||||||
disabled_turret_item[i] = util.table.deepcopy(data.raw["item"][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
|
end
|
||||||
if disabled_turret_item[i] == nil then
|
end
|
||||||
disabled_turret_item[i] = util.table.deepcopy(data.raw["item-with-entity-data"]["artillery-wagon"])
|
|
||||||
|
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
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for i=1,(#disabled_turret),1 do
|
if settings.startup["tree-killer"].value == true then
|
||||||
data:extend({disabled_turret[i]})
|
local decon_spec = util.table.deepcopy(data.raw["deconstruction-item"]["deconstruction-planner"])
|
||||||
if disabled_gun[i] then
|
decon_spec.name = "shortcuts-deconstruction-planner"
|
||||||
data:extend({disabled_gun[i]})
|
decon_spec.localised_name = {"item-name.deconstruction-planner"}
|
||||||
end
|
decon_spec.flags = {"only-in-cursor"}
|
||||||
if disabled_turret_item[i] then
|
data:extend({decon_spec})
|
||||||
data:extend({disabled_turret_item[i]})
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local decon_spec = util.table.deepcopy(data.raw["deconstruction-item"]["deconstruction-planner"])
|
if settings.startup["autogen"].value == true then
|
||||||
decon_spec.name = "shortcuts-deconstruction-planner"
|
|
||||||
decon_spec.localised_name = {"item-name.deconstruction-planner"}
|
-- create a post on the discussion page if you want your shortcut to be added to this blacklist.
|
||||||
data:extend({decon_spec})
|
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
|
BIN
Shortcuts/graphics/path-remote-control-x24-white.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
Shortcuts/graphics/path-remote-control-x24.png
Normal file
After Width: | Height: | Size: 582 B |
BIN
Shortcuts/graphics/path-remote-control-x32-white.png
Normal file
After Width: | Height: | Size: 627 B |
BIN
Shortcuts/graphics/path-remote-control-x32.png
Normal file
After Width: | Height: | Size: 671 B |
BIN
Shortcuts/graphics/unit-remote-control-x24-white.png
Normal file
After Width: | Height: | Size: 501 B |
BIN
Shortcuts/graphics/unit-remote-control-x24.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
Shortcuts/graphics/unit-remote-control-x32-white.png
Normal file
After Width: | Height: | Size: 532 B |
BIN
Shortcuts/graphics/unit-remote-control-x32.png
Normal file
After Width: | Height: | Size: 539 B |
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "Shortcuts",
|
"name": "Shortcuts",
|
||||||
"version": "0.6.0",
|
"version": "0.7.0",
|
||||||
"factorio_version": "0.17",
|
"factorio_version": "0.17",
|
||||||
"title": "Shortcuts",
|
"title": "Shortcuts",
|
||||||
"author": "npc_strider(morley376)",
|
"author": "npc_strider(morley376)",
|
||||||
"contact": "",
|
"contact": "",
|
||||||
"homepage": "http://steamcommunity.com/id/morley376",
|
"homepage": "http://steamcommunity.com/id/morley376",
|
||||||
"description": "Adds a host of useful shortcuts to improve QOL. Shortcuts for the artillery remote, discharge defense remote, tree deconstructor, and toggles for equipment, rail blocks and the player lamp. Additionally adds in a customizable grid overlay, far zoom and a artillery wagon toggle. Mod support for module inserter, orbital ion cannon, outpost planner and max rate calculator. Suggest any new shortcut ideas to the discussion page."
|
"description": "Adds a host of useful shortcuts to improve QOL. Shortcuts for the artillery remote, discharge defense remote, tree deconstructor, and toggles for equipment, rail blocks and the player lamp. Additionally adds in a customizable grid overlay, far zoom and a artillery wagon toggle. See mod portal FAQ page for a full list of shortcuts and supported mods. Suggest any new shortcut ideas to the discussion page."
|
||||||
}
|
}
|
|
@ -79,6 +79,194 @@ data:extend({
|
||||||
localised_name = {"", {"item-name.artillery-wagon-cannon"}, " ", {"gui-mod-info.toggle"}, " ", {"description.decorative-type"}},
|
localised_name = {"", {"item-name.artillery-wagon-cannon"}, " ", {"gui-mod-info.toggle"}, " ", {"description.decorative-type"}},
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
allowed_values = {"both", "artillery-wagon", "artillery-turret"},
|
allowed_values = {"both", "artillery-wagon", "artillery-turret"},
|
||||||
default_value = "both"
|
default_value = "both",
|
||||||
}
|
order = "a"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "autogen",
|
||||||
|
localised_name = {"", "Auto-", {"gui-new-game.create"}, " ", {"gui-update.mod"}, " shortcuts"},
|
||||||
|
localised_description = {"", {""}, "Automatically generate shortcuts for mods which are not officially supported by this mod through a script."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "a"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
{ -- for each shortcut (to free up space for other modded shortcuts)
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "artillery-targeting-remote",
|
||||||
|
localised_name = {"", {"item-name.artillery-targeting-remote"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "draw-grid",
|
||||||
|
localised_name = {"", {"gui.grid"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "rail-block-visualization-toggle",
|
||||||
|
localised_name = {"", {"gui-interface-settings.show-rail-block-visualization"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "artillery-jammer-remote",
|
||||||
|
localised_name = {"", {"gui-mod-info.toggle"}, " ", {"entity-name.artillery-wagon"}, " ", {"damage-type-name.fire"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "tree-killer",
|
||||||
|
localised_name = {"", {"item-name.deconstruction-planner"}, " (", {"gui-deconstruction.whitelist-trees-and-rocks"}, ") ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "discharge-defense-remote",
|
||||||
|
localised_name = {"", {"item-name.discharge-defense-remote"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "flashlight-toggle",
|
||||||
|
localised_name = {"", {"entity-name.small-lamp"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "big-zoom",
|
||||||
|
localised_name = {"", {"controls.alt-zoom-out"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "signal-flare",
|
||||||
|
localised_name = {"", {"technology-name.military"}, " ", {"entity-name.beacon"}, " (", {"description.force"}, " ", {"deconstruction-tile-mode.only"}, ") ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "za"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Since we cannot conditionally extend mod settings, we have to implement them whether the mod is enabled or not :(
|
||||||
|
data:extend(
|
||||||
|
{
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "resource-monitor",
|
||||||
|
localised_name = {"", {"item-name.resource-monitor"}, " ", {"gui-mod-info.toggle"}, " (LEGACY YARM)"},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "path-remote-control",
|
||||||
|
localised_name = {"", {"item-name.path-remote-control"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "unit-remote-control",
|
||||||
|
localised_name = {"", {"item-name.unit-remote-control"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "outpost-builder",
|
||||||
|
localised_name = {"", {"item-name.outpost-builder"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "ion-cannon-targeter",
|
||||||
|
localised_name = {"", {"item-name.ion-cannon-targeter"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "max-rate-calculator",
|
||||||
|
localised_name = {"", {"item-name.max-rate-calculator"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "module-inserter",
|
||||||
|
localised_name = {"", {"item-name.module-inserter"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "night-vision-equipment",
|
||||||
|
localised_name = {"", {"equipment-name.night-vision-equipment"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "active-defense-equipment",
|
||||||
|
localised_name = {"", {"equipment-name.personal-laser-defense-equipment"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "bool-setting",
|
||||||
|
name = "belt-immunity-equipment",
|
||||||
|
localised_name = {"", {"equipment-name.belt-immunity-equipment"}, " ", {"gui-mod-info.toggle"}},
|
||||||
|
localised_description = {"", {""}, "Disable specific shortcuts to free up space for other modded shortcuts, or to slightly increase performance and load time."},
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = true,
|
||||||
|
order = "zz"
|
||||||
|
}
|
||||||
})
|
})
|