Example #1
0
        /// <summary>
        /// Writer for BMS4.34 setting Override
        /// </summary>
        /// <param name="mainWindow"></param>
        /// <param name="appReg"></param>
        public OverrideSettingFor434(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
        {
            mainWindow.Misc_Platform.IsChecked  = true;
            mainWindow.Misc_Platform.Visibility = Visibility.Hidden;
            mainWindow.Label_Platform.Content   = "Platform : BMS 4.34 is 64-bit apprecation.";

            mainWindow.CMD_BW.Visibility = Visibility.Hidden;
        }
        public Launcher434(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
        {
            mainWindow.Misc_Platform.IsChecked  = true;
            mainWindow.Misc_Platform.Visibility = Visibility.Hidden;
            mainWindow.Label_Platform.Content   = "Platform : BMS 4.34 is 64-bit appreciation.";

            mainWindow.CMD_BW.Visibility = Visibility.Hidden;
        }
Example #3
0
        /// <summary>
        /// Writer for BMS4.32 setting Override
        /// </summary>
        /// <param name="mainWindow"></param>
        /// <param name="appReg"></param>
        public OverrideSettingFor432(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
        {
            mainWindow.Misc_Platform.IsChecked  = false;
            mainWindow.Misc_Platform.Visibility = Visibility.Hidden;
            mainWindow.Label_Platform.Content   = "Platform : BMS 4.32 is 32-bit apprecation.";

            mainWindow.Launch_AVC.Visibility = Visibility.Hidden;
            mainWindow.Label_AVC.Visibility  = Visibility.Hidden;

            mainWindow.Name_FLIR_Brightness.Visibility  = Visibility.Hidden;
            mainWindow.Label_FLIR_Brightness.Visibility = Visibility.Hidden;
            mainWindow.Axis_FLIR_Brightness.Visibility  = Visibility.Hidden;
            mainWindow.FLIR_Brightness.Visibility       = Visibility.Hidden;

            mainWindow.Name_AI_vs_IVC.Visibility  = Visibility.Hidden;
            mainWindow.Label_AI_vs_IVC.Visibility = Visibility.Hidden;
            mainWindow.Axis_AI_vs_IVC.Visibility  = Visibility.Hidden;
            mainWindow.AI_vs_IVC.Visibility       = Visibility.Hidden;

            mainWindow.Tab_HSI_and_Altimeter.Visibility = Visibility.Collapsed;
        }
Example #4
0
        public OverrideSetting(MainWindow mainWindow, AppRegInfo appReg, Hashtable inGameAxis, DeviceControl deviceControl, KeyFile keyFile, VisualAcuity visualAcuity)
        {
            this.mainWindow    = mainWindow;
            this.appReg        = appReg;
            this.inGameAxis    = inGameAxis;
            this.deviceControl = deviceControl;
            this.keyFile       = keyFile;
            this.visualAcuity  = visualAcuity;

            if (!System.IO.Directory.Exists(appReg.GetInstallDir() + "/User/Config/Backup/"))
            {
                System.IO.Directory.CreateDirectory(appReg.GetInstallDir() + "/User/Config/Backup/");
            }

            SaveAxisMapping();
            SaveJoystickCal();
            SaveDeviceSorting();
            SaveConfigfile();
            SaveKeyMapping();
            SaveJoyAssignStatus();
        }
Example #5
0
        /// <summary>
        /// Read theater.lst and apply the list to Combobox.
        /// </summary>
        public TheaterList(AppRegInfo appReg, ComboBox Combo)
        {
            String filename = appReg.GetInstallDir() + "/Data/Terrdata/theaterdefinition/theater.lst";

            if (File.Exists(filename) == false)
            {
                return;
            }
            string[] definitionfile = File.ReadAllLines(filename, Encoding.UTF8);

            var list = new List <string>();

            foreach (string tdf in definitionfile)
            {
                if (File.Exists(appReg.GetInstallDir() + "\\Data\\" + tdf) == false)
                {
                    continue;
                }
                string[] line        = File.ReadAllLines(appReg.GetInstallDir() + "\\Data\\" + tdf, Encoding.UTF8);
                string   theatername = "";
                foreach (string str in line)
                {
                    if (!str.Contains("name "))
                    {
                        continue;
                    }
                    theatername = str.Replace("name ", "").Trim();
                    break;
                }
                list.Add(theatername);
            }
            for (int ii = 0; ii < list.Count; ii++)
            {
                Combo.Items.Add(list[ii]);
                if (list[ii] == appReg.GetCurrentTheater())
                {
                    Combo.SelectedIndex = ii;
                }
            }
        }
Example #6
0
        /// <summary>
        /// Read theater.lst and apply the list to Combobox.
        /// </summary>
        public static void Populate(AppRegInfo appReg, ComboBox Combo)
        {
            string filename = appReg.GetInstallDir() + "/Data/Terrdata/theaterdefinition/theater.lst";

            if (File.Exists(filename) == false)
            {
                return;
            }
            IEnumerable <string> theaterPaths = File.ReadLines(filename, Encoding.UTF8)
                                                .Select(line => line.Trim())                                // Trim whitespace
                                                .Where(line => line.Length > 0 && !line.StartsWith("#"))    // Throw out empty lines, comments, etc.
                                                .Select(line => appReg.GetInstallDir() + "\\Data\\" + line) // Construct TDF file path
                                                .Where(tdf => File.Exists(tdf));                            // Throw out paths we can't find

            List <string> theaters = new List <string>();

            foreach (string tdf in theaterPaths)
            {
                IEnumerable <string> lines = File.ReadLines(tdf, Encoding.UTF8);
                foreach (string str in lines)
                {
                    if (str.Contains("name "))
                    {
                        theaters.Add(str.Replace("name ", "").Trim());
                        break;
                    }
                }
            }
            theaters.Sort();

            for (int ii = 0; ii < theaters.Count; ii++)
            {
                Combo.Items.Add(theaters[ii]);
                if (theaters[ii] == appReg.GetCurrentTheater())
                {
                    Combo.SelectedIndex = ii;
                }
            }
        }
        public Launcher432(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
        {
            mainWindow.Misc_Platform.IsChecked  = false;
            mainWindow.Misc_Platform.Visibility = Visibility.Hidden;
            mainWindow.Label_Platform.Content   = "Platform : BMS 4.35 64-bit.";

            mainWindow.Launch_AVC.Visibility = Visibility.Hidden;
            mainWindow.Label_AVC.Visibility  = Visibility.Hidden;

            mainWindow.Name_FLIR_Brightness.Visibility  = Visibility.Hidden;
            mainWindow.Label_FLIR_Brightness.Visibility = Visibility.Hidden;
            mainWindow.Axis_FLIR_Brightness.Visibility  = Visibility.Hidden;
            mainWindow.FLIR_Brightness.Visibility       = Visibility.Hidden;

            mainWindow.Name_AI_vs_IVC.Visibility  = Visibility.Hidden;
            mainWindow.Label_AI_vs_IVC.Visibility = Visibility.Hidden;
            mainWindow.Axis_AI_vs_IVC.Visibility  = Visibility.Hidden;
            mainWindow.AI_vs_IVC.Visibility       = Visibility.Hidden;

            mainWindow.Tab_HSI_and_Altimeter.Visibility    = Visibility.Collapsed;
            mainWindow.Misc_NaturalHeadMovement.Visibility = Visibility.Collapsed;
        }
Example #8
0
        /// <summary>
        /// Make new instance.
        /// </summary>
        public void ImportStockSetup(AppRegInfo appReg, int devcount, int povnum, int joynum)
        {
            Invoke    invokeStatus    = Invoke.UI;
            Behaviour behaviourStatus = Behaviour.Press;

            string deviceSorting = appReg.GetInstallDir() + "/User/Config/DeviceSorting.txt";

            if (System.IO.Path.GetFileName(deviceSorting) != "DeviceSorting.txt")
            {
                return;
            }
            if (System.IO.File.Exists(deviceSorting) == false)
            {
                return;
            }
            string[] lines     = System.IO.File.ReadAllLines(deviceSorting, Encoding.UTF8);
            int      currentID = -1;

            for (int i = 0; i < lines.Count(); i++)
            {
                if (lines[i] == this.GetDeviceSortingLine().Replace("\r\n", ""))
                {
                    currentID = i;
                }
            }
            if (currentID == -1)
            {
                return;
            }
            string keyfile = appReg.GetInstallDir() + "/User/Config/" + appReg.getKeyFileName();

            string[] Klines = System.IO.File.ReadAllLines(keyfile, Encoding.UTF8);
            foreach (string stBuffer in Klines)
            {
                string[] stArrayData = stBuffer.Split(' ');
                if (stArrayData.Length < 7)
                {
                    continue;
                }
                if (stBuffer.Substring(0, 1) == "#")
                {
                    continue;
                }
                if (stArrayData[3] == "-2" | stArrayData[3] == "-3")
                {
                    if ((string)stArrayData[2] == "-1")
                    {
                        invokeStatus = Invoke.Default;
                    }
                    if ((string)stArrayData[2] == "-2")
                    {
                        invokeStatus = Invoke.Down;
                    }
                    if ((string)stArrayData[2] == "-4")
                    {
                        invokeStatus = Invoke.Up;
                    }
                    if ((string)stArrayData[2] == "8")
                    {
                        invokeStatus = Invoke.UI;
                    }
                    if ((string)stArrayData[3] == "0")
                    {
                        behaviourStatus = Behaviour.Press;
                    }
                    if ((string)stArrayData[3] == "0x42")
                    {
                        behaviourStatus = Behaviour.Release;
                    }
                }
                // Import DX Setup
                if (stArrayData[3] == "-2")
                {
                    for (int i = 0; i < 32; i++)
                    {
                        if (Int32.Parse(stArrayData[1]) == i + currentID * 32)
                        {
                            this.dx[i].Assign((string)stArrayData[0], Pinky.UnShift, behaviourStatus, invokeStatus, 0);
                        }
                        if (Int32.Parse(stArrayData[1]) == i + currentID * 32 + devcount * 32) // Okay This has to be the problem. I have to read FalconBMS.cfg for
                        {
                            this.dx[i].Assign((string)stArrayData[0], Pinky.Shift, behaviourStatus, invokeStatus, 0);
                        }
                    }
                }
                // Import POV Setup
                if (stArrayData[3] == "-3")
                {
                    for (int i = 0; i < 4; i++)
                    {
                        if (Int32.Parse(stArrayData[1]) != i)
                        {
                            continue;
                        }
                        if (povnum < 3)
                        {
                            if (i == 0 | i == 1)
                            {
                                this.pov[i].direction[Int32.Parse(stArrayData[4])].Assign((string)stArrayData[0], Pinky.UnShift, 0);
                            }
                            if (i == 2 | i == 3)
                            {
                                this.pov[i - 2].direction[Int32.Parse(stArrayData[4])].Assign((string)stArrayData[0], Pinky.Shift, 0);
                            }
                            continue;
                        }
                        this.pov[i].direction[Int32.Parse(stArrayData[4])].Assign((string)stArrayData[0], Pinky.UnShift, 0);
                    }
                }
                // Import Axis Setup
                string filename = appReg.GetInstallDir() + "/User/Config/axismapping.dat";
                if (!System.IO.File.Exists(filename))
                {
                    return;
                }
                System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
                byte[] ad = new byte[fs.Length];
                fs.Read(ad, 0, ad.Length);
                fs.Close();

                filename = appReg.GetInstallDir() + "/User/Config/joystick.cal";
                if (!System.IO.File.Exists(filename))
                {
                    return;
                }
                fs = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
                byte[] jc = new byte[fs.Length];
                fs.Read(jc, 0, jc.Length);
                fs.Close();

                AxisName[] axisMappingList = appReg.getOverrideWriter().getAxisMappingList();
                AxisName[] joystickCalList = appReg.getOverrideWriter().getJoystickCalList();
                for (int i = 0; i < axisMappingList.Count(); i++)
                {
                    for (int ii = 0; ii < devcount; ii++)
                    {
                        if ((int)ad[24 + i * 16] == currentID + 2)
                        {
                            int     axisNum  = (int)ad[24 + i * 16 + 4];
                            AxCurve deadzone = AxCurve.None;
                            if ((int)ad[24 + i * 16 + 8] == 0x64)
                            {
                                deadzone = AxCurve.Small;
                            }
                            if ((int)ad[24 + i * 16 + 8] == 0xF4)
                            {
                                deadzone = AxCurve.Medium;
                            }
                            if ((int)ad[24 + i * 16 + 8] == 0xE8)
                            {
                                deadzone = AxCurve.Large;
                            }
                            AxCurve saturation = AxCurve.None;
                            if ((int)ad[24 + i * 16 + 12] == 0x1C)
                            {
                                saturation = AxCurve.Small;
                            }
                            if ((int)ad[24 + i * 16 + 12] == 0x28)
                            {
                                saturation = AxCurve.Medium;
                            }
                            if ((int)ad[24 + i * 16 + 12] == 0x34)
                            {
                                saturation = AxCurve.Large;
                            }
                            bool invert = false;

                            for (int iii = 0; iii < joystickCalList.Count(); iii++)
                            {
                                // read joystick.cal
                                if (axisMappingList[i] != joystickCalList[iii])
                                {
                                    continue;
                                }
                                int invertnum = (int)jc[iii * 28 + 20];
                                if (invertnum == 1)
                                {
                                    invert = true;
                                }
                            }

                            InGameAxAssgn inGameAxAssgn = new InGameAxAssgn(currentID, axisNum, invert, deadzone, saturation);
                            this.axis[axisNum] = new AxAssgn(axisMappingList[i].ToString(), inGameAxAssgn);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Get Devices.
        /// </summary>
        public DeviceControl(AppRegInfo appReg)
        {
            // Make Joystick Instances.
            this.devList   = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly);
            this.joyStick  = new Device[devList.Count];
            this.joyAssign = new JoyAssgn[devList.Count];

            System.Xml.Serialization.XmlSerializer serializer;
            System.IO.StreamReader sr;
            string fileName      = "";
            string stockFileName = "";
            int    i             = 0;

            foreach (DeviceInstance dev in devList)
            {
                joyStick[i]  = new Device(dev.InstanceGuid);
                joyAssign[i] = new JoyAssgn();

                joyAssign[i].SetDeviceInstance(dev);
                int povnum = joyStick[i].Caps.NumberPointOfViews;
                joyStick.Count();

                fileName = appReg.GetInstallDir() + "/User/Config/Setup.v100." + joyAssign[i].GetProductName().Replace("/", "-")
                           + " {" + joyAssign[i].GetInstanceGUID().ToString().ToUpper() + "}.xml";

                // Load exsisting .xml files.
                if (File.Exists(fileName))
                {
                    serializer   = new System.Xml.Serialization.XmlSerializer(typeof(JoyAssgn));
                    sr           = new System.IO.StreamReader(fileName, new System.Text.UTF8Encoding(false));
                    joyAssign[i] = (JoyAssgn)serializer.Deserialize(sr);
                    sr.Close();
                }
                else
                {
                    stockFileName = appReg.GetInstallDir() + "/User/Config/Setup.v100." + joyAssign[i].GetProductName().Replace("/", "-")
                                    + " {Stock}.xml";
                    if (File.Exists(stockFileName))
                    {
                        File.Copy(stockFileName, fileName);

                        serializer   = new System.Xml.Serialization.XmlSerializer(typeof(JoyAssgn));
                        sr           = new System.IO.StreamReader(fileName, new System.Text.UTF8Encoding(false));
                        joyAssign[i] = (JoyAssgn)serializer.Deserialize(sr);
                        sr.Close();
                    }
                }
                joyAssign[i].SetDeviceInstance(dev);
                i += 1;
            }

            // Import stock BMS Setup if .xml save file for the joystick does not exist.
            try
            {
                for (int ii = 0; ii < joyAssign.Count(); ii++)
                {
                    fileName = appReg.GetInstallDir() + "/User/Config/Setup.v100." + joyAssign[ii].GetProductName().Replace("/", "-")
                               + " {" + joyAssign[ii].GetInstanceGUID().ToString().ToUpper() + "}.xml";
                    if (File.Exists(fileName) == false)
                    {
                        joyAssign[ii].ImportStockSetup(appReg, joyStick.Count(), joyStick[ii].Caps.NumberPointOfViews, ii);
                    }
                }
            }
            catch (System.IO.FileNotFoundException ex)
            {
                System.Console.WriteLine(ex.Message);

                System.IO.StreamWriter sw = new System.IO.StreamWriter(appReg.GetInstallDir() + "\\Error.txt", false, System.Text.Encoding.GetEncoding("shift_jis"));
                sw.Write(ex.Message);
                sw.Close();
            }

            // Load MouseWheel .xml file.
            serializer = new System.Xml.Serialization.XmlSerializer(typeof(JoyAssgn.AxAssgn));
            fileName   = appReg.GetInstallDir() + "/User/Config/Setup.v100.Mousewheel.xml";
            if (File.Exists(fileName))
            {
                sr = new System.IO.StreamReader(fileName, new System.Text.UTF8Encoding(false));
                mouseWheelAssign = (JoyAssgn.AxAssgn)serializer.Deserialize(sr);
                sr.Close();
            }

            // Load ThrottlePosition .xml file.
            serializer = new System.Xml.Serialization.XmlSerializer(typeof(ThrottlePosition));
            fileName   = appReg.GetInstallDir() + "/User/Config/Setup.v100.throttlePosition.xml";
            if (File.Exists(fileName))
            {
                sr          = new System.IO.StreamReader(fileName, new System.Text.UTF8Encoding(false));
                throttlePos = (ThrottlePosition)serializer.Deserialize(sr);
                sr.Close();
            }
        }
Example #10
0
 /// <summary>
 /// Writer for BMS4.33 setting Override
 /// </summary>
 /// <param name="mainWindow"></param>
 /// <param name="appReg"></param>
 public OverrideSettingFor433(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
 {
     mainWindow.Tab_HSI_and_Altimeter.Visibility = Visibility.Collapsed;
 }
 public Launcher(AppRegInfo appReg, MainWindow mainWindow)
 {
     this.appReg     = appReg;
     this.mainWindow = mainWindow;
 }
 public Launcher433(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
 {
     mainWindow.Tab_HSI_and_Altimeter.Visibility    = Visibility.Collapsed;
     mainWindow.Misc_NaturalHeadMovement.Visibility = Visibility.Collapsed;
 }
Example #13
0
 /// <summary>
 /// Writer for BMS4.34 setting Override
 /// </summary>
 /// <param name="mainWindow"></param>
 /// <param name="appReg"></param>
 public OverrideSettingFor434(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
 {
 }
Example #14
0
        public KeyFile(string Filename, AppRegInfo appReg)
        {
            string stParentName = Path.GetDirectoryName(Filename);

            // Do BMS - FULL.key file exists at User/Config?
            if (File.Exists(Filename) == false)
            {
                MessageBoxResult result = MessageBox.Show
                                              ("App could not find " + Filename, "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            string[] lines = File.ReadAllLines(Filename, Encoding.UTF8);

            keyAssign = new KeyAssgn[lines.Length];

            int i = -1;

            foreach (string stBuffer in lines)
            {
                string[] stArrayData = stBuffer.Split(' ');

                if (stArrayData.Length < 7)
                {
                    continue;
                }
                if (stBuffer.Substring(0, 1) == "#")
                {
                    continue;
                }
                if (stArrayData[3] == "-2" | stArrayData[3] == "-3")
                {
                    continue;
                }

                // Okay now this line is confirmed to be a line that shows keyboard assignment.

                i           += 1;
                keyAssign[i] = new KeyAssgn(stBuffer);

                // What if the line format was broken?

                if (keyAssign[i].CheckFileCollapsing() == false)
                {
                    continue;
                }

                MessageBoxResult result = MessageBox.Show
                                              ("App found " + appReg.getKeyFileName() + " broken\nWould you like to restore it to the default?", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation);
                if (result == MessageBoxResult.OK)
                {
                    string fnamestock = appReg.GetInstallDir() + "\\Docs\\Key Files & Input\\" + appReg.getKeyFileName();
                    string fname      = appReg.GetInstallDir() + "\\User\\Config\\" + appReg.getKeyFileName();;
                    if (File.Exists(fnamestock))
                    {
                        File.Copy(fnamestock, fname, true);
                        Application.Current.Shutdown();
                        System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
                        return;
                    }
                    MessageBox.Show("App could not find " + appReg.getKeyFileName() + " at\nDocs\\Key Files & Input\\", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    Application.Current.Shutdown();
                    return;
                }
                Application.Current.Shutdown();
                return;
            }
            Array.Resize(ref keyAssign, i + 1);
        }
Example #15
0
 /// <summary>
 /// Writer for setting Override
 /// </summary>
 /// <param name="mainWindow"></param>
 /// <param name="appReg"></param>
 public OverrideSetting(MainWindow mainWindow, AppRegInfo appReg)
 {
     this.mainWindow = mainWindow;
     this.appReg     = appReg;
 }
Example #16
0
 /// <summary>
 /// Writer for UNDEFINED BMS VERSION setting Override
 /// </summary>
 /// <param name="mainWindow"></param>
 /// <param name="appReg"></param>
 public OverrideSettingForUNDEFINED(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
 {
     mainWindow.Misc_TrackIRZ.Visibility      = Visibility.Hidden;
     mainWindow.Misc_ExMouseLook.Visibility   = Visibility.Hidden;
     mainWindow.Misc_RollLinkedNWS.Visibility = Visibility.Hidden;
 }
        /// <summary>
        /// Execute when launching this app.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                // load command line.
                string[] args = Environment.GetCommandLineArgs();

                if (args.Length % 2 == 1)
                {
                    Dictionary <string, string> option = new Dictionary <string, string>();
                    for (int index = 1; index < args.Length; index += 2)
                    {
                        option.Add(args[index], args[index + 1]);
                    }
                    if (option.ContainsKey("/yame"))
                    {
                        if (option["/yame"] == "true")
                        {
                            FLG_YAME64 = true;
                        }
                    }

                    if (FLG_YAME64)
                    {
                        LargeTab.SelectedIndex  = 1;
                        Tab_Launcher.Visibility = Visibility.Collapsed;

                        Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                        BackGroundBox1.Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                        BackGroundBox2.Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                        BackGroundBox3.Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                        BackGroundBox4.Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                        BackGroundImage.Opacity   = 0;

                        Button_Apply_YAME64.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        Button_Apply_YAME64.Visibility = Visibility.Hidden;
                    }
                }
            }
            catch (FileNotFoundException ex)
            {
                Console.WriteLine(ex.Message);

                StreamWriter sw = new StreamWriter("C:\\FBMSAltLauncherErrorLog.txt", false, System.Text.Encoding.GetEncoding("shift_jis"));
                sw.Write(ex.Message);
                sw.Close();

                MessageBox.Show("Error Log Saved To C:\\FBMSAltLauncherErrorLog.txt", "WARNING", MessageBoxButton.OK, MessageBoxImage.Information);

                Close();
            }

            // Load UI Properties(Like Button Status).
            appProperties = new AppProperties(this);

            // Read Registry
            appReg = new AppRegInfo(this);

            if (appReg.getBMSVersion() == BMS_Version.UNDEFINED)
            {
                Close();
                return;
            }

            try
            {
                // Read Theater List
                TheaterList.Populate(appReg, Dropdown_TheaterList);

                // Get Devices
                deviceControl  = new DeviceControl(appReg);
                neutralButtons = new NeutralButtons[deviceControl.devList.Count];

                // Aquire joySticks
                AquireAll(true);

                // Reset All Axis Settings
                foreach (AxisName nme in axisNameList)
                {
                    inGameAxis[nme.ToString()] = new InGameAxAssgn();
                }
                joyAssign_2_inGameAxis();
                ResetAssgnWindow();

                // Read BMS-FULL.key
                string fname = appReg.GetInstallDir() + "\\User\\Config\\" + appReg.getKeyFileName();
                keyFile = new KeyFile(fname, appReg);

                // Write Data Grid
                WriteDataGrid();

                // Set Timer
                AxisMovingTimer.Tick    += AxisMovingTimer_Tick;
                AxisMovingTimer.Interval = new TimeSpan(0, 0, 0, 0, 16);

                KeyMappingTimer.Tick    += KeyMappingTimer_Tick;
                KeyMappingTimer.Interval = new TimeSpan(0, 0, 0, 0, 16);

                //System.Diagnostics.PresentationTraceSources.DataBindingSource.Switch.Level = System.Diagnostics.SourceLevels.Critical;
            }
            catch (FileNotFoundException ex)
            {
                Console.WriteLine(ex.Message);

                StreamWriter sw = new StreamWriter(appReg.GetInstallDir() + "\\Error.txt", false, System.Text.Encoding.GetEncoding("shift_jis"));
                sw.Write(ex.Message);
                sw.Close();

                MessageBox.Show("Error Log Saved To " + appReg.GetInstallDir() + "\\Error.txt", "WARNING", MessageBoxButton.OK, MessageBoxImage.Information);

                Close();
            }
        }
Example #18
0
        /// <summary>
        /// Execute when launching this app.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                // Load UI Properties(Like Button Status).
                this.appProperties = new AppProperties(this);

                // Read Registry
                appReg = new AppRegInfo(this);

                // Read Theater List
                TheaterList theaterlist = new TheaterList(appReg, this.Dropdown_TheaterList);

                // Get Devices
                deviceControl  = new DeviceControl(appReg);
                neutralButtons = new NeutralButtons[deviceControl.devList.Count];

                // Aquire joySticks
                AquireAll(true);

                // Reset All Axis Settings
                foreach (AxisName nme in axisNameList)
                {
                    inGameAxis[nme.ToString()] = new InGameAxAssgn();
                }
                joyAssign_2_inGameAxis();
                ResetAssgnWindow();

                // Read BMS-FULL.key
                string fname = appReg.GetInstallDir() + "\\User\\Config\\BMS - Full.key";
                keyFile = new KeyFile(fname, appReg);

                // Write Data Grid
                WriteDataGrid();

                // Set Timer
                AxisMovingTimer.Tick    += AxisMovingTimer_Tick;
                AxisMovingTimer.Interval = new TimeSpan(0, 0, 0, 0, 16);

                KeyMappingTimer.Tick    += KeyMappingTimer_Tick;
                KeyMappingTimer.Interval = new TimeSpan(0, 0, 0, 0, 16);

                // Set VisualAcuity page graph and results.
                this.visualAcuity = new VisualAcuity(this);

                //System.Diagnostics.PresentationTraceSources.DataBindingSource.Switch.Level = System.Diagnostics.SourceLevels.Critical;
            }
            catch (System.IO.FileNotFoundException ex)
            {
                System.Console.WriteLine(ex.Message);

                System.IO.StreamWriter sw = new System.IO.StreamWriter(appReg.GetInstallDir() + "\\Error.txt", false, System.Text.Encoding.GetEncoding("shift_jis"));
                sw.Write(ex.Message);
                sw.Close();

                this.Close();
            }

            // YAME 64 VERSION
            if (FLG_YAME64 == true)
            {
                LargeTab.SelectedIndex              = 1;
                Tab_Launcher.Visibility             = Visibility.Collapsed;
                Tab_VisualAcuity.Visibility         = Visibility.Collapsed;
                Misc_SmartScalingOverride.IsChecked = false;

                this.Background           = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                BackGroundBox1.Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                BackGroundBox2.Background = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
                BackGroundImage.Opacity   = 0;
            }
            else
            {
                Button_Apply_YAME64.Visibility = Visibility.Hidden;
            }
        }
Example #19
0
 public Launcher435(AppRegInfo appReg, MainWindow mainWindow) : base(appReg, mainWindow)
 {
 }