diff --git a/filezamena/Error Code 1.xaml b/filezamena/Error Code 1.xaml
new file mode 100644
index 0000000..00c0e42
--- /dev/null
+++ b/filezamena/Error Code 1.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/filezamena/Error Code 1.xaml.cs b/filezamena/Error Code 1.xaml.cs
new file mode 100644
index 0000000..9a5bdf5
--- /dev/null
+++ b/filezamena/Error Code 1.xaml.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace filezamena
+{
+ ///
+ /// Логика взаимодействия для Error_Code_1.xaml
+ ///
+ public partial class Error_Code_1 : Window
+ {
+ public Error_Code_1()
+ {
+ InitializeComponent();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ this.Close();
+ }
+ }
+}
diff --git a/filezamena/GameinfoProccess.xaml b/filezamena/GameinfoProccess.xaml
new file mode 100644
index 0000000..5a1c30d
--- /dev/null
+++ b/filezamena/GameinfoProccess.xaml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
diff --git a/filezamena/GameinfoProccess.xaml.cs b/filezamena/GameinfoProccess.xaml.cs
new file mode 100644
index 0000000..62e4ef4
--- /dev/null
+++ b/filezamena/GameinfoProccess.xaml.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace filezamena
+{
+ ///
+ /// Логика взаимодействия для GameinfoProccess.xaml
+ ///
+ public partial class GameinfoProccess : Window
+ {
+
+ public bool isClose
+ {
+ get; set;
+ } = true;
+
+
+ public GameinfoProccess()
+ {
+ InitializeComponent();
+ this.Closing += (o, e) =>
+ {
+ isClose = false;
+ };
+ }
+ }
+}
diff --git a/filezamena/MainWindow.xaml b/filezamena/MainWindow.xaml
index 25dff3f..e06133e 100644
--- a/filezamena/MainWindow.xaml
+++ b/filezamena/MainWindow.xaml
@@ -9,7 +9,6 @@
Title="TSPMODMAKER"
Height="448.5"
Width="659.265"
- Icon="C:\Users\celis\Documents\The Stanley Parable Ultimate\Autorun Files\image\4.ico"
ResizeMode="NoResize"
>
@@ -29,7 +28,7 @@
Content="Create"
HorizontalAlignment="Left"
Height="74"
- Margin="132,26,0,0"
+ Margin="195,28,0,0"
VerticalAlignment="Top"
Width="236"
FontFamily="Impact"
@@ -38,7 +37,7 @@
VerticalContentAlignment="Center"
/>
+
+
-
+
diff --git a/filezamena/MainWindow.xaml.cs b/filezamena/MainWindow.xaml.cs
index b101080..c5d16e1 100644
--- a/filezamena/MainWindow.xaml.cs
+++ b/filezamena/MainWindow.xaml.cs
@@ -29,33 +29,32 @@ namespace filezamena
///
public partial class MainWindow : Window
{
+ public string modname;
+ public string foldername;
+ public string clearfoldername;
public MainWindow()
{
+ Window1 window1 = new Window1();
+ GameinfoProccess gameinfoProccess = new GameinfoProccess();
InitializeComponent();
+
}
private void Button_Click(object sender, RoutedEventArgs e)
{
- string modname = this.modname.Text;
- string foldername = this.Foldername.Text+"\\";
- string clearfoldername = this.Foldername.Text;
- void DLL()
- {
- if (!Directory.Exists(foldername + "bin"))
- Directory.CreateDirectory(foldername + "bin");
+ this.End.Visibility = Visibility.Hidden;
+ this.Progressbar.Visibility = Visibility.Visible;
+ this.Progressbar.Value = 20;
- var client = new WebClient();
- client.DownloadFile("https://github.com/celisej567/Base-mod-creator-for-tsp/blob/master/filezamena/Resources/client.dll", foldername+"bin\\client.dll");
- var server = new WebClient();
- client.DownloadFile("https://github.com/celisej567/Base-mod-creator-for-tsp/blob/master/filezamena/Resources/server.dll", foldername + "bin\\server.dll");
+ modname = this.Modname.Text;
+ foldername = this.Foldername.Text+"\\";
+ clearfoldername = this.Foldername.Text;
+
- var matchmaking = new WebClient();
- client.DownloadFile("https://github.com/celisej567/Base-mod-creator-for-tsp/blob/master/filezamena/Resources/matchmaking.dll", foldername + "bin\\matchmaking.dll");
- }
/*
void DLL()
@@ -85,12 +84,23 @@ namespace filezamena
bool? check_dll = this.DLLCheck.IsChecked;
if (check_dll == true)
{
- DLL();
+
+ this.End.Visibility = Visibility.Hidden;
+ this.Progressbar.Visibility = Visibility.Visible;
+ this.Progressbar.Value = 20;
+ Window1 window1 = new Window1();
+ window1.foldername = foldername;
+ window1.Show();
+
+
Workgameinfo();
}
if (check_dll == false)
{
+ this.End.Visibility = Visibility.Hidden;
+ this.Progressbar.Visibility = Visibility.Visible;
+ this.Progressbar.Value = 20;
Workgameinfo();
}
@@ -103,15 +113,26 @@ namespace filezamena
void Workgameinfo()
{
- this.End.Visibility = Visibility.Hidden;
-
- this.Progressbar.Visibility = Visibility.Visible;
+ GameinfoProccess proccessGameinfo = new GameinfoProccess();
+ proccessGameinfo.Show();
+ this.Wait.Visibility = Visibility.Visible;
Console.WriteLine("---READING---\n");
+
+
+ if (!File.Exists(path_dir + path))
+ {
+ var fixgameinfo = new WebClient();
+ string string_fixgameinfo = fixgameinfo.DownloadString("https://raw.githubusercontent.com/celisej567/Base-mod-creator-for-tsp/master/filezamena/bin/Release/thestanleyparable/gameinfo.txt");
+ File.WriteAllText(path_dir+path, string_fixgameinfo);
+ }
+
+
+
string gameinfo_read_write = File.ReadAllText(path_dir+path);
Console.WriteLine(gameinfo_read_write);
- this.Progressbar.Value = 20;
+
Console.WriteLine("---GENERATING---");
@@ -125,6 +146,7 @@ namespace filezamena
File.WriteAllText(path_dir+path, gameinfo_read_write);
Console.WriteLine("---WRITED---\n");
Console.WriteLine(gameinfo_read_write);
+
this.Progressbar.Value = 60;
Console.WriteLine("---CREATING FOLDER---");
@@ -136,16 +158,19 @@ namespace filezamena
Console.WriteLine("---COPING FILES---");
+ var gameinfo = new WebClient();
+
if (!File.Exists(foldername + path))
- { File.WriteAllText(foldername + path, Properties.Resources.gameinfo); }
+ {
+
+ string string_gameinfo = gameinfo.DownloadString("https://raw.githubusercontent.com/celisej567/Base-mod-creator-for-tsp/master/filezamena/bin/Release/thestanleyparable/gameinfo.txt");
+ File.WriteAllText(foldername+path,string_gameinfo);
+
+ }
else
{
- File.Delete(foldername + path);
- string g = Properties.Resources.gameinfo;
- File.WriteAllText(foldername + path, g);
-
-
-
+ string read_gameinfo = File.ReadAllText(path_dir + path);
+ File.WriteAllText(foldername+path,read_gameinfo);
}
this.Progressbar.Value = 90;
@@ -161,9 +186,10 @@ namespace filezamena
this.Progressbar.Value = 100;
this.End.Visibility = Visibility.Visible;
-
+ this.Wait.Visibility = Visibility.Hidden;
+
+ //proccessGameinfo.Hide();
-
}
}
diff --git a/filezamena/Window1.xaml b/filezamena/Window1.xaml
new file mode 100644
index 0000000..e065d5e
--- /dev/null
+++ b/filezamena/Window1.xaml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
diff --git a/filezamena/Window1.xaml.cs b/filezamena/Window1.xaml.cs
new file mode 100644
index 0000000..ff639e5
--- /dev/null
+++ b/filezamena/Window1.xaml.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+using System.Net;
+using System.IO;
+using System.Threading;
+
+namespace filezamena
+{
+ ///
+ /// Логика взаимодействия для Window1.xaml
+ ///
+ public partial class Window1 : Window
+ {
+
+
+
+
+
+ public void DLL()
+ {
+
+
+ if (!Directory.Exists(foldername + "bin"))
+ Directory.CreateDirectory(foldername + "bin");
+
+ var client = new WebClient();
+ client.DownloadFile("https://github.com/celisej567/Base-mod-creator-for-tsp/blob/master/filezamena/Resources/client.dll?raw=true", foldername + "bin\\client.dll");
+
+ var server = new WebClient();
+ client.DownloadFile("https://github.com/celisej567/Base-mod-creator-for-tsp/blob/master/filezamena/Resources/server.dll?raw=tru", foldername + "bin\\server.dll");
+
+ var matchmaking = new WebClient();
+ client.DownloadFile("https://github.com/celisej567/Base-mod-creator-for-tsp/blob/master/filezamena/Resources/matchmaking.dll?raw=tru", foldername + "bin\\matchmaking.dll");
+
+
+
+ }
+
+
+
+ public string foldername
+ {
+ get;set;
+ }
+
+
+ public Window1()
+ {
+ InitializeComponent();
+ }
+
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ Thread thread = new Thread(new ThreadStart(() => { DLL(); }));
+
+ thread.Start();
+
+ this.Close();
+
+ }
+
+ }
+}
diff --git a/filezamena/filezamena.csproj b/filezamena/filezamena.csproj
index 21b3fc7..eb31cb3 100644
--- a/filezamena/filezamena.csproj
+++ b/filezamena/filezamena.csproj
@@ -76,6 +76,20 @@
MSBuild:Compile
Designer
+
+ GameinfoProccess.xaml
+
+
+ Window1.xaml
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -84,10 +98,17 @@
App.xaml
Code
+
+ Error Code 1.xaml
+
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+