示例#1
0
        public Host(bool options, bool isranked)
        {
            InitializeComponent();

            if (options)
            {
                TimeLimit.SelectedItem = Program.Config.TimeLimit;
                BanList.SelectedItem   = Program.Config.BanList;
                Mode.SelectedItem      = Program.Config.Mode;
                GameName.Text          = Program.Config.GameName;
                CardRules.SelectedItem = Program.Config.CardRules;
                Priority.Checked       = Program.Config.EnablePrority;
                ShuffleDeck.Checked    = Program.Config.DisableShuffleDeck;
                CheckDeck.Checked      = Program.Config.DisableCheckDeck;
                BanList.Items.AddRange(LauncherHelper.GetBanListArray());
            }
            else
            {
                TimeLimit.SelectedIndex = 0;
                CardRules.SelectedIndex = 0;
                Mode.SelectedIndex      = 0;
                GameName.Text           = LauncherHelper.GenerateString().Substring(0, 5);
                BanList.Items.AddRange(LauncherHelper.GetBanListArray());
                BanList.SelectedIndex = 0;
            }
            Mode.SelectedIndexChanged += DuelModeChanged;
            if (!isranked)
            {
                CardRules.SelectedIndexChanged += new EventHandler(CardRulesChanged);
            }
            ApplyTranslation();
        }
示例#2
0
        private void BackUpBtn_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want to back up the current game Textures?", "Backup Textures", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
            {
                if (!ThemeExists("Backup Theme"))
                {
                    AddTheme("Backup Theme");
                }
                SelectedTheme            = "Backup Theme";
                ThemeSelect.SelectedItem = "Backup Theme";

                foreach (ContentType type in ItemKeys())
                {
                    if (type != ContentType.Music && type != ContentType.Sound_Effects)
                    {
                        try
                        {
                            string GeneratedString = LauncherHelper.GenerateString();
                            File.Copy(Data[type].GameItem, Data[type].AssetPath + GeneratedString + Data[type].FileType);
                            AddThemeItem(type, Data[type].AssetPath + GeneratedString + Data[type].FileType, GeneratedString);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
                RefreshList();
                RefreshInstalledThemeItems();
                SaveTheme("Backup Theme");
                ThemeSelect.Items.Add("Backup Theme");
                ThemeSelect.SelectedItem = "Backup Theme";
            }
        }