Skip to content
Snippets Groups Projects
Commit 55ceebe3 authored by Rsge's avatar Rsge
Browse files

Add project files

parent 45f12cfa
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
## ##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
#Zip files
*.zip
# User-specific files # User-specific files
*.rsuser *.rsuser
*.suo *.suo
......
This diff is collapsed.
This diff is collapsed.
Add UI_bc1 folder to MP_MODSPACK
Replace:
IGE-Mod: IGE_Window.lua --> EUI compatible
EUI: UnitPanel.lua --> mod compatible
EUI: CityBannerManager.lua, CityView.lua & Highlights.xml --> Unlocked recolored
Add "ContextPtr:LoadNewContext"-Parts from old UI files to UI_bc1 in:
CityView.lua
InGame.lua
LeaderHeadRoot.lua
UnitPanel.lua (EvilSpiritsMission, THTanukiMission)
Delete:
Old UI folder
BNW Mass Effect (v 7)\Dummy Building Folder\CivilopediaScreen.lua
BNW Mass Effect (v 7)\Dummy Building Folder\CityView.lua
Touhou - Evil Spirits (v 2)\Lua\UnitPanel.lua
Touhou - Probability Space Hypervessel (v 1)\Lua\TechTree.lua
Touhou - Probability Space Hypervessel (v 1)\Lua\TechButtonInclude.lua
\ No newline at end of file
#!/usr/bin/env python
#Imports
import os
from os.path import join as j
from glob import glob as g
import subprocess
import shutil
import re
#Change to base DLC directory
os.chdir("../..")
##Global Values
print("Configuring variables...")
#Names
modpack_folder_name = "MP_MODSPACK"
modded_eui_zip_name = "EUI_CUC.7z"
eui_cu_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",
"CityView.lua",
"TechTree.lua",
"TechButtonInclude.lua",
unit_panel_file_name]
unit_panel_modcompat_file_names = ["EvilSpiritsMission.lua",
"THTanukiMission.lua"]
#Paths
base_path = os.getcwd()
modsave_path = j(base_path, "zzz_Modsaves")
modpack_path = j(base_path, modpack_folder_name)
vanilla_packs_path = j(base_path, "zz_Vanilla_Versions")
ui_path = j(modpack_path, "UI")
eui_path = j(base_path, "UI_bc1")
szip = r"C:\Program Files\7-Zip\7z.exe"
#Files
mod_files = j(modpack_path, "Mods", "**", "*.lua")
ui_files = j(ui_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
load_tags = {}
unit_panel_modcompat_needed = False
null = open(os.devnull, 'w')
#Get modpack zip
while True:
modpack_name = input("\nWhich pack should be converted?\n")
modpack_zips = g(j(vanilla_packs_path, modpack_name + ".*"))
if len(modpack_zips) > 0:
modpack_zip = modpack_zips[0]
break
print("This file doesn't exist, try again.")
#Remove previous modpack
print("Removing previous modpack leftovers...")
if os.path.isdir(modpack_path):
shutil.rmtree(modpack_path)
if os.path.isdir(eui_path):
shutil.rmtree(eui_path)
#Compile EUI with colored unlocked citizens
if not os.path.isfile(modded_eui_zip_path):
print("Creating colored unlocked Citizens EUI...")
subprocess.run([szip, 'x', base_eui_zip], 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]
shutil.move(orig_eui_file, orig_eui_file + ".orig")
shutil.copyfile(eui_cu_file, orig_eui_file)
subprocess.run([szip, 'a', modded_eui_zip_name, eui_path], stdout=null, stderr=null)
else:
#Unzip EUI
print("Unzipping EUI...")
subprocess.run([szip, 'x', modded_eui_zip_path], stdout=null, stderr=null)
#Unzip modpack zip
print("Unzipping Modpack...")
subprocess.run([szip, 'x', j(vanilla_packs_path, modpack_zip)], stdout=null, stderr=null)
#Manage mod files
for mod_file in g(mod_files, recursive = True):
mod_file_path = mod_file.split(os.sep)
mod_file_name = mod_file_path[len(mod_file_path) - 1]
#IGE UI compat file
if mod_file_name == ige_compat_file_name:
print("Providing IGE-EUI-compat...")
shutil.move(mod_file, mod_file + ".orig")
shutil.copyfile(g(j(modsave_path, ige_compat_file_name + "*"))[0], mod_file)
#Delete UI overwrite duplicates
if mod_file_name in delete_file_names:
print("Removing overwriting file " + mod_file_name + "...")
os.remove(mod_file)
#Find out if modcompat unit panel needed
if mod_file_name in unit_panel_modcompat_file_names:
print("UnitPanel modcompat need detected...")
unit_panel_modcompat_needed = True
#Delete useless desktop.ini (Thanks True...)
ini_files = re.sub(r"\.\w+$", ".ini", mod_files)
for ini_file in g(ini_files, recursive = True):
ini_file_path = ini_file.split(os.sep)
ini_file_name = ini_file_path[len(ini_file_path) - 1]
if ini_file_name == "desktop.ini":
print("Removing useless desktop.ini (Thanks True)...")
os.remove(mod_file)
#Get stuff from UI files
for ui_file in g(ui_files):
with open(ui_file, 'r') as file:
lines = file.readlines()
ui_file_path = ui_file.split(os.sep)
ui_file_name = ui_file_path[len(ui_file_path) - 1]
print("Getting tags from " + ui_file_name + "...")
load_tags[ui_file_name] = []
for line in lines:
if line.startswith(load_tag):
load_tags[ui_file_name].append(line)
#Insert stuff into EUI files
for eui_file in g(eui_files):
eui_file_path = eui_file.split(os.sep)
eui_file_name = eui_file_path[len(eui_file_path) - 1]
#Base UI files
if eui_file_name in load_tags.keys():
print("Writing tags to " + eui_file_name + "...")
with open(eui_file, 'a') as file:
file.write('\n')
for load_tag in load_tags[eui_file_name]:
file.write(load_tag)
#Modcompat unit panel
elif eui_file_name == unit_panel_file_name and unit_panel_modcompat_needed:
print("Providing EUI-UnitPanel-Modcompat...")
shutil.move(eui_file, eui_file + ".orig")
shutil.copyfile(g(j(modsave_path, unit_panel_file_name + "*"))[0], eui_file)
#Move EUI folder
print("Moving EUI folder...")
shutil.move(eui_path, modpack_path)
print("Removing UI folder...")
shutil.rmtree(ui_path)
#Zip modpack folder
print("Zipping Modpack...")
subprocess.run([szip, 'a', modpack_name + "_EUI.7z", modpack_path], stdout=null, stderr=null)
##Move modpack folder
#print("Moving Modspack folder")
#shutil.move(modpack_path, j(base_path, modpack_folder_name))
null.close()
print("Done.\n")
\ No newline at end of file
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>ea28d07f-cd43-45d1-b01d-1eeeb360d215</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>EUI_Converter.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>EUI_Converter</Name>
<RootNamespace>EUI_Converter</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="EUI_Converter.py" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31019.35
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "EUI_Converter", "EUI_Converter.pyproj", "{EA28D07F-CD43-45D1-B01D-1EEEB360D215}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{081253F6-C547-4C81-B928-0D7472199986}"
ProjectSection(SolutionItems) = preProject
..\.gitattributes = ..\.gitattributes
..\.gitignore = ..\.gitignore
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EA28D07F-CD43-45D1-B01D-1EEEB360D215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA28D07F-CD43-45D1-B01D-1EEEB360D215}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D4E8032E-FBFB-40D5-8FEC-B7EF67F27664}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<Highlights>
<style name="" type="HexContour" width=".2" texture="hex_contour2.dds"/>
<style name="SampleFilledHex" type="FilledHex" width="1" color="0,0,0,128"/>
<style name="SampleStaticTexture" type="StaticTexture" texture="static_texture_highlight.dds"/>
<style name="SampleHexModel" type="HexModel" model="SelectedAniOneTurn.fxsxml"/>
<style name="EditorHexStyle1" type="HexContour" width=".15" texture="Solid_Contour.dds"/>
<style name="EditorHexStyle2" type="HexContour" width=".08" texture="Solid_Contour.dds"/>
<style name="EditorHexStyle3" type="HexContour" width=".03" texture="Solid_Contour.dds"/>
<style name="TempBorder" type="HexContour" width=".2" texture="hex_contour2.dds"/>
<style name="GroupBorder" type="SplineBorder" width ="6" texture="spline_border_contour2.dds" color="255,128,0,200"/>
<style name="ValidFireTargetBorder" type="StaticTexture" texture="static_texture_highlight.dds"/>
<style name="FireRangeBorder" type="SplineBorder" width="6" texture="spline_border_contour2.dds" color="255,0,0,200"/>
<style name="MovementRangeBorder" type="SplineBorder" width="4" texture="spline_border_contour2.dds" color="100,185,245,240"/>
<style name="AMRBorder" type="StaticTexture" texture="static_texture_highlight.dds"/>
<style name="TradeRoute" type="HexContour" width=".2" texture="hex_contour2.dds"/>
<style name="GUHB" type="HexContour" width=".2" texture="hex_contour2.dds"/>
<!-- EUI styles -->
<style name="HexContour" type="HexContour" width=".2" texture="hex_contour2.dds" />
<style name="CityOverlap" type="FilledHex" width ="1" color="255,140,0,64" />
<style name="OverlapFill" type="FilledHex" width ="1" color="0,0,255,50" />
<style name="OverlapOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="0,0,255,164" />
<style name="WorkedFill" type="FilledHex" width ="1" color="0,255,0,50" />
<style name="WorkedOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="0,255,0,164" />
<style name="UnlockedFill" type="FilledHex" width ="1" color="7,107,0,50" />
<style name="UnlockedOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="7,107,0,164" />
<style name="OwnedFill" type="FilledHex" width ="1" color="0,140,255,50" />
<style name="OwnedOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="0,140,255,164" />
<style name="BuyFill" type="FilledHex" width ="1" color="255,215,0,50" />
<style name="BuyOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="255,215,0,192" />
<style name="VacantFill" type="FilledHex" width ="1" color="0,140,255,50" />
<style name="VacantOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="0,140,255,164" />
<style name="EnemyFill" type="FilledHex" width ="1" color="255,0,0,64" />
<style name="EnemyOutline" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="255,0,0,200" />
<style name="CityLimits" type="SplineBorder" width ="7" texture="hex_contour1.dds" color="0,0,0,164" />
</Highlights>
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment