-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dillan walker
authored and
dillan walker
committed
Dec 4, 2023
1 parent
bd29612
commit 5da6284
Showing
6 changed files
with
513 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net7.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.7.34221.43 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElvUI Extraction", "ElvUI Extraction.csproj", "{D0D8D3BB-4088-410F-A3BC-15B63078305D}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{D0D8D3BB-4088-410F-A3BC-15B63078305D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D0D8D3BB-4088-410F-A3BC-15B63078305D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D0D8D3BB-4088-410F-A3BC-15B63078305D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D0D8D3BB-4088-410F-A3BC-15B63078305D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {C3E4306F-38B1-44E8-8C65-0CDAC46F57BF} | ||
EndGlobalSection | ||
EndGlobal |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace ElvUIExtraction; | ||
|
||
public partial class Form1 : Form | ||
{ | ||
// Set window as always on top | ||
static readonly IntPtr HWND_TOPMOST = new IntPtr(-1); | ||
static readonly IntPtr HWND_NOTOPMOST = new IntPtr(-2); | ||
static readonly IntPtr HWND_TOP = new IntPtr(0); | ||
static readonly IntPtr HWND_BOTTOM = new IntPtr(1); | ||
const UInt32 SWP_NOSIZE = 0x0001; | ||
const UInt32 SWP_NOMOVE = 0x0002; | ||
const UInt32 TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE; | ||
|
||
[DllImport("user32.dll")] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); | ||
|
||
public Form1() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private string MainFolder = string.Empty; | ||
|
||
// Form load method | ||
private void WoW_Prompt(object sender, EventArgs e) | ||
{ | ||
SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS); | ||
|
||
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog | ||
{ | ||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop), | ||
}; | ||
|
||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK) | ||
{ | ||
MainFolder = folderBrowserDialog.SelectedPath; | ||
} | ||
} | ||
|
||
// OpenFileDialog for Zip File | ||
private void ElvUI_OFD(object sender, EventArgs e) | ||
{ | ||
OpenFileDialog ofd = new OpenFileDialog | ||
{ | ||
Title = "Select ElvUI Zip File", | ||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal), | ||
Filter = "zip files (*.zip)|*.zip", | ||
|
||
}; | ||
|
||
if (ofd.ShowDialog() == DialogResult.OK) | ||
{ | ||
ElvUIPath.Text = ofd.FileName; | ||
} | ||
} | ||
// OpenFileDialog for _classic_ | ||
private void _classic_Btn_Click(object sender, EventArgs e) | ||
{ | ||
FolderBrowserDialog ofd = new FolderBrowserDialog | ||
{ | ||
InitialDirectory = MainFolder | ||
}; | ||
|
||
if (ofd.ShowDialog(this) == DialogResult.OK) | ||
{ | ||
_classic_Path.Text = ofd.SelectedPath; | ||
} | ||
} | ||
// OpenFileDialog for _classic_era_ | ||
private void _classic_era_Btn_Click(object sender, EventArgs e) | ||
{ | ||
FolderBrowserDialog ofd = new FolderBrowserDialog | ||
{ | ||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal), | ||
}; | ||
|
||
if (ofd.ShowDialog(this) == DialogResult.OK) | ||
{ | ||
_classic_era_Path.Text = ofd.SelectedPath; | ||
} | ||
} | ||
// OpenFileDialog for _retail_ | ||
private void _retail_Btn_Click(object sender, EventArgs e) | ||
{ | ||
FolderBrowserDialog ofd = new FolderBrowserDialog | ||
{ | ||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal), | ||
}; | ||
|
||
if (ofd.ShowDialog(this) == DialogResult.OK) | ||
{ | ||
_retail_Path.Text = ofd.SelectedPath; | ||
} | ||
} | ||
//Extract using System.IO | ||
private void ExtractBtn_Click(object sender, EventArgs e) | ||
{ | ||
var zipPath = ElvUIPath.Text; | ||
var extract_classic_ = _classic_Path.Text; | ||
var extract_classic_era_ = _classic_era_Path.Text; | ||
var extract_retail_ = _retail_Path.Text; | ||
|
||
if (_classic_Path.Text.Length == 0) | ||
{ | ||
// Do Nothing | ||
} | ||
else | ||
{ | ||
System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extract_classic_, true); | ||
} | ||
|
||
if (_classic_era_Path.Text.Length == 0) | ||
{ | ||
// Do Nothing | ||
} | ||
else | ||
{ | ||
System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extract_classic_era_, true); | ||
} | ||
if (_retail_Path.Text.Length == 0) | ||
{ | ||
// Do Nothing | ||
} | ||
else | ||
{ | ||
System.IO.Compression.ZipFile.ExtractToDirectory(zipPath, extract_retail_, true); | ||
} | ||
//Error Handling | ||
if (ElvUIPath.Text.Length == 0) | ||
{ | ||
MessageBox.Show("Please Provide ElvUI Zip File"); | ||
return; | ||
} | ||
} | ||
} |
Oops, something went wrong.