diff --git a/App.config b/App.config
new file mode 100644
index 0000000..d01910d
--- /dev/null
+++ b/App.config
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/App.xaml b/App.xaml
new file mode 100644
index 0000000..a40fa09
--- /dev/null
+++ b/App.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/App.xaml.cs b/App.xaml.cs
new file mode 100644
index 0000000..cd6a366
--- /dev/null
+++ b/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace XP11SettingsTool
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/MainWindow.xaml b/MainWindow.xaml
new file mode 100644
index 0000000..572064c
--- /dev/null
+++ b/MainWindow.xaml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
new file mode 100644
index 0000000..9c89914
--- /dev/null
+++ b/MainWindow.xaml.cs
@@ -0,0 +1,184 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Microsoft.Win32;
+using XP11SettingsTool.Properties;
+
+namespace XP11SettingsTool
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private IEnumerable _lines;
+
+ private const string FileName = "Settings.lua";
+ private const string FileDefaultName = "SettingsDefault.lua";
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ private double GetDoubleValue(string tag)
+ {
+ var linha = _lines.FirstOrDefault(l => l.Contains(tag));
+ var value = linha.Split(',')[1].Replace(")", "");
+ return Convert.ToDouble(value, new CultureInfo("en"));
+ }
+
+ private bool GetBoolValue(string tag)
+ {
+ var linha = _lines.FirstOrDefault(l => l.Contains(tag));
+ var value = linha.Split(',')[1].Replace(")", "");
+ return value.Trim() == "1.00";
+ }
+
+ public static IEnumerable FindVisualChildren(DependencyObject depObj) where T : DependencyObject
+ {
+ if (depObj != null)
+ {
+ for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)
+ {
+ DependencyObject child = VisualTreeHelper.GetChild(depObj, i);
+ if (child != null && child is T)
+ {
+ yield return (T)child;
+ }
+
+ foreach (T childOfChild in FindVisualChildren(child))
+ {
+ yield return childOfChild;
+ }
+ }
+ }
+ }
+
+ private void LoadValues(string filePath)
+ {
+ try
+ {
+ if (File.Exists(filePath))
+ {
+ _lines = File.ReadLines(filePath);
+
+ foreach (CheckBox ckb in FindVisualChildren(grdMain))
+ {
+ ckb.IsChecked = GetBoolValue(ckb.Tag.ToString());
+ }
+
+ foreach (Slider sld in FindVisualChildren(grdMain))
+ {
+ sld.Value = GetDoubleValue(sld.Tag.ToString());
+ }
+ }
+ else
+ {
+ MessageBox.Show(this, "File '" + filePath + "' cannot be found. Please reinstall.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(this, ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
+ private void SaveFile()
+ {
+ try
+ {
+ foreach (CheckBox ckb in FindVisualChildren(grdMain))
+ {
+ var line = _lines.FirstOrDefault(l => l.Contains(ckb.Tag.ToString()));
+ var value = ckb.IsChecked.Value ? " 1.00)" : " 0.00)";
+ var newLine = line.Replace(line.Split(',')[1], value);
+
+ _lines = _lines.Select(s => s == line ? newLine : s).ToArray();
+ }
+
+ foreach (Slider sld in FindVisualChildren(grdMain))
+ {
+ var line = _lines.FirstOrDefault(l => l.Contains(sld.Tag.ToString()));
+ var value = " " + sld.Value.ToString("0.00", new CultureInfo("en")) + ")";
+ var newLine = line.Replace(line.Split(',')[1], value);
+
+ _lines = _lines.Select(s => s == line ? newLine : s).ToArray();
+ }
+
+ SaveFileDialog saveFileDialog = new SaveFileDialog();
+ saveFileDialog.FileName = FileName;
+
+ if (Directory.Exists(Settings.Default.FlyWithLuaScriptsFolder))
+ saveFileDialog.InitialDirectory = Settings.Default.FlyWithLuaScriptsFolder;
+
+ if (saveFileDialog.ShowDialog() == true)
+ {
+ File.WriteAllLines(saveFileDialog.FileName, _lines); // Na pasta
+ File.WriteAllLines(FileName, _lines); // Local
+
+ Settings.Default.FlyWithLuaScriptsFolder = System.IO.Path.GetDirectoryName(saveFileDialog.FileName);
+ Settings.Default.Save();
+ MessageBox.Show(this, "Settings saved successfully.", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(this, ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (File.Exists(FileName))
+ {
+ LoadValues(FileName);
+ }
+ else
+ {
+ LoadValues(FileDefaultName);
+ }
+ }
+
+ private void btnSave_Click(object sender, RoutedEventArgs e)
+ {
+ SaveFile();
+ }
+
+ private void btnDefault_Click(object sender, RoutedEventArgs e)
+ {
+ MessageBoxResult result = MessageBox.Show(this, "Discard all changes and load default XP11 values?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);
+ if (result == MessageBoxResult.Yes)
+ {
+ LoadValues(FileDefaultName);
+ }
+ }
+
+ private void btnUndo_Click(object sender, RoutedEventArgs e)
+ {
+ MessageBoxResult result = MessageBox.Show(this, "Discard all current changes?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);
+ if (result == MessageBoxResult.Yes)
+ {
+ LoadValues(FileName);
+ }
+ }
+
+ private void btnExit_Click(object sender, RoutedEventArgs e)
+ {
+ Application.Current.Shutdown(1);
+ }
+ }
+}
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..45d4f5b
--- /dev/null
+++ b/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("XP11SettingsTool")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("XP11SettingsTool")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..c8cd2f2
--- /dev/null
+++ b/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace XP11SettingsTool.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XP11SettingsTool.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..cfbc05c
--- /dev/null
+++ b/Properties/Settings.Designer.cs
@@ -0,0 +1,38 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace XP11SettingsTool.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("")]
+ public string FlyWithLuaScriptsFolder {
+ get {
+ return ((string)(this["FlyWithLuaScriptsFolder"]));
+ }
+ set {
+ this["FlyWithLuaScriptsFolder"] = value;
+ }
+ }
+ }
+}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
new file mode 100644
index 0000000..82ad4d0
--- /dev/null
+++ b/Properties/Settings.settings
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SettingsDefault.lua b/SettingsDefault.lua
new file mode 100644
index 0000000..d898039
--- /dev/null
+++ b/SettingsDefault.lua
@@ -0,0 +1,100 @@
+--Draw Aurora Borealis. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/draw_aurora", 1.00)
+
+--Draw aircraft carriers and frigates. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/draw_boats", 1.00)
+
+--Draw birds and deer in nice weather. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/draw_deer_birds", 1.00)
+
+--Draw fires and baloons. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/draw_fire_ball", 1.00)
+
+--Distance at which road traffic is visible. Default is 20000 meters. Recommend 7500.
+set( "sim/private/controls/cars/lod_min", 7500.00)
+
+--Distance at which static plans are visible. Default is 9260 meters. Recommend 3000.
+set( "sim/private/controls/park/static_plane_build_dis", 3000.00)
+
+--Runways follow terrain contours. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/sloped_runways", 1.00)
+
+--Atmospheric scattering. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/draw_scattering", 1.00)
+
+--Draw volumetric fog. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/draw_volume_fog01", 1.00)
+
+--Draw per pixel lighting. 0 (off) or 1 (on). Change both of the settings below to be the same.
+set( "sim/private/controls/reno/draw_per_pix_liting", 1.00)
+
+--3D Object Density. 0 (None) to 6 (Extreme)
+set( "sim/private/controls/reno/draw_objs_06", 6.00)
+
+--Road traffic density. 0 (off) to 5 (very dense)
+set( "sim/private/controls/reno/draw_cars_05", 4.00)
+
+--Road Density. 0 (None) to 3 (Extreme)
+set( "sim/private/controls/reno/draw_vecs_03", 2.00)
+
+--Runway and taxiway line smoothness and 3D runway/taxiway lighting. 0 (Low) to 3 (Extreme)
+set( "sim/private/controls/reno/draw_detail_apt_03", 2.00)
+
+--Forest density. 0 (Low) to 5 (Extreme)
+set( "sim/private/controls/reno/draw_for_05", 4.00)
+
+--Forest inner ring density. 0 (0%) to 1 (100%)
+set( "sim/private/controls/forest/inn_ring_density", 0.50)
+
+--Forest mid ring density. 0 (0%) to 1 (100%)
+set( "sim/private/controls/forest/mid_ring_density", 0.75)
+
+--Forest outer ring density. 0 (0%) to 1 (100%)
+set( "sim/private/controls/forest/out_ring_density", 1.00)
+
+--Fade start rate. 0.75 (low setting) to 0.6 (high setting)
+set( "sim/private/controls/terrain/fade_start_rat", 0.70)
+
+--Tile LOD bias. 0.72 (low setting) to 1.0 (high setting)
+set( "sim/private/controls/ag/tile_lod_bias", 0.83)
+
+--Composite far distance bias. 0.72 (low setting) to 1.0 (high setting)
+set( "sim/private/controls/terrain/composite_far_dist_bias", 0.83)
+
+--Water reflection detail. 0 (None) to 5 (Complete)
+set( "sim/private/controls/reno/draw_reflect_water05", 3.00)
+
+--Compress textures to save VRAM. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/comp_texes", 1.00)
+
+--Use bump map textures. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/use_bump_maps", 1.00)
+
+--Use detail (aka gritty) textures or decals. 0 (off) or 1 (on)
+set( "sim/private/controls/reno/use_detail_textures", 1.00)
+
+--Ambient Occlusion. 0 (off) or 1 (on)
+set( "sim/private/controls/ssao/enable", 1.00)
+
+--Static plane density. 1 (low) to 6 (high). Note this does not affect static planes manually placed by scenery designer, just the ones that automatically appear and start areas.
+set( "sim/private/controls/park/static_plane_density", 3.00)
+
+--Cascading Shadow Maps Exterior Quality (Higher numbers reduce jagged edges of shadows). Known valid values are 1 or 2 for XP11. XP10 used values of 0-5.
+set( "sim/private/controls/shadow/csm_split_exterior", 2.00)
+
+--Shadow fade distance. XP11 uses values ranging from 500 to 1500. XP10 used values ranging from 500 to 6000.
+set( "sim/private/controls/shadow/csm/far_limit", 1000.00)
+
+--Shadow texture size??? XP11 uses either 2048 or 4096. This setting was not used in XP10
+set( "sim/private/controls/fbo/shadow_cam_size", 4096.00)
+
+--The following values adjust the maximum distance ground scenery is visible. Default is 10000. Larger values seem to have no affect, but you might try lower values if you have a low end system.
+set( "sim/private/controls/skyc/max_dsf_vis_ever", 10000.00)
+
+--The following values adjust fading of ground textures in the distance. Default is 0.90 in XP10 (0.75 in XP 11). Higher values have no effect. But you might try lower values (0.10 for example) if you want the ground scenery to fade to brown more gradually in the distance.
+set( "sim/private/controls/skyc/dsf_fade_ratio", 0.90)
+
+--The following enables reflective water. Default is 1.00 (on)
+set( "sim/private/controls/caps/use_reflective_water", 1.00)
+
+
diff --git a/XP11SettingsTool.csproj b/XP11SettingsTool.csproj
new file mode 100644
index 0000000..808bebd
--- /dev/null
+++ b/XP11SettingsTool.csproj
@@ -0,0 +1,107 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {5C7D37E8-1D9C-42BF-87C7-210E4363B68C}
+ WinExe
+ Properties
+ XP11SettingsTool
+ XP11SettingsTool
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+ Always
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/XP11SettingsTool.sln b/XP11SettingsTool.sln
new file mode 100644
index 0000000..d9e26eb
--- /dev/null
+++ b/XP11SettingsTool.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XP11SettingsTool", "XP11SettingsTool.csproj", "{5C7D37E8-1D9C-42BF-87C7-210E4363B68C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5C7D37E8-1D9C-42BF-87C7-210E4363B68C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5C7D37E8-1D9C-42BF-87C7-210E4363B68C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5C7D37E8-1D9C-42BF-87C7-210E4363B68C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5C7D37E8-1D9C-42BF-87C7-210E4363B68C}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal