Shortened System.IO.Path to Path

This commit is contained in:
ZestyTS 2020-10-01 17:38:48 -07:00
parent 0e4be84818
commit 1955468813
8 changed files with 119 additions and 112 deletions

View file

@ -3547,9 +3547,9 @@ namespace UWUVCI_AIO_WPF
}
private void checkForAdditionalFiles(GameConsoles console, List<string> repoids)
{
if (!Directory.Exists(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
if (!Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
{
Directory.CreateDirectory(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
}
bool ini = false;
bool btsnd = false;
@ -3612,40 +3612,40 @@ namespace UWUVCI_AIO_WPF
var client = new WebClient();
if (ini)
{
client.DownloadFile(inip, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini"));
(Thing as N64Config).ini.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
GameConfiguration.N64Stuff.INIPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
client.DownloadFile(inip, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini"));
(Thing as N64Config).ini.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
GameConfiguration.N64Stuff.INIPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
}
if (btsnd)
{
client.DownloadFile(btsndp, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}"));
BootSound = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
client.DownloadFile(btsndp, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}"));
BootSound = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
switch (console)
{
case GameConsoles.NDS:
case GameConsoles.NES:
case GameConsoles.SNES:
case GameConsoles.MSX:
(Thing as OtherConfigs).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(Thing as OtherConfigs).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.GBA:
(Thing as GBA).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(Thing as GBA).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.N64:
(Thing as N64Config).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(Thing as N64Config).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.WII:
if (test == GameConsoles.GCN)
{
(Thing as GCConfig).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(Thing as GCConfig).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
}
else
{
(Thing as WiiConfig).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(Thing as WiiConfig).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
}
break;
case GameConsoles.TG16:
(Thing as TurboGrafX).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(Thing as TurboGrafX).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
}

View file

@ -15,6 +15,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -23,8 +24,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
/// </summary>
public partial class LOGSHOW : Window, IDisposable
{
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
string copy = "";
string pat = "";
BitmapImage bitmap = new BitmapImage();
@ -43,12 +44,12 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
pat = String.Copy(path);
InitializeComponent();
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image"))) Directory.Delete(System.IO.Path.Combine(tempPath, "image"), true);
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
if (Directory.Exists(Path.Combine(tempPath, "image"))) Directory.Delete(Path.Combine(tempPath, "image"), true);
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
if (path == "Added via Config")
{
File.WriteAllBytes(System.IO.Path.Combine(tempPath, "image", "log." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGALog.extension), (FindResource("mvm") as MainViewModel).GameConfiguration.TGALog.ImgBin);
pat = System.IO.Path.Combine(tempPath, "image", "log." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGALog.extension);
File.WriteAllBytes(Path.Combine(tempPath, "image", "log." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGALog.extension), (FindResource("mvm") as MainViewModel).GameConfiguration.TGALog.ImgBin);
pat = Path.Combine(tempPath, "image", "log." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGALog.extension);
}
if (new FileInfo(pat).Extension.Contains("tga"))
{
@ -59,13 +60,13 @@ namespace UWUVCI_AIO_WPF.UI.Windows
conv.StartInfo.CreateNoWindow = true;
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{pat}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{pat}\" -o \"{Path.Combine(tempPath, "image")}\"";
conv.Start();
conv.WaitForExit();
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
{
copy = sFile;
}

View file

@ -15,6 +15,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -23,8 +24,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
/// </summary>
public partial class ICOSHOW : Window, IDisposable
{
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
string copy = "";
string pat = "";
BitmapImage bitmap = new BitmapImage();
@ -44,12 +45,12 @@ namespace UWUVCI_AIO_WPF.UI.Windows
pat = String.Copy(path);
InitializeComponent();
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image"))) Directory.Delete(System.IO.Path.Combine(tempPath, "image"), true);
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
if (Directory.Exists(Path.Combine(tempPath, "image"))) Directory.Delete(Path.Combine(tempPath, "image"), true);
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
if(path == "Added via Config")
{
File.WriteAllBytes(System.IO.Path.Combine(tempPath, "image", "ico." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGAIco.extension), (FindResource("mvm") as MainViewModel).GameConfiguration.TGAIco.ImgBin);
pat = System.IO.Path.Combine(tempPath, "image", "ico." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGAIco.extension);
File.WriteAllBytes(Path.Combine(tempPath, "image", "ico." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGAIco.extension), (FindResource("mvm") as MainViewModel).GameConfiguration.TGAIco.ImgBin);
pat = Path.Combine(tempPath, "image", "ico." + (FindResource("mvm") as MainViewModel).GameConfiguration.TGAIco.extension);
}
if (new FileInfo(pat).Extension.Contains("tga"))
{
@ -60,13 +61,13 @@ namespace UWUVCI_AIO_WPF.UI.Windows
conv.StartInfo.CreateNoWindow = true;
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{pat}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{pat}\" -o \"{Path.Combine(tempPath, "image")}\"";
conv.Start();
conv.WaitForExit();
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
{
copy = sFile;
}

View file

@ -15,6 +15,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -23,8 +24,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
/// </summary>
public partial class TDRSHOW : Window, IDisposable
{
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
string copy = "";
string pat = "";
bool drc = false;
@ -45,8 +46,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
pat = String.Copy(path);
InitializeComponent();
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image"))) Directory.Delete(System.IO.Path.Combine(tempPath, "image"),true);
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
if (Directory.Exists(Path.Combine(tempPath, "image"))) Directory.Delete(Path.Combine(tempPath, "image"),true);
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
if (pat == "Added via Config")
{
string ext = "";
@ -55,15 +56,15 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
ext = (FindResource("mvm") as MainViewModel).GameConfiguration.TGADrc.extension;
imageb = (FindResource("mvm") as MainViewModel).GameConfiguration.TGADrc.ImgBin;
File.WriteAllBytes(System.IO.Path.Combine(tempPath, "image", "drc." + ext), imageb);
pat = System.IO.Path.Combine(tempPath, "image", "drc." + ext);
File.WriteAllBytes(Path.Combine(tempPath, "image", "drc." + ext), imageb);
pat = Path.Combine(tempPath, "image", "drc." + ext);
}
else
{
ext = (FindResource("mvm") as MainViewModel).GameConfiguration.TGATv.extension;
imageb = (FindResource("mvm") as MainViewModel).GameConfiguration.TGATv.ImgBin;
File.WriteAllBytes(System.IO.Path.Combine(tempPath, "image", "tv." + ext), imageb);
pat = System.IO.Path.Combine(tempPath, "image", "tv." + ext);
File.WriteAllBytes(Path.Combine(tempPath, "image", "tv." + ext), imageb);
pat = Path.Combine(tempPath, "image", "tv." + ext);
}
}
@ -76,13 +77,13 @@ namespace UWUVCI_AIO_WPF.UI.Windows
conv.StartInfo.CreateNoWindow = true;
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{pat}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{pat}\" -o \"{Path.Combine(tempPath, "image")}\"";
conv.Start();
conv.WaitForExit();
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
{
copy = sFile;
}

View file

@ -16,6 +16,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Classes;
using UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -93,13 +94,13 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
MainViewModel mvm = FindResource("mvm") as MainViewModel;
var client = new WebClient();
if (Directory.Exists(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
if (Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
{
Directory.Delete(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"), true);
Directory.Delete(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"), true);
}
Directory.CreateDirectory(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
client.DownloadFile(ic, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"));
mvm.GameConfiguration.TGAIco.ImgPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}");
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
client.DownloadFile(ic, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"));
mvm.GameConfiguration.TGAIco.ImgPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}");
mvm.GameConfiguration.TGAIco.extension = $".{ic.Split('.')[3]}";
if (mvm.test == GameBaseClassLibrary.GameConsoles.GCN)
{
@ -125,41 +126,41 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
(mvm.Thing as OtherConfigs).icoIMG.Visibility = Visibility.Visible;
}
client.DownloadFile(tvs, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
mvm.GameConfiguration.TGATv.ImgPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}");
client.DownloadFile(tvs, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
mvm.GameConfiguration.TGATv.ImgPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}");
mvm.GameConfiguration.TGATv.extension = $".{tvs.Split('.')[3]}";
if (mvm.test == GameBaseClassLibrary.GameConsoles.GCN)
{
(mvm.Thing as GCConfig).tvIMG.Visibility = Visibility.Visible;
(mvm.Thing as GCConfig).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
(mvm.Thing as GCConfig).imgpath(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.WII)
{
(mvm.Thing as WiiConfig).tvIMG.Visibility = Visibility.Visible;
(mvm.Thing as WiiConfig).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
(mvm.Thing as WiiConfig).imgpath(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.N64)
{
(mvm.Thing as N64Config).tvIMG.Visibility = Visibility.Visible;
(mvm.Thing as N64Config).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
(mvm.Thing as N64Config).imgpath(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.GBA)
{
(mvm.Thing as GBA).tvIMG.Visibility = Visibility.Visible;
(mvm.Thing as GBA).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
(mvm.Thing as GBA).imgpath(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.TG16)
{
(mvm.Thing as TurboGrafX).tvIMG.Visibility = Visibility.Visible;
(mvm.Thing as TurboGrafX).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
(mvm.Thing as TurboGrafX).imgpath(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NDS || mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.SNES || mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NES || mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.MSX)
{
(mvm.Thing as OtherConfigs).tvIMG.Visibility = Visibility.Visible;
(mvm.Thing as OtherConfigs).imgpath(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
(mvm.Thing as OtherConfigs).imgpath(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"iconTex.{ic.Split('.')[3]}"), Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootTvTex.{tvs.Split('.')[3]}"));
}
/* if(mvm.test == GameConsoles.GCN)
@ -175,9 +176,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
private void checkForAdditionalFiles(GameConsoles console)
{
if (!Directory.Exists(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
if (!Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
{
Directory.CreateDirectory(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
}
bool ini = false;
bool btsnd = false;
@ -226,33 +227,33 @@ namespace UWUVCI_AIO_WPF.UI.Windows
var client = new WebClient();
if (ini)
{
client.DownloadFile(inip, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini"));
(mvm.Thing as N64Config).ini.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
mvm.GameConfiguration.N64Stuff.INIPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
client.DownloadFile(inip, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini"));
(mvm.Thing as N64Config).ini.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
mvm.GameConfiguration.N64Stuff.INIPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
}
if (btsnd)
{
client.DownloadFile(btsndp, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}"));
mvm.BootSound = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
client.DownloadFile(btsndp, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}"));
mvm.BootSound = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
switch (console)
{
case GameConsoles.NDS:
(mvm.Thing as OtherConfigs).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as OtherConfigs).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.GBA:
(mvm.Thing as GBA).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as GBA).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.N64:
(mvm.Thing as N64Config).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as N64Config).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.WII:
if(mvm.test == GameConsoles.GCN)
{
(mvm.Thing as GCConfig).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as GCConfig).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
}
else
{
(mvm.Thing as WiiConfig).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as WiiConfig).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
}
break;
@ -264,9 +265,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
public void checkForAdditionalFiles(GameConsoles console, string repoid)
{
if (!Directory.Exists(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
if (!Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo")))
{
Directory.CreateDirectory(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo"));
}
bool ini = false;
bool btsnd = false;
@ -315,33 +316,33 @@ namespace UWUVCI_AIO_WPF.UI.Windows
var client = new WebClient();
if (ini)
{
client.DownloadFile(inip, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini"));
(mvm.Thing as N64Config).ini.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
mvm.GameConfiguration.N64Stuff.INIPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
client.DownloadFile(inip, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini"));
(mvm.Thing as N64Config).ini.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
mvm.GameConfiguration.N64Stuff.INIPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", "game.ini");
}
if (btsnd)
{
client.DownloadFile(btsndp, System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}"));
mvm.BootSound = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
client.DownloadFile(btsndp, Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}"));
mvm.BootSound = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
switch (console)
{
case GameConsoles.NDS:
(mvm.Thing as OtherConfigs).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as OtherConfigs).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.GBA:
(mvm.Thing as GBA).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as GBA).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.N64:
(mvm.Thing as N64Config).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as N64Config).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
break;
case GameConsoles.WII:
if (mvm.test == GameConsoles.GCN)
{
(mvm.Thing as GCConfig).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as GCConfig).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
}
else
{
(mvm.Thing as WiiConfig).sound.Text = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
(mvm.Thing as WiiConfig).sound.Text = Path.Combine(Directory.GetCurrentDirectory(), "bin", "repo", $"bootSound.{exten}");
}
break;

View file

@ -21,6 +21,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Classes;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -30,8 +31,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
public partial class asd : Window, IDisposable
{
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
MenuIconImage bi = new MenuIconImage();
Bitmap b;
string console = "other";
@ -85,18 +86,18 @@ namespace UWUVCI_AIO_WPF.UI.Windows
conv.StartInfo.UseShellExecute = false;
conv.StartInfo.CreateNoWindow = true;
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image")))
if (Directory.Exists(Path.Combine(tempPath, "image")))
{
Directory.Delete(System.IO.Path.Combine(tempPath, "image"), true);
Directory.Delete(Path.Combine(tempPath, "image"), true);
}
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{file}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{file}\" -o \"{Path.Combine(tempPath, "image")}\"";
conv.Start();
conv.WaitForExit();
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
{
copy = sFile;
}
@ -118,9 +119,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
Directory.CreateDirectory(@"bin\createdIMG");
}
if(File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
if(File.Exists(Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
{
File.Delete(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
File.Delete(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
}
if (drc)
{
@ -128,7 +129,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
b.Save(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
b.Save(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
this.Close();

View file

@ -22,6 +22,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Classes;
using UWUVCI_AIO_WPF.Properties;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -31,8 +32,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
public partial class LogoCreator : Window, IDisposable
{
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
BootLogoImage bi = new BootLogoImage();
Bitmap b;
string console = "other";
@ -73,18 +74,18 @@ namespace UWUVCI_AIO_WPF.UI.Windows
conv.StartInfo.UseShellExecute = false;
conv.StartInfo.CreateNoWindow = true;
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image")))
if (Directory.Exists(Path.Combine(tempPath, "image")))
{
Directory.Delete(System.IO.Path.Combine(tempPath, "image"), true);
Directory.Delete(Path.Combine(tempPath, "image"), true);
}
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{path}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{path}\" -o \"{Path.Combine(tempPath, "image")}\"";
conv.Start();
conv.WaitForExit();
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
{
copy = sFile;
}
@ -115,13 +116,13 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
Directory.CreateDirectory(@"bin\createdIMG");
}
if(File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
if(File.Exists(Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
{
File.Delete(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
File.Delete(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
}
b.Save(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
b.Save(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
this.Close();

View file

@ -21,6 +21,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using UWUVCI_AIO_WPF.Classes;
using Path = System.IO.Path;
namespace UWUVCI_AIO_WPF.UI.Windows
{
@ -30,8 +31,8 @@ namespace UWUVCI_AIO_WPF.UI.Windows
public partial class ImageCreator : Window, IDisposable
{
private static readonly string tempPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
private static readonly string tempPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "temp");
private static readonly string toolsPath = Path.Combine(Directory.GetCurrentDirectory(), "bin", "Tools");
BootImage bi = new BootImage();
Bitmap b;
string console = "other";
@ -175,18 +176,18 @@ namespace UWUVCI_AIO_WPF.UI.Windows
conv.StartInfo.UseShellExecute = false;
conv.StartInfo.CreateNoWindow = true;
if (Directory.Exists(System.IO.Path.Combine(tempPath, "image")))
if (Directory.Exists(Path.Combine(tempPath, "image")))
{
Directory.Delete(System.IO.Path.Combine(tempPath, "image"), true);
Directory.Delete(Path.Combine(tempPath, "image"), true);
}
Directory.CreateDirectory(System.IO.Path.Combine(tempPath, "image"));
conv.StartInfo.FileName = System.IO.Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{file}\" -o \"{System.IO.Path.Combine(tempPath, "image")}\"";
Directory.CreateDirectory(Path.Combine(tempPath, "image"));
conv.StartInfo.FileName = Path.Combine(toolsPath, "tga2png.exe");
conv.StartInfo.Arguments = $"-i \"{file}\" -o \"{Path.Combine(tempPath, "image")}\"";
conv.Start();
conv.WaitForExit();
foreach (string sFile in Directory.GetFiles(System.IO.Path.Combine(tempPath, "image"), "*.png"))
foreach (string sFile in Directory.GetFiles(Path.Combine(tempPath, "image"), "*.png"))
{
copy = sFile;
}
@ -209,9 +210,9 @@ namespace UWUVCI_AIO_WPF.UI.Windows
{
Directory.CreateDirectory(@"bin\createdIMG");
}
if (File.Exists(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
if (File.Exists(Path.Combine(@"bin\createdIMG", imageName.Content + ".png")))
{
File.Delete(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
File.Delete(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
}
if (drc)
{
@ -219,7 +220,7 @@ namespace UWUVCI_AIO_WPF.UI.Windows
}
b.Save(System.IO.Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
b.Save(Path.Combine(@"bin\createdIMG", imageName.Content + ".png"));
this.Close();