private void LangGerman(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("de-DE");
 }
 private void LangBrazil(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("pt-PT");
 }
 private void LangFrench(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("fr-FR");
 }
Ejemplo n.º 4
0
 private void manager_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.StartManager();
 }
 private void LangSpanish(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("es-ES");
 }
 private void buttonScenes_Click(object sender, RoutedEventArgs e)
 {
     EnvironmentHelper.OpenDirectory("UserData\\Studio\\scene");
 }
 private void buttonScreenshot_Click(object sender, RoutedEventArgs e)
 {
     EnvironmentHelper.OpenDirectory("UserData\\cap");
 }
 private void update_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.StartUpdate();
 }
 private void LangEnglish(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("en-US");
 }
 private void discord_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.StartProcess(SupportDiscord);
 }
 private void patreon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.StartProcess(EnvironmentHelper.PatreonUrl);
 }
 private void buttonManualV_Click(object sender, RoutedEventArgs e)
 {
     EnvironmentHelper.ShowManual($"{EnvironmentHelper.GameRootDirectory}\\manual_vr\\");
 }
        public MainWindow()
        {
            try
            {
                _suppressEvents = true;

                // Initialize code -------------------------------------
                EnvironmentHelper.Initialize(_builtinLanguages);

                _mainGameExists = File.Exists(EnvironmentHelper.GameRootDirectory + ExecutableGame);
                _studioExists   = File.Exists(EnvironmentHelper.GameRootDirectory + ExecutableStudio);

                if (_studioExists)
                {
                    SettingManager.Initialize(EnvironmentHelper.GetConfigFilePath(), RegistryKeyGame,
                                              RegistryKeyStudio, RegistryKeyVR);
                }
                else
                {
                    SettingManager.Initialize(EnvironmentHelper.GetConfigFilePath(), RegistryKeyGame);
                }

                SettingManager.LoadSettings();


                // Initialize interface --------------------------------
                InitializeComponent();

                WindowStartupLocation = WindowStartupLocation.CenterScreen;
                CustomRes.Visibility  = Visibility.Hidden;

                if (string.IsNullOrEmpty((string)labelTranslated.Content))
                {
                    labelTranslated.Visibility       = Visibility.Hidden;
                    labelTranslatedBorder.Visibility = Visibility.Hidden;
                }

                if (!EnvironmentHelper.KKmanExist)
                {
                    gridUpdate.Visibility = Visibility.Hidden;
                }

                // Launcher Customization: Defining Warning, background and character
                if (!string.IsNullOrEmpty(EnvironmentHelper.VersionString))
                {
                    labelDist.Content = EnvironmentHelper.VersionString;
                }

                if (!string.IsNullOrEmpty(EnvironmentHelper.WarningString))
                {
                    warningText.Text = EnvironmentHelper.WarningString;
                }

                if (EnvironmentHelper.CustomCharacterImage != null)
                {
                    PackChara.Source = EnvironmentHelper.CustomCharacterImage;
                }
                if (EnvironmentHelper.CustomBgImage != null)
                {
                    appBG.ImageSource = EnvironmentHelper.CustomBgImage;
                }

                if (string.IsNullOrEmpty(EnvironmentHelper.PatreonUrl))
                {
                    linkPatreon.Visibility   = Visibility.Collapsed;
                    patreonBorder.Visibility = Visibility.Collapsed;
                    patreonIMG.Visibility    = Visibility.Collapsed;
                }

                var primaryDisplay = Localizable.PrimaryDisplay;
                var subDisplay     = Localizable.SubDisplay;
                for (var i = 0; i < Screen.AllScreens.Length; i++)
                {
                    // 0 is primary
                    var newItem = i == 0 ? primaryDisplay : $"{subDisplay} : " + i;
                    dropDisplay.Items.Add(newItem);
                }

                PlayHomeStartup();

                PluginToggleManager.CreatePluginToggles(Toggleables);

                _suppressEvents = false;

                UpdateDisplaySettings(SettingManager.CurrentSettings.FullScreen);

                Closed    += (sender, args) => SettingManager.SaveSettings();
                MouseDown += (sender, args) =>
                {
                    if (args.ChangedButton == MouseButton.Left)
                    {
                        DragMove();
                    }
                };
                buttonClose.Click += (sender, args) => Close();
            }
            catch (Exception e)
            {
                MessageBox.Show(
                    "Failed to start the launcher, please consider reporting this error to the developers.\n\nError that caused the crash: " +
                    e, "Launcher crash", MessageBoxButtons.OK, MessageBoxIcon.Error);
                File.WriteAllText(Path.Combine(EnvironmentHelper.GameRootDirectory, "launcher_crash.log"),
                                  e.ToString());
                Close();
            }
        }
Ejemplo n.º 14
0
 private void LangRussian(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("ru-RU");
 }
 private void LangNorwegian(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("no-NB");
 }
 private void LangJapanese(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("ja-JP");
 }
 private void buttonInst_Click(object sender, RoutedEventArgs e)
 {
     EnvironmentHelper.OpenDirectory("");
 }
 private void LangChineseTW(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("zh-TW");
 }
 private void buttonUserData_Click(object sender, RoutedEventArgs e)
 {
     EnvironmentHelper.OpenDirectory("UserData");
 }
 private void LangKorean(object sender, MouseButtonEventArgs e)
 {
     EnvironmentHelper.SetLanguage("ko-KR");
 }
 private void buttonMaleCard_Click(object sender, RoutedEventArgs e)
 {
     EnvironmentHelper.OpenDirectory("UserData\\chara\\male");
 }
Ejemplo n.º 22
0
        public MainWindow()
        {
            try
            {
                _suppressEvents = true;

                if (!File.Exists(EnvironmentHelper.GameRootDirectory + ExecutableGame))
                {
                    ExecutableGame = "AI-Syoujyo.exe";
                }

                // Initialize code -------------------------------------
                string tempgamedir =
                    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                bool isGameConverted = File.Exists($"{tempgamedir}/abdata/BRConvert/OK.txt");

                if (isGameConverted)
                {
                    RegistryKeyGame   = "Software\\illusion\\AI-Syoujyo\\AI-Syoujyo\\";
                    RegistryKeyStudio = "Software\\illusion\\AI-Syoujyo\\StudioNEOV2";
                    ExecutableGame    = "AI-Syoujyo.exe";
                }

                EnvironmentHelper.Initialize(!isGameConverted ? _builtinLanguages : _builtinLanguagesConvert);

                _mainGameExists = File.Exists(EnvironmentHelper.GameRootDirectory + ExecutableGame);
                _studioExists   = File.Exists(EnvironmentHelper.GameRootDirectory + ExecutableStudio);

                if (_studioExists)
                {
                    SettingManager.Initialize(EnvironmentHelper.GetConfigFilePath(), RegistryKeyGame, RegistryKeyStudio);
                }
                else
                {
                    SettingManager.Initialize(EnvironmentHelper.GetConfigFilePath(), RegistryKeyGame);
                }

                SettingManager.LoadSettings();

                // Initialize interface --------------------------------
                InitializeComponent();

                WindowStartupLocation = WindowStartupLocation.CenterScreen;
                CustomRes.Visibility  = Visibility.Hidden;

                if (string.IsNullOrEmpty((string)labelTranslated.Content))
                {
                    labelTranslated.Visibility       = Visibility.Hidden;
                    labelTranslatedBorder.Visibility = Visibility.Hidden;
                }

                if (!EnvironmentHelper.KKmanExist)
                {
                    gridUpdate.Visibility = Visibility.Hidden;
                }

                /*
                 * // Launcher Customization: Defining Warning, background and character
                 * if (!string.IsNullOrEmpty(EnvironmentHelper.VersionString))
                 *  labelDist.Content = EnvironmentHelper.VersionString;
                 */
                if (!string.IsNullOrEmpty(EnvironmentHelper.WarningString))
                {
                    warningText.Text = EnvironmentHelper.WarningString;
                }

                if (EnvironmentHelper.CustomCharacterImage != null)
                {
                    PackChara.Source = EnvironmentHelper.CustomCharacterImage;
                }
                if (EnvironmentHelper.CustomBgImage != null)
                {
                    appBG.ImageSource = EnvironmentHelper.CustomBgImage;
                }


                var primaryDisplay = Localizable.PrimaryDisplay;
                var subDisplay     = Localizable.SubDisplay;
                for (var i = 0; i < Screen.AllScreens.Length; i++)
                {
                    // 0 is primary
                    var newItem = i == 0 ? primaryDisplay : $"{subDisplay} : " + i;
                    dropDisplay.Items.Add(newItem);
                }

                PluginToggleManager.CreatePluginToggles(Toggleables);

                _suppressEvents = false;

                UpdateDisplaySettings(SettingManager.CurrentSettings.FullScreen);

                Closed    += (sender, args) => SettingManager.SaveSettings();
                MouseDown += (sender, args) => { if (args.ChangedButton == MouseButton.Left)
                                                 {
                                                     DragMove();
                                                 }
                };
                buttonClose.Click += (sender, args) => Close();
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to start the launcher, please consider reporting this error to the developers.\n\nError that caused the crash: " + e, "Launcher crash", MessageBoxButtons.OK, MessageBoxIcon.Error);
                File.WriteAllText(Path.Combine(EnvironmentHelper.GameRootDirectory, "launcher_crash.log"), e.ToString());
                Close();
            }
        }