Made changes in the settings form to account for new and changed settings; also changed the MSU directory to attempt to use a symlink rather than copy.

This commit is contained in:
RadzPrower 2023-03-06 10:44:30 -05:00
parent f08441d368
commit 771e44b047
4 changed files with 62 additions and 33 deletions

View File

@ -17,6 +17,5 @@ namespace Zelda_3_Launcher
public static string currentDirectory = Directory.GetCurrentDirectory();
public static string repoDir = Path.Combine(currentDirectory, "zelda3");
public static string third_partyDir = Path.Combine(repoDir, "third_party");
public static Boolean messageMSU = false;
}
}

View File

@ -113,6 +113,7 @@
this.labelHoverNote = new System.Windows.Forms.Label();
this.labelMSUCopy = new System.Windows.Forms.Label();
this.progressMSU = new System.Windows.Forms.ProgressBar();
this.checkBoxDimFlashing = new System.Windows.Forms.CheckBox();
this.general.SuspendLayout();
this.aspectRatio.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericWindowScale)).BeginInit();
@ -359,7 +360,7 @@
//
// numericWindowScale
//
this.numericWindowScale.Location = new System.Drawing.Point(339, 151);
this.numericWindowScale.Location = new System.Drawing.Point(340, 180);
this.numericWindowScale.Maximum = new decimal(new int[] {
10,
0,
@ -377,7 +378,7 @@
//
// labelScale
//
this.labelScale.Location = new System.Drawing.Point(238, 151);
this.labelScale.Location = new System.Drawing.Point(239, 180);
this.labelScale.Name = "labelScale";
this.labelScale.Size = new System.Drawing.Size(95, 23);
this.labelScale.TabIndex = 4;
@ -917,11 +918,12 @@
this.comboRenderMethod.Items.AddRange(new object[] {
"SDL (Default)",
"SDL-Software",
"OpenGL"});
"OpenGL",
"OpenGL ES"});
this.comboRenderMethod.Location = new System.Drawing.Point(104, 180);
this.comboRenderMethod.MaxDropDownItems = 3;
this.comboRenderMethod.Name = "comboRenderMethod";
this.comboRenderMethod.Size = new System.Drawing.Size(144, 23);
this.comboRenderMethod.Size = new System.Drawing.Size(129, 23);
this.comboRenderMethod.TabIndex = 8;
this.toolTip1.SetToolTip(this.comboRenderMethod, "Rendering software used. SDL-software rendering may give better performance on Ra" +
"spberry Pi");
@ -963,6 +965,7 @@
//
// graphics
//
this.graphics.Controls.Add(this.checkBoxDimFlashing);
this.graphics.Controls.Add(this.linkLabelGLSLShaders);
this.graphics.Controls.Add(this.linkLabelCustomSprites);
this.graphics.Controls.Add(this.checkBoxShader);
@ -1131,6 +1134,16 @@
this.progressMSU.TabIndex = 7;
this.progressMSU.Visible = false;
//
// checkBoxDimFlashing
//
this.checkBoxDimFlashing.AutoSize = true;
this.checkBoxDimFlashing.Location = new System.Drawing.Point(270, 155);
this.checkBoxDimFlashing.Name = "checkBoxDimFlashing";
this.checkBoxDimFlashing.Size = new System.Drawing.Size(95, 19);
this.checkBoxDimFlashing.TabIndex = 9;
this.checkBoxDimFlashing.Text = "Dim Flashing";
this.checkBoxDimFlashing.UseVisualStyleBackColor = true;
//
// settingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@ -1267,5 +1280,6 @@
private Button buttonKeymapping;
private LinkLabel linkLabelMinorFixes;
private LinkLabel linkLabelMajorFixes;
private CheckBox checkBoxDimFlashing;
}
}

View File

@ -337,6 +337,7 @@ namespace Zelda_3_Launcher
checkStretch.Checked = settings["Graphics"]["IgnoreAspectRatio"].ToBool();
checkSpriteLimit.Checked = settings["Graphics"]["NoSpriteLimits"].ToBool();
checkLinearFiltering.Checked = settings["Graphics"]["LinearFiltering"].ToBool();
checkBoxDimFlashing.Checked = settings["Graphics"]["DimFlashes"].ToBool();
switch (settings["Graphics"]["OutputMethod"])
{
@ -563,6 +564,7 @@ namespace Zelda_3_Launcher
settings["Graphics"]["EnhancedMode7"] = Convert.ToInt32(checkMode7.Checked).ToString();
settings["Graphics"]["IgnoreAspectRatio"] = Convert.ToInt32(checkStretch.Checked).ToString();
settings["Graphics"]["WindowScale"] = Convert.ToInt32(numericWindowScale.Value).ToString();
settings["Graphics"]["DimFlashes"] = Convert.ToInt32(checkBoxDimFlashing.Checked).ToString();
switch (comboRenderMethod.SelectedIndex)
{
@ -639,6 +641,21 @@ namespace Zelda_3_Launcher
if (!MSUDir.Equals(textBoxMSUDirectory.Text))
{
if (Directory.Exists(MSUDir)) Directory.Delete(MSUDir, true);
try
{
Directory.CreateSymbolicLink(MSUDir, textBoxMSUDirectory.Text);
}
catch
{
var answer = MessageBox.Show("A symlink could not be created.\n\n" +
"It could be due to a lack of privileges, so running as administrator could allow for symlink creation. " +
"If you are already running the launcher as an administrator, your problem is likely filesystem related and cannot be avoided.\n\n" +
"At this point, you can copy the files instead of creating a symlink, but this will take up more space on your drive. " +
"Alternatively, you can choose to not copy the files over and the MSU directory setting will not be saved at which point you can restart the launcher as administrator and attempt again.\n\n" +
"Would you like to copy the files instead?", "Symlink Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (answer == DialogResult.Yes)
{
Directory.CreateDirectory(MSUDir);
//Now Create all of the directories
@ -654,7 +671,11 @@ namespace Zelda_3_Launcher
progressMSU.Value = Directory.EnumerateFiles(MSUDir, "*.*", SearchOption.AllDirectories).Count();
}
}
}
}
if (Directory.Exists(MSUDir))
{
var files = Directory.EnumerateFiles(MSUDir, "*.pcm").Select(Path.GetFileName);
if (files.Count<string>() == 0)
{
@ -664,6 +685,7 @@ namespace Zelda_3_Launcher
var prefix = findMSUPrefix(files);
settings["Sound"]["MSUPath"] = "msu/" + prefix;
}
labelMSUCopy.Visible = false;
progressMSU.Visible = false;
@ -798,15 +820,6 @@ namespace Zelda_3_Launcher
private void buttonMSUDirectory_Click(object sender, EventArgs e)
{
if (!Program.messageMSU)
{
MessageBox.Show("MSU files MUST be within the zelda3 directory structure. "
+ "Therefore, whatever directory you select will be entirely copied to the proper location. "
+ "Please be cautious in your directory selection.", "Caution", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Program.messageMSU = true;
}
var result = new FolderBrowserDialog();
result.ShowDialog();

View File

@ -60,6 +60,9 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="checkBoxQuickSwitch.ToolTip" xml:space="preserve">
<value>Allows you to switch items with L/R but also allows you to assign items to X, Y, L, and R.