Skip to content
Snippets Groups Projects
Commit 5b9e00b7 authored by Rsge's avatar Rsge
Browse files

Made the script a little bit more easily configurable

parent 55ceebe3
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,13 @@ os.chdir("../..") ...@@ -14,8 +14,13 @@ os.chdir("../..")
##Global Values ##Global Values
print("Configuring variables...") print("Configuring variables...")
#Names #Names
# Customize according to your setup here #
vanilla_eui_zip = "!EUI.7z" # Vanilla EUI file (in vanilla_packs_folder)
modded_eui_zip = "!EUI_CUC.7z" # CUC-version file name of EUI
modsave_folder = "zzz_Modsaves" # Folder containing this scripts project folder and it's needed edited files
vanilla_packs_folder = "zz_Vanilla_Versions" # Folder containing the vanilla packs
# Don't change from here [if you don't really know what you're doing that is of cause ;)] #
modpack_folder_name = "MP_MODSPACK" modpack_folder_name = "MP_MODSPACK"
modded_eui_zip_name = "EUI_CUC.7z"
eui_cu_file_names = ["CityBannerManager.lua", eui_cu_file_names = ["CityBannerManager.lua",
"CityView.lua", "CityView.lua",
"Highlights.xml"] "Highlights.xml"]
...@@ -31,18 +36,18 @@ unit_panel_modcompat_file_names = ["EvilSpiritsMission.lua", ...@@ -31,18 +36,18 @@ unit_panel_modcompat_file_names = ["EvilSpiritsMission.lua",
"THTanukiMission.lua"] "THTanukiMission.lua"]
#Paths #Paths
base_path = os.getcwd() base_path = os.getcwd()
modsave_path = j(base_path, "zzz_Modsaves") modsave_path = j(base_path, modsave_folder)
modpack_path = j(base_path, modpack_folder_name) modpack_path = j(base_path, modpack_folder_name)
vanilla_packs_path = j(base_path, "zz_Vanilla_Versions") vanilla_packs_path = j(base_path, vanilla_packs_folder)
ui_path = j(modpack_path, "UI") ui_path = j(modpack_path, "UI")
eui_path = j(base_path, "UI_bc1") eui_path = j(base_path, "UI_bc1")
szip = r"C:\Program Files\7-Zip\7z.exe" szip = r"C:\Program Files\7-Zip\7z.exe"
#Files #Files
base_eui_zip_path = j(vanilla_packs_path, vanilla_eui_zip)
modded_eui_zip_path = j(base_path, modded_eui_zip)
mod_files = j(modpack_path, "Mods", "**", "*.lua") mod_files = j(modpack_path, "Mods", "**", "*.lua")
ui_files = j(ui_path, "*.lua") ui_files = j(ui_path, "*.lua")
eui_files = j(eui_path, "*", "*.lua") eui_files = j(eui_path, "*", "*.lua")
base_eui_zip = j(vanilla_packs_path, "0EUI.7z")
modded_eui_zip_path = j(base_path, modded_eui_zip_name)
#Global Variables #Global Variables
load_tags = {} load_tags = {}
...@@ -70,14 +75,14 @@ if os.path.isdir(eui_path): ...@@ -70,14 +75,14 @@ if os.path.isdir(eui_path):
#Compile EUI with colored unlocked citizens #Compile EUI with colored unlocked citizens
if not os.path.isfile(modded_eui_zip_path): if not os.path.isfile(modded_eui_zip_path):
print("Creating colored unlocked Citizens EUI...") print("Creating colored unlocked Citizens EUI...")
subprocess.run([szip, 'x', base_eui_zip], stdout=null, stderr=null) subprocess.run([szip, 'x', base_eui_zip_path], stdout=null, stderr=null)
#shutil.move(j(vanilla_packs_path, eui_file_name), eui_path) #shutil.move(j(vanilla_packs_path, eui_file_name), eui_path)
for eui_cu_file_name in eui_cu_file_names: for eui_cu_file_name in eui_cu_file_names:
eui_cu_file = g(j(modsave_path, eui_cu_file_name + "*"))[0] eui_cu_file = g(j(modsave_path, eui_cu_file_name + "*"))[0]
orig_eui_file = g(j(eui_path, "*", eui_cu_file_name))[0] orig_eui_file = g(j(eui_path, "*", eui_cu_file_name))[0]
shutil.move(orig_eui_file, orig_eui_file + ".orig") shutil.move(orig_eui_file, orig_eui_file + ".orig")
shutil.copyfile(eui_cu_file, orig_eui_file) shutil.copyfile(eui_cu_file, orig_eui_file)
subprocess.run([szip, 'a', modded_eui_zip_name, eui_path], stdout=null, stderr=null) subprocess.run([szip, 'a', modded_eui_zip, eui_path], stdout=null, stderr=null)
else: else:
#Unzip EUI #Unzip EUI
print("Unzipping EUI...") print("Unzipping EUI...")
......
...@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ...@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\.gitattributes = ..\.gitattributes ..\.gitattributes = ..\.gitattributes
..\.gitignore = ..\.gitignore ..\.gitignore = ..\.gitignore
..\Readme.md = ..\Readme.md
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
......
# EUI Converter
A script for Civilization 5 to add colored unlocked citizens (CUC) to EUI and EUI to MPMPM modpacks.
The following things are assumed when running the script without changes:
* Having [7-zip](https://www.7-zip.org/) installed in the standard programs directory.
* Every pack being saved as a .7z or .rar archive.
* This folder structure:
* *steamapps\common\Sid Meier's Civilization V\Assets\DLC\*
EUI-Modpacks and EUI with CUC
* *zzz_Modsaves\*
Edited files
* *EUI_Converter\*
Script and project files
* *zz_Vanilla_Versions\*
Vanilla Modpacks and EUI
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment