/************************************************************************/ /* 内部定義 */ /************************************************************************/ //============================================================================ //! システムイメージの作成 private void _CreateSystemImage() { var manager = ResourceManager.GetInstance(); var resource_Path = SystemUtility.GetResourcePath(); MemberHeaderImage.Source = manager.CreateImage(resource_Path + @"\System\MemberHeader.adg"); }
/************************************************************************/ /* 内部定義 */ /************************************************************************/ //============================================================================ //! 初期化 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; }
/************************************************************************/ /* 公開処理 */ /************************************************************************/ /// <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); } }