Compatible with Factorio 0.18

This commit is contained in:
David Skrundz 2020-04-01 20:47:39 -06:00
parent bd54f82739
commit 7c30f129f9
No known key found for this signature in database
GPG Key ID: 9A0FA0614CE9422E
10 changed files with 66 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.zip

5
README.md Normal file
View File

@ -0,0 +1,5 @@
# Dark Night
Make night completely dark.
![Alt text](/before-after.png?raw=true)

BIN
before-after.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 KiB

5
changelog.txt Normal file
View File

@ -0,0 +1,5 @@
---------------------------------------------------------------------------------------------------
Version: 0.1.0
Date: 01.04.2020
Features:
- Initial release

11
data-updates.lua Normal file
View File

@ -0,0 +1,11 @@
local function convertPath(path)
return path:gsub("__core__", "__DarkNight__") -- Mod change
end
for _, table in pairs(data.raw["utility-constants"]["default"].daytime_color_lookup) do
table[2] = convertPath(table[2])
end
for _, table in pairs(data.raw["utility-constants"]["default"].zoom_to_world_daytime_color_lookup) do
table[2] = convertPath(table[2])
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

13
info.json Normal file
View File

@ -0,0 +1,13 @@
{
"name":"DarkNight",
"version":"0.1.0",
"title":"Dark Night",
"description":"Make night completely dark.",
"author":"David Skrundz",
"contact": "david@skrundz.ca",
"homepage": "https://github.com/DavidSkrundz/DarkNight",
"factorio_version": "0.18",
"dependencies": [
"base >= 0.18.0"
]
}

31
package.py Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env python3
import json
import os
from zipfile import ZipFile
modFiles = [
"info.json",
"changelog.txt",
"thumbnail.png",
"data-updates.lua",
]
modFolders = [
"graphics",
]
with open("info.json") as file:
modInfo = json.load(file)
zipName = "{}_{}".format(modInfo["name"], modInfo["version"])
with ZipFile("{}.zip".format(zipName), 'w') as modZip:
for file in modFiles:
modZip.write(file, arcname="{}/{}".format(zipName, file))
for folder in modFolders:
for root, dirs, files in os.walk(folder):
for file in files:
filePath = os.path.join(root, file)
archivePath = os.path.relpath(filePath, os.path.join(folder, '..'))
modZip.write(filePath, arcname="{}/{}".format(zipName, archivePath))

BIN
thumbnail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB