Skip to content
Snippets Groups Projects
Commit 18e23dc9 authored by Rsge's avatar Rsge
Browse files

Fixed small mistake in UnitPanel mod compat

parent dc64fdd9
No related branches found
No related tags found
No related merge requests found
######################################################################## ########################################################################
# # # #
# © 2021 - MPL 2.0 - Rsge - v2.1.0 # # © 2021 - MPL 2.0 - Rsge - v2.1.1 #
# https://github.com/Rsge/Civ-V-EUI-Modpack-Converter # # https://github.com/Rsge/Civ-V-EUI-Modpack-Converter #
# # # #
# WINDOWS ONLY! # # WINDOWS ONLY! #
...@@ -84,7 +84,7 @@ print("Configuring variables...") ...@@ -84,7 +84,7 @@ print("Configuring variables...")
# Names # Names
modpack_folder_name = "MP_MODSPACK" modpack_folder_name = "MP_MODSPACK"
preservation_extension = ".orig" preservation_extension = ".orig"
load_tag = "ContextPtr:LoadNewContext" load_tag_marker = "ContextPtr:LoadNewContext"
unit_panel_tag = "LuaEvents.UnitPanelActionAddin" unit_panel_tag = "LuaEvents.UnitPanelActionAddin"
unit_panel_insert_marker = "--Insert ContextPtr for modded unit panel buttons here\n" unit_panel_insert_marker = "--Insert ContextPtr for modded unit panel buttons here\n"
eui_cuc_file_names = ["CityBannerManager.lua", eui_cuc_file_names = ["CityBannerManager.lua",
...@@ -191,7 +191,7 @@ for mod_file in g(mod_files, recursive = True): ...@@ -191,7 +191,7 @@ for mod_file in g(mod_files, recursive = True):
shutil.copyfile(g(j(modsave_path, ige_compat_file_name + "*"))[0], mod_file) shutil.copyfile(g(j(modsave_path, ige_compat_file_name + "*"))[0], mod_file)
# Delete UI overwrite duplicates # Delete UI overwrite duplicates
elif mod_file_name in vanilla_ui_file_names: elif mod_file_name in vanilla_ui_file_names:
print("\tRemoving overwriting file \"{}\"...".format(mod_file_short_path)) print('\tRemoving overwriting file "{}"...'.format(mod_file_short_path))
os.remove(mod_file) os.remove(mod_file)
# Get unit panel addon files # Get unit panel addon files
else: else:
...@@ -199,7 +199,7 @@ for mod_file in g(mod_files, recursive = True): ...@@ -199,7 +199,7 @@ for mod_file in g(mod_files, recursive = True):
lines = file.readlines() lines = file.readlines()
for line in lines: for line in lines:
if unit_panel_tag in line: if unit_panel_tag in line:
print("\tDetecting unit panel addon in file \"{}\"...".format(mod_file_short_path)) print('\tDetecting unit panel addon in file "{}"...'.format(mod_file_short_path))
unit_panel_addon_file_names.append(mod_file_name) unit_panel_addon_file_names.append(mod_file_name)
break break
...@@ -221,7 +221,7 @@ for ui_file in g(ui_files): ...@@ -221,7 +221,7 @@ for ui_file in g(ui_files):
with open(ui_file, 'r') as file: with open(ui_file, 'r') as file:
lines = file.readlines() lines = file.readlines()
for line in lines: for line in lines:
if line.startswith(load_tag): if line.startswith(load_tag_marker):
load_tags[ui_file_name].append(line) load_tags[ui_file_name].append(line)
# Insert stuff into EUI files # Insert stuff into EUI files
...@@ -239,7 +239,7 @@ for eui_file in g(eui_files): ...@@ -239,7 +239,7 @@ for eui_file in g(eui_files):
print("Providing EUI-UnitPanel-Modcompat...") print("Providing EUI-UnitPanel-Modcompat...")
unit_panel_load_tags = "" unit_panel_load_tags = ""
for unit_panel_addon_file_name in unit_panel_addon_file_names: for unit_panel_addon_file_name in unit_panel_addon_file_names:
unit_panel_load_tags += "{}(\"{}\")\n".format(load_tag, p.splitext(unit_panel_addon_file_name)[0]) unit_panel_load_tags += '{}("{}")\n'.format(load_tag_marker, p.splitext(unit_panel_addon_file_name)[0])
shutil.move(eui_file, eui_file + preservation_extension) shutil.move(eui_file, eui_file + preservation_extension)
shutil.copyfile(g(j(modsave_path, unit_panel_file_name + "*"))[0], eui_file) shutil.copyfile(g(j(modsave_path, unit_panel_file_name + "*"))[0], eui_file)
with open(eui_file, 'r') as file: with open(eui_file, 'r') as file:
......
######################################################################## ########################################################################
# # # #
# © 2021 - MPL 2.0 - Rsge - v1.0.1 # # © 2021 - MPL 2.0 - Rsge - v1.0.2 #
# https://github.com/Rsge/Civ-V-EUI-Modpack-Converter # # https://github.com/Rsge/Civ-V-EUI-Modpack-Converter #
# # # #
# WINDOWS ONLY! # # WINDOWS ONLY! #
...@@ -22,6 +22,7 @@ vanilla_eui_zip = "!EUI.7z" ...@@ -22,6 +22,7 @@ vanilla_eui_zip = "!EUI.7z"
modded_eui_zip = "!EUI_CUC.7z" modded_eui_zip = "!EUI_CUC.7z"
# Folder containing this scripts project folder and it's needed edited files # Folder containing this scripts project folder and it's needed edited files
# (Sid Meier's Civilization V\Assets\DLC\ThisVariableAsFolderName)
modsave_folder = "zzz_Modsaves" modsave_folder = "zzz_Modsaves"
# Folder containing the vanilla packs # Folder containing the vanilla packs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment