private async void DeleteSkinPackButton_Click(object sender, RoutedEventArgs e)
        {
            MoreButton.ContextMenu.IsOpen = false;
            var skinPack = GetParent().LoadedSkinPacks.SelectedItem as MCSkinPack;

            if (skinPack == null)
            {
                return;
            }

            var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
            var content = this.FindResource("Dialog_DeleteItem_Text") as string;
            var item    = this.FindResource("Dialog_Item_SkinPack_Text") as string;

            var result = await DialogPrompt.ShowDialog_YesNo(title, content, item, skinPack.DisplayName);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    Directory.Delete(skinPack.Directory, true);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine(ex);
                }
                GetParent().ReloadSkinPacks();
            }
        }
        public async void InvokeKillGame()
        {
            if (ConfigManager.GameManager.GameProcess != null)
            {
                var title   = Application.Current.FindResource("Dialog_KillGame_Title") as string;
                var content = Application.Current.FindResource("Dialog_KillGame_Text") as string;

                var result = await DialogPrompt.ShowDialog_YesNo(title, content);

                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    GameProcess.Kill();
                }
            }
        }
Beispiel #3
0
        private async void RemoveProfileButton_Click(object sender, RoutedEventArgs e)
        {
            var profile = Properties.LauncherSettings.Default.CurrentProfile;

            var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
            var content = this.FindResource("Dialog_DeleteItem_Text") as string;
            var item    = this.FindResource("Dialog_Item_Profile_Text") as string;

            var result = await DialogPrompt.ShowDialog_YesNo(title, content, item, profile);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                ConfigManager.RemoveProfile(profile);
            }
        }
        private async void DeleteInstallationButton_Click(object sender, RoutedEventArgs e)
        {
            var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
            var content = this.FindResource("Dialog_DeleteItem_Text") as string;
            var item    = this.FindResource("Dialog_Item_Installation_Text") as string;

            MenuItem button       = sender as MenuItem;
            var      installation = button.DataContext as BLInstallation;
            var      result       = await DialogPrompt.ShowDialog_YesNo(title, content, item, installation.DisplayName_Full);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                LauncherModel.Default.Config.Installation_Delete(installation);
            }
        }
        private async void DeleteInstallationButton_Click(object sender, RoutedEventArgs e)
        {
            var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
            var content = this.FindResource("Dialog_DeleteItem_Text") as string;
            var item    = this.FindResource("Dialog_Item_Installation_Text") as string;

            MenuItem button       = sender as MenuItem;
            var      installation = button.DataContext as Classes.MCInstallation;
            var      result       = await DialogPrompt.ShowDialog_YesNo(title, content, item, installation.DisplayName);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                ConfigManager.DeleteInstallation(installation);
                ConfigManager.MainThread.RefreshInstallationList();
            }
        }
        private async void Delete_Click(object sender, RoutedEventArgs e)
        {
            Button button  = sender as Button;
            var    version = button.DataContext as Classes.MCVersion;

            var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
            var content = this.FindResource("Dialog_DeleteItem_Text") as string;
            var item    = this.FindResource("Dialog_Item_Version_Text") as string;

            var result = await DialogPrompt.ShowDialog_YesNo(title, content, item, version.DisplayName);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                ConfigManager.GameManager.Remove(version);
                GetParent().RefreshVersionsList();
            }
        }
Beispiel #7
0
        private async void Delete_Click(object sender, RoutedEventArgs e)
        {
            MenuItem button = sender as MenuItem;
            var      mod    = button.DataContext as Classes.DungeonsMod;

            var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
            var content = this.FindResource("Dialog_DeleteItem_Text") as string;
            var item    = "mod";

            var result = await DialogPrompt.ShowDialog_YesNo(title, content, item, mod.Name);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                mod.Delete();
                RefreshModsList();
            }
        }
        private async void DeleteSkinButton_Click(object sender, RoutedEventArgs e)
        {
            var skinPack = GetParent().LoadedSkinPacks.SelectedItem as MCSkinPack;
            var skin     = GetParent().SkinPreviewList.SelectedItem as MCSkin;
            int index    = GetParent().SkinPreviewList.SelectedIndex;

            if (skin != null && skinPack != null)
            {
                var title   = this.FindResource("Dialog_DeleteItem_Title") as string;
                var content = this.FindResource("Dialog_DeleteItem_Text") as string;
                var item    = this.FindResource("Dialog_Item_Skin_Text") as string;

                var result = await DialogPrompt.ShowDialog_YesNo(title, content, item, skinPack.GetLocalizedSkinName(skin.localization_name));

                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    skinPack.RemoveSkin(index);
                    GetParent().ReloadSkinPacks();
                }
            }
        }