예제 #1
0
        private void LoadRecoveryTaunts(HashSet <Skill> validTaunts = null)
        {
            String filePath = CheckSaveFile("StyleWT");

            if (File.Exists(filePath))
            {
                using (StreamReader sr = new StreamReader(filePath))
                {
                    var           lines          = File.ReadAllLines(filePath);
                    List <string> existingGroups = new List <string>();
                    foreach (String tauntData in lines)
                    {
                        try
                        {
                            WakeUpGroup newGroup  = new WakeUpGroup("");
                            String      groupName = newGroup.GetTauntDataName(tauntData);

                            if (existingGroups.Contains(groupName))
                            {
                                L.D(groupName + " already exists!");
                                foreach (WakeUpGroup styleGroup in wu_styles.Items)
                                {
                                    if (styleGroup.Name.Equals(groupName))
                                    {
                                        styleGroup.LoadWakeUpData(tauntData, validTaunts, modVersion);
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                L.D(groupName + " is a new WakeUpGroup!");
                                newGroup.LoadWakeUpData(tauntData, validTaunts, modVersion);
                                wu_styles.Items.Add(newGroup);
                                existingGroups.Add(groupName);
                            }
                        }
                        catch (Exception ex)
                        {
                            L.D("WakeUpTaunt Load Error:" + ex);
                        }
                    }

                    if (wu_styles.Items.Count > 0)
                    {
                        wu_styles.SelectedIndex = 0;
                    }
                    else
                    {
                        LoadWakeUp();
                    }
                }
            }
            else
            {
                LoadWakeUp();
            }

            filePath = CheckSaveFile("WrestlerWT");
            if (File.Exists(filePath))
            {
                var           lines          = File.ReadAllLines(filePath);
                List <string> existingGroups = new List <string>();
                foreach (String tauntData in lines)
                {
                    try
                    {
                        WakeUpGroup newGroup  = new WakeUpGroup("");
                        String      groupName = newGroup.GetTauntDataName(tauntData);

                        if (existingGroups.Contains(groupName))
                        {
                            L.D(groupName + " already exists!");
                            foreach (WakeUpGroup wrestlerGroup in wu_wrestlers.Items)
                            {
                                if (wrestlerGroup.Name.Equals(groupName))
                                {
                                    wrestlerGroup.LoadWakeUpData(tauntData, validTaunts, modVersion);
                                    break;
                                }
                            }
                        }
                        else
                        {
                            L.D(groupName + " is a new WakeUpGroup!");
                            newGroup.LoadWakeUpData(tauntData, validTaunts, modVersion);
                            wu_wrestlers.Items.Add(newGroup);
                            existingGroups.Add(groupName);
                        }
                    }
                    catch (Exception ex)
                    {
                        L.D("WakeUpTaunt Load Error:" + ex);
                    }
                }


                if (wu_wrestlers.Items.Count > 0)
                {
                    wu_wrestlers.SelectedIndex = 0;
                }
            }

            SetValidMoves();
        }