Finished some codes.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
|
||||
</startup>
|
||||
</configuration>
|
||||
4
SMBX Magic Patcher/Form1.Designer.vb
generated
4
SMBX Magic Patcher/Form1.Designer.vb
generated
@@ -311,8 +311,6 @@ Partial Class Form1
|
||||
Me.SwitchButton_Liquids.Size = New System.Drawing.Size(57, 23)
|
||||
Me.SwitchButton_Liquids.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled
|
||||
Me.SwitchButton_Liquids.TabIndex = 49
|
||||
Me.SwitchButton_Liquids.Value = True
|
||||
Me.SwitchButton_Liquids.ValueObject = "Y"
|
||||
'
|
||||
'LabelX8
|
||||
'
|
||||
@@ -468,8 +466,6 @@ Partial Class Form1
|
||||
Me.SwitchButton_BlocksEtc.Size = New System.Drawing.Size(57, 23)
|
||||
Me.SwitchButton_BlocksEtc.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled
|
||||
Me.SwitchButton_BlocksEtc.TabIndex = 34
|
||||
Me.SwitchButton_BlocksEtc.Value = True
|
||||
Me.SwitchButton_BlocksEtc.ValueObject = "Y"
|
||||
'
|
||||
'LabelX9
|
||||
'
|
||||
|
||||
@@ -74,7 +74,8 @@ Public Class Form1
|
||||
SwitchButton_Liquids.Value)
|
||||
|
||||
Case 1 : MessageBoxEx.Show("Done", "Patch succesfully created!", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
Case Else : MessageBoxEx.Show("Done", "Patch succesfully created!", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
Case 2 : MessageBoxEx.Show("Done", "There is an error at packing!", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
Case Else : MessageBoxEx.Show("Done", "There is an unknown error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
End Select
|
||||
|
||||
Button_CreatePatch.Enabled = True
|
||||
@@ -83,7 +84,20 @@ Public Class Form1
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button_ApplyPatch.Click
|
||||
SMBXPFX.ApplyPatch(TextBoxX_OriginalLevelApply.Text, TextBoxX_PatchFileApply.Text)
|
||||
CircularProgress_Apply.IsRunning = True
|
||||
LabelX14.Enabled = True
|
||||
Button_ApplyPatch.Enabled = True
|
||||
|
||||
Select Case SMBXPFX.ApplyPatch(TextBoxX_OriginalLevelApply.Text, TextBoxX_PatchFileApply.Text)
|
||||
Case 1 : MessageBoxEx.Show("Done", "Patch applied succesfully!", MessageBoxButtons.OK, MessageBoxIcon.Information)
|
||||
Case 2 : MessageBoxEx.Show("Done", "There is an error at extracting files! Or maybe this isn't a valid patch file.", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
Case 3 : MessageBoxEx.Show("Done", "This isn't a valid patch file.", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
Case Else : MessageBoxEx.Show("Done", "There is an unknown error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
|
||||
End Select
|
||||
|
||||
LabelX14.Enabled = False
|
||||
CircularProgress_Apply.IsRunning = False
|
||||
Button_ApplyPatch.Enabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBoxX2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxX2.CheckedChanged
|
||||
@@ -190,16 +204,17 @@ SkipCheck: End If
|
||||
Return 2 'Error at packing
|
||||
End If
|
||||
|
||||
Directory.Delete(TempLeveldir, True)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Shared Function ApplyPatch(OriginalLevel As String, PatchFile As String) As Integer
|
||||
Dim PatchTyp As Integer = 0 '0 = plx | 1 = slp
|
||||
Dim PLevel As List(Of String) = File.ReadAllLines(OriginalLevel).ToList
|
||||
Dim TempLeveldir As String = Form1.TempDir & "\TempLevel"
|
||||
Dim TempLevelfiledir As String = TempLeveldir & "\data"
|
||||
If Directory.Exists(TempLeveldir) Then Directory.Delete(TempLeveldir, True)
|
||||
Directory.CreateDirectory(TempLeveldir)
|
||||
Dim TempLeveldir As String = Form1.TempDir & "\TempLevel" : Dim TempLevelfiledir As String = TempLeveldir & "\data"
|
||||
Dim oLeveldir As String = Path.GetDirectoryName(OriginalLevel) : Dim oLevelfiledir As String = oLeveldir & "\" & Path.GetFileNameWithoutExtension(OriginalLevel)
|
||||
If Directory.Exists(TempLeveldir) Then Directory.Delete(TempLeveldir, True) : Application.DoEvents()
|
||||
Directory.CreateDirectory(TempLeveldir) : Application.DoEvents()
|
||||
|
||||
'Check Patchtyp:
|
||||
Select Case Path.GetExtension(PatchFile)
|
||||
@@ -220,7 +235,6 @@ SkipCheck: End If
|
||||
sevenzip.StartInfo.UseShellExecute = False
|
||||
sevenzip.StartInfo.CreateNoWindow = True
|
||||
sevenzip.Start()
|
||||
|
||||
Do Until sevenzip.HasExited = True : Application.DoEvents() : Loop
|
||||
If sevenzip.ExitCode <> 0 Then
|
||||
Return 2 'Error at packing
|
||||
@@ -228,7 +242,7 @@ SkipCheck: End If
|
||||
End If
|
||||
|
||||
'Load patchlevel:
|
||||
Dim PFile() As String = {""}
|
||||
Dim PFile() As String = {}
|
||||
Select Case PatchTyp
|
||||
Case 0 : PFile = File.ReadAllLines(TempLeveldir & "\data.dat")
|
||||
Case 1 : PFile = File.ReadAllLines(PatchFile)
|
||||
@@ -236,15 +250,21 @@ SkipCheck: End If
|
||||
|
||||
'Apply lines in patch to the level:
|
||||
For Each l As String In PFile
|
||||
If Not PLevel.Contains(l) Then
|
||||
PLevel.Add(l)
|
||||
End If
|
||||
If Not PLevel.Contains(l) Then PLevel.Add(l)
|
||||
Next
|
||||
|
||||
'Copy and replace files
|
||||
If PatchTyp = 0 Then
|
||||
Dim ListFilesInLeveldir() As String = Directory.GetFileSystemEntries(TempLeveldir)
|
||||
|
||||
Dim pListFilesInLeveldir() As String = Directory.GetFiles(TempLeveldir) : Dim pListFilesInLevelfiledir() As String = {} : If Directory.Exists(TempLevelfiledir) Then pListFilesInLevelfiledir = Directory.GetFiles(TempLevelfiledir)
|
||||
Dim oListFilesInLeveldir() As String = Directory.GetFiles(oLeveldir) : Dim oListFilesInLevelfiledir() As String = {} : If Directory.Exists(oLevelfiledir) Then oListFilesInLevelfiledir = Directory.GetFiles(oLevelfiledir)
|
||||
If Not Directory.Exists(oLevelfiledir) And oListFilesInLevelfiledir.Count > 0 Then Directory.CreateDirectory(oLevelfiledir)
|
||||
For i As Integer = 0 To pListFilesInLeveldir.Count - 1
|
||||
If Not pListFilesInLeveldir(i) = TempLeveldir & "\data.dat" Then
|
||||
File.Copy(pListFilesInLeveldir(i), oLeveldir & "\" & Path.GetFileName(pListFilesInLeveldir(i)), True) : MsgBox("") : End If
|
||||
Application.DoEvents() : Next
|
||||
For i As Integer = 0 To pListFilesInLevelfiledir.Count - 1
|
||||
File.Copy(pListFilesInLevelfiledir(i), oLevelfiledir & "\" & Path.GetFileName(pListFilesInLevelfiledir(i)), True)
|
||||
Application.DoEvents() : Next
|
||||
End If
|
||||
|
||||
'Wirte new level file
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
@@ -14,10 +14,10 @@ Option Explicit On
|
||||
|
||||
Namespace My
|
||||
|
||||
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
|
||||
' or if you encounter build errors in this file, go to the Project Designer
|
||||
' (go to Project Properties or double-click the My Project node in
|
||||
' Solution Explorer), and make changes on the Application tab.
|
||||
'HINWEIS: Diese Datei wird automatisch generiert und darf nicht direkt bearbeitet werden. Wenn Sie Änderungen vornehmen möchten,
|
||||
' oder bei in dieser Datei auftretenden Buildfehlern wechseln Sie zum Projekt-Designer.
|
||||
' (Wechseln Sie dazu zu den Projekteigenschaften, oder doppelklicken Sie auf den Knoten "Mein Projekt" im
|
||||
' Projektmappen-Explorer). Nehmen Sie auf der Registerkarte "Anwendung" entsprechende Änderungen vor.
|
||||
'
|
||||
Partial Friend Class MyApplication
|
||||
|
||||
|
||||
27
SMBX Magic Patcher/My Project/Resources.Designer.vb
generated
27
SMBX Magic Patcher/My Project/Resources.Designer.vb
generated
@@ -1,25 +1,26 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
@@ -32,7 +33,7 @@ Namespace My.Resources
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
@@ -46,15 +47,15 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
14
SMBX Magic Patcher/My Project/Settings.Designer.vb
generated
14
SMBX Magic Patcher/My Project/Settings.Designer.vb
generated
@@ -1,10 +1,10 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
@@ -15,14 +15,14 @@ Option Explicit On
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#Region "Funktion zum automatischen Speichern von My.Settings"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
<AssemblyName>SMBX Magic Patcher</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>WindowsForms</MyType>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
||||
Reference in New Issue
Block a user