Add files via upload

This commit is contained in:
celisej567
2021-07-31 20:04:38 +03:00
committed by GitHub
parent 5fc1bfeda5
commit 23f8a25137
9 changed files with 316 additions and 33 deletions

View File

@@ -0,0 +1,14 @@
<Window x:Class="filezamena.Error_Code_1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:filezamena"
mc:Ignorable="d"
Title="Error_Code_1" Height="187.85" Width="337.383">
<Grid>
<Label Content="Error Code 1: gameinfo.txt not &#xD;&#xA;fount in thestanleyparable folder" HorizontalAlignment="Left" Margin="27,37,0,0" VerticalAlignment="Top" Height="96" Width="237"/>
<Button Content="OK" HorizontalAlignment="Left" Margin="222,118,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
</Grid>
</Window>

View File

@@ -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
{
/// <summary>
/// Логика взаимодействия для Error_Code_1.xaml
/// </summary>
public partial class Error_Code_1 : Window
{
public Error_Code_1()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

View File

@@ -0,0 +1,29 @@
<Window x:Class="filezamena.GameinfoProccess"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:filezamena"
mc:Ignorable="d"
Title="Processing" Height="193.029" Width="508.043"
ResizeMode="NoResize"
>
<Grid Background="#7F474747">
<Label
Content="DOWNLOADING gameinfo.txt"
HorizontalAlignment="Left"
Height="60"
Margin="34,66,0,0"
VerticalAlignment="Top"
Width="423"
FontSize="36"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontFamily="Impact"
/>
</Grid>
</Window>

View File

@@ -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
{
/// <summary>
/// Логика взаимодействия для GameinfoProccess.xaml
/// </summary>
public partial class GameinfoProccess : Window
{
public bool isClose
{
get; set;
} = true;
public GameinfoProccess()
{
InitializeComponent();
this.Closing += (o, e) =>
{
isClose = false;
};
}
}
}

View File

@@ -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"
>
<Grid Background="#7F474747">
@@ -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"
/>
<TextBox
x:Name="modname"
x:Name="Modname"
HorizontalAlignment="Left"
Height="54"
Margin="27,128,0,0"
@@ -90,7 +89,7 @@
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontFamily="Impact"
Visibility="Hidden"
Visibility="Hidden"
/>
<Label
Content="with a capital letter"
@@ -100,6 +99,20 @@
VerticalAlignment="Top"
Width="119"
/>
<Label
x:Name="Wait"
Content="PLEASE WAIT"
HorizontalAlignment="Left"
Height="60"
Margin="63,228,0,0"
VerticalAlignment="Top"
Width="368"
FontSize="36"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontFamily="Impact"
Visibility="Hidden"
/>
<CheckBox
x:Name="DLLCheck"
Content="Create DLL for SourceMods"
@@ -115,8 +128,12 @@
/>
<Grid.Effect>
<BlurEffect Radius="1.5" RenderingBias="Quality"/>
<BlurEffect
Radius="1.5"
RenderingBias="Quality"
/>
</Grid.Effect>

View File

@@ -29,33 +29,32 @@ namespace filezamena
/// </summary>
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();
}
}

30
filezamena/Window1.xaml Normal file
View File

@@ -0,0 +1,30 @@
<Window x:Class="filezamena.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:filezamena"
mc:Ignorable="d"
Title="Processing" Height="193.029" Width="508.043"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen" Loaded="Window_Loaded"
>
<Grid Background="#7F474747">
<Label
Content="DOWNLOADING DLL"
HorizontalAlignment="Left"
Height="60"
Margin="66,69,0,0"
VerticalAlignment="Top"
Width="368"
FontSize="36"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
FontFamily="Impact"
/>
</Grid>
</Window>

View File

@@ -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
{
/// <summary>
/// Логика взаимодействия для Window1.xaml
/// </summary>
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();
}
}
}

View File

@@ -76,6 +76,20 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="GameinfoProccess.xaml.cs">
<DependentUpon>GameinfoProccess.xaml</DependentUpon>
</Compile>
<Compile Include="Window1.xaml.cs">
<DependentUpon>Window1.xaml</DependentUpon>
</Compile>
<Page Include="Error Code 1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="GameinfoProccess.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -84,10 +98,17 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Error Code 1.xaml.cs">
<DependentUpon>Error Code 1.xaml</DependentUpon>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Window1.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">