Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
fix everything
Browse files Browse the repository at this point in the history
  • Loading branch information
AtlasTheProto committed Feb 13, 2020
1 parent 846d25b commit fb7ac4c
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 39 deletions.
8 changes: 6 additions & 2 deletions bC7totif/App.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>


<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bulkTexConverter.appSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>


<userSettings>
<bulkTexConverter.appSettings>
<setting name="gamePath" serializeAs="String">
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers</value>
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures</value>
</setting>
<setting name="toolPath" serializeAs="String">
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools</value>
<value />
</setting>
<setting name="outDir" serializeAs="String">
<value />
Expand Down
44 changes: 28 additions & 16 deletions bC7totif/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 30 additions & 11 deletions bC7totif/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@ private void btnBrowseGameDir_Click(object sender, EventArgs e)
}
}

private void resetSettingsToolStripMenuItem_Click(object sender, EventArgs e)
{
appSettings.Default.Reset();
tbToolPath.Text = "";
tbOutputDir.Text = "";
//tbGameDirectory.Text = "";
tbToolPath.Text = appSettings.Default.toolPath;
tbOutputDir.Text = appSettings.Default.outDir;
tbGameDirectory.Text = appSettings.Default.gamePath;
//appSettings.Default.Save();
}

private void tbToolPath_TextChanged(object sender, EventArgs e)
{
toolPath = tbToolPath.Text;
Expand All @@ -172,6 +184,7 @@ private void tbOutputDir_TextChanged(object sender, EventArgs e)

private void tbGameDirectory_TextChanged(object sender, EventArgs e)
{

gamePath = tbGameDirectory.Text;
updateSettings();
}
Expand Down Expand Up @@ -212,7 +225,7 @@ public static void doConvertAll()

busy = true;
// I hate this
var moveDirs = new List<string> { "Models", "Particles", "Voxels", "Sprites", "Miscellaneous", "Lights", "Logo", "GUI", "HUD", "Gizmo", "Decals", "Debug", "BackgroundCube", "FactionLogo", "SunGlare"};
//var moveDirs = new List<string> { "Models", "Particles", "Voxels", "Sprites", "Miscellaneous", "Lights", "Logo", "GUI", "HUD", "Gizmo", "Decals", "Debug", "BackgroundCube", "FactionLogo", "SunGlare"};
var count = 0;
foreach (string obj in Items)
{
Expand Down Expand Up @@ -271,7 +284,8 @@ public static void doConvertAll()
var currentFilePath = fileList[i];
var DirName = Path.GetDirectoryName(currentFilePath);
var relDir = DirName.Replace(gamePath,"");
var destDir = "temp/" + relDir;
var destDir = outDir + relDir;
//var destDir = "temp/" + relDir;
var convFileName = Path.GetFileName(currentFilePath);
Directory.CreateDirectory(destDir);
currentfiles = i;
Expand All @@ -283,11 +297,9 @@ public static void doConvertAll()
{
newProcess.WaitForExit();
}
// Console.WriteLine(cmdArgs);

// Sorry in advance

}
/*
foreach (string dir in moveDirs)
{
try
Expand All @@ -297,17 +309,20 @@ public static void doConvertAll()
}
catch
{
consoleBuffer.Enqueue("Did not move " + dir + " as it had no converted textures");
consoleBuffer.Enqueue("Skipped moving " + dir + ", it may already exist");
}
}
MessageBox.Show("Done");
*/

//Directory.Delete("temp");
MessageBox.Show("Finished!", "Conversion completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
busy = false;

}

private void btnConvert_Click(object sender, EventArgs e)
{
#if !DEBUG

if (!File.Exists(toolPath + "/texconv.exe"))
{
MessageBox.Show("Cannot find texconv.exe under tool directory.\n\nPlease ensure ModSDK is installed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Expand All @@ -318,7 +333,7 @@ private void btnConvert_Click(object sender, EventArgs e)
MessageBox.Show("Game path is wrong.\n\nPlease ensure game is installed.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
#endif

Items = lbfolderList.Items;
var asyncThreadParamInit = new ThreadStart(doConvertAll);
//doConvertAll();
Expand All @@ -336,11 +351,12 @@ private void btnAdd_Click(object sender, EventArgs e)
var diagRes = appFolderBrowser.ShowDialog();
if (diagRes == DialogResult.OK)
{

var pth1 = appFolderBrowser.SelectedPath;
var pth2 = pth1.Replace(gamePath + "\\", "\\");
if (pth2 == pth1)
{
MessageBox.Show("Path must be inside game directory.");
MessageBox.Show("Path must be inside game directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
lbfolderList.Items.Add(pth2);
Expand All @@ -365,6 +381,7 @@ private void LoadPresetsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (File.Exists("presets.ini"))
{

lbfolderList.Items.Clear();
var sparr = File.ReadAllLines("presets.ini");
for (int i = 0; i < sparr.Length; i++)
Expand All @@ -382,8 +399,10 @@ private void LoadPresetsToolStripMenuItem_Click(object sender, EventArgs e)
}
} else
{
MessageBox.Show("presets.ini not found in application directory.");
MessageBox.Show("presets.ini not found in application directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}


}
}
7 changes: 3 additions & 4 deletions bC7totif/appSettings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bC7totif/appSettings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<Profiles />
<Settings>
<Setting Name="gamePath" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers</Value>
<Value Profile="(Default)">C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures</Value>
</Setting>
<Setting Name="toolPath" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools</Value>
<Value Profile="(Default)" />
</Setting>
<Setting Name="outDir" Type="System.String" Scope="User">
<Value Profile="(Default)" />
Expand Down
Binary file modified bC7totif/bin/Debug/bulkTexConverter.exe
Binary file not shown.
8 changes: 6 additions & 2 deletions bC7totif/bin/Debug/bulkTexConverter.exe.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>


<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bulkTexConverter.appSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>


<userSettings>
<bulkTexConverter.appSettings>
<setting name="gamePath" serializeAs="String">
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers</value>
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures</value>
</setting>
<setting name="toolPath" serializeAs="String">
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools</value>
<value />
</setting>
<setting name="outDir" serializeAs="String">
<value />
Expand Down
Binary file modified bC7totif/bin/Release/bulkTexConverter.exe
Binary file not shown.
8 changes: 6 additions & 2 deletions bC7totif/bin/Release/bulkTexConverter.exe.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>


<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bulkTexConverter.appSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>


<userSettings>
<bulkTexConverter.appSettings>
<setting name="gamePath" serializeAs="String">
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers</value>
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Textures</value>
</setting>
<setting name="toolPath" serializeAs="String">
<value>C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineersModSDK\Tools\TexturePacking\Tools</value>
<value />
</setting>
<setting name="outDir" serializeAs="String">
<value />
Expand Down

0 comments on commit fb7ac4c

Please sign in to comment.