2017-03-19 13:05:33 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using Mesen.GUI.Config;
|
|
|
|
|
using Mesen.GUI.Controls;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Forms
|
|
|
|
|
{
|
|
|
|
|
public partial class frmHelp : BaseForm
|
|
|
|
|
{
|
|
|
|
|
public frmHelp()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-01-27 01:11:25 -05:00
|
|
|
|
ThemeHelper.ExcludeFromTheme(lblExample);
|
2017-03-19 13:05:33 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
|
|
|
|
lblExample.Font = new Font(BaseControl.MonospaceFontFamily, BaseControl.DefaultFontSize - 2);
|
2019-01-27 01:33:26 -05:00
|
|
|
|
|
|
|
|
|
float fontSize = BaseControl.DefaultFontSize - (Program.IsMono ? 2 : 4);
|
|
|
|
|
txtAudioOptions.Font = new Font(BaseControl.MonospaceFontFamily, fontSize);
|
|
|
|
|
txtEmulationOptions.Font = new Font(BaseControl.MonospaceFontFamily, fontSize);
|
|
|
|
|
txtVideoOptions.Font = new Font(BaseControl.MonospaceFontFamily, fontSize);
|
|
|
|
|
txtGeneralOptions.Font = new Font(BaseControl.MonospaceFontFamily, fontSize);
|
2017-03-19 13:05:33 -04:00
|
|
|
|
|
|
|
|
|
lblExample.Text = ConvertSlashes(lblExample.Text);
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
DisplayOptions(typeof(VideoInfo), sb);
|
|
|
|
|
txtVideoOptions.Text = ConvertSlashes(sb.ToString().Trim());
|
|
|
|
|
|
|
|
|
|
sb.Clear();
|
|
|
|
|
DisplayOptions(typeof(AudioInfo), sb);
|
|
|
|
|
txtAudioOptions.Text = ConvertSlashes(sb.ToString().Trim());
|
|
|
|
|
|
|
|
|
|
sb.Clear();
|
|
|
|
|
DisplayOptions(typeof(EmulationInfo), sb);
|
|
|
|
|
txtEmulationOptions.Text = ConvertSlashes(sb.ToString().Trim());
|
|
|
|
|
|
|
|
|
|
sb.Clear();
|
|
|
|
|
DisplayOptions(typeof(Configuration), sb);
|
2018-12-22 13:25:09 -05:00
|
|
|
|
|
|
|
|
|
txtGeneralOptions.Text = ConvertSlashes(
|
|
|
|
|
ResourceHelper.GetMessage("HelpFullscreen") + Environment.NewLine +
|
|
|
|
|
ResourceHelper.GetMessage("HelpDoNotSaveSettings") + Environment.NewLine +
|
|
|
|
|
ResourceHelper.GetMessage("HelpRecordMovie") + Environment.NewLine +
|
2018-12-22 16:27:14 -05:00
|
|
|
|
ResourceHelper.GetMessage("HelpLoadLastSession") + Environment.NewLine +
|
2018-12-22 13:25:09 -05:00
|
|
|
|
sb.ToString().Trim()
|
|
|
|
|
);
|
2017-03-19 13:05:33 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private string ConvertSlashes(string options)
|
|
|
|
|
{
|
|
|
|
|
if(Program.IsMono) {
|
|
|
|
|
return options.Replace("/", "--");
|
|
|
|
|
}
|
|
|
|
|
return options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DisplayOptions(Type type, StringBuilder sb)
|
|
|
|
|
{
|
|
|
|
|
FieldInfo[] fields = type.GetFields();
|
|
|
|
|
foreach(FieldInfo info in fields) {
|
|
|
|
|
if(info.FieldType == typeof(int) || info.FieldType == typeof(uint) || info.FieldType == typeof(double)) {
|
|
|
|
|
MinMaxAttribute minMaxAttribute = info.GetCustomAttribute(typeof(MinMaxAttribute)) as MinMaxAttribute;
|
|
|
|
|
if(minMaxAttribute != null) {
|
|
|
|
|
sb.AppendLine("/" + info.Name + " = [" + minMaxAttribute.Min.ToString() + ", " + minMaxAttribute.Max.ToString() + "]");
|
|
|
|
|
} else {
|
|
|
|
|
ValidValuesAttribute validValuesAttribute = info.GetCustomAttribute(typeof(ValidValuesAttribute)) as ValidValuesAttribute;
|
|
|
|
|
if(validValuesAttribute != null) {
|
|
|
|
|
sb.AppendLine("/" + info.Name + " = " + string.Join(" | ", validValuesAttribute.ValidValues));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if(info.FieldType == typeof(bool)) {
|
|
|
|
|
sb.AppendLine("/" + info.Name + " = true | false");
|
|
|
|
|
} else if(info.FieldType.IsEnum) {
|
|
|
|
|
sb.AppendLine("/" + info.Name + " = " + string.Join(" | ", Enum.GetNames(info.FieldType)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|