Created
February 7, 2024 07:47
-
-
Save DJStompZone/35e850b5ce49aaaaa919c28dd6042d02 to your computer and use it in GitHub Desktop.
DDLC Mod Installer UI Powershell
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
Add-Type -AssemblyName System.Windows.Forms | |
Add-Type -AssemblyName System.Drawing | |
$form = New-Object System.Windows.Forms.Form | |
$form.Text = 'DDLC Mod Installer' | |
$form.Size = New-Object System.Drawing.Size(800, 500) | |
$form.StartPosition = 'CenterScreen' | |
$form.FormBorderStyle = 'FixedSingle' | |
$form.MaximizeBox = $false | |
# Function to set control properties more efficiently | |
function Set-Control { | |
param( | |
$control, | |
$posX, | |
$posY, | |
$sizeX, | |
$sizeY | |
) | |
$control.Location = New-Object System.Drawing.Point($posX, $posY) | |
$control.Size = New-Object System.Drawing.Size($sizeX, $sizeY) | |
} | |
# Zip File GroupBox | |
$groupZip = New-Object System.Windows.Forms.GroupBox | |
$groupZip.Text = 'Zip File:' | |
Set-Control $groupZip 10 10 760 60 | |
$form.Controls.Add($groupZip) | |
$txtZipFile = New-Object System.Windows.Forms.TextBox | |
Set-Control $txtZipFile 80 20 600 20 | |
$groupZip.Controls.Add($txtZipFile) | |
$btnBrowseZip = New-Object System.Windows.Forms.Button | |
$btnBrowseZip.Text = 'Browse' | |
Set-Control $btnBrowseZip 685 20 65 20 | |
# TODO: Add Click event logic for $btnBrowseZip here | |
$groupZip.Controls.Add($btnBrowseZip) | |
# Game Directory GroupBox | |
$groupGame = New-Object System.Windows.Forms.GroupBox | |
$groupGame.Text = 'Game Directory:' | |
Set-Control $groupGame 10 80 760 60 | |
$form.Controls.Add($groupGame) | |
$txtGameDirectory = New-Object System.Windows.Forms.TextBox | |
Set-Control $txtGameDirectory 80 20 560 20 | |
$groupGame.Controls.Add($txtGameDirectory) | |
$btnBrowseGameDir = New-Object System.Windows.Forms.Button | |
$btnBrowseGameDir.Text = 'Browse' | |
Set-Control $btnBrowseGameDir 645 20 60 20 | |
$groupGame.Controls.Add($btnBrowseGameDir) | |
$btnAutoGameDir = New-Object System.Windows.Forms.Button | |
$btnAutoGameDir.Text = 'Auto' | |
Set-Control $btnAutoGameDir 710 20 40 20 | |
# TODO: Add Click event logic for $btnAutoGameDir here | |
$groupGame.Controls.Add($btnAutoGameDir) | |
# Mod Path GroupBox | |
$groupModPath = New-Object System.Windows.Forms.GroupBox | |
$groupModPath.Text = 'Mod Path:' | |
Set-Control $groupModPath 10 150 760 60 | |
$form.Controls.Add($groupModPath) | |
$txtModPath = New-Object System.Windows.Forms.TextBox | |
Set-Control $txtModPath 80 20 600 20 | |
$groupModPath.Controls.Add($txtModPath) | |
$btnBrowseModPath = New-Object System.Windows.Forms.Button | |
$btnBrowseModPath.Text = 'Browse' | |
Set-Control $btnBrowseModPath 685 20 65 20 | |
# TODO: Add Click event logic for $btnBrowseModPath here | |
$groupModPath.Controls.Add($btnBrowseModPath) | |
# Install Mod to Separate Directory CheckBox | |
$chkInstallSeparate = New-Object System.Windows.Forms.CheckBox | |
$chkInstallSeparate.Text = 'Install Mod to Separate Directory' | |
Set-Control $chkInstallSeparate 10 220 250 20 | |
# TODO: Add CheckedChanged event logic for $chkInstallSeparate here | |
$form.Controls.Add($chkInstallSeparate) | |
# Install Mod Button | |
$btnInstallMod = New-Object System.Windows.Forms.Button | |
$btnInstallMod.Text = 'Install Mod' | |
Set-Control $btnInstallMod 10 250 100 30 | |
# TODO: Add Click event logic for $btnInstallMod here | |
$form.Controls.Add($btnInstallMod) | |
# Delete DDLC Button | |
$btnDeleteDDLC = New-Object System.Windows.Forms.Button | |
$btnDeleteDDLC.Text = 'Delete DDLC' | |
Set-Control $btnDeleteDDLC 115 250 100 30 | |
# TODO: Add Click event logic for $btnDeleteDDLC here | |
$form.Controls.Add($btnDeleteDDLC) | |
# Console Output TextBox | |
$txtConsoleOutput = New-Object System.Windows.Forms.TextBox | |
$txtConsoleOutput.Multiline = $true | |
$txtConsoleOutput.ScrollBars = 'Vertical' | |
$txtConsoleOutput.ReadOnly = $true | |
Set-Control $txtConsoleOutput 10 290 760 140 | |
$form.Controls.Add($txtConsoleOutput) | |
# Reminder Label | |
$lblReminder = New-Object System.Windows.Forms.Label | |
$lblReminder.Text = 'Remember to install on a fresh copy of Doki Doki Literature Club!' | |
Set-Control $lblReminder 10 440 780 20 | |
$form.Controls.Add($lblReminder) | |
# Show the form | |
$form.ShowDialog() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment