Skip to content

Commit

Permalink
Merge branch 'master' into HotkeySupport
Browse files Browse the repository at this point in the history
# Conflicts:
#	changelog.txt
#	settings/shuttle-train-sets.lua
  • Loading branch information
Nexela committed Jul 16, 2016
2 parents 0d813ca + b4ace3f commit b51f05a
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 51 deletions.
31 changes: 18 additions & 13 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ MOD = { NAME = "Autofill", IF = "af" }
require "loader"
loader.addItemArray "settings/vanilla-items"
loader.addSets "settings/vanilla-sets"
loader.extendItemArray "settings/generic-items"
loader.addItemArray "settings/generic-newitems"
loader.addSets "settings/generic-sets"
loader.addItemArray "settings/bob-newitems" --bobwarfare added Artillery and Laser Ammo
loader.extendItemArray "settings/bob-items" -- Bob Warfare Bullets, Cannon Shells - TODO have it prio extended items
loader.addSets "settings/bob-sets" -- Bobwarfare added tanks 2 and 3
loader.addSets "settings/farl-sets"
loader.extendItemArray "settings/ammobox-items"
loader.addSets "settings/ammobox-sets"
loader.addItemArray "settings/yuoki-ind-newitems" --New Ammo Catergories for YI
loader.extendItemArray "settings/yuoki-ind-items" -- YI Bullets
loader.addSets "settings/yuoki-ind-sets" -- YI Item Sets
loader.addSets "settings/shuttle-train-sets" -- Autofill for shuttle trains
loader.extendItemArray "settings/aircraft-items"
loader.addSets "settings/aircraft-sets"
loader.addSets "settings/5dim-sets"
loader.extendItemArray "settings/up-items" -- Uranium Power Bullets and Cannon Shells -UNTESTED but based on the same concepts as the other additions so it should work.



--flying text colors
Expand All @@ -38,7 +34,7 @@ local order = {
--

script.on_configuration_changed(function()
initMod(true)
initMod()
end)

script.on_init(function()
Expand All @@ -49,10 +45,11 @@ script.on_event(defines.events.on_built_entity, function(event)
local player = game.players[event.player_index]
local global = global
if global.personalsets[player.name] and global.personalsets[player.name].active then
local fillset = global.personalsets[player.name][event.created_entity.name] or global.defaultsets[event.created_entity.name]
--globalPrint(global.defaultsets[event.created_entity.name])
local fillset = global.personalsets[player.name][event.created_entity.name] or global.defaultsets[event.created_entity.name]
if fillset ~= 0 and fillset ~= nil then
autoFill(event.created_entity, player, fillset)
end
end
end
end)

Expand Down Expand Up @@ -278,12 +275,20 @@ end

function globalPrint(msg)
local players = game.players
msg = { "autofill.msg-template", msg }
if type(msg) == "string" then
output= msg
else
output=serpent.dump(msg, {name="var", comment=false, sparse=false, sortkeys=true})
end
--msg = { "autofill.msg-template", msg }
for i=1, #players do
players[i].print(msg)
players[i].print(output)
end
printToFile(output)
end



function initMod(reset)
if not global.defaultsets or not global.personalsets or not global.item_arrays or reset then
global = {} -- Clears global
Expand Down Expand Up @@ -374,7 +379,7 @@ end
function printToFile(line, path)
path = path or "log"
path = table.concat({ MOD.IF, "/", path, ".txt" })
game.makefile( path, line)
game.write_file( path, line.."\n\n", true)
end
--]]

Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autofill",
"version": "1.3.16",
"version": "1.3.17",
"factorio_version": "0.13",
"title": "Autofill",
"author": "rk84",
Expand Down
2 changes: 1 addition & 1 deletion loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ loader = {
table.sort(all, fuelHighToLow)
table.sort(high, fuelHighToLow)
end
}
}
4 changes: 0 additions & 4 deletions settings/aircraft-items.lua

This file was deleted.

9 changes: 0 additions & 9 deletions settings/ammobox-items.lua

This file was deleted.

7 changes: 0 additions & 7 deletions settings/ammobox-sets.lua

This file was deleted.

3 changes: 0 additions & 3 deletions settings/farl-sets.lua

This file was deleted.

10 changes: 10 additions & 0 deletions settings/generic-items.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--
-- Disclaimer: mp warranty void if edited.
--

return {
["ammo-bullets"] = {"uranium-bullet-magazine"}, --Uranium Power
["ammo-bullets"] = {"basic-bullet-ammo-box", "piercing-bullet-ammo-box"}, --Ammobox
["ammo-shells"] = {"uranium-small-nuke-shell", "uranium-cannon-shell"}, --Uranium Power
["ammo-shells"] = {"high-explosive-cannon-shell"} --Aircraft
}
7 changes: 7 additions & 0 deletions settings/generic-newitems.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--
-- Disclaimer: mp warranty void if edited.
--

return {
["combat-units"] = {"destroyer-unit-ammo", "defender-unit-ammo", "distractor-unit-ammo"} --Combat Units
}
11 changes: 11 additions & 0 deletions settings/generic-sets.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--
-- Disclaimer: mp warranty void if edited.
--

return {
["bulldozer"] = {slots={2}, "fuels-all"}, --Bulldozer
["unit-launcher"] = {priority=1, slots={1}, group="combatunitlauncher", "combat-units"}, --Combat Units
["farl"] = {group="locomotives", "fuels-high"}, --FARL
["shuttleTrain"] = {group="locomotives", "fuels-high"}, --ShuttleTrain
["ammobox-gun-turret-2"]= {group="turrets", limits= {10}, "ammo-bullets" } --Ammobox
}
3 changes: 0 additions & 3 deletions settings/shuttle-train-sets.lua

This file was deleted.

10 changes: 0 additions & 10 deletions settings/up-items.lua

This file was deleted.

0 comments on commit b51f05a

Please sign in to comment.