Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Civ-V-Modpack-UI-Converter
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gohrbandt, Jan
Civ-V-Modpack-UI-Converter
Commits
b8678637
Commit
b8678637
authored
3 years ago
by
Rsge
Browse files
Options
Downloads
Patches
Plain Diff
Added the ability to only add CUC to EUI
parent
0e90be93
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
EUI_Converter/EUI_Converter.py
+58
-38
58 additions, 38 deletions
EUI_Converter/EUI_Converter.py
EUI_Converter/EUI_Converter.sln
+1
-0
1 addition, 0 deletions
EUI_Converter/EUI_Converter.sln
with
59 additions
and
38 deletions
EUI_Converter/EUI_Converter.py
+
58
−
38
View file @
b8678637
...
...
@@ -8,40 +8,47 @@ import subprocess
import
shutil
import
re
#Change to base DLC directory
os
.
chdir
(
"
../..
"
)
## Global Values
print
(
"
Configuring variables...
"
)
# Names
# Customize according to your setup
here
#
# Customize
these
according to your setup #
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 ;)]
#
#
Ignore these
#
modpack_folder_name
=
"
MP_MODSPACK
"
eui_cu_file_names
=
[
"
CityBannerManager.lua
"
,
eui_cu
c
_file_names
=
[
"
CityBannerManager.lua
"
,
"
CityView.lua
"
,
"
Highlights.xml
"
]
load_tag
=
"
ContextPtr:LoadNewContext
"
unit_panel_file_name
=
"
UnitPanel.lua
"
ige_compat_file_name
=
"
IGE_Window.lua
"
delete_file_names
=
[
"
CivilopediaScreen.lua
"
,
# Maybe you also need to add to these lists #
delete_file_names
=
[
"
CivilopediaScreen.lua
"
,
# Mod files overwriting original UI files, conflicting with EUI
"
CityView.lua
"
,
"
TechTree.lua
"
,
"
TechButtonInclude.lua
"
,
unit_panel_file_name
]
unit_panel_modcompat_file_names
=
[
"
EvilSpiritsMission.lua
"
,
unit_panel_modcompat_file_names
=
[
"
EvilSpiritsMission.lua
"
,
# Mod files adding new actions to units
"
THTanukiMission.lua
"
]
# Don't change from here [if you don't really know what you're doing that is of cause ;)] #
# This only runs with 7zip. If you want to use WinRar you'll have to change the methods yourself - or just download 7zip =P
szip
=
r
"
C:\Program Files\7-Zip\7z.exe
"
# Paths
# Change to base DLC directory
os
.
chdir
(
"
../..
"
)
base_path
=
os
.
getcwd
()
modsave_path
=
j
(
base_path
,
modsave_folder
)
modpack_path
=
j
(
base_path
,
modpack_folder_name
)
vanilla_packs_path
=
j
(
base_path
,
vanilla_packs_folder
)
ui_path
=
j
(
modpack_path
,
"
UI
"
)
eui_path
=
j
(
base_path
,
"
UI_bc1
"
)
szip
=
r
"
C:\Program Files\7-Zip\7z.exe
"
# Files
base_eui_zip_path
=
j
(
vanilla_packs_path
,
vanilla_eui_zip
)
modded_eui_zip_path
=
j
(
base_path
,
modded_eui_zip
)
...
...
@@ -53,11 +60,15 @@ eui_files = j(eui_path, "*", "*.lua")
load_tags
=
{}
unit_panel_modcompat_needed
=
False
null
=
open
(
os
.
devnull
,
'
w
'
)
eui_only
=
False
# Get modpack zip
while
True
:
modpack_name
=
input
(
"
\n
Which pack should be converted?
\n
"
)
modpack_name
=
input
(
"
\n
Which pack should be converted?
\n
(Type
'
EUI
'
to just convert EUI)
\n
"
)
if
modpack_name
==
"
EUI
"
:
eui_only
=
True
break
modpack_zips
=
g
(
j
(
vanilla_packs_path
,
modpack_name
+
"
.*
"
))
if
len
(
modpack_zips
)
>
0
:
modpack_zip
=
modpack_zips
[
0
]
...
...
@@ -77,17 +88,25 @@ if not os.path.isfile(modded_eui_zip_path):
print
(
"
Creating colored unlocked Citizens EUI...
"
)
subprocess
.
run
([
szip
,
'
x
'
,
base_eui_zip_path
],
stdout
=
null
,
stderr
=
null
)
#shutil.move(j(vanilla_packs_path, eui_file_name), eui_path)
for
eui_cu_file_name
in
eui_cu_file_names
:
eui_cu_file
=
g
(
j
(
modsave_path
,
eui_cu_file_name
+
"
*
"
))[
0
]
orig_eui_file
=
g
(
j
(
eui_path
,
"
*
"
,
eui_cu_file_name
))[
0
]
for
eui_cu
c
_file_name
in
eui_cu
c
_file_names
:
eui_cu
c
_file
=
g
(
j
(
modsave_path
,
eui_cu
c
_file_name
+
"
*
"
))[
0
]
orig_eui_file
=
g
(
j
(
eui_path
,
"
*
"
,
eui_cu
c
_file_name
))[
0
]
shutil
.
move
(
orig_eui_file
,
orig_eui_file
+
"
.orig
"
)
shutil
.
copyfile
(
eui_cu_file
,
orig_eui_file
)
shutil
.
copyfile
(
eui_cu
c
_file
,
orig_eui_file
)
subprocess
.
run
([
szip
,
'
a
'
,
modded_eui_zip
,
eui_path
],
stdout
=
null
,
stderr
=
null
)
el
se
:
el
if
not
eui_only
:
# Unzip EUI
print
(
"
Unzipping EUI...
"
)
subprocess
.
run
([
szip
,
'
x
'
,
modded_eui_zip_path
],
stdout
=
null
,
stderr
=
null
)
# Stop here if only EUI should be converted
if
eui_only
:
if
os
.
path
.
isdir
(
eui_path
):
shutil
.
rmtree
(
eui_path
)
null
.
close
()
print
(
"
Done.
\n
"
)
exit
(
0
)
# Unzip modpack zip
print
(
"
Unzipping Modpack...
"
)
...
...
@@ -170,9 +189,10 @@ shutil.rmtree(ui_path)
print
(
"
Zipping Modpack...
"
)
subprocess
.
run
([
szip
,
'
a
'
,
modpack_name
+
"
_EUI.7z
"
,
modpack_path
],
stdout
=
null
,
stderr
=
null
)
#
#
Move modpack folder
#
Move modpack folder
#print("Moving Modspack folder")
#shutil.move(modpack_path, j(base_path, modpack_folder_name))
null
.
close
()
print
(
"
Done.
\n
"
)
exit
(
0
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
EUI_Converter/EUI_Converter.sln
+
1
−
0
View file @
b8678637
...
...
@@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
..\.gitattributes = ..\.gitattributes
..\.gitignore = ..\.gitignore
..\LICENSE = ..\LICENSE
..\Readme.md = ..\Readme.md
EndProjectSection
EndProject
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment