diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 80e2cdb..3c4efe2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,41 +1,53 @@ -# The following command works for downloading when using Git for Windows: -# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore -# -# Download this file using PowerShell v3 under Windows with the following comand: -# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore -# -# or wget: -# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. # User-specific files *.suo *.user +*.userosscache *.sln.docstates +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + # Build results [Dd]ebug/ +[Dd]ebugPublic/ [Rr]elease/ +[Rr]eleases/ x64/ +x86/ +bld/ [Bb]in/ [Oo]bj/ -# build folder is nowadays used for build scripts and should not be ignored -#build/ +[Ll]og/ -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + *_i.c *_p.c +*_i.h *.ilk *.meta *.obj @@ -55,25 +67,31 @@ x64/ *.vssscc .builds *.pidb -*.log +*.svclog *.scc -# OS generated files # -.DS_Store* -Icon? +# Chutzpah Test files +_Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb +*.opendb *.opensdf *.sdf *.cachefile +*.VC.db +*.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ # Guidance Automation Toolkit *.gpState @@ -81,6 +99,10 @@ ipch/ # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode # TeamCity is a build add-in _TeamCity* @@ -89,8 +111,16 @@ _TeamCity* *.dotCover # NCrunch -*.ncrunch* +_NCrunch_* .*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ # Installshield output folder [Ee]xpress/ @@ -109,117 +139,123 @@ DocProject/Help/html publish/ # Publish Web Output -*.Publish.xml +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets -# Windows Azure Build Output -csx +# Microsoft Azure Build Output +csx/ *.build.csdef -# Windows Store app package directory +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ # Others -*.Cache ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl -*.[Pp]ublish.xml +*.dbproj.schemaview +*.jfm *.pfx *.publishsettings -modulesbin/ -tempbin/ +node_modules/ +orleans.codegen.cs -# EPiServer Site file (VPP) -AppData/ +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ # RIA/Silverlight projects Generated_Code/ -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm -# vim -*.txt~ -*.swp -*.swo - -# Temp files when opening LibreOffice on ubuntu -.~lock.* - -# svn -.svn - -# CVS - Source Control -**/CVS/ - -# Remainings from resolving conflicts in Source Control -*.orig - # SQL Server files -**/App_Data/*.mdf -**/App_Data/*.ldf -**/App_Data/*.sdf - +*.mdf +*.ldf -#LightSwitch generated files -GeneratedArtifacts/ -_Pvt_Extensions/ -ModelManifest.xml +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings -# ========================= -# Windows detritus -# ========================= +# Microsoft Fakes +FakesAssemblies/ -# Windows image file caches -Thumbs.db -ehthumbs.db +# GhostDoc plugin setting file +*.GhostDoc.xml -# Folder config file -Desktop.ini +# Node.js Tools for Visual Studio +.ntvs_analysis.dat -# Recycle Bin used on file shares -$RECYCLE.BIN/ +# Visual Studio 6 build log +*.plg -# Mac desktop service store files -.DS_Store +# Visual Studio 6 workspace options file +*.opt -# SASS Compiler cache -.sass-cache +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions -# Visual Studio 2014 CTP -**/*.sln.ide +# Paket dependency manager +.paket/paket.exe +paket-files/ -# Visual Studio temp something -.vs/ +# FAKE - F# Make +.fake/ -# dotnet stuff -project.lock.json - -# VS 2015+ -*.vc.vc.opendb -*.vc.db - -# Rider +# JetBrains Rider .idea/ +*.sln.iml -# Visual Studio Code -.vscode/ - -# Output folder used by Webpack or other FE stuff -**/node_modules/* -**/wwwroot/* - -# SpecFlow specific -*.feature.cs -*.feature.xlsx.* -*.Specs_*.html +# CodeRush +.cr/ -##### -# End of core ignore list, below put you custom 'per project' settings (patterns or path) -##### \ No newline at end of file +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/MP1_Trilogy_Rando_Generator/Config/AppSettings.cs b/MP1_Trilogy_Rando_Generator/Config/AppSettings.cs index 1efdd89..9e9d770 100644 --- a/MP1_Trilogy_Rando_Generator/Config/AppSettings.cs +++ b/MP1_Trilogy_Rando_Generator/Config/AppSettings.cs @@ -7,6 +7,8 @@ namespace MP1_Trilogy_Rando_Generator.Config class AppSettings { public String prime1RandomizerPath; + public String prime1PlandomizerPath; + public String prime1PlandomizerLastJsonPath; public String outputPath; public String outputType; @@ -27,6 +29,10 @@ public AppSettings() { if (kvp[0].Groups[1].Value == "prime1RandomizerPath") this.prime1RandomizerPath = kvp[1].Groups[1].Value; + if (kvp[0].Groups[1].Value == "prime1PlandomizerPath") + this.prime1PlandomizerPath = kvp[1].Groups[1].Value; + if (kvp[0].Groups[1].Value == "prime1PlandomizerLastJsonPath") + this.prime1PlandomizerLastJsonPath = kvp[1].Groups[1].Value; if (kvp[0].Groups[1].Value == "outputPath") this.outputPath = kvp[1].Groups[1].Value; if (kvp[0].Groups[1].Value == "outputType") @@ -38,6 +44,8 @@ public AppSettings() catch { this.prime1RandomizerPath = ""; + this.prime1PlandomizerPath = ""; + this.prime1PlandomizerLastJsonPath = ""; this.outputPath = ""; this.outputType = ".ciso"; this.SaveToJson(); @@ -53,6 +61,8 @@ public void SaveToJson() { sW.WriteLine("{"); sW.WriteLine("\t\"prime1RandomizerPath\": \"" + this.prime1RandomizerPath + "\","); + sW.WriteLine("\t\"prime1PlandomizerPath\": \"" + this.prime1PlandomizerPath + "\","); + sW.WriteLine("\t\"prime1PlandomizerLastJsonPath\": \"" + this.prime1PlandomizerLastJsonPath + "\","); sW.WriteLine("\t\"outputPath\": \"" + this.outputPath + "\","); sW.WriteLine("\t\"outputType\": \"" + this.outputType + "\""); sW.WriteLine("}"); diff --git a/MP1_Trilogy_Rando_Generator/Config/RandomizerSettings.cs b/MP1_Trilogy_Rando_Generator/Config/RandomizerSettings.cs index 6eeff4e..a734612 100644 --- a/MP1_Trilogy_Rando_Generator/Config/RandomizerSettings.cs +++ b/MP1_Trilogy_Rando_Generator/Config/RandomizerSettings.cs @@ -37,8 +37,7 @@ public RandomizerSettings(String path) if (kvp[0].Trim() == "staggered suit damage") this.suitDamageReduction = kvp[1].Trim() == "true" ? "Progressive" : "Default"; if (kvp[0].Trim() == "starting area") - if (this.spawnRoom == null) - this.spawnRoom = SpawnRoom.Values[kvp[1].Trim()]; + this.spawnRoom = SpawnRoom.randomizerValues[kvp[1].Trim()]; } } } @@ -46,7 +45,7 @@ public RandomizerSettings(String path) this.skipFrigate = false; this.heatProtection = "Any Suit"; this.suitDamageReduction = "Default"; - this.spawnRoom = SpawnRoom.Values["Landing Site"]; + this.spawnRoom = SpawnRoom.randomizerValues["Landing Site"]; } } } diff --git a/MP1_Trilogy_Rando_Generator/Enums/SpawnRoom.cs b/MP1_Trilogy_Rando_Generator/Enums/SpawnRoom.cs index 8fcd99a..c9b819e 100644 --- a/MP1_Trilogy_Rando_Generator/Enums/SpawnRoom.cs +++ b/MP1_Trilogy_Rando_Generator/Enums/SpawnRoom.cs @@ -15,7 +15,7 @@ class SpawnRoom this.MREA_ID = MREA_ID; } - public static readonly Dictionary Values = new Dictionary() + public static readonly Dictionary randomizerValues = new Dictionary() { { "Chozo Ruins West (Main Plaza)", new SpawnRoom(0x83f6ff6f, 2, 0) }, // Chozo Ruins - Transport to Tallon Overworld North { "Chozo Ruins North (Sun Tower)", new SpawnRoom(0x83f6ff6f, 2, 24) }, // Chozo Ruins - Transport to Magmoor Caverns North @@ -26,8 +26,8 @@ class SpawnRoom { "Tallon Overworld North (Tallon Canyon)", new SpawnRoom(0x39f2de28, 4, 14) }, // Tallon Overworld - Transport to Chozo Ruins West { "Tallon Overworld East (Frigate Crash Site)", new SpawnRoom(0x39f2de28, 4, 22) }, // Tallon Overworld - Transport to Chozo Ruins East { "Tallon Overworld West (Root Cave)", new SpawnRoom(0x39f2de28, 4, 23) }, // Tallon Overworld - Transport to Magmoor Caverns East - { "Tallon Overworld South (Great Tree Hall, Upper)", new SpawnRoom(0x39f2de28, 4, 41) }, // Transport to Chozo Ruins South - { "Tallon Overworld South (Great Tree Hall, Lower)", new SpawnRoom(0x39f2de28, 4, 43) }, // Transport to Phazon Mines East + { "Tallon Overworld South (Great Tree Hall, Upper)", new SpawnRoom(0x39f2de28, 4, 41) }, // Tallon Overworld - Transport to Chozo Ruins South + { "Tallon Overworld South (Great Tree Hall, Lower)", new SpawnRoom(0x39f2de28, 4, 43) }, // Tallon Overworld - Transport to Phazon Mines East { "Artifact Temple", new SpawnRoom(0x39f2de28, 4, 16) }, // Tallon Overworld - Artifact Temple { "Landing Site", new SpawnRoom(0x39f2de28, 4, 0) }, // Tallon Overworld - Landing Site { "Phazon Mines East (Main Quarry)", new SpawnRoom(0xb1ac4d65, 5, 0) }, // Phazon Mines - Transport to Tallon Overworld South @@ -38,5 +38,284 @@ class SpawnRoom { "Magmoor Caverns East (Magmoor Workstation, Debris)", new SpawnRoom(0x3ef8237c, 6, 26) }, // Magmoor Caverns - Transport to Phazon Mines West { "Magmoor Caverns East (Magmoor Workstation, Save Station)", new SpawnRoom(0x3ef8237c, 6, 27) } // Magmoor Caverns - Transport to Phendrana Drifts South }; + + public static readonly Dictionary plandomizerValues = new Dictionary() + { + { "Frigate:Exterior Docking Hangar", new SpawnRoom(0x158efe17, 1, 0) }, + { "Frigate:Air Lock", new SpawnRoom(0x158efe17, 1, 1) }, + { "Frigate:Deck Alpha Access Hall", new SpawnRoom(0x158efe17, 1, 2) }, + { "Frigate:Deck Alpha Mech Shaft", new SpawnRoom(0x158efe17, 1, 3) }, + { "Frigate:Emergency Evacuation Area", new SpawnRoom(0x158efe17, 1, 4) }, + { "Frigate:Connection Elevator to Deck Alpha", new SpawnRoom(0x158efe17, 1, 5) }, + { "Frigate:Deck Alpha Umbilical Hall", new SpawnRoom(0x158efe17, 1, 6) }, + { "Frigate:Biotech Research Area 2", new SpawnRoom(0x158efe17, 1, 7) }, + { "Frigate:Map Facility", new SpawnRoom(0x158efe17, 1, 8) }, + { "Frigate:Main Ventilation Shaft F", new SpawnRoom(0x158efe17, 1, 9) }, + { "Frigate:Connection Elevator to Deck Beta", new SpawnRoom(0x158efe17, 1, 10) }, + { "Frigate:Main Ventilation Shaft E", new SpawnRoom(0x158efe17, 1, 11) }, + { "Frigate:Deck Beta Conduit Hall", new SpawnRoom(0x158efe17, 1, 12) }, + { "Frigate:Main Ventilation Shaft D", new SpawnRoom(0x158efe17, 1, 13) }, + { "Frigate:Biotech Research Area 1", new SpawnRoom(0x158efe17, 1, 14) }, + { "Frigate:Main Ventilation Shaft C", new SpawnRoom(0x158efe17, 1, 15) }, + { "Frigate:Deck Beta Security Hall", new SpawnRoom(0x158efe17, 1, 16) }, + { "Frigate:Connection Elevator to Deck Beta 2", new SpawnRoom(0x158efe17, 1, 17) }, + { "Frigate:Subventilation Shaft Section A", new SpawnRoom(0x158efe17, 1, 18) }, + { "Frigate:Main Ventilation Shaft B", new SpawnRoom(0x158efe17, 1, 19) }, + { "Frigate:Biohazard Containment", new SpawnRoom(0x158efe17, 1, 20) }, + { "Frigate:Deck Gamma Monitor Hall", new SpawnRoom(0x158efe17, 1, 21) }, + { "Frigate:Subventilation Shaft Section B", new SpawnRoom(0x158efe17, 1, 22) }, + { "Frigate:Main Ventilation Shaft A", new SpawnRoom(0x158efe17, 1, 23) }, + { "Frigate:Deck Beta Transit Hall", new SpawnRoom(0x158efe17, 1, 24) }, + { "Frigate:Reactor Core", new SpawnRoom(0x158efe17, 1, 25) }, + { "Frigate:Cargo Freight Lift to Deck Gamma", new SpawnRoom(0x158efe17, 1, 26) }, + { "Frigate:Reactor Core Entrance", new SpawnRoom(0x158efe17, 1, 25) }, + { "Chozo:Transport to Tallon Overworld North", new SpawnRoom(0x83f6ff6f, 2, 0) }, + { "Chozo:Ruins Entrance", new SpawnRoom(0x83f6ff6f, 2, 1) }, + { "Chozo:Main Plaza", new SpawnRoom(0x83f6ff6f, 2, 2) }, + { "Chozo:Ruined Fountain Access", new SpawnRoom(0x83f6ff6f, 2, 3) }, + { "Chozo:Ruined Shrine Access", new SpawnRoom(0x83f6ff6f, 2, 4) }, + { "Chozo:Nursery Access", new SpawnRoom(0x83f6ff6f, 2, 5) }, + { "Chozo:Plaza Access", new SpawnRoom(0x83f6ff6f, 2, 6) }, + { "Chozo:Piston Tunnel", new SpawnRoom(0x83f6ff6f, 2, 7) }, + { "Chozo:Ruined Fountain", new SpawnRoom(0x83f6ff6f, 2, 8) }, + { "Chozo:Ruined Shrine", new SpawnRoom(0x83f6ff6f, 2, 9) }, + { "Chozo:Eyon Tunnel", new SpawnRoom(0x83f6ff6f, 2, 10) }, + { "Chozo:Vault", new SpawnRoom(0x83f6ff6f, 2, 11) }, + { "Chozo:Training Chamber", new SpawnRoom(0x83f6ff6f, 2, 12) }, + { "Chozo:Arboretum Access", new SpawnRoom(0x83f6ff6f, 2, 13) }, + { "Chozo:Meditation Fountain", new SpawnRoom(0x83f6ff6f, 2, 14) }, + { "Chozo:Tower of Light Access", new SpawnRoom(0x83f6ff6f, 2, 15) }, + { "Chozo:Ruined Nursery", new SpawnRoom(0x83f6ff6f, 2, 16) }, + { "Chozo:Vault Access", new SpawnRoom(0x83f6ff6f, 2, 17) }, + { "Chozo:Training Chamber Access", new SpawnRoom(0x83f6ff6f, 2, 18) }, + { "Chozo:Arboretum", new SpawnRoom(0x83f6ff6f, 2, 19) }, + { "Chozo:Magma Pool", new SpawnRoom(0x83f6ff6f, 2, 20) }, + { "Chozo:Tower of Light", new SpawnRoom(0x83f6ff6f, 2, 21) }, + { "Chozo:Save Station 1", new SpawnRoom(0x83f6ff6f, 2, 22) }, + { "Chozo:North Atrium", new SpawnRoom(0x83f6ff6f, 2, 23) }, + { "Chozo:Transport to Magmoor Caverns North", new SpawnRoom(0x83f6ff6f, 2, 24) }, + { "Chozo:Sunchamber Lobby", new SpawnRoom(0x83f6ff6f, 2, 25) }, + { "Chozo:Gathering Hall Access", new SpawnRoom(0x83f6ff6f, 2, 26) }, + { "Chozo:Tower Chamber", new SpawnRoom(0x83f6ff6f, 2, 27) }, + { "Chozo:Ruined Gallery", new SpawnRoom(0x83f6ff6f, 2, 28) }, + { "Chozo:Sun Tower", new SpawnRoom(0x83f6ff6f, 2, 29) }, + { "Chozo:Transport Access North", new SpawnRoom(0x83f6ff6f, 2, 30) }, + { "Chozo:Sunchamber Access", new SpawnRoom(0x83f6ff6f, 2, 31) }, + { "Chozo:Gathering Hall", new SpawnRoom(0x83f6ff6f, 2, 32) }, + { "Chozo:Totem Access", new SpawnRoom(0x83f6ff6f, 2, 33) }, + { "Chozo:Map Station", new SpawnRoom(0x83f6ff6f, 2, 34) }, + { "Chozo:Sun Tower Access", new SpawnRoom(0x83f6ff6f, 2, 35) }, + { "Chozo:Hive Totem", new SpawnRoom(0x83f6ff6f, 2, 36) }, + { "Chozo:Sunchamber", new SpawnRoom(0x83f6ff6f, 2, 37) }, + { "Chozo:Watery Hall Access", new SpawnRoom(0x83f6ff6f, 2, 38) }, + { "Chozo:Save Station 2", new SpawnRoom(0x83f6ff6f, 2, 39) }, + { "Chozo:East Atrium", new SpawnRoom(0x83f6ff6f, 2, 40) }, + { "Chozo:Watery Hall", new SpawnRoom(0x83f6ff6f, 2, 41) }, + { "Chozo:Energy Core Access", new SpawnRoom(0x83f6ff6f, 2, 42) }, + { "Chozo:Dynamo Access", new SpawnRoom(0x83f6ff6f, 2, 43) }, + { "Chozo:Energy Core", new SpawnRoom(0x83f6ff6f, 2, 44) }, + { "Chozo:Dynamo", new SpawnRoom(0x83f6ff6f, 2, 45) }, + { "Chozo:Burn Dome Access", new SpawnRoom(0x83f6ff6f, 2, 46) }, + { "Chozo:West Furnace Access", new SpawnRoom(0x83f6ff6f, 2, 47) }, + { "Chozo:Burn Dome", new SpawnRoom(0x83f6ff6f, 2, 48) }, + { "Chozo:Furnace", new SpawnRoom(0x83f6ff6f, 2, 49) }, + { "Chozo:East Atrium Access", new SpawnRoom(0x83f6ff6f, 2, 50) }, + { "Chozo:Crossway Access West", new SpawnRoom(0x83f6ff6f, 2, 51) }, + { "Chozo:Hall of the Elders", new SpawnRoom(0x83f6ff6f, 2, 52) }, + { "Chozo:Crossway", new SpawnRoom(0x83f6ff6f, 2, 53) }, + { "Chozo:Reflecting Pool Access", new SpawnRoom(0x83f6ff6f, 2, 54) }, + { "Chozo:Elder Hall Access", new SpawnRoom(0x83f6ff6f, 2, 55) }, + { "Chozo:Crossway Access South", new SpawnRoom(0x83f6ff6f, 2, 56) }, + { "Chozo:Elder Chamber", new SpawnRoom(0x83f6ff6f, 2, 57) }, + { "Chozo:Reflecting Pool", new SpawnRoom(0x83f6ff6f, 2, 58) }, + { "Chozo:Save Station 3", new SpawnRoom(0x83f6ff6f, 2, 59) }, + { "Chozo:Transport Access South", new SpawnRoom(0x83f6ff6f, 2, 60) }, + { "Chozo:Antechamber", new SpawnRoom(0x83f6ff6f, 2, 61) }, + { "Chozo:Transport to Tallon Overworld East", new SpawnRoom(0x83f6ff6f, 2, 62) }, + { "Chozo:Transport to Tallon Overworld South", new SpawnRoom(0x83f6ff6f, 2, 63) }, + { "Phendrana:Transport to Magmoor Caverns West", new SpawnRoom(0xa8be6291, 3, 0) }, + { "Phendrana:Shoreline Entrance", new SpawnRoom(0xa8be6291, 3, 1) }, + { "Phendrana:Phendrana Shorelines", new SpawnRoom(0xa8be6291, 3, 2) }, + { "Phendrana:Temple Entryway", new SpawnRoom(0xa8be6291, 3, 3) }, + { "Phendrana:Save Station B", new SpawnRoom(0xa8be6291, 3, 4) }, + { "Phendrana:Ruins Entryway", new SpawnRoom(0xa8be6291, 3, 5) }, + { "Phendrana:Plaza Walkway", new SpawnRoom(0xa8be6291, 3, 6) }, + { "Phendrana:Ice Ruins Access", new SpawnRoom(0xa8be6291, 3, 7) }, + { "Phendrana:Chozo Ice Temple", new SpawnRoom(0xa8be6291, 3, 8) }, + { "Phendrana:Ice Ruins West", new SpawnRoom(0xa8be6291, 3, 9) }, + { "Phendrana:Ice Ruins East", new SpawnRoom(0xa8be6291, 3, 10) }, + { "Phendrana:Chapel Tunnel", new SpawnRoom(0xa8be6291, 3, 11) }, + { "Phendrana:Courtyard Entryway", new SpawnRoom(0xa8be6291, 3, 12) }, + { "Phendrana:Canyon Entryway", new SpawnRoom(0xa8be6291, 3, 13) }, + { "Phendrana:Chapel of the Elders", new SpawnRoom(0xa8be6291, 3, 14) }, + { "Phendrana:Ruined Courtyard", new SpawnRoom(0xa8be6291, 3, 15) }, + { "Phendrana:Phendrana Canyon", new SpawnRoom(0xa8be6291, 3, 16) }, + { "Phendrana:Save Station A", new SpawnRoom(0xa8be6291, 3, 17) }, + { "Phendrana:Specimen Storage", new SpawnRoom(0xa8be6291, 3, 18) }, + { "Phendrana:Quarantine Access", new SpawnRoom(0xa8be6291, 3, 19) }, + { "Phendrana:Research Entrance", new SpawnRoom(0xa8be6291, 3, 20) }, + { "Phendrana:North Quarantine Tunnel", new SpawnRoom(0xa8be6291, 3, 21) }, + { "Phendrana:Map Station", new SpawnRoom(0xa8be6291, 3, 22) }, + { "Phendrana:Hydra Lab Entryway", new SpawnRoom(0xa8be6291, 3, 23) }, + { "Phendrana:Quarantine Cave", new SpawnRoom(0xa8be6291, 3, 24) }, + { "Phendrana:Research Lab Hydra", new SpawnRoom(0xa8be6291, 3, 25) }, + { "Phendrana:South Quarantine Tunnel", new SpawnRoom(0xa8be6291, 3, 26) }, + { "Phendrana:Quarantine Monitor", new SpawnRoom(0xa8be6291, 3, 27) }, + { "Phendrana:Observatory Access", new SpawnRoom(0xa8be6291, 3, 28) }, + { "Phendrana:Transport to Magmoor Caverns South", new SpawnRoom(0xa8be6291, 3, 29) }, + { "Phendrana:Observatory", new SpawnRoom(0xa8be6291, 3, 30) }, + { "Phendrana:Transport Access", new SpawnRoom(0xa8be6291, 3, 31) }, + { "Phendrana:West Tower Entrance", new SpawnRoom(0xa8be6291, 3, 32) }, + { "Phendrana:Save Station D", new SpawnRoom(0xa8be6291, 3, 33) }, + { "Phendrana:Frozen Pike", new SpawnRoom(0xa8be6291, 3, 34) }, + { "Phendrana:West Tower", new SpawnRoom(0xa8be6291, 3, 35) }, + { "Phendrana:Pike Access", new SpawnRoom(0xa8be6291, 3, 36) }, + { "Phendrana:Frost Cave Access", new SpawnRoom(0xa8be6291, 3, 37) }, + { "Phendrana:Hunter Cave Access", new SpawnRoom(0xa8be6291, 3, 38) }, + { "Phendrana:Control Tower", new SpawnRoom(0xa8be6291, 3, 39) }, + { "Phendrana:Research Core", new SpawnRoom(0xa8be6291, 3, 40) }, + { "Phendrana:Frost Cave", new SpawnRoom(0xa8be6291, 3, 41) }, + { "Phendrana:Hunter Cave", new SpawnRoom(0xa8be6291, 3, 42) }, + { "Phendrana:East Tower", new SpawnRoom(0xa8be6291, 3, 43) }, + { "Phendrana:Research Core Access", new SpawnRoom(0xa8be6291, 3, 44) }, + { "Phendrana:Save Station C", new SpawnRoom(0xa8be6291, 3, 45) }, + { "Phendrana:Upper Edge Tunnel", new SpawnRoom(0xa8be6291, 3, 46) }, + { "Phendrana:Lower Edge Tunnel", new SpawnRoom(0xa8be6291, 3, 47) }, + { "Phendrana:Chamber Access", new SpawnRoom(0xa8be6291, 3, 48) }, + { "Phendrana:Lake Tunnel", new SpawnRoom(0xa8be6291, 3, 49) }, + { "Phendrana:Aether Lab Entryway", new SpawnRoom(0xa8be6291, 3, 50) }, + { "Phendrana:Research Lab Aether", new SpawnRoom(0xa8be6291, 3, 51) }, + { "Phendrana:Phendrana's Edge", new SpawnRoom(0xa8be6291, 3, 52) }, + { "Phendrana:Gravity Chamber", new SpawnRoom(0xa8be6291, 3, 53) }, + { "Phendrana:Storage Cave", new SpawnRoom(0xa8be6291, 3, 54) }, + { "Phendrana:Security Cave", new SpawnRoom(0xa8be6291, 3, 55) }, + { "Tallon:Landing Site", new SpawnRoom(0x39f2de28, 4, 0) }, + { "Tallon:Gully", new SpawnRoom(0x39f2de28, 4, 1) }, + { "Tallon:Canyon Cavern", new SpawnRoom(0x39f2de28, 4, 2) }, + { "Tallon:Temple Hall", new SpawnRoom(0x39f2de28, 4, 3) }, + { "Tallon:Alcove", new SpawnRoom(0x39f2de28, 4, 4) }, + { "Tallon:Waterfall Cavern", new SpawnRoom(0x39f2de28, 4, 5) }, + { "Tallon:Tallon Canyon", new SpawnRoom(0x39f2de28, 4, 6) }, + { "Tallon:Temple Security Station", new SpawnRoom(0x39f2de28, 4, 7) }, + { "Tallon:Frigate Crash Site", new SpawnRoom(0x39f2de28, 4, 8) }, + { "Tallon:Transport Tunnel A", new SpawnRoom(0x39f2de28, 4, 9) }, + { "Tallon:Root Tunnel", new SpawnRoom(0x39f2de28, 4, 10) }, + { "Tallon:Temple Lobby", new SpawnRoom(0x39f2de28, 4, 11) }, + { "Tallon:Frigate Access Tunnel", new SpawnRoom(0x39f2de28, 4, 12) }, + { "Tallon:Overgrown Cavern", new SpawnRoom(0x39f2de28, 4, 13) }, + { "Tallon:Transport to Chozo Ruins West", new SpawnRoom(0x39f2de28, 4, 14) }, + { "Tallon:Root Cave", new SpawnRoom(0x39f2de28, 4, 15) }, + { "Tallon:Artifact Temple", new SpawnRoom(0x39f2de28, 4, 16) }, + { "Tallon:Main Ventilation Shaft Section C", new SpawnRoom(0x39f2de28, 4, 17) }, + { "Tallon:Transport Tunnel C", new SpawnRoom(0x39f2de28, 4, 18) }, + { "Tallon:Transport Tunnel B", new SpawnRoom(0x39f2de28, 4, 19) }, + { "Tallon:Arbor Chamber", new SpawnRoom(0x39f2de28, 4, 20) }, + { "Tallon:Main Ventilation Shaft Section B", new SpawnRoom(0x39f2de28, 4, 21) }, + { "Tallon:Transport to Chozo Ruins East", new SpawnRoom(0x39f2de28, 4, 22) }, + { "Tallon:Transport to Magmoor Caverns East", new SpawnRoom(0x39f2de28, 4, 23) }, + { "Tallon:Main Ventilation Shaft Section A", new SpawnRoom(0x39f2de28, 4, 24) }, + { "Tallon:Reactor Core", new SpawnRoom(0x39f2de28, 4, 25) }, + { "Tallon:Reactor Access", new SpawnRoom(0x39f2de28, 4, 26) }, + { "Tallon:Cargo Freight Lift to Deck Gamma", new SpawnRoom(0x39f2de28, 4, 27) }, + { "Tallon:Savestation", new SpawnRoom(0x39f2de28, 4, 28) }, + { "Tallon:Deck Beta Transit Hall", new SpawnRoom(0x39f2de28, 4, 29) }, + { "Tallon:Biohazard Containment", new SpawnRoom(0x39f2de28, 4, 30) }, + { "Tallon:Deck Beta Security Hall", new SpawnRoom(0x39f2de28, 4, 31) }, + { "Tallon:Biotech Research Area 1", new SpawnRoom(0x39f2de28, 4, 32) }, + { "Tallon:Deck Beta Conduit Hall", new SpawnRoom(0x39f2de28, 4, 33) }, + { "Tallon:Connection Elevator to Deck Beta", new SpawnRoom(0x39f2de28, 4, 34) }, + { "Tallon:Hydro Access Tunnel", new SpawnRoom(0x39f2de28, 4, 35) }, + { "Tallon:Great Tree Hall", new SpawnRoom(0x39f2de28, 4, 36) }, + { "Tallon:Great Tree Chamber", new SpawnRoom(0x39f2de28, 4, 37) }, + { "Tallon:Transport Tunnel D", new SpawnRoom(0x39f2de28, 4, 38) }, + { "Tallon:Life Grove Tunnel", new SpawnRoom(0x39f2de28, 4, 39) }, + { "Tallon:Transport Tunnel E", new SpawnRoom(0x39f2de28, 4, 40) }, + { "Tallon:Transport to Chozo Ruins South", new SpawnRoom(0x39f2de28, 4, 41) }, + { "Tallon:Life Grove", new SpawnRoom(0x39f2de28, 4, 42) }, + { "Tallon:Transport to Phazon Mines East", new SpawnRoom(0x39f2de28, 4, 43) }, + { "Mines:Transport to Tallon Overworld South", new SpawnRoom(0xb1ac4d65, 5, 0) }, + { "Mines:Quarry Access", new SpawnRoom(0xb1ac4d65, 5, 1) }, + { "Mines:Main Quarry", new SpawnRoom(0xb1ac4d65, 5, 2) }, + { "Mines:Waste Disposal", new SpawnRoom(0xb1ac4d65, 5, 3) }, + { "Mines:Save Station Mines A", new SpawnRoom(0xb1ac4d65, 5, 4) }, + { "Mines:Security Access A", new SpawnRoom(0xb1ac4d65, 5, 5) }, + { "Mines:Ore Processing", new SpawnRoom(0xb1ac4d65, 5, 6) }, + { "Mines:Mine Security Station", new SpawnRoom(0xb1ac4d65, 5, 7) }, + { "Mines:Research Access", new SpawnRoom(0xb1ac4d65, 5, 8) }, + { "Mines:Storage Depot B", new SpawnRoom(0xb1ac4d65, 5, 9) }, + { "Mines:Elevator Access A", new SpawnRoom(0xb1ac4d65, 5, 10) }, + { "Mines:Security Access B", new SpawnRoom(0xb1ac4d65, 5, 11) }, + { "Mines:Storage Depot A", new SpawnRoom(0xb1ac4d65, 5, 12) }, + { "Mines:Elite Research", new SpawnRoom(0xb1ac4d65, 5, 13) }, + { "Mines:Elevator A", new SpawnRoom(0xb1ac4d65, 5, 14) }, + { "Mines:Elite Control Access", new SpawnRoom(0xb1ac4d65, 5, 15) }, + { "Mines:Elite Control", new SpawnRoom(0xb1ac4d65, 5, 16) }, + { "Mines:Maintenance Tunnel", new SpawnRoom(0xb1ac4d65, 5, 17) }, + { "Mines:Ventilation Shaft", new SpawnRoom(0xb1ac4d65, 5, 18) }, + { "Mines:Phazon Processing Center", new SpawnRoom(0xb1ac4d65, 5, 19) }, + { "Mines:Omega Research", new SpawnRoom(0xb1ac4d65, 5, 20) }, + { "Mines:Transport Access", new SpawnRoom(0xb1ac4d65, 5, 21) }, + { "Mines:Processing Center Access", new SpawnRoom(0xb1ac4d65, 5, 22) }, + { "Mines:Map Station Mines", new SpawnRoom(0xb1ac4d65, 5, 23) }, + { "Mines:Dynamo Access", new SpawnRoom(0xb1ac4d65, 5, 24) }, + { "Mines:Transport to Magmoor Caverns South", new SpawnRoom(0xb1ac4d65, 5, 25) }, + { "Mines:Elite Quarters", new SpawnRoom(0xb1ac4d65, 5, 26) }, + { "Mines:Central Dynamo", new SpawnRoom(0xb1ac4d65, 5, 27) }, + { "Mines:Elite Quarters Access", new SpawnRoom(0xb1ac4d65, 5, 28) }, + { "Mines:Quarantine Access A", new SpawnRoom(0xb1ac4d65, 5, 29) }, + { "Mines:Save Station Mines B", new SpawnRoom(0xb1ac4d65, 5, 30) }, + { "Mines:Metroid Quarantine B", new SpawnRoom(0xb1ac4d65, 5, 31) }, + { "Mines:Metroid Quarantine A", new SpawnRoom(0xb1ac4d65, 5, 32) }, + { "Mines:Quarantine Access B", new SpawnRoom(0xb1ac4d65, 5, 33) }, + { "Mines:Save Station Mines C", new SpawnRoom(0xb1ac4d65, 5, 34) }, + { "Mines:Elevator Access B", new SpawnRoom(0xb1ac4d65, 5, 35) }, + { "Mines:Fungal Hall B", new SpawnRoom(0xb1ac4d65, 5, 36) }, + { "Mines:Elevator B", new SpawnRoom(0xb1ac4d65, 5, 37) }, + { "Mines:Missile Station Mines", new SpawnRoom(0xb1ac4d65, 5, 38) }, + { "Mines:Phazon Mining Tunnel", new SpawnRoom(0xb1ac4d65, 5, 39) }, + { "Mines:Fungal Hall Access", new SpawnRoom(0xb1ac4d65, 5, 40) }, + { "Mines:Fungal Hall A", new SpawnRoom(0xb1ac4d65, 5, 41) }, + { "Magmoor:Transport to Chozo Ruins North", new SpawnRoom(0x3ef8237c, 6, 0) }, + { "Magmoor:Burning Trail", new SpawnRoom(0x3ef8237c, 6, 1) }, + { "Magmoor:Lake Tunnel", new SpawnRoom(0x3ef8237c, 6, 2) }, + { "Magmoor:Save Station Magmoor A", new SpawnRoom(0x3ef8237c, 6, 3) }, + { "Magmoor:Lava Lake", new SpawnRoom(0x3ef8237c, 6, 4) }, + { "Magmoor:Pit Tunnel", new SpawnRoom(0x3ef8237c, 6, 5) }, + { "Magmoor:Triclops Pit", new SpawnRoom(0x3ef8237c, 6, 6) }, + { "Magmoor:Monitor Tunnel", new SpawnRoom(0x3ef8237c, 6, 7) }, + { "Magmoor:Storage Cavern", new SpawnRoom(0x3ef8237c, 6, 8) }, + { "Magmoor:Monitor Station", new SpawnRoom(0x3ef8237c, 6, 9) }, + { "Magmoor:Transport Tunnel A", new SpawnRoom(0x3ef8237c, 6, 10) }, + { "Magmoor:Warrior Shrine", new SpawnRoom(0x3ef8237c, 6, 11) }, + { "Magmoor:Shore Tunnel", new SpawnRoom(0x3ef8237c, 6, 12) }, + { "Magmoor:Transport to Phendrana Drifts North", new SpawnRoom(0x3ef8237c, 6, 13) }, + { "Magmoor:Fiery Shores", new SpawnRoom(0x3ef8237c, 6, 14) }, + { "Magmoor:Transport Tunnel B", new SpawnRoom(0x3ef8237c, 6, 15) }, + { "Magmoor:Transport to Tallon Overworld West", new SpawnRoom(0x3ef8237c, 6, 16) }, + { "Magmoor:Twin Fires Tunnel", new SpawnRoom(0x3ef8237c, 6, 17) }, + { "Magmoor:Twin Fires", new SpawnRoom(0x3ef8237c, 6, 18) }, + { "Magmoor:North Core Tunnel", new SpawnRoom(0x3ef8237c, 6, 19) }, + { "Magmoor:Geothermal Core", new SpawnRoom(0x3ef8237c, 6, 20) }, + { "Magmoor:Plasma Processing", new SpawnRoom(0x3ef8237c, 6, 21) }, + { "Magmoor:South Core Tunnel", new SpawnRoom(0x3ef8237c, 6, 22) }, + { "Magmoor:Magmoor Workstation", new SpawnRoom(0x3ef8237c, 6, 23) }, + { "Magmoor:Workstation Tunnel", new SpawnRoom(0x3ef8237c, 6, 24) }, + { "Magmoor:Transport Tunnel C", new SpawnRoom(0x3ef8237c, 6, 25) }, + { "Magmoor:Transport to Phazon Mines West", new SpawnRoom(0x3ef8237c, 6, 26) }, + { "Magmoor:Transport to Phendrana Drifts South", new SpawnRoom(0x3ef8237c, 6, 27) }, + { "Magmoor:Save Station Magmoor B", new SpawnRoom(0x3ef8237c, 6, 28) }, + { "Crater:Crater Entry Point", new SpawnRoom(0xc13b09d1, 7, 0) }, + { "Crater:Crater Tunnel A", new SpawnRoom(0xc13b09d1, 7, 1) }, + { "Crater:Phazon Core", new SpawnRoom(0xc13b09d1, 7, 2) }, + { "Crater:Crater Missile Station", new SpawnRoom(0xc13b09d1, 7, 3) }, + { "Crater:Crater Tunnel B", new SpawnRoom(0xc13b09d1, 7, 4) }, + { "Crater:Phazon Infusion Chamber", new SpawnRoom(0xc13b09d1, 7, 5) }, + { "Crater:Subchamber One", new SpawnRoom(0xc13b09d1, 7, 6) }, + { "Crater:Subchamber Two", new SpawnRoom(0xc13b09d1, 7, 7) }, + { "Crater:Subchamber Three", new SpawnRoom(0xc13b09d1, 7, 8) }, + { "Crater:Subchamber Four", new SpawnRoom(0xc13b09d1, 7, 9) }, + { "Crater:Subchamber Five", new SpawnRoom(0xc13b09d1, 7, 10) }, + { "Crater:Metroid Prime Lair", new SpawnRoom(0xc13b09d1, 7, 11) } + }; } } diff --git a/MP1_Trilogy_Rando_Generator/Form1.Designer.cs b/MP1_Trilogy_Rando_Generator/Form1.Designer.cs index 2c03f1b..5abad35 100644 --- a/MP1_Trilogy_Rando_Generator/Form1.Designer.cs +++ b/MP1_Trilogy_Rando_Generator/Form1.Designer.cs @@ -1,6 +1,6 @@ namespace MP1_Trilogy_Rando_Generator { - partial class Form1 + partial class main_form { /// /// Variable nécessaire au concepteur. @@ -28,384 +28,803 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.label1 = new System.Windows.Forms.Label(); - this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); - this.button2 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.button5 = new System.Windows.Forms.Button(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); - this.button3 = new System.Windows.Forms.Button(); - this.button4 = new System.Windows.Forms.Button(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.label3 = new System.Windows.Forms.Label(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.tableLayoutPanel1.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel7.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); - this.tableLayoutPanel5.SuspendLayout(); - this.tableLayoutPanel6.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); + this.main_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.output_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.output_type_lbl = new DarkUI.Controls.DarkLabel(); + this.output_path_lbl = new DarkUI.Controls.DarkLabel(); + this.output_path_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.output_path_txt_box = new DarkUI.Controls.DarkTextBox(); + this.output_path_btn = new DarkUI.Controls.DarkButton(); + this.output_type_combo_box = new DarkUI.Controls.DarkComboBox(); + this.status_bar_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.status_progress_bar = new System.Windows.Forms.ProgressBar(); + this.status_lbl = new DarkUI.Controls.DarkLabel(); + this.title_bar_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.close_btn = new System.Windows.Forms.Button(); + this.help_btn = new System.Windows.Forms.Button(); + this.title_lbl = new DarkUI.Controls.DarkLabel(); + this.tab_btn_bar_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.settings_btn = new System.Windows.Forms.Button(); + this.plandomizer_btn = new System.Windows.Forms.Button(); + this.randomizer_btn = new System.Windows.Forms.Button(); + this.template_iso_btn = new System.Windows.Forms.Button(); + this.tab_manager = new System.Windows.Forms.TabControlNoHeader(); + this.template_iso_tab = new System.Windows.Forms.TabPage(); + this.template_iso_tab_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.template_iso_btn_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.generate_template_iso_btn = new DarkUI.Controls.DarkButton(); + this.delete_cache_btn = new DarkUI.Controls.DarkButton(); + this.template_iso_lbl = new DarkUI.Controls.DarkLabel(); + this.randomizer_tab = new System.Windows.Forms.TabPage(); + this.randomizer_tab_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.randomizer_btn_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.locate_randomizer_btn = new DarkUI.Controls.DarkButton(); + this.randomize_btn = new DarkUI.Controls.DarkButton(); + this.randomizer_lbl = new DarkUI.Controls.DarkLabel(); + this.plandomizer_tab = new System.Windows.Forms.TabPage(); + this.plandomizer_tab_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.plandomizer_lbl = new DarkUI.Controls.DarkLabel(); + this.input_json_lbl = new DarkUI.Controls.DarkLabel(); + this.input_json_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.input_json_txt_box = new DarkUI.Controls.DarkTextBox(); + this.input_json_btn = new DarkUI.Controls.DarkButton(); + this.plandomizer_btn_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.locate_plandomizer_btn = new DarkUI.Controls.DarkButton(); + this.plandomize_btn = new DarkUI.Controls.DarkButton(); + this.settings_tab = new System.Windows.Forms.TabPage(); + this.settings_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.disable_spring_ball_check_box = new DarkUI.Controls.DarkCheckBox(); + this.main_table_layout.SuspendLayout(); + this.output_table_layout.SuspendLayout(); + this.output_path_table_layout.SuspendLayout(); + this.status_bar_table_layout.SuspendLayout(); + this.title_bar_table_layout.SuspendLayout(); + this.tab_btn_bar_table_layout.SuspendLayout(); + this.tab_manager.SuspendLayout(); + this.template_iso_tab.SuspendLayout(); + this.template_iso_tab_table_layout.SuspendLayout(); + this.template_iso_btn_table_layout.SuspendLayout(); + this.randomizer_tab.SuspendLayout(); + this.randomizer_tab_table_layout.SuspendLayout(); + this.randomizer_btn_table_layout.SuspendLayout(); + this.plandomizer_tab.SuspendLayout(); + this.plandomizer_tab_table_layout.SuspendLayout(); + this.input_json_table_layout.SuspendLayout(); + this.plandomizer_btn_table_layout.SuspendLayout(); + this.settings_tab.SuspendLayout(); + this.settings_table_layout.SuspendLayout(); this.SuspendLayout(); // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 1; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.groupBox1, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel4, 0, 2); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 4; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 190F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(784, 316); - this.tableLayoutPanel1.TabIndex = 0; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.tableLayoutPanel2); - this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox1.Location = new System.Drawing.Point(3, 3); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(778, 94); - this.groupBox1.TabIndex = 1; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "ISO Template"; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.ColumnCount = 1; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel7, 0, 1); - this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 2; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(772, 75); - this.tableLayoutPanel2.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; - this.label1.Location = new System.Drawing.Point(3, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(766, 33); - this.label1.TabIndex = 0; - this.label1.Text = "No Metroid Prime Wii ISO template for Prime 1 Randomizer detected!"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // tableLayoutPanel7 - // - this.tableLayoutPanel7.ColumnCount = 2; - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel7.Controls.Add(this.button2, 0, 0); - this.tableLayoutPanel7.Controls.Add(this.button1, 0, 0); - this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel7.Location = new System.Drawing.Point(0, 33); - this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel7.Name = "tableLayoutPanel7"; - this.tableLayoutPanel7.RowCount = 1; - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); - this.tableLayoutPanel7.Size = new System.Drawing.Size(772, 42); - this.tableLayoutPanel7.TabIndex = 3; - // - // button2 - // - this.button2.Dock = System.Windows.Forms.DockStyle.Fill; - this.button2.Enabled = false; - this.button2.Location = new System.Drawing.Point(389, 3); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(380, 36); - this.button2.TabIndex = 3; - this.button2.Text = "Delete cache (Template ISO + tmp folder)\r\n"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button1 - // - this.button1.Dock = System.Windows.Forms.DockStyle.Fill; - this.button1.Location = new System.Drawing.Point(3, 3); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(380, 36); - this.button1.TabIndex = 2; - this.button1.Text = "Generate a template ISO for BashPrime\'s Randomizer"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.tableLayoutPanel3); - this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox2.Location = new System.Drawing.Point(3, 103); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(778, 184); - this.groupBox2.TabIndex = 2; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Randomizer"; - // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.ColumnCount = 1; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Controls.Add(this.label5, 0, 4); - this.tableLayoutPanel3.Controls.Add(this.label4, 0, 2); - this.tableLayoutPanel3.Controls.Add(this.label2, 0, 0); - this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel5, 0, 3); - this.tableLayoutPanel3.Controls.Add(this.comboBox1, 0, 5); - this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel6, 0, 1); - this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 16); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 6; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(772, 165); - this.tableLayoutPanel3.TabIndex = 0; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Dock = System.Windows.Forms.DockStyle.Fill; - this.label5.Location = new System.Drawing.Point(3, 113); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(766, 26); - this.label5.TabIndex = 7; - this.label5.Text = "Output Type"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Dock = System.Windows.Forms.DockStyle.Fill; - this.label4.Location = new System.Drawing.Point(3, 61); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(766, 26); - this.label4.TabIndex = 4; - this.label4.Text = "Output Path"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Dock = System.Windows.Forms.DockStyle.Fill; - this.label2.Location = new System.Drawing.Point(3, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(766, 29); - this.label2.TabIndex = 1; - this.label2.Text = "BashPrime\'s Randomizer not found! (v2.6.0 or later required)"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // tableLayoutPanel5 - // - this.tableLayoutPanel5.ColumnCount = 2; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); - this.tableLayoutPanel5.Controls.Add(this.button5, 1, 0); - this.tableLayoutPanel5.Controls.Add(this.textBox1, 0, 0); - this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel5.Location = new System.Drawing.Point(0, 87); - this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - this.tableLayoutPanel5.RowCount = 1; - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(772, 26); - this.tableLayoutPanel5.TabIndex = 5; - // - // button5 - // - this.button5.Dock = System.Windows.Forms.DockStyle.Fill; - this.button5.Location = new System.Drawing.Point(675, 3); - this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(94, 20); - this.button5.TabIndex = 3; - this.button5.Text = "Browse"; - this.button5.UseVisualStyleBackColor = true; - this.button5.Click += new System.EventHandler(this.button5_Click); - // - // textBox1 - // - this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox1.Location = new System.Drawing.Point(3, 3); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(666, 20); - this.textBox1.TabIndex = 4; - // - // comboBox1 - // - this.comboBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Items.AddRange(new object[] { + // main_table_layout + // + this.main_table_layout.ColumnCount = 1; + this.main_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.main_table_layout.Controls.Add(this.output_table_layout, 0, 3); + this.main_table_layout.Controls.Add(this.status_bar_table_layout, 0, 4); + this.main_table_layout.Controls.Add(this.title_bar_table_layout, 0, 0); + this.main_table_layout.Controls.Add(this.tab_btn_bar_table_layout, 0, 1); + this.main_table_layout.Controls.Add(this.tab_manager, 0, 2); + this.main_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.main_table_layout.Location = new System.Drawing.Point(0, 0); + this.main_table_layout.Name = "main_table_layout"; + this.main_table_layout.RowCount = 5; + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 165F)); + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 110F)); + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.main_table_layout.Size = new System.Drawing.Size(800, 360); + this.main_table_layout.TabIndex = 0; + // + // output_table_layout + // + this.output_table_layout.ColumnCount = 1; + this.output_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.output_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.output_table_layout.Controls.Add(this.output_type_lbl, 0, 2); + this.output_table_layout.Controls.Add(this.output_path_lbl, 0, 0); + this.output_table_layout.Controls.Add(this.output_path_table_layout, 0, 1); + this.output_table_layout.Controls.Add(this.output_type_combo_box, 0, 3); + this.output_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_table_layout.Location = new System.Drawing.Point(3, 232); + this.output_table_layout.Name = "output_table_layout"; + this.output_table_layout.RowCount = 4; + this.output_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.output_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.output_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.output_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.output_table_layout.Size = new System.Drawing.Size(794, 104); + this.output_table_layout.TabIndex = 9; + // + // output_type_lbl + // + this.output_type_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_type_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.output_type_lbl.Location = new System.Drawing.Point(3, 52); + this.output_type_lbl.Name = "output_type_lbl"; + this.output_type_lbl.Size = new System.Drawing.Size(788, 26); + this.output_type_lbl.TabIndex = 6; + this.output_type_lbl.Text = "Output Type"; + this.output_type_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // output_path_lbl + // + this.output_path_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_path_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.output_path_lbl.Location = new System.Drawing.Point(3, 0); + this.output_path_lbl.Name = "output_path_lbl"; + this.output_path_lbl.Size = new System.Drawing.Size(788, 26); + this.output_path_lbl.TabIndex = 0; + this.output_path_lbl.Text = "Output Path"; + this.output_path_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // output_path_table_layout + // + this.output_path_table_layout.ColumnCount = 2; + this.output_path_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.output_path_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.output_path_table_layout.Controls.Add(this.output_path_txt_box, 0, 0); + this.output_path_table_layout.Controls.Add(this.output_path_btn, 1, 0); + this.output_path_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_path_table_layout.Location = new System.Drawing.Point(0, 26); + this.output_path_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.output_path_table_layout.Name = "output_path_table_layout"; + this.output_path_table_layout.RowCount = 1; + this.output_path_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.output_path_table_layout.Size = new System.Drawing.Size(794, 26); + this.output_path_table_layout.TabIndex = 5; + // + // output_path_txt_box + // + this.output_path_txt_box.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); + this.output_path_txt_box.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.output_path_txt_box.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_path_txt_box.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.output_path_txt_box.Location = new System.Drawing.Point(3, 3); + this.output_path_txt_box.MaxLength = 260; + this.output_path_txt_box.Name = "output_path_txt_box"; + this.output_path_txt_box.Size = new System.Drawing.Size(688, 20); + this.output_path_txt_box.TabIndex = 4; + // + // output_path_btn + // + this.output_path_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_path_btn.Location = new System.Drawing.Point(697, 3); + this.output_path_btn.Name = "output_path_btn"; + this.output_path_btn.Padding = new System.Windows.Forms.Padding(5); + this.output_path_btn.Size = new System.Drawing.Size(94, 20); + this.output_path_btn.TabIndex = 5; + this.output_path_btn.Text = "Browse"; + this.output_path_btn.Click += new System.EventHandler(this.output_path_btn_click); + // + // output_type_combo_box + // + this.output_type_combo_box.Dock = System.Windows.Forms.DockStyle.Fill; + this.output_type_combo_box.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; + this.output_type_combo_box.FormattingEnabled = true; + this.output_type_combo_box.Items.AddRange(new object[] { ".ciso", ".wbfs"}); - this.comboBox1.Location = new System.Drawing.Point(3, 142); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(766, 21); - this.comboBox1.TabIndex = 6; - this.comboBox1.Text = ".ciso"; - this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); - // - // tableLayoutPanel6 - // - this.tableLayoutPanel6.ColumnCount = 2; - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel6.Controls.Add(this.button3, 0, 0); - this.tableLayoutPanel6.Controls.Add(this.button4, 1, 0); - this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel6.Location = new System.Drawing.Point(0, 29); - this.tableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel6.Name = "tableLayoutPanel6"; - this.tableLayoutPanel6.RowCount = 1; - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel6.Size = new System.Drawing.Size(772, 32); - this.tableLayoutPanel6.TabIndex = 8; - // - // button3 - // - this.button3.Dock = System.Windows.Forms.DockStyle.Fill; - this.button3.Location = new System.Drawing.Point(3, 3); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(380, 26); - this.button3.TabIndex = 3; - this.button3.Text = "Locate BashPrime\'s Randomizer"; - this.button3.UseVisualStyleBackColor = true; - this.button3.Click += new System.EventHandler(this.button3_Click); - // - // button4 - // - this.button4.Dock = System.Windows.Forms.DockStyle.Fill; - this.button4.Location = new System.Drawing.Point(389, 3); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(380, 26); - this.button4.TabIndex = 3; - this.button4.Text = "Randomize"; - this.button4.UseVisualStyleBackColor = true; - this.button4.Click += new System.EventHandler(this.button4_Click); - // - // tableLayoutPanel4 - // - this.tableLayoutPanel4.ColumnCount = 2; - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F)); - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F)); - this.tableLayoutPanel4.Controls.Add(this.label3, 0, 0); - this.tableLayoutPanel4.Controls.Add(this.progressBar1, 1, 0); - this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel4.Location = new System.Drawing.Point(0, 290); - this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 1; - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.Size = new System.Drawing.Size(784, 26); - this.tableLayoutPanel4.TabIndex = 5; - // - // label3 - // - this.label3.Dock = System.Windows.Forms.DockStyle.Fill; - this.label3.Location = new System.Drawing.Point(3, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(464, 26); - this.label3.TabIndex = 5; - this.label3.Text = "Status : Idle"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // progressBar1 - // - this.progressBar1.Dock = System.Windows.Forms.DockStyle.Fill; - this.progressBar1.Location = new System.Drawing.Point(473, 3); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(308, 20); - this.progressBar1.TabIndex = 6; - this.progressBar1.Visible = false; - // - // Form1 + this.output_type_combo_box.Location = new System.Drawing.Point(3, 81); + this.output_type_combo_box.Name = "output_type_combo_box"; + this.output_type_combo_box.Size = new System.Drawing.Size(788, 21); + this.output_type_combo_box.TabIndex = 7; + this.output_type_combo_box.SelectedIndexChanged += new System.EventHandler(this.output_type_combo_box_selected_index_changed); + // + // status_bar_table_layout + // + this.status_bar_table_layout.ColumnCount = 2; + this.status_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 60F)); + this.status_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 40F)); + this.status_bar_table_layout.Controls.Add(this.status_progress_bar, 1, 0); + this.status_bar_table_layout.Controls.Add(this.status_lbl, 0, 0); + this.status_bar_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.status_bar_table_layout.Location = new System.Drawing.Point(0, 339); + this.status_bar_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.status_bar_table_layout.Name = "status_bar_table_layout"; + this.status_bar_table_layout.RowCount = 1; + this.status_bar_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.status_bar_table_layout.Size = new System.Drawing.Size(800, 21); + this.status_bar_table_layout.TabIndex = 5; + // + // status_progress_bar + // + this.status_progress_bar.Dock = System.Windows.Forms.DockStyle.Fill; + this.status_progress_bar.Location = new System.Drawing.Point(483, 3); + this.status_progress_bar.Name = "status_progress_bar"; + this.status_progress_bar.Size = new System.Drawing.Size(314, 15); + this.status_progress_bar.TabIndex = 6; + this.status_progress_bar.Visible = false; + // + // status_lbl + // + this.status_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.status_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.status_lbl.Location = new System.Drawing.Point(3, 0); + this.status_lbl.Name = "status_lbl"; + this.status_lbl.Size = new System.Drawing.Size(474, 21); + this.status_lbl.TabIndex = 7; + this.status_lbl.Text = "Status : Idle"; + this.status_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // title_bar_table_layout + // + this.title_bar_table_layout.ColumnCount = 3; + this.title_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.title_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.title_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.title_bar_table_layout.Controls.Add(this.close_btn, 2, 0); + this.title_bar_table_layout.Controls.Add(this.help_btn, 1, 0); + this.title_bar_table_layout.Controls.Add(this.title_lbl, 0, 0); + this.title_bar_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.title_bar_table_layout.Location = new System.Drawing.Point(0, 0); + this.title_bar_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.title_bar_table_layout.Name = "title_bar_table_layout"; + this.title_bar_table_layout.RowCount = 1; + this.title_bar_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.title_bar_table_layout.Size = new System.Drawing.Size(800, 32); + this.title_bar_table_layout.TabIndex = 6; + // + // close_btn + // + this.close_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.close_btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.close_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.close_btn.Location = new System.Drawing.Point(771, 3); + this.close_btn.Name = "close_btn"; + this.close_btn.Size = new System.Drawing.Size(26, 26); + this.close_btn.TabIndex = 0; + this.close_btn.Text = "X"; + this.close_btn.UseVisualStyleBackColor = false; + this.close_btn.Click += new System.EventHandler(this.close_btn_click); + // + // help_btn + // + this.help_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.help_btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); + this.help_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.help_btn.Location = new System.Drawing.Point(739, 3); + this.help_btn.Name = "help_btn"; + this.help_btn.Size = new System.Drawing.Size(26, 26); + this.help_btn.TabIndex = 1; + this.help_btn.Text = "?"; + this.help_btn.UseVisualStyleBackColor = false; + this.help_btn.Click += new System.EventHandler(this.help_btn_click); + // + // title_lbl + // + this.title_lbl.AutoSize = true; + this.title_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.title_lbl.Font = new System.Drawing.Font("Impact", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.title_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.title_lbl.Location = new System.Drawing.Point(3, 0); + this.title_lbl.Name = "title_lbl"; + this.title_lbl.Size = new System.Drawing.Size(730, 32); + this.title_lbl.TabIndex = 2; + this.title_lbl.Text = "MP1 Trilogy Rando Generator v2.0"; + this.title_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.title_lbl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.form1_MouseDown); + // + // tab_btn_bar_table_layout + // + this.tab_btn_bar_table_layout.ColumnCount = 5; + this.tab_btn_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tab_btn_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tab_btn_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tab_btn_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tab_btn_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tab_btn_bar_table_layout.Controls.Add(this.settings_btn, 3, 0); + this.tab_btn_bar_table_layout.Controls.Add(this.plandomizer_btn, 2, 0); + this.tab_btn_bar_table_layout.Controls.Add(this.randomizer_btn, 1, 0); + this.tab_btn_bar_table_layout.Controls.Add(this.template_iso_btn, 0, 0); + this.tab_btn_bar_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.tab_btn_bar_table_layout.Location = new System.Drawing.Point(0, 32); + this.tab_btn_bar_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.tab_btn_bar_table_layout.Name = "tab_btn_bar_table_layout"; + this.tab_btn_bar_table_layout.RowCount = 1; + this.tab_btn_bar_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tab_btn_bar_table_layout.Size = new System.Drawing.Size(800, 32); + this.tab_btn_bar_table_layout.TabIndex = 7; + // + // settings_btn + // + this.settings_btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.settings_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.settings_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.settings_btn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.settings_btn.Location = new System.Drawing.Point(303, 3); + this.settings_btn.Name = "settings_btn"; + this.settings_btn.Size = new System.Drawing.Size(94, 26); + this.settings_btn.TabIndex = 3; + this.settings_btn.Text = "Settings"; + this.settings_btn.UseVisualStyleBackColor = false; + this.settings_btn.Click += new System.EventHandler(this.tab_bar_btn_click); + // + // plandomizer_btn + // + this.plandomizer_btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.plandomizer_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.plandomizer_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.plandomizer_btn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.plandomizer_btn.Location = new System.Drawing.Point(203, 3); + this.plandomizer_btn.Name = "plandomizer_btn"; + this.plandomizer_btn.Size = new System.Drawing.Size(94, 26); + this.plandomizer_btn.TabIndex = 2; + this.plandomizer_btn.Text = "Plandomizer"; + this.plandomizer_btn.UseVisualStyleBackColor = false; + this.plandomizer_btn.Click += new System.EventHandler(this.tab_bar_btn_click); + // + // randomizer_btn + // + this.randomizer_btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.randomizer_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.randomizer_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.randomizer_btn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.randomizer_btn.Location = new System.Drawing.Point(103, 3); + this.randomizer_btn.Name = "randomizer_btn"; + this.randomizer_btn.Size = new System.Drawing.Size(94, 26); + this.randomizer_btn.TabIndex = 1; + this.randomizer_btn.Text = "Randomizer"; + this.randomizer_btn.UseVisualStyleBackColor = false; + this.randomizer_btn.Click += new System.EventHandler(this.tab_bar_btn_click); + // + // template_iso_btn + // + this.template_iso_btn.BackColor = System.Drawing.Color.Gray; + this.template_iso_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.template_iso_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.template_iso_btn.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.template_iso_btn.Location = new System.Drawing.Point(3, 3); + this.template_iso_btn.Name = "template_iso_btn"; + this.template_iso_btn.Size = new System.Drawing.Size(94, 26); + this.template_iso_btn.TabIndex = 0; + this.template_iso_btn.Text = "Template ISO"; + this.template_iso_btn.UseVisualStyleBackColor = false; + this.template_iso_btn.Click += new System.EventHandler(this.tab_bar_btn_click); + // + // tab_manager + // + this.tab_manager.Controls.Add(this.template_iso_tab); + this.tab_manager.Controls.Add(this.randomizer_tab); + this.tab_manager.Controls.Add(this.plandomizer_tab); + this.tab_manager.Controls.Add(this.settings_tab); + this.tab_manager.Dock = System.Windows.Forms.DockStyle.Fill; + this.tab_manager.Location = new System.Drawing.Point(0, 64); + this.tab_manager.Margin = new System.Windows.Forms.Padding(0); + this.tab_manager.Multiline = true; + this.tab_manager.Name = "tab_manager"; + this.tab_manager.SelectedIndex = 0; + this.tab_manager.Size = new System.Drawing.Size(800, 165); + this.tab_manager.TabIndex = 8; + // + // template_iso_tab + // + this.template_iso_tab.Controls.Add(this.template_iso_tab_table_layout); + this.template_iso_tab.Location = new System.Drawing.Point(4, 22); + this.template_iso_tab.Margin = new System.Windows.Forms.Padding(0); + this.template_iso_tab.Name = "template_iso_tab"; + this.template_iso_tab.Size = new System.Drawing.Size(792, 139); + this.template_iso_tab.TabIndex = 0; + this.template_iso_tab.Text = "Template ISO"; + this.template_iso_tab.UseVisualStyleBackColor = true; + // + // template_iso_tab_table_layout + // + this.template_iso_tab_table_layout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.template_iso_tab_table_layout.ColumnCount = 1; + this.template_iso_tab_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.template_iso_tab_table_layout.Controls.Add(this.template_iso_btn_table_layout, 0, 1); + this.template_iso_tab_table_layout.Controls.Add(this.template_iso_lbl, 0, 0); + this.template_iso_tab_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.template_iso_tab_table_layout.Location = new System.Drawing.Point(0, 0); + this.template_iso_tab_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.template_iso_tab_table_layout.Name = "template_iso_tab_table_layout"; + this.template_iso_tab_table_layout.RowCount = 3; + this.template_iso_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); + this.template_iso_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); + this.template_iso_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.template_iso_tab_table_layout.Size = new System.Drawing.Size(792, 139); + this.template_iso_tab_table_layout.TabIndex = 2; + // + // template_iso_btn_table_layout + // + this.template_iso_btn_table_layout.ColumnCount = 2; + this.template_iso_btn_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.template_iso_btn_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.template_iso_btn_table_layout.Controls.Add(this.generate_template_iso_btn, 0, 0); + this.template_iso_btn_table_layout.Controls.Add(this.delete_cache_btn, 1, 0); + this.template_iso_btn_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.template_iso_btn_table_layout.Location = new System.Drawing.Point(0, 42); + this.template_iso_btn_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.template_iso_btn_table_layout.Name = "template_iso_btn_table_layout"; + this.template_iso_btn_table_layout.RowCount = 1; + this.template_iso_btn_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.template_iso_btn_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); + this.template_iso_btn_table_layout.Size = new System.Drawing.Size(792, 42); + this.template_iso_btn_table_layout.TabIndex = 3; + // + // generate_template_iso_btn + // + this.generate_template_iso_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.generate_template_iso_btn.Location = new System.Drawing.Point(3, 3); + this.generate_template_iso_btn.Name = "generate_template_iso_btn"; + this.generate_template_iso_btn.Padding = new System.Windows.Forms.Padding(5); + this.generate_template_iso_btn.Size = new System.Drawing.Size(390, 36); + this.generate_template_iso_btn.TabIndex = 4; + this.generate_template_iso_btn.Text = "Generate a template ISO for the patcher"; + this.generate_template_iso_btn.Click += new System.EventHandler(this.generate_template_iso_btn_click); + // + // delete_cache_btn + // + this.delete_cache_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.delete_cache_btn.Enabled = false; + this.delete_cache_btn.Location = new System.Drawing.Point(399, 3); + this.delete_cache_btn.Name = "delete_cache_btn"; + this.delete_cache_btn.Padding = new System.Windows.Forms.Padding(5); + this.delete_cache_btn.Size = new System.Drawing.Size(390, 36); + this.delete_cache_btn.TabIndex = 5; + this.delete_cache_btn.Text = "Delete cache (Template ISO + tmp folder)"; + this.delete_cache_btn.Click += new System.EventHandler(this.delete_cache_btn_click); + // + // template_iso_lbl + // + this.template_iso_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.template_iso_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.template_iso_lbl.Location = new System.Drawing.Point(3, 0); + this.template_iso_lbl.Name = "template_iso_lbl"; + this.template_iso_lbl.Size = new System.Drawing.Size(786, 42); + this.template_iso_lbl.TabIndex = 4; + this.template_iso_lbl.Text = "No Metroid Prime Wii ISO template for Prime 1 Randomizer detected!"; + this.template_iso_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // randomizer_tab + // + this.randomizer_tab.Controls.Add(this.randomizer_tab_table_layout); + this.randomizer_tab.Location = new System.Drawing.Point(4, 22); + this.randomizer_tab.Margin = new System.Windows.Forms.Padding(0); + this.randomizer_tab.Name = "randomizer_tab"; + this.randomizer_tab.Size = new System.Drawing.Size(792, 139); + this.randomizer_tab.TabIndex = 1; + this.randomizer_tab.Text = "Randomizer"; + this.randomizer_tab.UseVisualStyleBackColor = true; + // + // randomizer_tab_table_layout + // + this.randomizer_tab_table_layout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.randomizer_tab_table_layout.ColumnCount = 1; + this.randomizer_tab_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.randomizer_tab_table_layout.Controls.Add(this.randomizer_btn_table_layout, 0, 1); + this.randomizer_tab_table_layout.Controls.Add(this.randomizer_lbl, 0, 0); + this.randomizer_tab_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.randomizer_tab_table_layout.Location = new System.Drawing.Point(0, 0); + this.randomizer_tab_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.randomizer_tab_table_layout.Name = "randomizer_tab_table_layout"; + this.randomizer_tab_table_layout.RowCount = 3; + this.randomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.randomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.randomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.randomizer_tab_table_layout.Size = new System.Drawing.Size(792, 139); + this.randomizer_tab_table_layout.TabIndex = 0; + // + // randomizer_btn_table_layout + // + this.randomizer_btn_table_layout.ColumnCount = 2; + this.randomizer_btn_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.randomizer_btn_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.randomizer_btn_table_layout.Controls.Add(this.locate_randomizer_btn, 0, 0); + this.randomizer_btn_table_layout.Controls.Add(this.randomize_btn, 1, 0); + this.randomizer_btn_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.randomizer_btn_table_layout.Location = new System.Drawing.Point(0, 40); + this.randomizer_btn_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.randomizer_btn_table_layout.Name = "randomizer_btn_table_layout"; + this.randomizer_btn_table_layout.RowCount = 1; + this.randomizer_btn_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.randomizer_btn_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.randomizer_btn_table_layout.Size = new System.Drawing.Size(792, 40); + this.randomizer_btn_table_layout.TabIndex = 8; + // + // locate_randomizer_btn + // + this.locate_randomizer_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.locate_randomizer_btn.Location = new System.Drawing.Point(3, 3); + this.locate_randomizer_btn.Name = "locate_randomizer_btn"; + this.locate_randomizer_btn.Padding = new System.Windows.Forms.Padding(5); + this.locate_randomizer_btn.Size = new System.Drawing.Size(390, 34); + this.locate_randomizer_btn.TabIndex = 4; + this.locate_randomizer_btn.Text = "Locate BashPrime\'s Randomizer"; + this.locate_randomizer_btn.Click += new System.EventHandler(this.locate_randomizer_btn_click); + // + // randomize_btn + // + this.randomize_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.randomize_btn.Location = new System.Drawing.Point(399, 3); + this.randomize_btn.Name = "randomize_btn"; + this.randomize_btn.Padding = new System.Windows.Forms.Padding(5); + this.randomize_btn.Size = new System.Drawing.Size(390, 34); + this.randomize_btn.TabIndex = 5; + this.randomize_btn.Text = "Randomize"; + this.randomize_btn.Click += new System.EventHandler(this.randomize_btn_click); + // + // randomizer_lbl + // + this.randomizer_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.randomizer_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.randomizer_lbl.Location = new System.Drawing.Point(3, 0); + this.randomizer_lbl.Name = "randomizer_lbl"; + this.randomizer_lbl.Size = new System.Drawing.Size(786, 40); + this.randomizer_lbl.TabIndex = 9; + this.randomizer_lbl.Text = "BashPrime\'s Randomizer not found! (v2.6.0 or later required)"; + this.randomizer_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // plandomizer_tab + // + this.plandomizer_tab.Controls.Add(this.plandomizer_tab_table_layout); + this.plandomizer_tab.Location = new System.Drawing.Point(4, 22); + this.plandomizer_tab.Name = "plandomizer_tab"; + this.plandomizer_tab.Size = new System.Drawing.Size(792, 139); + this.plandomizer_tab.TabIndex = 2; + this.plandomizer_tab.Text = "Plandomizer"; + this.plandomizer_tab.UseVisualStyleBackColor = true; + // + // plandomizer_tab_table_layout + // + this.plandomizer_tab_table_layout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.plandomizer_tab_table_layout.ColumnCount = 1; + this.plandomizer_tab_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.plandomizer_tab_table_layout.Controls.Add(this.plandomizer_lbl, 0, 2); + this.plandomizer_tab_table_layout.Controls.Add(this.input_json_lbl, 0, 0); + this.plandomizer_tab_table_layout.Controls.Add(this.input_json_table_layout, 0, 1); + this.plandomizer_tab_table_layout.Controls.Add(this.plandomizer_btn_table_layout, 0, 3); + this.plandomizer_tab_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.plandomizer_tab_table_layout.Location = new System.Drawing.Point(0, 0); + this.plandomizer_tab_table_layout.Name = "plandomizer_tab_table_layout"; + this.plandomizer_tab_table_layout.RowCount = 5; + this.plandomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.plandomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.plandomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.plandomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.plandomizer_tab_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.plandomizer_tab_table_layout.Size = new System.Drawing.Size(792, 139); + this.plandomizer_tab_table_layout.TabIndex = 1; + // + // plandomizer_lbl + // + this.plandomizer_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.plandomizer_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.plandomizer_lbl.Location = new System.Drawing.Point(3, 52); + this.plandomizer_lbl.Name = "plandomizer_lbl"; + this.plandomizer_lbl.Size = new System.Drawing.Size(786, 40); + this.plandomizer_lbl.TabIndex = 9; + this.plandomizer_lbl.Text = "toasterparty\'s Plandomizer not found! (Recommended version : 1.6)"; + this.plandomizer_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // input_json_lbl + // + this.input_json_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.input_json_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.input_json_lbl.Location = new System.Drawing.Point(3, 0); + this.input_json_lbl.Name = "input_json_lbl"; + this.input_json_lbl.Size = new System.Drawing.Size(786, 26); + this.input_json_lbl.TabIndex = 12; + this.input_json_lbl.Text = "Input JSON :"; + this.input_json_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // input_json_table_layout + // + this.input_json_table_layout.ColumnCount = 2; + this.input_json_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.input_json_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.input_json_table_layout.Controls.Add(this.input_json_txt_box, 0, 0); + this.input_json_table_layout.Controls.Add(this.input_json_btn, 1, 0); + this.input_json_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.input_json_table_layout.Location = new System.Drawing.Point(0, 26); + this.input_json_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.input_json_table_layout.Name = "input_json_table_layout"; + this.input_json_table_layout.RowCount = 1; + this.input_json_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.input_json_table_layout.Size = new System.Drawing.Size(792, 26); + this.input_json_table_layout.TabIndex = 11; + // + // input_json_txt_box + // + this.input_json_txt_box.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); + this.input_json_txt_box.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.input_json_txt_box.Dock = System.Windows.Forms.DockStyle.Fill; + this.input_json_txt_box.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.input_json_txt_box.Location = new System.Drawing.Point(3, 3); + this.input_json_txt_box.MaxLength = 260; + this.input_json_txt_box.Name = "input_json_txt_box"; + this.input_json_txt_box.Size = new System.Drawing.Size(686, 20); + this.input_json_txt_box.TabIndex = 4; + // + // input_json_btn + // + this.input_json_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.input_json_btn.Location = new System.Drawing.Point(695, 3); + this.input_json_btn.Name = "input_json_btn"; + this.input_json_btn.Padding = new System.Windows.Forms.Padding(5); + this.input_json_btn.Size = new System.Drawing.Size(94, 20); + this.input_json_btn.TabIndex = 5; + this.input_json_btn.Text = "Browse"; + this.input_json_btn.Click += new System.EventHandler(this.input_json_btn_click); + // + // plandomizer_btn_table_layout + // + this.plandomizer_btn_table_layout.ColumnCount = 2; + this.plandomizer_btn_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.plandomizer_btn_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.plandomizer_btn_table_layout.Controls.Add(this.locate_plandomizer_btn, 0, 0); + this.plandomizer_btn_table_layout.Controls.Add(this.plandomize_btn, 1, 0); + this.plandomizer_btn_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.plandomizer_btn_table_layout.Location = new System.Drawing.Point(0, 92); + this.plandomizer_btn_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.plandomizer_btn_table_layout.Name = "plandomizer_btn_table_layout"; + this.plandomizer_btn_table_layout.RowCount = 1; + this.plandomizer_btn_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.plandomizer_btn_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); + this.plandomizer_btn_table_layout.Size = new System.Drawing.Size(792, 40); + this.plandomizer_btn_table_layout.TabIndex = 8; + // + // locate_plandomizer_btn + // + this.locate_plandomizer_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.locate_plandomizer_btn.Location = new System.Drawing.Point(3, 3); + this.locate_plandomizer_btn.Name = "locate_plandomizer_btn"; + this.locate_plandomizer_btn.Padding = new System.Windows.Forms.Padding(5); + this.locate_plandomizer_btn.Size = new System.Drawing.Size(390, 34); + this.locate_plandomizer_btn.TabIndex = 4; + this.locate_plandomizer_btn.Text = "Locate toasterparty\'s Plandomizer"; + this.locate_plandomizer_btn.Click += new System.EventHandler(this.locate_plandomizer_btn_Click); + // + // plandomize_btn + // + this.plandomize_btn.Dock = System.Windows.Forms.DockStyle.Fill; + this.plandomize_btn.Location = new System.Drawing.Point(399, 3); + this.plandomize_btn.Name = "plandomize_btn"; + this.plandomize_btn.Padding = new System.Windows.Forms.Padding(5); + this.plandomize_btn.Size = new System.Drawing.Size(390, 34); + this.plandomize_btn.TabIndex = 5; + this.plandomize_btn.Text = "Plandomize"; + this.plandomize_btn.Click += new System.EventHandler(this.plandomize_btn_Click); + // + // settings_tab + // + this.settings_tab.Controls.Add(this.settings_table_layout); + this.settings_tab.Location = new System.Drawing.Point(4, 22); + this.settings_tab.Name = "settings_tab"; + this.settings_tab.Size = new System.Drawing.Size(792, 139); + this.settings_tab.TabIndex = 3; + this.settings_tab.Text = "Settings"; + this.settings_tab.UseVisualStyleBackColor = true; + // + // settings_table_layout + // + this.settings_table_layout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.settings_table_layout.ColumnCount = 2; + this.settings_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.settings_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.settings_table_layout.Controls.Add(this.disable_spring_ball_check_box, 0, 0); + this.settings_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.settings_table_layout.Location = new System.Drawing.Point(0, 0); + this.settings_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.settings_table_layout.Name = "settings_table_layout"; + this.settings_table_layout.RowCount = 6; + this.settings_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.settings_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.settings_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.settings_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.settings_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26F)); + this.settings_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.settings_table_layout.Size = new System.Drawing.Size(792, 139); + this.settings_table_layout.TabIndex = 3; + // + // disable_spring_ball_check_box + // + this.disable_spring_ball_check_box.AutoSize = true; + this.disable_spring_ball_check_box.Dock = System.Windows.Forms.DockStyle.Fill; + this.disable_spring_ball_check_box.Location = new System.Drawing.Point(3, 3); + this.disable_spring_ball_check_box.Name = "disable_spring_ball_check_box"; + this.disable_spring_ball_check_box.Size = new System.Drawing.Size(390, 20); + this.disable_spring_ball_check_box.TabIndex = 0; + this.disable_spring_ball_check_box.Text = "Disable Spring Ball"; + // + // main_form // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(784, 316); - this.Controls.Add(this.tableLayoutPanel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.ClientSize = new System.Drawing.Size(800, 360); + this.Controls.Add(this.main_table_layout); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.HelpButton = true; this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(800, 355); + this.MaximumSize = new System.Drawing.Size(800, 360); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(800, 355); - this.Name = "Form1"; + this.MinimumSize = new System.Drawing.Size(800, 360); + this.Name = "main_form"; this.ShowIcon = false; this.Text = "Metroid Prime 1 - Trilogy Rando Generator v1.8"; - this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.helpBtn_Click); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.formClosing); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.form_closing); this.Load += new System.EventHandler(this.Form1_Load); - this.tableLayoutPanel1.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel7.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.tableLayoutPanel3.ResumeLayout(false); - this.tableLayoutPanel3.PerformLayout(); - this.tableLayoutPanel5.ResumeLayout(false); - this.tableLayoutPanel5.PerformLayout(); - this.tableLayoutPanel6.ResumeLayout(false); - this.tableLayoutPanel4.ResumeLayout(false); + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.form1_MouseDown); + this.main_table_layout.ResumeLayout(false); + this.output_table_layout.ResumeLayout(false); + this.output_path_table_layout.ResumeLayout(false); + this.output_path_table_layout.PerformLayout(); + this.status_bar_table_layout.ResumeLayout(false); + this.title_bar_table_layout.ResumeLayout(false); + this.title_bar_table_layout.PerformLayout(); + this.tab_btn_bar_table_layout.ResumeLayout(false); + this.tab_manager.ResumeLayout(false); + this.template_iso_tab.ResumeLayout(false); + this.template_iso_tab_table_layout.ResumeLayout(false); + this.template_iso_btn_table_layout.ResumeLayout(false); + this.randomizer_tab.ResumeLayout(false); + this.randomizer_tab_table_layout.ResumeLayout(false); + this.randomizer_btn_table_layout.ResumeLayout(false); + this.plandomizer_tab.ResumeLayout(false); + this.plandomizer_tab_table_layout.ResumeLayout(false); + this.input_json_table_layout.ResumeLayout(false); + this.input_json_table_layout.PerformLayout(); + this.plandomizer_btn_table_layout.ResumeLayout(false); + this.settings_tab.ResumeLayout(false); + this.settings_table_layout.ResumeLayout(false); + this.settings_table_layout.PerformLayout(); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Button button4; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; - private System.Windows.Forms.Button button5; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.ProgressBar progressBar1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.ComboBox comboBox1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; - private System.Windows.Forms.Button button3; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.TableLayoutPanel main_table_layout; + private System.Windows.Forms.TableLayoutPanel randomizer_tab_table_layout; + private System.Windows.Forms.TableLayoutPanel output_path_table_layout; + private System.Windows.Forms.TableLayoutPanel status_bar_table_layout; + private System.Windows.Forms.TableLayoutPanel randomizer_btn_table_layout; + private System.Windows.Forms.TableLayoutPanel title_bar_table_layout; + private System.Windows.Forms.Button close_btn; + private System.Windows.Forms.Button help_btn; + private DarkUI.Controls.DarkLabel title_lbl; + private System.Windows.Forms.TableLayoutPanel tab_btn_bar_table_layout; + private System.Windows.Forms.TabPage template_iso_tab; + private System.Windows.Forms.TabPage randomizer_tab; + private System.Windows.Forms.TabPage plandomizer_tab; + private System.Windows.Forms.TableLayoutPanel template_iso_tab_table_layout; + private System.Windows.Forms.TableLayoutPanel template_iso_btn_table_layout; + private DarkUI.Controls.DarkButton generate_template_iso_btn; + private DarkUI.Controls.DarkButton delete_cache_btn; + private DarkUI.Controls.DarkLabel template_iso_lbl; + private System.Windows.Forms.TableLayoutPanel output_table_layout; + private DarkUI.Controls.DarkLabel output_path_lbl; + private DarkUI.Controls.DarkLabel output_type_lbl; + private DarkUI.Controls.DarkTextBox output_path_txt_box; + private DarkUI.Controls.DarkButton output_path_btn; + private DarkUI.Controls.DarkComboBox output_type_combo_box; + private DarkUI.Controls.DarkButton locate_randomizer_btn; + private DarkUI.Controls.DarkButton randomize_btn; + private DarkUI.Controls.DarkLabel randomizer_lbl; + private System.Windows.Forms.TableLayoutPanel plandomizer_tab_table_layout; + private System.Windows.Forms.TableLayoutPanel plandomizer_btn_table_layout; + private DarkUI.Controls.DarkButton locate_plandomizer_btn; + private DarkUI.Controls.DarkButton plandomize_btn; + private DarkUI.Controls.DarkLabel plandomizer_lbl; + internal System.Windows.Forms.Button template_iso_btn; + internal System.Windows.Forms.Button randomizer_btn; + internal System.Windows.Forms.Button plandomizer_btn; + internal System.Windows.Forms.TabControlNoHeader tab_manager; + internal DarkUI.Controls.DarkLabel status_lbl; + internal System.Windows.Forms.ProgressBar status_progress_bar; + private System.Windows.Forms.TableLayoutPanel input_json_table_layout; + private DarkUI.Controls.DarkTextBox input_json_txt_box; + private DarkUI.Controls.DarkButton input_json_btn; + private DarkUI.Controls.DarkLabel input_json_lbl; + private System.Windows.Forms.TabPage settings_tab; + private System.Windows.Forms.TableLayoutPanel settings_table_layout; + internal System.Windows.Forms.Button settings_btn; + private DarkUI.Controls.DarkCheckBox disable_spring_ball_check_box; } } diff --git a/MP1_Trilogy_Rando_Generator/Form1.cs b/MP1_Trilogy_Rando_Generator/Form1.cs index 72f5563..2b6ce45 100644 --- a/MP1_Trilogy_Rando_Generator/Form1.cs +++ b/MP1_Trilogy_Rando_Generator/Form1.cs @@ -1,96 +1,37 @@ -using MP1_Trilogy_Rando_Generator.Utils; +using DarkUI.Forms; +using MP1_Trilogy_Rando_Generator.Enums; +using MP1_Trilogy_Rando_Generator.Utils; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Diagnostics; using System.IO; using System.IO.Compression; using System.Linq; -using System.Text; using System.Windows.Forms; namespace MP1_Trilogy_Rando_Generator { - public partial class Form1 : Form + public partial class main_form : DarkForm { - readonly Random rand; + internal bool isLoading = false; static readonly Config.AppSettings appSettings = new Config.AppSettings(); - static readonly List UsedDeveloperCodes = new List(); bool IsTemplateISOGenerated() { try { return File.Exists("gc_template.iso") && Directory.Exists(".\\tmp\\wii") && - (IsMetroidPrimeTrilogyNTSC_UOrPAL(".\\tmp\\wii\\DATA\\sys\\boot.bin") || IsMetroidPrimeWiiNTSC_J(".\\tmp\\wii\\DATA\\sys\\boot.bin")); + (DiscUtils.IsMetroidPrimeTrilogyNTSC_UOrPAL(".\\tmp\\wii\\DATA\\sys\\boot.bin") || DiscUtils.IsMetroidPrimeWiiNTSC_J(".\\tmp\\wii\\DATA\\sys\\boot.bin")); } catch { return false; } } - bool IsMetroidPrimeTrilogyNTSC_UOrPAL(string fileName) + public main_form() { - String GameID = GetGameID(fileName); - if (GameID.Substring(0, 3) != "R3M") - return false; - return GameID[3] == 'E' || GameID[3] == 'P'; - } - - bool IsMetroidPrimeWiiNTSC_J(string fileName) - { - String GameID = GetGameID(fileName); - return GameID.Substring(0, 3) == "R3I" && GameID[3] == 'J'; - } - - String GetGameID(string fileName) - { - if (!File.Exists(fileName)) - return ""; - using (var bR = new BinaryReader(File.OpenRead(fileName))) - { - return Encoding.ASCII.GetString(bR.ReadBytes(6)); - } - } - - String RandomizeDeveloperCode() - { - const String AllowedCharacters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - int len = AllowedCharacters.Length; - String DeveloperCode = "01"; - while (DeveloperCode == "01" || UsedDeveloperCodes.Contains(DeveloperCode)) - DeveloperCode = "" + AllowedCharacters[rand.Next(len)] + AllowedCharacters[rand.Next(len)]; - UsedDeveloperCodes.Add(DeveloperCode); - File.WriteAllLines("udc.bin", UsedDeveloperCodes.ToArray()); - return DeveloperCode; - } - - void SetProgressStatus(int cur, int max) - { - if (cur != max) - { - this.progressBar1.Visible = true; - this.progressBar1.Value = (cur * 100) / (max - 1); - } - else - { - this.progressBar1.Visible = false; - this.progressBar1.Value = 0; - } - this.progressBar1.Update(); - } - - void SetStatus(String status, int cur=0, int len=0) - { - this.label3.Text = "Status : " + status; - if(len > 1) - this.label3.Text += " (" + (cur+1) + " / " + len + ")"; - this.label3.Update(); - } - - public Form1() - { - rand = new Random((int)((DateTime.Now.Ticks / TimeSpan.TicksPerSecond))); Directory.SetCurrentDirectory(Path.GetDirectoryName(Application.ExecutablePath)); + FormUtils.Init(this); InitializeComponent(); } @@ -99,58 +40,73 @@ private void Form1_Load(object sender, EventArgs e) if (!Directory.Exists(@".\tmp")) Directory.CreateDirectory(@".\tmp"); - if (File.Exists("udc.bin")) - UsedDeveloperCodes.AddRange(File.ReadAllLines("udc.bin")); if (IsTemplateISOGenerated()) { - this.label1.Text = "Metroid Prime Wii ISO template for Prime 1 Randomizer detected!"; - this.button1.Enabled = false; - this.button2.Enabled = true; + this.template_iso_lbl.Text = "Metroid Prime Wii ISO template for Prime 1 patcher detected!"; + this.generate_template_iso_btn.Enabled = false; + this.delete_cache_btn.Enabled = true; } if (appSettings.prime1RandomizerPath.EndsWith(".exe") && File.Exists(appSettings.prime1RandomizerPath)) - this.label2.Text = "BashPrime's Randomizer found!"; - this.textBox1.Text = appSettings.outputPath; - this.comboBox1.SelectedIndex = this.comboBox1.Items.IndexOf(appSettings.outputType); - - if (!NodManager.Installed()) + this.randomizer_lbl.Text = "BashPrime's Randomizer found!"; + if (appSettings.prime1PlandomizerPath.EndsWith(".exe") && File.Exists(appSettings.prime1PlandomizerPath)) + this.plandomizer_lbl.Text = "toasterparty's Plandomizer found!"; + this.input_json_txt_box.Text = appSettings.prime1PlandomizerLastJsonPath; + this.output_path_txt_box.Text = appSettings.outputPath; + this.output_type_combo_box.SelectedIndex = this.output_type_combo_box.Items.IndexOf(appSettings.outputType); + + if (!ISOUtils.NOD.Installed()) { - SetProgressStatus(1, 2); - SetStatus("Downloading and installing nod..."); - if (!NodManager.Init()) + FormUtils.SetProgressStatus(1, 2); + FormUtils.SetStatus("Downloading and installing nod..."); + if (!ISOUtils.NOD.Init()) { MessageBox.Show("Couldn't download nod"); this.Close(); } - SetProgressStatus(2, 2); - SetStatus("Idle"); + FormUtils.SetProgressStatus(2, 2); + FormUtils.SetStatus("Idle"); } - if (!WITManager.Installed()) + if (!ISOUtils.WIT.Installed()) { - SetProgressStatus(1, 2); - SetStatus("Downloading and installing WIT..."); - if (!WITManager.Init()) + FormUtils.SetProgressStatus(1, 2); + FormUtils.SetStatus("Downloading and installing WIT..."); + if (!ISOUtils.WIT.Init()) { MessageBox.Show("Couldn't download WIT"); this.Close(); } - SetProgressStatus(2, 2); - SetStatus("Idle"); + FormUtils.SetProgressStatus(2, 2); + FormUtils.SetStatus("Idle"); } } - private void button1_Click(object sender, EventArgs e) + private void generate_template_iso_btn_click(object sender, EventArgs e) { var wii_iso_path = default(String); var GameID = default(String); + if(isLoading && ((Button)sender).Text == "Cancel") + { + ProcessUtils.KillChildrenProcesses(Process.GetCurrentProcess().Id); + if (Directory.Exists(@".\tmp")) + Directory.Delete(@".\tmp", true); + if(File.Exists(@".\gc_template.iso")) + File.Delete(@".\gc_template.iso"); + FormUtils.ShowMessageBox("Cancelled generation!"); + FormUtils.SetControlText(this.generate_template_iso_btn, "Generate a template ISO for the patcher"); + isLoading = false; + return; + } + + isLoading = true; MessageBox.Show(@"/!\ This operation can take 10 mins or more on a 5400 RPM HDD. So please be patient!"); using (var openFileDialog = new OpenFileDialog()) { var dialogResult = default(DialogResult); - openFileDialog.Title = "Select a NTSC-U iso of Metroid Prime Trilogy"; + openFileDialog.Title = "Select an iso of Metroid Prime Trilogy or Metroid Prime New Play Controls"; openFileDialog.Filter = "Wii ISO File|*.iso|Wii NKit ISO File|*.nkit.iso;*.nkit.iso"; openFileDialog.FileName = ""; openFileDialog.InitialDirectory = Directory.GetCurrentDirectory(); @@ -165,162 +121,180 @@ private void button1_Click(object sender, EventArgs e) MessageBox.Show("Select a Wii iso"); continue; } - if (!IsMetroidPrimeTrilogyNTSC_UOrPAL(openFileDialog.FileName) && !IsMetroidPrimeWiiNTSC_J(openFileDialog.FileName)) + if (!DiscUtils.IsMetroidPrimeTrilogyNTSC_UOrPAL(openFileDialog.FileName) && !DiscUtils.IsMetroidPrimeWiiNTSC_J(openFileDialog.FileName)) { openFileDialog.FileName = ""; MessageBox.Show("Select a Metroid Prime Wii iso (NTSC-U/NTSC-J/PAL)"); continue; } - GameID = GetGameID(openFileDialog.FileName); + GameID = DiscUtils.GetGameID(openFileDialog.FileName); wii_iso_path = openFileDialog.FileName; } if (dialogResult == DialogResult.Cancel) + { + isLoading = false; return; + } } } - SetProgressStatus(0, 5); - SetStatus("Extracting Metroid Prime Wii ISO..."); - if (wii_iso_path.ToLower().EndsWith(".nkit.iso") || wii_iso_path.ToLower().EndsWith(".nkit.gcz")) + FormUtils.RunAsynchrousTask(new Action(() => { - if (!NKitManager.ExtractISO(wii_iso_path)) + FormUtils.SetControlText(this.generate_template_iso_btn, "Cancel"); + FormUtils.SetProgressStatus(0, 5); + FormUtils.SetStatus("Extracting Metroid Prime Wii ISO..."); + if (wii_iso_path.ToLower().EndsWith(".nkit.iso") || wii_iso_path.ToLower().EndsWith(".nkit.gcz")) + { + if (!ISOUtils.NKIT.ExtractISO(wii_iso_path)) + { + FormUtils.ShowMessageBox("Failed extracting wii nkit iso!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.generate_template_iso_btn, "Generate a template ISO for the patcher"); + isLoading = false; + return; + } + + try + { + if (GameID == "R3ME01") + File.WriteAllBytes(@".\tmp\nkit\nkit_files.zip", Properties.Resources.R3ME01_nkit); + if (GameID == "R3MP01") + File.WriteAllBytes(@".\tmp\nkit\nkit_files.zip", Properties.Resources.R3MP01_nkit); + if (GameID == "R3IJ01") + File.WriteAllBytes(@".\tmp\nkit\nkit_files.zip", Properties.Resources.R3IJ01_nkit); + ZipFile.ExtractToDirectory(@".\tmp\nkit\nkit_files.zip", @".\tmp\nkit\DATA"); + File.Move(@".\tmp\nkit\DATA\files\main.dol", @".\tmp\nkit\DATA\sys\main.dol"); + File.Delete(@".\tmp\nkit\nkit_files.zip"); + File.Delete(@".\tmp\nkit\DATA\files\boot.bin"); + File.Delete(@".\tmp\nkit\DATA\files\appldr.bin"); + File.Delete(@".\tmp\nkit\DATA\files\bi2.bin"); + File.Delete(@".\tmp\nkit\DATA\files\fst.bin"); + File.Delete(@".\tmp\nkit\DATA\sys\R3MEhdr.bin"); + File.Delete(@".\tmp\nkit\DATA\sys\hdr.bin"); + Directory.Move(@".\tmp\nkit", @".\tmp\wii"); + } + catch + { + Directory.Delete(@".\tmp\nkit", true); + } + } + else if (wii_iso_path.ToLower().EndsWith(".iso")) + { + if (!ISOUtils.NOD.ExtractISO(wii_iso_path, false)) + { + FormUtils.ShowMessageBox("Failed extracting wii iso!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.generate_template_iso_btn, "Generate a template ISO for the patcher"); + isLoading = false; + return; + } + } + + if (!Directory.Exists(@".\tmp\wii")) { - MessageBox.Show("Failed extracting wii nkit iso!"); - SetProgressStatus(5, 5); - SetStatus("Idle"); + FormUtils.ShowMessageBox("Failed extracting wii iso!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.generate_template_iso_btn, "Generate a template ISO for the patcher"); + isLoading = false; return; } - try { - if(GameID == "R3ME01") - File.WriteAllBytes(@".\tmp\nkit\nkit_files.zip", Properties.Resources.R3ME01_nkit); - if (GameID == "R3MP01") - File.WriteAllBytes(@".\tmp\nkit\nkit_files.zip", Properties.Resources.R3MP01_nkit); - if (GameID == "R3IJ01") - File.WriteAllBytes(@".\tmp\nkit\nkit_files.zip", Properties.Resources.R3IJ01_nkit); - ZipFile.ExtractToDirectory(@".\tmp\nkit\nkit_files.zip", @".\tmp\nkit\DATA"); - File.Move(@".\tmp\nkit\DATA\files\main.dol", @".\tmp\nkit\DATA\sys\main.dol"); - File.Delete(@".\tmp\nkit\nkit_files.zip"); - File.Delete(@".\tmp\nkit\DATA\files\boot.bin"); - File.Delete(@".\tmp\nkit\DATA\files\appldr.bin"); - File.Delete(@".\tmp\nkit\DATA\files\bi2.bin"); - File.Delete(@".\tmp\nkit\DATA\files\fst.bin"); - File.Delete(@".\tmp\nkit\DATA\sys\R3MEhdr.bin"); - File.Delete(@".\tmp\nkit\DATA\sys\hdr.bin"); - Directory.Move(@".\tmp\nkit", @".\tmp\wii"); - } catch { - Directory.Delete(@".\tmp\nkit", true); + FormUtils.SetProgressStatus(1, 5); + FormUtils.SetStatus("Backing up original DOLs..."); + + if (!Directory.Exists(".\\tmp\\dol_backup\\")) + Directory.CreateDirectory(".\\tmp\\dol_backup\\"); + + if (GameID == "R3IJ01") + File.Copy(".\\tmp\\wii\\DATA\\files\\rs5mp1jpn_p.dol", ".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", true); + else + File.Copy(".\\tmp\\wii\\DATA\\files\\rs5mp1_p.dol", ".\\tmp\\dol_backup\\rs5mp1_p.dol", true); + File.Copy(".\\tmp\\wii\\DATA\\files\\rs5fe_p.dol", ".\\tmp\\dol_backup\\rs5fe_p.dol", true); + + FormUtils.SetProgressStatus(2, 5); + FormUtils.SetStatus("Stripping unnecessary files from Metroid Prime ISO..."); + File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\mp1\\attract01.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\mp1\\Attract02.thp", Properties.Resources.dummy); + Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Audio\\MP1_Bonus", true); + if (GameID != "R3IJ01") + { + File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd\\attract01.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd\\Attract02.thp", Properties.Resources.dummy); + FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\MP2", true); + FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\MP3", true); + Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Video\\mp2", true); + foreach (var file in Directory.EnumerateFiles(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd", "Menu_To_Game_MP2_*.thp")) + File.Delete(file); + foreach (var file in Directory.EnumerateFiles(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd", "Menu_To_Game_MP3_*.thp")) + File.Delete(file); + Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Audio\\MP2_Bonus", true); + Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Audio\\MP3_Bonus", true); + FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\", "*.dol", "rs5mp1_p.dol", "rs5fe_p.dol"); } - } - else if (wii_iso_path.ToLower().EndsWith(".iso")) - { - if (!NodManager.ExtractISO(wii_iso_path, false)) + else + FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\", "*.dol", "rs5mp1jpn_p.dol", "rs5fe_p.dol"); + + FormUtils.SetProgressStatus(3, 5); + FormUtils.SetStatus("Copying resources from Metroid Prime Wii to Template ISO..."); + + Directory.CreateDirectory(".\\tmp\\gc\\files"); + Directory.CreateDirectory(".\\tmp\\gc\\sys"); + if (GameID == "R3IJ01") { - MessageBox.Show("Failed extracting wii iso!"); - SetProgressStatus(5, 5); - SetStatus("Idle"); - return; + DirectoryUtils.Copy(".\\tmp\\wii\\DATA\\files\\MP1JPN", ".\\tmp\\gc\\files\\", true); + File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\gc\\files\\default.dol", true); } - } + else + { + DirectoryUtils.Copy(".\\tmp\\wii\\DATA\\files\\MP1", ".\\tmp\\gc\\files\\", true); + File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\gc\\files\\default.dol", true); + } + Directory.Delete(".\\tmp\\gc\\files\\RSO", true); + Directory.Delete(".\\tmp\\gc\\files\\rhbm", true); + DirectoryUtils.Copy(".\\tmp\\wii\\DATA\\sys", ".\\tmp\\gc\\sys\\", true); + if (GameID == "R3IJ01") + File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\gc\\sys\\main.dol", true); + else + File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\gc\\sys\\main.dol", true); + FileUtils.Write(".\\tmp\\gc\\sys\\boot.bin", 0x18, (UInt32)0, true); + FileUtils.Write(".\\tmp\\gc\\sys\\boot.bin", 0x1C, (UInt32)0xC2339F3D, true); + File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\02_start_fileselect_A.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\02_start_fileselect_B.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\02_start_fileselect_C.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\04_fileselect_playgame_A.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\04_fileselect_playgame_B.thp", Properties.Resources.dummy); + File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\04_fileselect_playgame_C.thp", Properties.Resources.dummy); - if (!Directory.Exists(@".\tmp\wii")) - { - MessageBox.Show("Failed extracting wii iso!"); - SetProgressStatus(5, 5); - SetStatus("Idle"); - return; - } + FormUtils.SetProgressStatus(4, 5); + FormUtils.SetStatus("Creating Metroid Prime Wii ISO template to be used with Prime 1 patcher"); - SetProgressStatus(1, 5); - SetStatus("Backing up original DOLs..."); - - if (!Directory.Exists(".\\tmp\\dol_backup\\")) - Directory.CreateDirectory(".\\tmp\\dol_backup\\"); - - if(GameID == "R3IJ01") - File.Copy(".\\tmp\\wii\\DATA\\files\\rs5mp1jpn_p.dol", ".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", true); - else - File.Copy(".\\tmp\\wii\\DATA\\files\\rs5mp1_p.dol", ".\\tmp\\dol_backup\\rs5mp1_p.dol", true); - File.Copy(".\\tmp\\wii\\DATA\\files\\rs5fe_p.dol", ".\\tmp\\dol_backup\\rs5fe_p.dol", true); - - SetProgressStatus(2, 5); - SetStatus("Stripping unnecessary files from Metroid Prime ISO..."); - File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\mp1\\attract01.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\mp1\\Attract02.thp", Properties.Resources.dummy); - Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Audio\\MP1_Bonus", true); - if (GameID != "R3IJ01") - { - File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd\\attract01.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd\\Attract02.thp", Properties.Resources.dummy); - FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\MP2", true); - FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\MP3", true); - Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Video\\mp2", true); - foreach (var file in Directory.EnumerateFiles(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd", "Menu_To_Game_MP2_*.thp")) - File.Delete(file); - foreach (var file in Directory.EnumerateFiles(".\\tmp\\wii\\DATA\\files\\fe\\Video\\FrontEnd", "Menu_To_Game_MP3_*.thp")) - File.Delete(file); - Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Audio\\MP2_Bonus", true); - Directory.Delete(".\\tmp\\wii\\DATA\\files\\fe\\Audio\\MP3_Bonus", true); - FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\", "*.dol", "rs5mp1_p.dol", "rs5fe_p.dol"); - } - else - FileUtils.NullifyFiles(".\\tmp\\wii\\DATA\\files\\", "*.dol", "rs5mp1jpn_p.dol", "rs5fe_p.dol"); + ISOUtils.NOD.CreateISO("gc_template.iso", true, GameID); - SetProgressStatus(3, 5); - SetStatus("Copying resources from Metroid Prime Wii to Template ISO..."); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); - Directory.CreateDirectory(".\\tmp\\gc\\files"); - Directory.CreateDirectory(".\\tmp\\gc\\sys"); - if (GameID == "R3IJ01") - { - DirectoryUtils.Copy(".\\tmp\\wii\\DATA\\files\\MP1JPN", ".\\tmp\\gc\\files\\", true); - File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\gc\\files\\default.dol", true); - } - else - { - DirectoryUtils.Copy(".\\tmp\\wii\\DATA\\files\\MP1", ".\\tmp\\gc\\files\\", true); - File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\gc\\files\\default.dol", true); - } - Directory.Delete(".\\tmp\\gc\\files\\RSO", true); - Directory.Delete(".\\tmp\\gc\\files\\rhbm", true); - DirectoryUtils.Copy(".\\tmp\\wii\\DATA\\sys", ".\\tmp\\gc\\sys\\", true); - if (GameID == "R3IJ01") - File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\gc\\sys\\main.dol", true); - else - File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\gc\\sys\\main.dol", true); - FileUtils.Write(".\\tmp\\gc\\sys\\boot.bin", 0x18, (UInt32)0, true); - FileUtils.Write(".\\tmp\\gc\\sys\\boot.bin", 0x1C, (UInt32)0xC2339F3D, true); - File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\02_start_fileselect_A.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\02_start_fileselect_B.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\02_start_fileselect_C.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\04_fileselect_playgame_A.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\04_fileselect_playgame_B.thp", Properties.Resources.dummy); - File.WriteAllBytes(".\\tmp\\gc\\files\\Video\\04_fileselect_playgame_C.thp", Properties.Resources.dummy); - - SetProgressStatus(4, 5); - SetStatus("Creating Metroid Prime Wii ISO template to be used with BashPrime's Randomizer"); - - NodManager.CreateISO("gc_template.iso", true, GameID); - - SetProgressStatus(5, 5); - SetStatus("Idle"); - - Directory.Delete(".\\tmp\\gc", true); - this.label1.Text = "Metroid Prime Wii ISO template for BashPrime's Randomizer detected!"; - this.button1.Enabled = false; - this.button2.Enabled = true; + Directory.Delete(".\\tmp\\gc", true); + FormUtils.SetControlText(this.template_iso_lbl, "Metroid Prime Wii ISO template for Prime 1 patcher detected!"); + FormUtils.SetControlEnabled(this.generate_template_iso_btn, false); + FormUtils.SetControlEnabled(this.delete_cache_btn, true); + FormUtils.SetControlText(this.generate_template_iso_btn, "Generate a template ISO for the patcher"); + isLoading = false; + })); } - private void button2_Click(object sender, EventArgs e) + private void delete_cache_btn_click(object sender, EventArgs e) { File.Delete("gc_template.iso"); Directory.Delete("tmp", true); - this.label1.Text = "No Metroid Prime Wii ISO template for BashPrime's Randomizer detected!"; - this.button1.Enabled = true; - this.button2.Enabled = false; + FormUtils.SetControlText(this.template_iso_lbl, "No Metroid Prime Wii ISO template for Prime 1 patcher detected!"); + FormUtils.SetControlEnabled(this.generate_template_iso_btn, true); + FormUtils.SetControlEnabled(this.delete_cache_btn, false); } - private void button3_Click(object sender, EventArgs e) + private void locate_randomizer_btn_click(object sender, EventArgs e) { using (var openFileDialog = new OpenFileDialog()) { @@ -343,19 +317,19 @@ private void button3_Click(object sender, EventArgs e) } appSettings.prime1RandomizerPath = openFileDialog.FileName; appSettings.SaveToJson(); - this.label2.Text = "BashPrime's Randomizer found!"; + this.randomizer_lbl.Text = "BashPrime's Randomizer found!"; } if (dialogResult == DialogResult.Cancel) { if (!appSettings.prime1RandomizerPath.EndsWith(".exe")) - this.label2.Text = "BashPrime's Randomizer not found! (v2.5.0 or later)"; + this.randomizer_lbl.Text = "BashPrime's Randomizer not found! (v2.6.0 or later)"; return; } } } } - private void button4_Click(object sender, EventArgs e) + private void randomize_btn_click(object sender, EventArgs e) { var new_wii_iso_path = default(String); var gc_iso_filename = default(String); @@ -367,16 +341,27 @@ private void button4_Click(object sender, EventArgs e) String GameSettingsDolphinEmuPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Path.DirectorySeparatorChar+ "Dolphin Emulator" + Path.DirectorySeparatorChar + "GameSettings" + Path.DirectorySeparatorChar; String curDir = Directory.GetCurrentDirectory(); + if (isLoading && ((Button)sender).Text == "Cancel") + { + ProcessUtils.KillChildrenProcesses(Process.GetCurrentProcess().Id); + if (Directory.Exists(@".\tmp\gc")) + Directory.Delete(@".\tmp\gc", true); + FormUtils.ShowMessageBox("Cancelled randomization!"); + FormUtils.SetControlText(this.randomize_btn, "Randomize"); + isLoading = false; + return; + } + if (!IsTemplateISOGenerated()) { MessageBox.Show("Please click on \"Generate a template ISO for BashPrime's Randomizer\" before attempting to randomize!"); return; } - if (!IsMetroidPrimeTrilogyNTSC_UOrPAL("gc_template.iso") && !IsMetroidPrimeWiiNTSC_J("gc_template.iso")) + if (!DiscUtils.IsMetroidPrimeTrilogyNTSC_UOrPAL("gc_template.iso") && !DiscUtils.IsMetroidPrimeWiiNTSC_J("gc_template.iso")) return; - GameID = GetGameID("gc_template.iso"); + GameID = DiscUtils.GetGameID("gc_template.iso"); if (appSettings.prime1RandomizerPath == "" || !File.Exists(appSettings.prime1RandomizerPath)) { @@ -384,192 +369,492 @@ private void button4_Click(object sender, EventArgs e) return; } - if (comboBox1.SelectedIndex == -1) + if (output_type_combo_box.SelectedIndex == -1) { MessageBox.Show("Select an output type to save the iso in that format!"); return; } - if (this.textBox1.Text == "") + if (output_path_txt_box.Text == "") { - MessageBox.Show("Select a folder to save the "+ comboBox1.SelectedItem + " file !"); + MessageBox.Show("Select a folder to save the "+ output_type_combo_box.SelectedItem + " file !"); return; } - Config.PatchSettings patchSettingsBak = new Config.PatchSettings(); - new Config.PatchSettings((curDir + @"\gc_template.iso").Replace("\\", "\\\\"), (curDir + @"\tmp").Replace("\\", "\\\\")).SaveToJson(); + isLoading = true; - SetProgressStatus(0, 5); - SetStatus("Running BashPrime's Randomizer..."); - if (!RandomizerManager.Run(appSettings.prime1RandomizerPath)) + FormUtils.RunAsynchrousTask(new Action(() => { - MessageBox.Show("BashPrime's Randomizer hasn't properly exited! Cancelling..."); + FormUtils.SetControlText(this.randomize_btn, "Cancel"); + Config.PatchSettings patchSettingsBak = new Config.PatchSettings(); + new Config.PatchSettings((curDir + @"\gc_template.iso").Replace("\\", "\\\\"), (curDir + @"\tmp").Replace("\\", "\\\\")).SaveToJson(); + + FormUtils.SetProgressStatus(0, 5); + FormUtils.SetStatus("Running BashPrime's Randomizer..."); + if (!ProcessUtils.Run(appSettings.prime1RandomizerPath)) + { + MessageBox.Show("BashPrime's Randomizer hasn't properly exited! Cancelling..."); + patchSettingsBak.SaveToJson(); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.randomize_btn, "Randomize"); + isLoading = false; + return; + } + patchSettingsBak.SaveToJson(); - SetProgressStatus(5, 5); - SetStatus("Idle"); + + if (Directory.EnumerateFiles(".\\tmp", "*.iso").Count() == 0) + { + MessageBox.Show("No Randomized ISO generated! Cancelling..."); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.randomize_btn, "Randomize"); + isLoading = false; + return; + } + int i = 0; + String[] gc_iso_files = Directory.EnumerateFiles(".\\tmp", "*.iso").ToArray(); + foreach (var gc_iso_file in gc_iso_files) + { + gc_iso_filename = Path.GetFileName(gc_iso_file); + spoiler_filename = Path.ChangeExtension(gc_iso_filename, ".json").Replace(".json", " - Spoiler.json"); + + FormUtils.SetProgressStatus(1, 5); + FormUtils.SetStatus("Extracting randomized ISO...", i, gc_iso_files.Length); + + if (!ISOUtils.NOD.ExtractISO(".\\tmp\\" + gc_iso_filename, true)) + { + FormUtils.ShowMessageBox("Failed extracting randomized iso!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.randomize_btn, "Randomize"); + isLoading = false; + return; + } + + File.Delete(".\\tmp\\" + gc_iso_filename); + + var randomizerSettings = new Config.RandomizerSettings(".\\tmp\\gc\\files\\randomprime.txt"); + + FormUtils.SetProgressStatus(2, 5); + FormUtils.SetStatus("Replacing original PAKs with randomized PAKs...", i, gc_iso_files.Length); + + Pak_Path = ".\\tmp\\wii\\DATA\\files\\MP1"; + if (GameID.Substring(2, 2) == "IJ") + Pak_Path += "JPN"; + + File.Copy(".\\tmp\\dol_backup\\rs5fe_p.dol", ".\\tmp\\wii\\DATA\\sys\\main.dol", true); + File.Copy(".\\tmp\\dol_backup\\rs5fe_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5fe_p.dol", true); + if (GameID[3] == 'J') + File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5mp1jpn_p.dol", true); + else + File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5mp1_p.dol", true); + + foreach (var file in Directory.EnumerateFiles(".\\tmp\\gc\\files", "Metroid*.pak", SearchOption.TopDirectoryOnly)) + File.Copy(file, Pak_Path + "\\" + Path.GetFileName(file), true); + + File.Copy(".\\tmp\\gc\\files\\Tweaks.pak", Pak_Path + "\\Tweaks.pak", true); + File.Copy(".\\tmp\\gc\\files\\NoARAM.pak", Pak_Path + "\\NoARAM.pak", true); + File.Copy(".\\tmp\\gc\\files\\randomprime.txt", ".\\tmp\\wii\\DATA\\files\\randomprime.txt", true); + + Directory.Delete(".\\tmp\\gc", true); + + FormUtils.SetProgressStatus(3, 5); + FormUtils.SetStatus("Applying patches to MP1 executable...", i, gc_iso_files.Length); + + PatchedGameID = GameID.Substring(0, 4) + DiscUtils.RandomizeDeveloperCode(); + + /* Applying patches to dol file */ + + Patcher.Patcher.Init(PatchedGameID[3]); + + if (randomizerSettings.skipFrigate) + { + if (randomizerSettings.spawnRoom == null) + { + FormUtils.ShowMessageBox("No spawn room defined!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.SetControlText(this.randomize_btn, "Randomize"); + isLoading = false; + return; + } + Patcher.Patcher.SetStartingArea(randomizerSettings.spawnRoom); + } + + //new DOL_AddSection_Patch(Patches.MP1_Dol_Path, DOL_AddSection_Patch.SectionType.TEXT, 0x80001800, 0x800).Apply(); + + //Patches.DisableHintSystem(true); + Patcher.Patcher.ApplySkipCutscenePatch(); + Patcher.Patcher.ApplyHeatProtectionPatch(randomizerSettings.heatProtection); + Patcher.Patcher.ApplySuitDamageReductionPatch(randomizerSettings.suitDamageReduction); + Patcher.Patcher.ApplyScanDashPatch(); + Patcher.Patcher.ApplyUnderwaterSlopeJumpFixPatch(true); + Patcher.Patcher.SetSaveFilename(PatchedGameID.Substring(4, 2) + ".bin"); + //Patches.ApplyInputPatch(); + + /* */ + + FormUtils.SetProgressStatus(4, 5); + FormUtils.SetStatus("Packing Metroid Prime Wii to " + ((String)output_type_combo_box.SelectedItem).Substring(1).ToUpper() + " format...", i, gc_iso_files.Length); + // WIT doesn't like complex paths so make the image in tmp folder then move back to the output folder + if (((String)output_type_combo_box.SelectedItem).ToLower().EndsWith(".ciso")) + { + ISOUtils.WIT.CreateCompressISO(".\\tmp\\mpt.ciso", false, PatchedGameID); + if (File.Exists(GameSettingsDolphinEmuPath + GameID + ".ini") && !File.Exists(GameSettingsDolphinEmuPath + PatchedGameID + ".ini")) + File.Copy(GameSettingsDolphinEmuPath + GameID + ".ini", GameSettingsDolphinEmuPath + PatchedGameID + ".ini"); + } + else if (((String)output_type_combo_box.SelectedItem).ToLower().EndsWith(".wbfs")) + ISOUtils.WIT.CreateWBFS(".\\tmp\\mpt.wbfs", PatchedGameID); + + if (File.Exists(this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)output_type_combo_box.SelectedItem)) + File.Delete(this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)output_type_combo_box.SelectedItem); + if ((String)output_type_combo_box.SelectedItem == ".wbfs") + new_wii_iso_path = this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + "[" + PatchedGameID + "]\\" + PatchedGameID + ".wbfs"; + else + new_wii_iso_path = this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)output_type_combo_box.SelectedItem; + + if (!Directory.Exists(Path.GetDirectoryName(new_wii_iso_path))) + Directory.CreateDirectory(Path.GetDirectoryName(new_wii_iso_path)); + + File.Move(".\\tmp\\mpt" + (String)output_type_combo_box.SelectedItem, new_wii_iso_path); + + if (File.Exists(".\\tmp" + spoiler_filename)) + { + if (File.Exists(Path.GetDirectoryName(new_wii_iso_path) + "\\" + spoiler_filename)) + File.Delete(Path.GetDirectoryName(new_wii_iso_path) + "\\" + spoiler_filename); + File.Move(".\\tmp\\" + spoiler_filename, Path.GetDirectoryName(new_wii_iso_path) + "\\" + spoiler_filename); + } + i++; + } + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.ShowMessageBox(gc_iso_files.Length + " ISO" + (gc_iso_files.Length > 1 ? "s have" : " has") + " been randomized! Have fun!"); + FormUtils.SetControlText(this.randomize_btn, "Randomize"); + isLoading = false; + })); + } + + private void input_json_btn_click(object sender, EventArgs e) + { + using (var openFileDialog = new OpenFileDialog()) + { + openFileDialog.Filter = "JSON File|*.json"; + openFileDialog.FileName = ""; + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + this.input_json_txt_box.Text = openFileDialog.FileName; + appSettings.prime1PlandomizerLastJsonPath = openFileDialog.FileName; + appSettings.SaveToJson(); + } + } + } + + private void locate_plandomizer_btn_Click(object sender, EventArgs e) + { + using (var openFileDialog = new OpenFileDialog()) + { + var dialogResult = default(DialogResult); + + openFileDialog.Title = "Select the executable of toasterparty's Plandomizer"; + openFileDialog.Filter = "EXE File|*.exe"; + openFileDialog.FileName = ""; + openFileDialog.InitialDirectory = Directory.GetCurrentDirectory(); + while (!openFileDialog.FileName.ToLower().EndsWith(".exe")) + { + dialogResult = openFileDialog.ShowDialog(); + if (dialogResult == DialogResult.OK) + { + if (!openFileDialog.FileName.ToLower().EndsWith(".exe")) + { + openFileDialog.FileName = ""; + MessageBox.Show("Invalid selection!"); + continue; + } + appSettings.prime1PlandomizerPath = openFileDialog.FileName; + appSettings.SaveToJson(); + this.plandomizer_lbl.Text = "toasterparty's Plandomizer found!"; + } + if (dialogResult == DialogResult.Cancel) + { + if (!appSettings.prime1RandomizerPath.EndsWith(".exe")) + this.plandomizer_lbl.Text = "toasterparty's Plandomizer not found! (Recommended version : 1.6)"; + return; + } + } + } + } + + private void plandomize_btn_Click(object sender, EventArgs e) + { + var new_wii_iso_path = default(String); + var gc_iso_filename = default(String); + var GameID = default(String); + var PatchedGameID = default(String); + var Pak_Path = default(String); + + String GameSettingsDolphinEmuPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Path.DirectorySeparatorChar + "Dolphin Emulator" + Path.DirectorySeparatorChar + "GameSettings" + Path.DirectorySeparatorChar; + String curDir = Directory.GetCurrentDirectory(); + String json_file_path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Temp\world_layout.json"; + + if (isLoading && ((Button)sender).Text == "Cancel") + { + ProcessUtils.KillChildrenProcesses(Process.GetCurrentProcess().Id); + if (Directory.Exists(@".\tmp\gc")) + Directory.Delete(@".\tmp\gc", true); + FormUtils.ShowMessageBox("Cancelled plandomization!"); + FormUtils.SetControlText(this.plandomize_btn, "Plandomize"); + isLoading = false; return; } - patchSettingsBak.SaveToJson(); + if (!IsTemplateISOGenerated()) + { + MessageBox.Show("Please click on \"Generate a template ISO for toasterparty's Plandomizer\" before attempting to plandomize!"); + return; + } + + if (!DiscUtils.IsMetroidPrimeTrilogyNTSC_UOrPAL("gc_template.iso") && !DiscUtils.IsMetroidPrimeWiiNTSC_J("gc_template.iso")) + return; - if(Directory.EnumerateFiles(".\\tmp", "*.iso").Count() == 0) + GameID = DiscUtils.GetGameID("gc_template.iso"); + + if (appSettings.prime1PlandomizerPath == "" || !File.Exists(appSettings.prime1PlandomizerPath)) { - MessageBox.Show("No Randomized ISO generated! Cancelling..."); - SetProgressStatus(5, 5); - SetStatus("Idle"); + MessageBox.Show("Please click on \"Locate toasterparty's Plandomizer\" before attempting to plandomize!"); return; } - int i = 0; - String[] gc_iso_files = Directory.EnumerateFiles(".\\tmp", "*.iso").ToArray(); - foreach (var gc_iso_file in gc_iso_files) + + if (appSettings.prime1PlandomizerLastJsonPath == "" || !File.Exists(appSettings.prime1PlandomizerLastJsonPath)) { - gc_iso_filename = Path.GetFileName(gc_iso_file); - spoiler_filename = Path.ChangeExtension(gc_iso_filename, ".json").Replace(".json", " - Spoiler.json"); + MessageBox.Show("Please select a valid plando json file!"); + return; + } - SetProgressStatus(1, 5); - SetStatus("Extracting randomized ISO...", i, gc_iso_files.Length); + if (output_type_combo_box.SelectedIndex == -1) + { + MessageBox.Show("Select an output type to save the iso in that format!"); + return; + } - if (!NodManager.ExtractISO(".\\tmp\\" + gc_iso_filename, true)) + if (output_path_txt_box.Text == "") + { + MessageBox.Show("Select a folder to save the " + output_type_combo_box.SelectedItem + " file !"); + return; + } + + isLoading = true; + + FormUtils.RunAsynchrousTask(new Action(() => + { + FormUtils.SetControlText(this.plandomize_btn, "Cancel"); + dynamic json = JObject.Parse(File.ReadAllText(appSettings.prime1PlandomizerLastJsonPath)); + json.input_iso = Path.GetDirectoryName(Application.ExecutablePath) + @"\gc_template.iso"; + json.output_iso = Path.GetDirectoryName(Application.ExecutablePath) + @"\tmp\" + json.output_iso; + File.WriteAllText(json_file_path, JsonConvert.SerializeObject(json, Formatting.Indented)); + FormUtils.SetProgressStatus(0, 5); + FormUtils.SetStatus("Running toasterparty's Plandomizer..."); + if (!ProcessUtils.Run(appSettings.prime1PlandomizerPath, "--profile", "\"" + json_file_path + "\"")) { - MessageBox.Show("Failed extracting randomized iso!"); - SetProgressStatus(5, 5); - SetStatus("Idle"); + FormUtils.ShowMessageBox("toasterparty's Plandomizer hasn't properly exited! Cancelling..."); + File.Delete(json_file_path); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + isLoading = false; + FormUtils.SetControlText(this.plandomize_btn, "Plandomize"); return; } - File.Delete(".\\tmp\\" + gc_iso_filename); + File.Delete(json_file_path); - var randomizerSettings = new Config.RandomizerSettings(".\\tmp\\gc\\files\\randomprime.txt"); + if (Directory.EnumerateFiles(".\\tmp", "*.iso").Count() == 0) + { + FormUtils.ShowMessageBox("No Plandomized ISO generated! Cancelling..."); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + isLoading = false; + FormUtils.SetControlText(this.plandomize_btn, "Plandomize"); + return; + } - SetProgressStatus(2, 5); - SetStatus("Replacing original PAKs with randomized PAKs...", i, gc_iso_files.Length); + int i = 0; + String[] gc_iso_files = Directory.EnumerateFiles(".\\tmp", "*.iso").ToArray(); + foreach (var gc_iso_file in gc_iso_files) + { + gc_iso_filename = Path.GetFileName(gc_iso_file); - Pak_Path = ".\\tmp\\wii\\DATA\\files\\MP1"; - if (GameID.Substring(2, 2) == "IJ") - Pak_Path += "JPN"; + FormUtils.SetProgressStatus(1, 5); + FormUtils.SetStatus("Extracting plandomized ISO...", i, gc_iso_files.Length); - File.Copy(".\\tmp\\dol_backup\\rs5fe_p.dol", ".\\tmp\\wii\\DATA\\sys\\main.dol", true); - File.Copy(".\\tmp\\dol_backup\\rs5fe_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5fe_p.dol", true); - if(GameID[3] == 'J') - File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5mp1jpn_p.dol", true); - else - File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5mp1_p.dol", true); + if (!ISOUtils.NOD.ExtractISO(".\\tmp\\" + gc_iso_filename, true)) + { + FormUtils.ShowMessageBox("Failed extracting plandomized iso!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + isLoading = false; + FormUtils.SetControlText(this.plandomize_btn, "Plandomize"); + return; + } - foreach (var file in Directory.EnumerateFiles(".\\tmp\\gc\\files", "Metroid*.pak", SearchOption.TopDirectoryOnly)) - File.Copy(file, Pak_Path + "\\" + Path.GetFileName(file), true); + File.Delete(".\\tmp\\" + gc_iso_filename); - File.Copy(".\\tmp\\gc\\files\\NoARAM.pak", Pak_Path + "\\NoARAM.pak", true); - File.Copy(".\\tmp\\gc\\files\\randomprime.txt", ".\\tmp\\wii\\DATA\\files\\randomprime.txt", true); + var randomizerSettings = new Config.RandomizerSettings(".\\tmp\\gc\\files\\randomprime.txt"); - Directory.Delete(".\\tmp\\gc", true); + FormUtils.SetProgressStatus(2, 5); + FormUtils.SetStatus("Replacing original PAKs with plandomized PAKs...", i, gc_iso_files.Length); - SetProgressStatus(3, 5); - SetStatus("Applying patches to MP1 executable...", i, gc_iso_files.Length); + Pak_Path = ".\\tmp\\wii\\DATA\\files\\MP1"; + if (GameID.Substring(2, 2) == "IJ") + Pak_Path += "JPN"; - PatchedGameID = GameID.Substring(0, 4) + RandomizeDeveloperCode(); + File.Copy(".\\tmp\\dol_backup\\rs5fe_p.dol", ".\\tmp\\wii\\DATA\\sys\\main.dol", true); + File.Copy(".\\tmp\\dol_backup\\rs5fe_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5fe_p.dol", true); + if (GameID[3] == 'J') + File.Copy(".\\tmp\\dol_backup\\rs5mp1jpn_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5mp1jpn_p.dol", true); + else + File.Copy(".\\tmp\\dol_backup\\rs5mp1_p.dol", ".\\tmp\\wii\\DATA\\files\\rs5mp1_p.dol", true); - /* Applying patches to dol file */ + foreach (var file in Directory.EnumerateFiles(".\\tmp\\gc\\files", "Metroid*.pak", SearchOption.TopDirectoryOnly)) + File.Copy(file, Pak_Path + "\\" + Path.GetFileName(file), true); - Patcher.Patcher.Init(PatchedGameID[3]); + File.Copy(".\\tmp\\gc\\files\\NoARAM.pak", Pak_Path + "\\NoARAM.pak", true); + File.Copy(".\\tmp\\gc\\files\\randomprime.txt", ".\\tmp\\wii\\DATA\\files\\randomprime.txt", true); - if (randomizerSettings.skipFrigate) - { - if (randomizerSettings.spawnRoom == null) - { - MessageBox.Show("No spawn room defined!"); - SetProgressStatus(5, 5); - SetStatus("Idle"); - return; - } - Patcher.Patcher.SetStartingArea(randomizerSettings.spawnRoom); - } + Directory.Delete(".\\tmp\\gc", true); - //new DOL_AddSection_Patch(Patches.MP1_Dol_Path, DOL_AddSection_Patch.SectionType.TEXT, 0x80001800, 0x800).Apply(); + FormUtils.SetProgressStatus(3, 5); + FormUtils.SetStatus("Applying patches to MP1 executable...", i, gc_iso_files.Length); - //Patches.DisableHintSystem(true); - Patcher.Patcher.ApplySkipCutscenePatch(); - Patcher.Patcher.ApplyHeatProtectionPatch(randomizerSettings.heatProtection); - Patcher.Patcher.ApplySuitDamageReductionPatch(randomizerSettings.suitDamageReduction); - Patcher.Patcher.ApplyScanDashPatch(); - Patcher.Patcher.ApplyUnderwaterSlopeJumpFixPatch(true); - Patcher.Patcher.SetSaveFilename(PatchedGameID.Substring(4, 2) + ".bin"); - //Patches.ApplyInputPatch(); + PatchedGameID = GameID.Substring(0, 4) + DiscUtils.RandomizeDeveloperCode(); - /* */ + /* Applying patches to dol file */ - SetProgressStatus(4, 5); - SetStatus("Packing Metroid Prime Wii to " + ((String)comboBox1.SelectedItem).Substring(1).ToUpper() + " format...", i, gc_iso_files.Length); - // WIT doesn't like complex paths so make the image in tmp folder then move back to the output folder - if (((String)comboBox1.SelectedItem).ToLower().EndsWith(".ciso")) - { - WITManager.CreateCompressISO(".\\tmp\\mpt.ciso", false, PatchedGameID); - if (File.Exists(GameSettingsDolphinEmuPath + GameID + ".ini") && !File.Exists(GameSettingsDolphinEmuPath + PatchedGameID + ".ini")) - File.Copy(GameSettingsDolphinEmuPath + GameID + ".ini", GameSettingsDolphinEmuPath + PatchedGameID + ".ini"); - } - else if (((String)comboBox1.SelectedItem).ToLower().EndsWith(".wbfs")) - WITManager.CreateWBFS(".\\tmp\\mpt.wbfs", PatchedGameID); + Patcher.Patcher.Init(PatchedGameID[3]); + try + { + SpawnRoom spawnRoom = SpawnRoom.plandomizerValues[json.new_save_spawn_room]; + if (spawnRoom == null) + { + FormUtils.ShowMessageBox("Spawn room defined!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + isLoading = false; + FormUtils.SetControlText(this.plandomize_btn, "Plandomize"); + return; + } + Patcher.Patcher.SetStartingArea(spawnRoom); + } + catch + { + if (json.patchSettings.skip_frigate) + Patcher.Patcher.SetStartingArea(SpawnRoom.plandomizerValues["Tallon:Landing Site"]); + } - if (File.Exists(this.textBox1.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)comboBox1.SelectedItem)) - File.Delete(this.textBox1.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)comboBox1.SelectedItem); - if ((String)comboBox1.SelectedItem == ".wbfs") - new_wii_iso_path = this.textBox1.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + "["+ PatchedGameID + "]\\" + PatchedGameID + ".wbfs"; - else - new_wii_iso_path = this.textBox1.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)comboBox1.SelectedItem; + Patcher.Patcher.ApplySkipCutscenePatch(); + Patcher.Patcher.ApplyHeatProtectionPatch(json.patchSettings.varia_heat_protection); + Patcher.Patcher.ApplySuitDamageReductionPatch(json.patchSettings.stagger_suit_damage); + Patcher.Patcher.ApplyScanDashPatch(); + Patcher.Patcher.ApplyUnderwaterSlopeJumpFixPatch(true); + Patcher.Patcher.SetSaveFilename(PatchedGameID.Substring(4, 2) + ".bin"); + if (disable_spring_ball_check_box.Checked) + Patcher.Patcher.ApplyDisableSpringBallPatch(); + + /* */ + + FormUtils.SetProgressStatus(4, 5); + FormUtils.SetStatus("Packing Metroid Prime Wii to " + ((String)output_type_combo_box.SelectedItem).Substring(1).ToUpper() + " format...", i, gc_iso_files.Length); + // WIT doesn't like complex paths so make the image in tmp folder then move back to the output folder + if (((String)output_type_combo_box.SelectedItem).ToLower().EndsWith(".ciso")) + { + ISOUtils.WIT.CreateCompressISO(".\\tmp\\mpt.ciso", false, PatchedGameID); + if (File.Exists(GameSettingsDolphinEmuPath + GameID + ".ini") && !File.Exists(GameSettingsDolphinEmuPath + PatchedGameID + ".ini")) + File.Copy(GameSettingsDolphinEmuPath + GameID + ".ini", GameSettingsDolphinEmuPath + PatchedGameID + ".ini"); + } + else if (((String)output_type_combo_box.SelectedItem).ToLower().EndsWith(".wbfs")) + ISOUtils.WIT.CreateWBFS(".\\tmp\\mpt.wbfs", PatchedGameID); - if (!Directory.Exists(Path.GetDirectoryName(new_wii_iso_path))) - Directory.CreateDirectory(Path.GetDirectoryName(new_wii_iso_path)); + if (File.Exists(this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)output_type_combo_box.SelectedItem)) + File.Delete(this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)output_type_combo_box.SelectedItem); + if ((String)output_type_combo_box.SelectedItem == ".wbfs") + new_wii_iso_path = this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + "[" + PatchedGameID + "]\\" + PatchedGameID + ".wbfs"; + else + new_wii_iso_path = this.output_path_txt_box.Text + "\\" + Path.GetFileNameWithoutExtension(gc_iso_filename) + (String)output_type_combo_box.SelectedItem; - File.Move(".\\tmp\\mpt" + (String)comboBox1.SelectedItem, new_wii_iso_path); + if (!Directory.Exists(Path.GetDirectoryName(new_wii_iso_path))) + Directory.CreateDirectory(Path.GetDirectoryName(new_wii_iso_path)); - if (File.Exists(".\\tmp" + spoiler_filename)) - { - if (File.Exists(Path.GetDirectoryName(new_wii_iso_path) + "\\" + spoiler_filename)) - File.Delete(Path.GetDirectoryName(new_wii_iso_path) + "\\" + spoiler_filename); - File.Move(".\\tmp\\" + spoiler_filename, Path.GetDirectoryName(new_wii_iso_path) + "\\" + spoiler_filename); + File.Move(".\\tmp\\mpt" + (String)output_type_combo_box.SelectedItem, new_wii_iso_path); + i++; } - i++; - } - SetProgressStatus(5, 5); - SetStatus("Idle"); - MessageBox.Show(gc_iso_files.Length + " ISO"+(gc_iso_files.Length > 1 ? "s have" :" has") +" been randomized! Have fun!"); + FormUtils.SetProgressStatus(5, 5); + FormUtils.SetStatus("Idle"); + FormUtils.ShowMessageBox(gc_iso_files.Length + " ISO" + (gc_iso_files.Length > 1 ? "s have" : " has") + " been plandomized! Have fun!"); + FormUtils.SetControlText(this.plandomize_btn, "Plandomize"); + isLoading = false; + })); } - private void button5_Click(object sender, EventArgs e) + private void output_path_btn_click(object sender, EventArgs e) { using (var folderBrowserDialog = new FolderBrowserDialog()) { if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { - this.textBox1.Text = folderBrowserDialog.SelectedPath; + this.output_path_txt_box.Text = folderBrowserDialog.SelectedPath; appSettings.outputPath = folderBrowserDialog.SelectedPath; appSettings.SaveToJson(); } } } - private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) + private void output_type_combo_box_selected_index_changed(object sender, EventArgs e) { - if (comboBox1.SelectedIndex != -1) + if (output_type_combo_box.SelectedIndex != -1) { - appSettings.outputType = (String)comboBox1.SelectedItem; + appSettings.outputType = (String)output_type_combo_box.SelectedItem; appSettings.SaveToJson(); } } - private void helpBtn_Click(object sender, CancelEventArgs e) + private void form_closing(object sender, FormClosingEventArgs e) { - try { + // Closing any nod or wit application running + ProcessUtils.KillChildrenProcesses(Process.GetCurrentProcess().Id); + } + + private void form1_MouseDown(object sender, MouseEventArgs e) + { + FormUtils.SendClickToCaption(); + } + + private void help_btn_click(object sender, EventArgs e) + { + try + { new HelpForm().ShowDialog(); - } catch { + } + catch + { MessageBox.Show("No wiki files found! Connect to internet to download the wiki files!"); } - e.Cancel = true; } - private void formClosing(object sender, FormClosingEventArgs e) + private void close_btn_click(object sender, EventArgs e) { - // Closing any nod or wit application running - ProcessUtils.KillChildrenProcesses(Process.GetCurrentProcess().Id); + FormUtils.SafeClose(); + } + + private void tab_bar_btn_click(object sender, EventArgs e) + { + if (((Button)sender).Text == "Template ISO") + FormUtils.SwitchTab(0); + if (((Button)sender).Text == "Randomizer") + FormUtils.SwitchTab(1); + if (((Button)sender).Text == "Plandomizer") + FormUtils.SwitchTab(2); + if (((Button)sender).Text == "Settings") + FormUtils.SwitchTab(3); } } } diff --git a/MP1_Trilogy_Rando_Generator/Forms/Control/TabControlNoHeader.cs b/MP1_Trilogy_Rando_Generator/Forms/Control/TabControlNoHeader.cs new file mode 100644 index 0000000..718cf2d --- /dev/null +++ b/MP1_Trilogy_Rando_Generator/Forms/Control/TabControlNoHeader.cs @@ -0,0 +1,18 @@ +namespace System.Windows.Forms +{ + public partial class TabControlNoHeader : TabControl + { + public TabControlNoHeader() + { + if (!this.DesignMode) this.Multiline = true; + } + + protected override void WndProc(ref Message m) + { + if (m.Msg == 0x1328 && !this.DesignMode) + m.Result = new IntPtr(1); + else + base.WndProc(ref m); + } + } +} diff --git a/MP1_Trilogy_Rando_Generator/WebClientPlus.cs b/MP1_Trilogy_Rando_Generator/Forms/Control/WebClientPlus.cs similarity index 100% rename from MP1_Trilogy_Rando_Generator/WebClientPlus.cs rename to MP1_Trilogy_Rando_Generator/Forms/Control/WebClientPlus.cs diff --git a/MP1_Trilogy_Rando_Generator/HelpForm.Designer.cs b/MP1_Trilogy_Rando_Generator/HelpForm.Designer.cs index 848fffb..05244c5 100644 --- a/MP1_Trilogy_Rando_Generator/HelpForm.Designer.cs +++ b/MP1_Trilogy_Rando_Generator/HelpForm.Designer.cs @@ -28,34 +28,106 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + this.main_table_layout = new System.Windows.Forms.TableLayoutPanel(); this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.title_bar_table_layout = new System.Windows.Forms.TableLayoutPanel(); + this.title_lbl = new DarkUI.Controls.DarkLabel(); + this.close_btn = new System.Windows.Forms.Button(); + this.main_table_layout.SuspendLayout(); + this.title_bar_table_layout.SuspendLayout(); this.SuspendLayout(); // + // main_table_layout + // + this.main_table_layout.ColumnCount = 1; + this.main_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.main_table_layout.Controls.Add(this.webBrowser1, 0, 1); + this.main_table_layout.Controls.Add(this.title_bar_table_layout, 0, 0); + this.main_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.main_table_layout.Location = new System.Drawing.Point(0, 0); + this.main_table_layout.Name = "main_table_layout"; + this.main_table_layout.RowCount = 2; + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.main_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.main_table_layout.Size = new System.Drawing.Size(1008, 729); + this.main_table_layout.TabIndex = 0; + // // webBrowser1 // this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; - this.webBrowser1.Location = new System.Drawing.Point(0, 0); + this.webBrowser1.Location = new System.Drawing.Point(3, 35); this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser1.Name = "webBrowser1"; - this.webBrowser1.Size = new System.Drawing.Size(1008, 729); - this.webBrowser1.TabIndex = 0; - this.webBrowser1.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.NewURL); + this.webBrowser1.Size = new System.Drawing.Size(1002, 691); + this.webBrowser1.TabIndex = 5; + // + // title_bar_table_layout + // + this.title_bar_table_layout.ColumnCount = 2; + this.title_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.title_bar_table_layout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.title_bar_table_layout.Controls.Add(this.close_btn, 0, 0); + this.title_bar_table_layout.Controls.Add(this.title_lbl, 0, 0); + this.title_bar_table_layout.Dock = System.Windows.Forms.DockStyle.Fill; + this.title_bar_table_layout.Location = new System.Drawing.Point(0, 0); + this.title_bar_table_layout.Margin = new System.Windows.Forms.Padding(0); + this.title_bar_table_layout.Name = "title_bar_table_layout"; + this.title_bar_table_layout.RowCount = 1; + this.title_bar_table_layout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.title_bar_table_layout.Size = new System.Drawing.Size(1008, 32); + this.title_bar_table_layout.TabIndex = 6; + // + // title_lbl + // + this.title_lbl.AutoSize = true; + this.title_lbl.Dock = System.Windows.Forms.DockStyle.Fill; + this.title_lbl.Font = new System.Drawing.Font("Impact", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.title_lbl.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.title_lbl.Location = new System.Drawing.Point(3, 0); + this.title_lbl.Name = "title_lbl"; + this.title_lbl.Size = new System.Drawing.Size(970, 32); + this.title_lbl.TabIndex = 5; + this.title_lbl.Text = "MP1 Trilogy Rando Generator v2.0 - Help"; + this.title_lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // close_btn + // + this.close_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.close_btn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.close_btn.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.close_btn.Location = new System.Drawing.Point(979, 3); + this.close_btn.Name = "close_btn"; + this.close_btn.Size = new System.Drawing.Size(26, 26); + this.close_btn.TabIndex = 6; + this.close_btn.Text = "X"; + this.close_btn.UseVisualStyleBackColor = false; + this.close_btn.Click += new System.EventHandler(this.close_btn_Click); // // HelpForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1008, 729); - this.Controls.Add(this.webBrowser1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Controls.Add(this.main_table_layout); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "HelpForm"; this.Text = "Help"; + this.main_table_layout.ResumeLayout(false); + this.title_bar_table_layout.ResumeLayout(false); + this.title_bar_table_layout.PerformLayout(); this.ResumeLayout(false); } #endregion + private System.Windows.Forms.TableLayoutPanel main_table_layout; private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.TableLayoutPanel title_bar_table_layout; + private DarkUI.Controls.DarkLabel title_lbl; + private System.Windows.Forms.Button close_btn; } } \ No newline at end of file diff --git a/MP1_Trilogy_Rando_Generator/HelpForm.cs b/MP1_Trilogy_Rando_Generator/HelpForm.cs index 00765d6..cbd2ec6 100644 --- a/MP1_Trilogy_Rando_Generator/HelpForm.cs +++ b/MP1_Trilogy_Rando_Generator/HelpForm.cs @@ -1,11 +1,12 @@ -using System; +using DarkUI.Forms; +using System; using System.IO; using System.Net; using System.Windows.Forms; namespace MP1_Trilogy_Rando_Generator { - public partial class HelpForm : Form + public partial class HelpForm : DarkForm { bool IsConnectedToInternet() { @@ -37,5 +38,10 @@ public HelpForm() private void NewURL(object sender, WebBrowserNavigatedEventArgs e) { } + + private void close_btn_Click(object sender, EventArgs e) + { + this.Close(); + } } } diff --git a/MP1_Trilogy_Rando_Generator/MP1_Trilogy_Rando_Generator.csproj b/MP1_Trilogy_Rando_Generator/MP1_Trilogy_Rando_Generator.csproj index 0ac91b3..1e9037f 100644 --- a/MP1_Trilogy_Rando_Generator/MP1_Trilogy_Rando_Generator.csproj +++ b/MP1_Trilogy_Rando_Generator/MP1_Trilogy_Rando_Generator.csproj @@ -33,6 +33,12 @@ 4 + + ..\packages\DarkUI.2.0.2\lib\DarkUI.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + refs\NKit.dll @@ -69,31 +75,33 @@ Form1.cs + + Component + + + Component + Form HelpForm.cs - + + + - - Component - - - - Form1.cs @@ -128,9 +136,7 @@ - - - + diff --git a/MP1_Trilogy_Rando_Generator/NKitManager.cs b/MP1_Trilogy_Rando_Generator/NKitManager.cs deleted file mode 100644 index d916a13..0000000 --- a/MP1_Trilogy_Rando_Generator/NKitManager.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Nanook.NKit; -using System.IO; -using System.Text.RegularExpressions; - -namespace MP1_Trilogy_Rando_Generator -{ - class NKitManager - { - static bool IsValidFilename(string value) - { - return Regex.IsMatch(value, @"^[\w\-. ]+$"); - } - - public static bool ExtractISO(string filename) - { - bool result = true; - if (!Directory.Exists(@".\tmp\nkit")) - Directory.CreateDirectory(@".\tmp\nkit"); - try - { - using(var ndisc = new NDisc(null, File.OpenRead(filename))) - { - if (ndisc == null) - throw new System.Exception(); - if (ndisc.ExtractBasicInfo().Id.Substring(0, 6) != "R3ME01" && - ndisc.ExtractBasicInfo().Id.Substring(0, 6) != "R3MP01" && - ndisc.ExtractBasicInfo().Id.Substring(0, 6) != "R3IJ01") - throw new System.Exception(); - ndisc.ExtractFiles(ext_f => true, - (f, ext_f) => - { - var path = @".\tmp\nkit\DATA\" + (ext_f.PartitionId == null ? @"sys" : @"files"); - if (ext_f.Path != "") - path += @"\" + ext_f.Path; - if (!Directory.Exists(path)) - Directory.CreateDirectory(path); - using (var stream = File.OpenWrite(path + @"\" + ext_f.Name)) - f.Copy(stream, ext_f.Length); - }); - } - } - catch - { - result = false; - } - if (Directory.Exists(@".\Dats")) - Directory.Delete(@".\Dats", true); - if (Directory.Exists(@".\Processed")) - Directory.Delete(@".\Processed", true); - if (Directory.Exists(@".\Recovery")) - Directory.Delete(@".\Recovery", true); - if (!result) - Directory.Delete(@".\tmp\nkit", true); - return result; - } - } -} diff --git a/MP1_Trilogy_Rando_Generator/NodManager.cs b/MP1_Trilogy_Rando_Generator/NodManager.cs deleted file mode 100644 index 4cbdb10..0000000 --- a/MP1_Trilogy_Rando_Generator/NodManager.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Net; -using System.Text; - -namespace MP1_Trilogy_Rando_Generator -{ - class NodManager - { - - private const string NOD_PATH = @"nod\nod.exe"; - private const string NOD_EXE_URL = "https://github.com/AxioDL/nod/releases/download/v1.0/nodtool.v1.win64.exe"; - private const string NOD_LICENSE_URL = "https://raw.githubusercontent.com/AxioDL/nod/master/LICENSE"; - - public static bool Installed() - { - return File.Exists(NOD_PATH); - } - - public static bool Init() - { - try - { - if (Installed()) - return true; - using (var client = new WebClientPlus()) - { - if (!Directory.Exists(@".\nod")) - Directory.CreateDirectory(@".\nod"); - client.DownloadFile(NOD_EXE_URL, NOD_PATH); - client.DownloadFile(NOD_LICENSE_URL, @".\nod\LICENSE"); - return true; - } - } - catch - { - return false; - } - } - - public static bool ExtractISO(string filename, bool isGC_ISO) - { - if (!Directory.Exists(".\\tmp\\" + (isGC_ISO ? "gc" : "wii"))) - Directory.CreateDirectory(".\\tmp\\" + (isGC_ISO ? "gc" : "wii")); - try - { - ProcessStartInfo info = new ProcessStartInfo(NOD_PATH, "extract -f \"" + filename + "\" .\\tmp\\"+ (isGC_ISO?"gc":"wii")); - info.WorkingDirectory = Directory.GetCurrentDirectory(); - info.CreateNoWindow = true; - info.UseShellExecute = false; - Process proc = Process.Start(info); - proc.WaitForExit(); - return proc.ExitCode == 0; - } - catch - { - return false; - } - } - - static bool SetTitleID(String title_id, bool isGC_ISO) - { - var path = isGC_ISO ? "gc" : "wii\\DATA"; - try - { - if (title_id.Length > 6) - return false; - if (!isGC_ISO) - { - using (var file = File.OpenWrite(".\\tmp\\" + path + "\\disc\\header.bin")) - using (var writer = new BinaryWriter(file)) - { - writer.Write(Encoding.ASCII.GetBytes(title_id.ToCharArray(), 0, 6)); - } - } - using (var file = File.OpenWrite(".\\tmp\\" + path + "\\sys\\boot.bin")) - using (var writer = new BinaryWriter(file)) - { - writer.Write(Encoding.ASCII.GetBytes(title_id.ToCharArray(), 0, 6)); - if(title_id.StartsWith("R3M")) - writer.Write((short)0); - } - return true; - } - catch - { - return false; - } - } - - public static bool CreateISO(string filename, bool isGC_ISO, String title_id) - { - try - { - if (!SetTitleID(title_id, isGC_ISO)) - return false; - - ProcessStartInfo info = new ProcessStartInfo(NOD_PATH, (isGC_ISO?"makegcn .\\tmp\\gc":"makewii .\\tmp\\wii") + " \"" + filename+"\""); - info.WorkingDirectory = Directory.GetCurrentDirectory(); - info.CreateNoWindow = true; - info.UseShellExecute = false; - Process proc = Process.Start(info); - proc.WaitForExit(); - return proc.ExitCode == 0; - } - catch - { - return false; - } - } - } -} diff --git a/MP1_Trilogy_Rando_Generator/Program.cs b/MP1_Trilogy_Rando_Generator/Program.cs index 06cc2bd..761b8c6 100644 --- a/MP1_Trilogy_Rando_Generator/Program.cs +++ b/MP1_Trilogy_Rando_Generator/Program.cs @@ -16,7 +16,7 @@ static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new main_form()); } } } diff --git a/MP1_Trilogy_Rando_Generator/RandomizerManager.cs b/MP1_Trilogy_Rando_Generator/RandomizerManager.cs deleted file mode 100644 index f883c86..0000000 --- a/MP1_Trilogy_Rando_Generator/RandomizerManager.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; - -namespace MP1_Trilogy_Rando_Generator -{ - class RandomizerManager - { - public static bool Run(String path) - { - try - { - ProcessStartInfo info = new ProcessStartInfo(path); - info.WorkingDirectory = Directory.GetCurrentDirectory(); - Process proc = Process.Start(info); - proc.WaitForExit(); - return proc.ExitCode == 0; - } - catch - { - return false; - } - } - } -} \ No newline at end of file diff --git a/MP1_Trilogy_Rando_Generator/Utils/DiscUtils.cs b/MP1_Trilogy_Rando_Generator/Utils/DiscUtils.cs new file mode 100644 index 0000000..4263ea2 --- /dev/null +++ b/MP1_Trilogy_Rando_Generator/Utils/DiscUtils.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace MP1_Trilogy_Rando_Generator.Utils +{ + class DiscUtils + { + static Random rand = null; + static readonly List UsedDeveloperCodes = new List(); + internal static bool IsMetroidPrimeTrilogyNTSC_UOrPAL(string fileName) + { + String GameID = GetGameID(fileName); + if (GameID.Substring(0, 3) != "R3M") + return false; + return GameID[3] == 'E' || GameID[3] == 'P'; + } + + internal static bool IsMetroidPrimeWiiNTSC_J(string fileName) + { + String GameID = GetGameID(fileName); + return GameID.Substring(0, 3) == "R3I" && GameID[3] == 'J'; + } + + internal static String GetGameID(string fileName) + { + if (!File.Exists(fileName)) + return ""; + using (var bR = new BinaryReader(File.OpenRead(fileName))) + { + return Encoding.ASCII.GetString(bR.ReadBytes(6)); + } + } + + internal static String RandomizeDeveloperCode() + { + const String AllowedCharacters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int len = AllowedCharacters.Length; + String DeveloperCode = "01"; + if (rand == null) + { + rand = new Random((int)((DateTime.Now.Ticks / TimeSpan.TicksPerSecond))); + UsedDeveloperCodes.Clear(); + if (File.Exists("udc.bin")) + UsedDeveloperCodes.AddRange(File.ReadAllLines("udc.bin")); + } + while (DeveloperCode == "01" || UsedDeveloperCodes.Contains(DeveloperCode)) + DeveloperCode = "" + AllowedCharacters[rand.Next(len)] + AllowedCharacters[rand.Next(len)]; + UsedDeveloperCodes.Add(DeveloperCode); + File.WriteAllLines("udc.bin", UsedDeveloperCodes.ToArray()); + return DeveloperCode; + } + } +} diff --git a/MP1_Trilogy_Rando_Generator/Utils/FormUtils.cs b/MP1_Trilogy_Rando_Generator/Utils/FormUtils.cs new file mode 100644 index 0000000..70a0cb5 --- /dev/null +++ b/MP1_Trilogy_Rando_Generator/Utils/FormUtils.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Threading; +using System.Windows.Forms; + +namespace MP1_Trilogy_Rando_Generator +{ + class FormUtils + { + #region WinAPI Constants + private const int WM_NCLBUTTONDOWN = 0xA1; + private const int HT_CAPTION = 0x2; + #endregion + + #region WinAPI Imports + [System.Runtime.InteropServices.DllImport("user32.dll")] + private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); + [System.Runtime.InteropServices.DllImport("user32.dll")] + private static extern bool ReleaseCapture(); + #endregion + + static main_form Instance = null; + + internal static void Init(main_form form) + { + Instance = form; + } + + internal static void SendClickToCaption() + { + if (Instance == null) { + throw new Exception("Call FormUtils.Init() in your form constructor"); + } + ReleaseCapture(); + SendMessage(Instance.Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); + } + + internal static void SafeClose() + { + if (Instance == null) { + throw new Exception("Call FormUtils.Init() in your form constructor"); + } + + if (Instance.InvokeRequired) { + Instance.Invoke(new Action(() => SafeClose())); + } else { + Instance.Close(); + } + } + + internal static void SetProgressStatus(int cur, int max) + { + if (Instance.InvokeRequired) + { + Instance.Invoke(new Action(() => SetProgressStatus(cur, max))); + } + else + { + if (cur != max) + { + Instance.status_progress_bar.Visible = true; + Instance.status_progress_bar.Value = (cur * 100) / (max - 1); + } + else + { + Instance.status_progress_bar.Visible = false; + Instance.status_progress_bar.Value = 0; + } + Instance.status_progress_bar.Update(); + } + } + + internal static void SetStatus(String status, int cur = 0, int len = 0) + { + if (Instance.InvokeRequired) + { + Instance.Invoke(new Action(() => SetStatus(status, cur, len))); + } + else + { + Instance.status_lbl.Text = "Status : " + status; + if (len > 1) + Instance.status_lbl.Text += " (" + (cur + 1) + " / " + len + ")"; + Instance.status_lbl.Update(); + } + } + + internal static void SetControlText(Control control, String text) + { + if (Instance == null) + { + throw new Exception("Call FormUtils.Init() in your form constructor"); + } + + if (Instance.InvokeRequired) + { + Instance.Invoke(new Action(() => SetControlText(control, text))); + } + else + { + control.Text = text; + } + } + + internal static void SetControlEnabled(Control control, bool enabled) + { + if (Instance == null) + { + throw new Exception("Call FormUtils.Init() in your form constructor"); + } + + if (Instance.InvokeRequired) + { + Instance.Invoke(new Action(() => SetControlEnabled(control, enabled))); + } + else + { + control.Enabled = enabled; + } + } + + internal static void SwitchTab(int selected) + { + if (Instance == null) { + throw new Exception("Call FormUtils.Init() in your form constructor"); + } + + if (Instance.InvokeRequired) { + Instance.Invoke(new Action(() => SwitchTab(selected))); + } else { + if (!Instance.isLoading) + { + // Template tab selected + Instance.template_iso_btn.Enabled = selected != 0; + Instance.template_iso_btn.BackColor = selected == 0 ? Color.Gray : Color.FromArgb(60, 63, 65); + // Randomizer tab selected + Instance.randomizer_btn.Enabled = selected != 1; + Instance.randomizer_btn.BackColor = selected == 1 ? Color.Gray : Color.FromArgb(60, 63, 65); + // Plandomizer tab selected + Instance.plandomizer_btn.Enabled = selected != 2; + Instance.plandomizer_btn.BackColor = selected == 2 ? Color.Gray : Color.FromArgb(60, 63, 65); + // Settings tab selected + Instance.settings_btn.Enabled = selected != 3; + Instance.settings_btn.BackColor = selected == 3 ? Color.Gray : Color.FromArgb(60, 63, 65); + + Instance.tab_manager.SelectedIndex = selected; + Instance.tab_manager.Update(); + } + } + } + + internal static Thread RunAsynchrousTask(Action action) + { + Thread thread = new Thread(new ThreadStart(() => action.Invoke())); + thread.Start(); + return thread; + } + + internal static Thread RunRepeatingAsynchrousTask(Action action) + { + Thread thread = new Thread(new ParameterizedThreadStart((t) => { + while (((Thread)t).ThreadState != ThreadState.AbortRequested) { + action.Invoke(); + } + })); + thread.Start(thread); + return thread; + } + + internal static void ShowMessageBox(String message) + { + if (Instance == null) + { + throw new Exception("Call FormUtils.Init() in your form constructor"); + } + + if (Instance.InvokeRequired) + Instance.Invoke(new Action(() => MessageBox.Show(message))); + } + } +} diff --git a/MP1_Trilogy_Rando_Generator/Utils/ISOUtils.cs b/MP1_Trilogy_Rando_Generator/Utils/ISOUtils.cs new file mode 100644 index 0000000..cc7c221 --- /dev/null +++ b/MP1_Trilogy_Rando_Generator/Utils/ISOUtils.cs @@ -0,0 +1,237 @@ +using Nanook.NKit; +using System; +using System.Diagnostics; +using System.IO; +using System.IO.Compression; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; + +namespace MP1_Trilogy_Rando_Generator.Utils +{ + class ISOUtils + { + internal class NKIT + { + static bool IsValidFilename(string value) + { + return Regex.IsMatch(value, @"^[\w\-. ]+$"); + } + + public static bool ExtractISO(string filename) + { + bool result = true; + if (!Directory.Exists(@".\tmp\nkit")) + Directory.CreateDirectory(@".\tmp\nkit"); + try + { + using (var ndisc = new NDisc(null, File.OpenRead(filename))) + { + if (ndisc == null) + throw new System.Exception(); + if (ndisc.ExtractBasicInfo().Id.Substring(0, 6) != "R3ME01" && + ndisc.ExtractBasicInfo().Id.Substring(0, 6) != "R3MP01" && + ndisc.ExtractBasicInfo().Id.Substring(0, 6) != "R3IJ01") + throw new System.Exception(); + ndisc.ExtractFiles(ext_f => true, + (f, ext_f) => + { + var path = @".\tmp\nkit\DATA\" + (ext_f.PartitionId == null ? @"sys" : @"files"); + if (ext_f.Path != "") + path += @"\" + ext_f.Path; + if (!Directory.Exists(path)) + Directory.CreateDirectory(path); + using (var stream = File.OpenWrite(path + @"\" + ext_f.Name)) + f.Copy(stream, ext_f.Length); + }); + } + } + catch + { + result = false; + } + if (Directory.Exists(@".\Dats")) + Directory.Delete(@".\Dats", true); + if (Directory.Exists(@".\Processed")) + Directory.Delete(@".\Processed", true); + if (Directory.Exists(@".\Recovery")) + Directory.Delete(@".\Recovery", true); + if (!result) + Directory.Delete(@".\tmp\nkit", true); + return result; + } + } + + internal class NOD + { + private const string NOD_PATH = @"nod\nod.exe"; + private const string NOD_EXE_URL = "https://github.com/AxioDL/nod/releases/download/v1.0/nodtool.v1.win64.exe"; + private const string NOD_LICENSE_URL = "https://raw.githubusercontent.com/AxioDL/nod/master/LICENSE"; + + public static bool Installed() + { + return File.Exists(NOD_PATH); + } + + public static bool Init() + { + try + { + if (Installed()) + return true; + using (var client = new WebClientPlus()) + { + if (!Directory.Exists(@".\nod")) + Directory.CreateDirectory(@".\nod"); + client.DownloadFile(NOD_EXE_URL, NOD_PATH); + client.DownloadFile(NOD_LICENSE_URL, @".\nod\LICENSE"); + return true; + } + } + catch + { + return false; + } + } + + public static bool ExtractISO(string filename, bool isGC_ISO) + { + if (!Directory.Exists(".\\tmp\\" + (isGC_ISO ? "gc" : "wii"))) + Directory.CreateDirectory(".\\tmp\\" + (isGC_ISO ? "gc" : "wii")); + try + { + ProcessStartInfo info = new ProcessStartInfo(NOD_PATH, "extract -f \"" + filename + "\" .\\tmp\\" + (isGC_ISO ? "gc" : "wii")); + info.WorkingDirectory = Directory.GetCurrentDirectory(); + info.CreateNoWindow = true; + info.UseShellExecute = false; + Process proc = Process.Start(info); + proc.WaitForExit(); + return proc.ExitCode == 0; + } + catch + { + return false; + } + } + + static bool SetTitleID(String title_id, bool isGC_ISO) + { + var path = isGC_ISO ? "gc" : "wii\\DATA"; + try + { + if (title_id.Length > 6) + return false; + if (!isGC_ISO) + { + using (var file = File.OpenWrite(".\\tmp\\" + path + "\\disc\\header.bin")) + using (var writer = new BinaryWriter(file)) + { + writer.Write(Encoding.ASCII.GetBytes(title_id.ToCharArray(), 0, 6)); + } + } + using (var file = File.OpenWrite(".\\tmp\\" + path + "\\sys\\boot.bin")) + using (var writer = new BinaryWriter(file)) + { + writer.Write(Encoding.ASCII.GetBytes(title_id.ToCharArray(), 0, 6)); + if (title_id.StartsWith("R3M")) + writer.Write((short)0); + } + return true; + } + catch + { + return false; + } + } + + public static bool CreateISO(string filename, bool isGC_ISO, String title_id) + { + try + { + if (!SetTitleID(title_id, isGC_ISO)) + return false; + + ProcessStartInfo info = new ProcessStartInfo(NOD_PATH, (isGC_ISO ? "makegcn .\\tmp\\gc" : "makewii .\\tmp\\wii") + " \"" + filename + "\""); + info.WorkingDirectory = Directory.GetCurrentDirectory(); + info.CreateNoWindow = true; + info.UseShellExecute = false; + Process proc = Process.Start(info); + proc.WaitForExit(); + return proc.ExitCode == 0; + } + catch + { + return false; + } + } + } + + internal class WIT + { + private const string WIT_PATH = @".\wit\bin\wit.exe"; + private const string WIT_URL = "https://wit.wiimm.de/download/wit-v3.03a-r8245-cygwin.zip"; + + public static bool Installed() + { + return File.Exists(WIT_PATH); + } + + public static bool Init() + { + try + { + if (Installed()) + return true; + using (var client = new WebClientPlus()) + { + client.DownloadFile(WIT_URL, @".\tmp\wit.zip"); + ZipFile.ExtractToDirectory(@".\tmp\wit.zip", @"."); + Directory.Move(@".\wit-v3.03a-r8245-cygwin", @".\wit"); + File.Delete(@".\tmp\wit.zip"); + return true; + } + } + catch + { + return false; + } + } + + public static bool CreateCompressISO(string filename, bool isGC_ISO, String GameCode) + { + try + { + ProcessStartInfo info = new ProcessStartInfo(WIT_PATH, "COPY -d \"" + filename + "\" -s .\\tmp\\wii -C --id " + GameCode); + info.WorkingDirectory = Directory.GetCurrentDirectory(); + info.CreateNoWindow = true; + info.UseShellExecute = false; + Process proc = Process.Start(info); + proc.WaitForExit(); + return proc.ExitCode == 0; + } + catch + { + return false; + } + } + + public static bool CreateWBFS(string filename, String GameCode) + { + try + { + ProcessStartInfo info = new ProcessStartInfo(WIT_PATH, "COPY -s \".\\tmp\\wii\" -d \"" + filename + "\" -B --id \"" + GameCode + "\""); + info.WorkingDirectory = Directory.GetCurrentDirectory(); + info.CreateNoWindow = true; + info.UseShellExecute = false; + Process proc = Process.Start(info); + proc.WaitForExit(); + return proc.ExitCode == 0; + } + catch + { + return false; + } + } + } + } +} diff --git a/MP1_Trilogy_Rando_Generator/Utils/ProcessUtils.cs b/MP1_Trilogy_Rando_Generator/Utils/ProcessUtils.cs index b59b239..1623276 100644 --- a/MP1_Trilogy_Rando_Generator/Utils/ProcessUtils.cs +++ b/MP1_Trilogy_Rando_Generator/Utils/ProcessUtils.cs @@ -1,4 +1,6 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; +using System.IO; using System.Management; namespace MP1_Trilogy_Rando_Generator.Utils @@ -26,5 +28,22 @@ internal static void KillChildrenProcesses(int id) } } } + + public static bool Run(String path, params String[] args) + { + try + { + ProcessStartInfo info = new ProcessStartInfo(path); + info.WorkingDirectory = Directory.GetCurrentDirectory(); + info.Arguments = String.Join(" ", args); + Process proc = Process.Start(info); + proc.WaitForExit(); + return proc.ExitCode == 0; + } + catch + { + return false; + } + } } } \ No newline at end of file diff --git a/MP1_Trilogy_Rando_Generator/WITManager.cs b/MP1_Trilogy_Rando_Generator/WITManager.cs deleted file mode 100644 index ea98440..0000000 --- a/MP1_Trilogy_Rando_Generator/WITManager.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.IO.Compression; -using System.Net; - -namespace MP1_Trilogy_Rando_Generator -{ - class WITManager - { - private const string WIT_PATH = @".\wit\bin\wit.exe"; - private const string WIT_URL = "https://wit.wiimm.de/download/wit-v3.03a-r8245-cygwin.zip"; - - public static bool Installed() - { - return File.Exists(WIT_PATH); - } - - public static bool Init() - { - try - { - if (Installed()) - return true; - using (var client = new WebClientPlus()) - { - client.DownloadFile(WIT_URL, @".\tmp\wit.zip"); - ZipFile.ExtractToDirectory(@".\tmp\wit.zip", @"."); - Directory.Move(@".\wit-v3.03a-r8245-cygwin", @".\wit"); - File.Delete(@".\tmp\wit.zip"); - return true; - } - } - catch - { - return false; - } - } - - public static bool CreateCompressISO(string filename, bool isGC_ISO, String GameCode) - { - try - { - ProcessStartInfo info = new ProcessStartInfo(WIT_PATH, "COPY -d \""+filename+ "\" -s .\\tmp\\wii -C --id " + GameCode); - info.WorkingDirectory = Directory.GetCurrentDirectory(); - info.CreateNoWindow = true; - info.UseShellExecute = false; - Process proc = Process.Start(info); - proc.WaitForExit(); - return proc.ExitCode == 0; - } - catch - { - return false; - } - } - - public static bool CreateWBFS(string filename, String GameCode) - { - try - { - ProcessStartInfo info = new ProcessStartInfo(WIT_PATH, "COPY -s \".\\tmp\\wii\" -d \"" + filename + "\" -B --id \"" + GameCode + "\""); - info.WorkingDirectory = Directory.GetCurrentDirectory(); - info.CreateNoWindow = true; - info.UseShellExecute = false; - Process proc = Process.Start(info); - proc.WaitForExit(); - return proc.ExitCode == 0; - } - catch - { - return false; - } - } - } -} diff --git a/MP1_Trilogy_Rando_Generator/Wiki/WikiHelper.cs b/MP1_Trilogy_Rando_Generator/Wiki/WikiHelper.cs index c11021a..377d6ef 100644 --- a/MP1_Trilogy_Rando_Generator/Wiki/WikiHelper.cs +++ b/MP1_Trilogy_Rando_Generator/Wiki/WikiHelper.cs @@ -102,6 +102,7 @@ public static void DownloadWikiToCache() HTML = RemoveTag(HTML, ""); HTML = RemoveTag(HTML, "
"); HTML = RemoveTag(HTML, "