//============================================================================ //! メンバー状態を読み込み private void _ReadTeamData(string iFilePath) { try { var analayzer = new DL.CXmlAnalyzer(); analayzer.AnalyzeXmlFile(iFilePath); var node = analayzer.GetRootNode().GetChildNodeFromPath("TeamList")[0]; mTeamList.Clear(); foreach (var iNode in node.GetChildNode()) { var info = new STeamInfo(); info.mTeamID = int.Parse(iNode.GetChildNode("TeamID")[0].GetNodeInfo().mValue); info.mTeamName = iNode.GetChildNode("TeamName")[0].GetNodeInfo().mValue; info.mJoinIDList = new List <int>(); foreach (var iMemberNode in iNode.GetChildNode("MemberList")[0].GetChildNode()) { info.mJoinIDList.Add(int.Parse(iMemberNode.GetNodeInfo().mValue)); } info.mCloseFlg = (iNode.GetChildNode("CloseFlg")[0].GetNodeInfo().mValue == "1"); mTeamList.Add(info); } _Refresh(); } catch (System.Exception) { mTeamList.Clear(); } }
/************************************************************************/ /* 公開処理 */ /************************************************************************/ /// <summary> /// 設定されているプリセット名からプリセットデータをロードする /// </summary> public void LoadPreset() { try { string preset_Name = (string)DataManager.GetInstance().GetData(SaveManager.GetInstance().PresetInfoKey); string preset_Path = SystemUtility.GetResourcePath() + @"Preset\" + preset_Name + @"\"; var analayzer = new DL.CXmlAnalyzer(); analayzer.AnalyzeXmlFile(preset_Path + "Preset.psx"); //背景画像の取得 var node = analayzer.GetRootNode().GetChildNodeFromPath("Preset/BackGroundImage")[0]; mBackgroundImage = ResourceManager.GetInstance().CreateImage(preset_Path + node.GetNodeInfo().mValue + ".adg"); //キャラクター情報の読み込み node = analayzer.GetRootNode().GetChildNodeFromPath("Preset/Characters")[0]; foreach (var iNode in node.GetChildNode("Character")) { var info = new SCharacterInfo(); info.mIndex = int.Parse(iNode.GetChildNode("Index")[0].GetNodeInfo().mValue); info.mName = iNode.GetChildNode("Name")[0].GetNodeInfo().mValue; info.mIconColorList = new Color[2] { SystemUtility.StringToColor(iNode.GetChildNode("UpBGColor")[0].GetNodeInfo().mValue), SystemUtility.StringToColor(iNode.GetChildNode("DownBGColor")[0].GetNodeInfo().mValue) }; info.mNameColorList = new Color[2] { SystemUtility.StringToColor(iNode.GetChildNode("FontColor")[0].GetNodeInfo().mValue), SystemUtility.StringToColor(iNode.GetChildNode("ShadowFontColor")[0].GetNodeInfo().mValue) }; info.mIconImage = ResourceManager.GetInstance().CreateImage(preset_Path + @"\" + string.Format("CIC{0}.adg", info.mIndex)); mCharacterMap.Add(info.mIndex, info); } mUnknownCharacterIcon = ResourceManager.GetInstance().CreateImage(SystemUtility.GetResourcePath() + @"System\CIC_UKN.adg"); } catch (System.Exception iException) { SystemUtility.DisplayErrorDialog(string.Format("プリセットソースの読み込みに失敗しました\n[{0}]", iException.Message)); System.Environment.Exit(1); } }
/************************************************************************/ /* 内部定義 */ /************************************************************************/ //============================================================================ //! 初期化 private void _Initialize() { string preset_Path = SystemUtility.GetResourcePath() + @"Preset"; string[] directory_List = System.IO.Directory.GetDirectories(preset_Path); foreach (string iPath in directory_List) { string preset_File_Path = iPath + @"\Preset.psx"; try { if (System.IO.File.Exists(preset_File_Path)) { //XMLを開いてゲーム名を取得 var analayzer = new DL.CXmlAnalyzer(); analayzer.AnalyzeXmlFile(preset_File_Path); var node = analayzer.GetRootNode().GetChildNodeFromPath("Preset/GameName")[0]; string game_Name = node.GetNodeInfo().mValue; PresetComboBox.Items.Add(game_Name); //プリセット名を追加 string preset_Name = preset_File_Path.Substring(0, preset_File_Path.LastIndexOf(@"\")); preset_Name = preset_Name.Substring(preset_Name.LastIndexOf(@"\") + 1); mPresetNameList.Add(preset_Name); } } catch (System.Exception iException) { //無効なプリセットデータがあります string message = string.Format("不正なプリセットデータが存在します\n[{0}]\n\n -> {1}", preset_File_Path, iException.Message); SystemUtility.DisplayErrorDialog(message); System.Environment.Exit(1); } } //無し if (PresetComboBox.Items.Count == 0) { SystemUtility.DisplayErrorDialog("使用可能なプリセットデータが存在しません"); System.Environment.Exit(1); } //選択 PresetComboBox.SelectedIndex = 0; mSelectIndex = -1; }
//============================================================================ //! メンバー状態を読み込み private void _ReadMemberData(string iFilePath) { try { var analayzer = new DL.CXmlAnalyzer(); analayzer.AnalyzeXmlFile(iFilePath); var node = analayzer.GetRootNode().GetChildNodeFromPath("MemberList")[0]; mJoinMemberList.Clear(); foreach (var iNode in node.GetChildNode()) { var info = new SJoinMemberInfo(); info.mMemberID = int.Parse(iNode.GetChildNode("MemberID")[0].GetNodeInfo().mValue); info.mJoinID = int.Parse(iNode.GetChildNode("JoinID")[0].GetNodeInfo().mValue); info.mUseCharacterID = int.Parse(iNode.GetChildNode("CharacterID")[0].GetNodeInfo().mValue); mJoinMemberList.Add(info); } _RefreshMemberList(); } catch (System.Exception) { mJoinMemberList.Clear(); } }