Skip to content

Commit

Permalink
Implemented zipping and backing up of project to 2 online folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMWestbrook committed Oct 18, 2019
1 parent 7bb1899 commit 8d8e363
Show file tree
Hide file tree
Showing 44 changed files with 535 additions and 88 deletions.
Binary file modified .vs/RPGMVTools/v16/.suo
Binary file not shown.
Binary file modified .vs/RPGMVTools/v16/Server/sqlite3/storage.ide
Binary file not shown.
Binary file not shown.
Binary file added .vs/RPGMVTools/v16/TestStore/0/testlog.manifest
Binary file not shown.
5 changes: 4 additions & 1 deletion .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"ExpandedNodes": [
""
"",
"\\bin",
"\\obj",
"\\Properties"
],
"SelectedNode": "\\MainWindow.xaml",
"PreviewInSolutionExplorer": false
Expand Down
Binary file modified .vs/slnx.sqlite
Binary file not shown.
110 changes: 56 additions & 54 deletions MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,60 @@
xmlns:local="clr-namespace:RPGMVTools"
mc:Ignorable="d"
Title="James' RPG MV Tools" Height="450" Width="600">
<StackPanel>

<!--Project Folder-->
<Button x:Name="ProjectFolderButton" Click="ProjectFolderButton_Click" Content="Choose Project Folder" Grid.Column="0" Margin="10,0,288,0"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="ProjectPath:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="ProjectFolderPath" Grid.ColumnSpan="2" Margin="73,0,0,0"/>

</Grid>
<!-- Backup 1 Folder-->
<Button x:Name="BackupFolderOneButton" Click="BackupFolderOneButton_Click" Content="Choose Backup Folder 1" Grid.Column="0" Margin="10,0,288,0" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Backup 1 Path:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="BackupFolderOnePath" Grid.ColumnSpan="2" Margin="83,0,0,0"/>

</Grid>

<!--Backup 2 Folder-->
<Button x:Name="BackupFolderTwoButton" Click="BackupFolderTwoButton_Click" Content="Choose Backup Folder 2" Grid.Column="1" Margin="10,0,288,0"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Backup 2 Path:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="BackupFolderTwoPath" Grid.ColumnSpan="2" Margin="83,0,0,0"/>

</Grid>

<!--Backup Project-->
<Button Content="Backup Project" Background="Aquamarine" x:Name="BackupProjectButton" Click="BackupProjectButton_Click" Margin="10,0" />

<!--RXGC Folder-->
<Button Content="Choose RXGCFolderPath" x:Name="RXGCFoldeButton" Click="RXGCFoldeButton_Click" Margin="10,10,288,10" />

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text ="RXGCFolderPath:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="RXGCFolderPath" Grid.ColumnSpan="2" Margin="94,0,0,0" />
</Grid>
<Button Content= "Custom Graphics -> Project" Background="Aquamarine" x:Name= "MoveGraphics" Click="MoveGraphics_Click" Margin="10,0" />

</StackPanel>
<StackPanel>

<!--Project Folder-->
<Button x:Name="ProjectFolderButton" Click="ProjectFolderButton_Click" Content="Choose Project Folder" Grid.Column="0" Margin="10,0,288,0"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="ProjectPath:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="ProjectFolderPath" Grid.ColumnSpan="2" Margin="73,0,0,0"/>

</Grid>
<!-- Backup 1 Folder-->
<Button x:Name="BackupFolderOneButton" Click="BackupFolderOneButton_Click" Content="Choose Backup Folder 1" Grid.Column="0" Margin="10,0,288,0" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Backup 1 Path:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="BackupFolderOnePath" Grid.ColumnSpan="2" Margin="83,0,0,0"/>

</Grid>

<!--Backup 2 Folder-->
<Button x:Name="BackupFolderTwoButton" Click="BackupFolderTwoButton_Click" Content="Choose Backup Folder 2" Grid.Column="1" Margin="10,0,288,0"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Backup 2 Path:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="BackupFolderTwoPath" Grid.ColumnSpan="2" Margin="83,0,0,0"/>

</Grid>

<!--Backup Project-->
<Button Content="Backup Project" Background="Aquamarine" x:Name="BackupProjectButton" Click="BackupProjectButton_Click" Margin="10,0" />

<!--Zip Project, NOT BEING USED-->
<!--<Button Content="Zip Project" Background="Aquamarine" x:Name="ZipProjectButton" Click="ZipProjectButton_Click" Margin="10,0" />-->
<!--RXGC Folder-->
<Button Content="Choose RXGCFolderPath" x:Name="RXGCFoldeButton" Click="RXGCFoldeButton_Click" Margin="10,10,288,10" />

<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text ="RXGCFolderPath:" Grid.Column="0" Margin="0,0,90,0"/>
<TextBlock x:Name="RXGCFolderPath" Grid.ColumnSpan="2" Margin="94,0,0,0" />
</Grid>
<Button Content= "Custom Graphics -> Project" Background="Aquamarine" x:Name= "MoveGraphics" Click="MoveGraphics_Click" Margin="10,0" />

</StackPanel>
</Window>
40 changes: 33 additions & 7 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.IO.Compression;

using System.Linq;
using System.Windows;
using WinForms = System.Windows.Forms;
Expand Down Expand Up @@ -106,10 +109,28 @@ private void BackupProjectButton_Click(object sender, RoutedEventArgs e)
DirectoryInfo ProjectFolder = new DirectoryInfo(projectPath);

FileInfo[] Project = ProjectFolder.GetFiles();
FileInfo[] OpenBackupOne = BackupOneDir.GetFiles();
FileInfo[] OpenBackupTwo = BackupTwoDir.GetFiles();

//DirectoryCopy(projectPath, BackupOnePath, true);
string BackupZipOne = BackupOnePath + @"\OtraReturnGame.zip";
string BackupZipTwo = BackupTwoPath + @"\OtraReturnGame.zip";
DeleteZip(BackupZipOne);
DeleteZip(BackupZipTwo);

ZipFile.CreateFromDirectory(projectPath, BackupOnePath + @"\OtraReturnGame.zip");
ZipFile.CreateFromDirectory(projectPath, BackupTwoPath + @"\OtraReturnGame.zip");
}

private void DeleteZip(string path)
{
if (File.Exists(path))
{
File.Delete(path);
}
}


private void DirectoryCopy(string sourceDirName, string destDirName, bool copySubDirs)
{

Expand Down Expand Up @@ -165,9 +186,6 @@ private void RXGCFoldeButton_Click(object sender, RoutedEventArgs e)
Properties.Settings.Default.Save();
}




private void MoveGraphics_Click(object sender, RoutedEventArgs e)
{

Expand Down Expand Up @@ -200,16 +218,24 @@ private void MoveImage(FileInfo file, DirectoryInfo ProjectFolder)
{
if (file.Name.Contains("Character.png"))
{
string DestinationFile = ProjectFolder + @"\img\Characters\" + file.Name;
string DestinationFile = ProjectFolder + @"\ReturnToOtraGame\img\Characters\" + file.Name;
if (File.Exists(DestinationFile)) File.Delete(DestinationFile);
file.MoveTo(DestinationFile);
}
else if (file.Name.Contains(".png"))
else if (file.Name.Contains("Face.png"))
{
string DestinationFile = ProjectFolder + @"\img\Faces\" + file.Name;
string DestinationFile = ProjectFolder + @"\ReturnToOtraGame\img\Faces\" + file.Name;
if (File.Exists(DestinationFile)) File.Delete(DestinationFile);
file.MoveTo(DestinationFile);
}
}

private void ZipProjectButton_Click(object sender, RoutedEventArgs e)
{
ZipFile.CreateFromDirectory(projectPath, @"C:\Users\james\Documents\Output\result.zip");
//ZipFile.ExtractToDirectory(@"C:\Users\james\Documents\Output\result.zip", @"C:\Users\james\Documents\Output");
}
}
}


}
28 changes: 28 additions & 0 deletions RPGMVTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -37,6 +52,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -95,5 +111,17 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
13 changes: 13 additions & 0 deletions RPGMVTools.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
Binary file modified bin/Debug/RPGMVTools.exe
Binary file not shown.
Binary file modified bin/Debug/RPGMVTools.pdb
Binary file not shown.
Binary file added bin/Release/RPGMVTools.exe
Binary file not shown.
27 changes: 27 additions & 0 deletions bin/Release/RPGMVTools.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="RPGMVTools.Properties.Settings" 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.7.2" />
</startup>
<userSettings>
<RPGMVTools.Properties.Settings>
<setting name="StoredProjectPath" serializeAs="String">
<value />
</setting>
<setting name="StoredBackupOnePath" serializeAs="String">
<value />
</setting>
<setting name="StoredBackupTwoPath" serializeAs="String">
<value />
</setting>
<setting name="RXGCFolderPath" serializeAs="String">
<value />
</setting>
</RPGMVTools.Properties.Settings>
</userSettings>
</configuration>
Binary file added bin/Release/RPGMVTools.pdb
Binary file not shown.
Binary file modified obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.
Binary file added obj/Debug/MainWindow.baml
Binary file not shown.
12 changes: 6 additions & 6 deletions obj/Debug/MainWindow.g.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DBDE059CE475AC29B4F245A80F621794C3B9CD4F4F866E49BB25A534CE990849"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C4B152F23E806DAC0D46049224AA8ED5FA9E8388F8A22672216544A78252568B"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
Expand Down Expand Up @@ -97,23 +97,23 @@ public partial class MainWindow : System.Windows.Window, System.Windows.Markup.I
#line hidden


#line 50 "..\..\MainWindow.xaml"
#line 52 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button RXGCFoldeButton;

#line default
#line hidden


#line 58 "..\..\MainWindow.xaml"
#line 60 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock RXGCFolderPath;

#line default
#line hidden


#line 60 "..\..\MainWindow.xaml"
#line 62 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button MoveGraphics;

Expand Down Expand Up @@ -198,7 +198,7 @@ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object
case 8:
this.RXGCFoldeButton = ((System.Windows.Controls.Button)(target));

#line 50 "..\..\MainWindow.xaml"
#line 52 "..\..\MainWindow.xaml"
this.RXGCFoldeButton.Click += new System.Windows.RoutedEventHandler(this.RXGCFoldeButton_Click);

#line default
Expand All @@ -210,7 +210,7 @@ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object
case 10:
this.MoveGraphics = ((System.Windows.Controls.Button)(target));

#line 60 "..\..\MainWindow.xaml"
#line 62 "..\..\MainWindow.xaml"
this.MoveGraphics.Click += new System.Windows.RoutedEventHandler(this.MoveGraphics_Click);

#line default
Expand Down
12 changes: 6 additions & 6 deletions obj/Debug/MainWindow.g.i.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "DBDE059CE475AC29B4F245A80F621794C3B9CD4F4F866E49BB25A534CE990849"
#pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "C4B152F23E806DAC0D46049224AA8ED5FA9E8388F8A22672216544A78252568B"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
Expand Down Expand Up @@ -97,23 +97,23 @@ public partial class MainWindow : System.Windows.Window, System.Windows.Markup.I
#line hidden


#line 50 "..\..\MainWindow.xaml"
#line 52 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button RXGCFoldeButton;

#line default
#line hidden


#line 58 "..\..\MainWindow.xaml"
#line 60 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock RXGCFolderPath;

#line default
#line hidden


#line 60 "..\..\MainWindow.xaml"
#line 62 "..\..\MainWindow.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button MoveGraphics;

Expand Down Expand Up @@ -198,7 +198,7 @@ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object
case 8:
this.RXGCFoldeButton = ((System.Windows.Controls.Button)(target));

#line 50 "..\..\MainWindow.xaml"
#line 52 "..\..\MainWindow.xaml"
this.RXGCFoldeButton.Click += new System.Windows.RoutedEventHandler(this.RXGCFoldeButton_Click);

#line default
Expand All @@ -210,7 +210,7 @@ void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object
case 10:
this.MoveGraphics = ((System.Windows.Controls.Button)(target));

#line 60 "..\..\MainWindow.xaml"
#line 62 "..\..\MainWindow.xaml"
this.MoveGraphics.Click += new System.Windows.RoutedEventHandler(this.MoveGraphics_Click);

#line default
Expand Down
Loading

0 comments on commit 8d8e363

Please sign in to comment.