private void SelectItemButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnAddDeck": new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) => { innerDeckNode.AddXmlInfoByPath("Card", selectedItem); InitLbxCards(); }, SubWindows.InputInfoWithSearchWindow_PRESET.CARDS).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DECKS); break; case "BtnDeleteDeck": if (LbxCards.SelectedItem != null) { innerDeckNode.RemoveXmlInfosByPath("Card", LbxCards.SelectedItem.ToString().Split(':').Last(), deleteOnce: true); InitLbxCards(); } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DECKS); break; } }
/// <summary> /// Button events that need search window /// </summary> private void SelectItemButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnFormation": new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) => { waveNode.SetXmlInfoByPath("Formation", selectedItem); string FORMATION_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"FORMATION"); BtnFormation.ToolTip = $"{FORMATION_WORD} : {DM.LocalizedGameDescriptions.GetDescriptionForFormation(selectedItem)}"; LblFormation.Content = $"{FORMATION_WORD} : {DM.LocalizedGameDescriptions.GetDescriptionForFormation(selectedItem)}"; BtnFormation.Content = " "; }, SubWindows.InputInfoWithSearchWindow_PRESET.FORMATION).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); break; case "BtnUnits": List <string> selectedEnemies = new List <string>(); waveNode.ActionXmlDataNodesByPath("Unit", (DM.XmlDataNode unitNode) => { selectedEnemies.Add($"{DM.LocalizedGameDescriptions.GetDescriptionForEnemy(unitNode.innerText)}:{unitNode.innerText}"); }); new SubWindows.Global_AddItemToListWindow((string addedEnemyID) => { waveNode.AddXmlInfoByPath("Unit", addedEnemyID); }, (string deletedEnemyID) => { waveNode.RemoveXmlInfosByPath("Unit", deletedEnemyID, deleteOnce: true); }, selectedEnemies, SubWindows.AddItemToListWindow_PRESET.ENEMIES).ShowDialog(); List <DM.XmlDataNode> unitNodes = waveNode.GetXmlDataNodesByPathWithXmlInfo("Unit"); string unitStr = ""; if (unitNodes.Count > 0) { unitNodes.ForEach((DM.XmlDataNode unitNode) => { unitStr += $" {DM.LocalizedGameDescriptions.GetDescriptionForEnemy(unitNode.innerText)}:{unitNode.innerText} /"; }); unitStr = unitStr.Trim('/'); if (!string.IsNullOrEmpty(unitStr.Trim())) { BtnUnits.ToolTip = unitStr; LblUnits.Content = unitStr; BtnUnits.Content = " "; } } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); break; } }
private void SelectItemButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnBookID": new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) => { innerEnemyNode.SetXmlInfoByPath("BookId", selectedItem); string BOOK_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"BOOK"); BtnBookID.ToolTip = $"{BOOK_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForKeyBook(selectedItem)}"; LblBookID.Content = $"{BOOK_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForKeyBook(selectedItem)}"; BtnBookID.Content = " "; }, SubWindows.InputInfoWithSearchWindow_PRESET.CRITICAL_BOOKS).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); break; case "BtnDeckID": new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) => { innerEnemyNode.SetXmlInfoByPath("DeckId", selectedItem); string DECK_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"DECK"); BtnDeckID.ToolTip = $"{DECK_WORD} : {DM.LocalizedGameDescriptions.GetDecriptionForDeck(selectedItem)}"; LblDeckID.Content = $"{DECK_WORD} : {DM.LocalizedGameDescriptions.GetDecriptionForDeck(selectedItem)}"; BtnDeckID.Content = " "; }, SubWindows.InputInfoWithSearchWindow_PRESET.DECKS).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DECKS); break; case "BtnRewardLevel_0": case "BtnRewardLevel_1": case "BtnRewardLevel_2": case "BtnRewardLevel_3": string DROP_BOOK_LEVEL = btn.Name.Split('_').Last(); List <string> dropTableItems = new List <string>(); innerEnemyNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "Level", DROP_BOOK_LEVEL, (DM.XmlDataNode dropTableNode) => { dropTableNode.ActionXmlDataNodesByPath("DropItem", (DM.XmlDataNode dropItemNode) => { dropTableItems.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(dropItemNode.innerText)); }); }); new SubWindows.Global_AddItemToListWindow((string addedDropBookItemID) => { if (!innerEnemyNode.CheckIfGivenPathWithXmlInfoExists("DropTable", attributeToCheck: new Dictionary <string, string>() { { "Level", DROP_BOOK_LEVEL } })) { innerEnemyNode.AddXmlInfoByPath("DropTable", attributePairsToSet: new Dictionary <string, string>() { { "Level", DROP_BOOK_LEVEL } }); } innerEnemyNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "Level", DROP_BOOK_LEVEL, (DM.XmlDataNode dropTableNode) => { dropTableNode.AddXmlInfoByPath("DropItem", valueToSet: addedDropBookItemID, attributePairsToSet: new Dictionary <string, string>() { { "Prob", "1" } }); }); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); MainWindow.mainWindow.UpdateDebugInfo(); }, (string deletedDropBookItemID) => { innerEnemyNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "Level", DROP_BOOK_LEVEL, (DM.XmlDataNode dropTableNode) => { dropTableNode.RemoveXmlInfosByPath("DropItem", deletedDropBookItemID); }); List <string> dropIDs = new List <string>(); innerEnemyNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "Level", DROP_BOOK_LEVEL, (DM.XmlDataNode dropTableNode) => { dropTableNode.ActionXmlDataNodesByPath("DropItem", (DM.XmlDataNode dropItemNode) => { dropIDs.Add(dropItemNode.innerText); }); }); if (dropIDs.Count <= 0) { innerEnemyNode.RemoveXmlInfosByPath("DropTable", attributeToCheck: new Dictionary <string, string>() { { "Level", DROP_BOOK_LEVEL } }); } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); MainWindow.mainWindow.UpdateDebugInfo(); }, dropTableItems, SubWindows.AddItemToListWindow_PRESET.DROP_BOOK).ShowDialog(); InitRewards(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); break; } }
/// <summary> /// Right menu button events /// </summary> private void RightMenuButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnExtraInfo": string AffectionPrev = ""; innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) => { AffectionPrev = specNode.GetAttributesSafe("Affection"); }); new SubWindows.Global_MultipleValueInputed(new Dictionary <string, string>() { { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Chapter"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnDropCards_ToolTip%") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"PriorityEnemy"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"PriorityEnemy_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"PriorityUser"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"PriorityUser_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"PriorityScript"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"PriorityScript_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"EmotionLimit"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"EmotionLimit_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"WideAreaCode"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"WideAreaCode_ToolTip") } }, new List <string>() { innerCardNode.GetInnerTextByPath("Chapter"), innerCardNode.GetInnerTextByPath("Priority"), innerCardNode.GetInnerTextByPath("SortPriority"), innerCardNode.GetInnerTextByPath("PriorityScript"), innerCardNode.GetInnerTextByPath("EmotionLimit"), AffectionPrev }, new List <Action <string> >() { (string inputedVar) => { innerCardNode.SetXmlInfoByPathAndEmptyWillRemove("Chapter", inputedVar); }, (string inputedVar) => { innerCardNode.SetXmlInfoByPathAndEmptyWillRemove("Priority", inputedVar); }, (string inputedVar) => { innerCardNode.SetXmlInfoByPathAndEmptyWillRemove("SortPriority", inputedVar); }, (string inputedVar) => { innerCardNode.SetXmlInfoByPathAndEmptyWillRemove("PriorityScript", inputedVar); }, (string inputedVar) => { innerCardNode.SetXmlInfoByPathAndEmptyWillRemove("EmotionLimit", inputedVar); }, (string inputedVar) => { innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) => { specNode.attribute["Affection"] = inputedVar; MainWindow.mainWindow.UpdateDebugInfo(); }); } }).ShowDialog(); UpdateExtrainfoIcon(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD); break; case "BtnDropCards": List <string> selectedCardDropTables = new List <string>(); DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.GetXmlDataNodesByPath("DropTable").ForEachSafe((DM.XmlDataNode cardDropTableID) => { if (cardDropTableID.CheckIfGivenPathWithXmlInfoExists("Card", innerCardNode.GetAttributesSafe("ID"))) { selectedCardDropTables.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(cardDropTableID.attribute["ID"])); } }); new SubWindows.Global_AddItemToListWindow((string addedDropTableItemID) => { if (DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.CheckIfGivenPathWithXmlInfoExists("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", addedDropTableItemID } })) { List <DM.XmlDataNode> foundCardDropTableNode = (DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", addedDropTableItemID } })); if (foundCardDropTableNode.Count > 0 && !foundCardDropTableNode[0].CheckIfGivenPathWithXmlInfoExists("Card", innerCardNode.GetAttributesSafe("ID"))) { foundCardDropTableNode[0].AddXmlInfoByPath("Card", innerCardNode.GetAttributesSafe("ID")); } } else { DM.XmlDataNode madeDropTableNode = DM.EditGameData_CardInfos.MakeNewStaticCardDropTableBase(addedDropTableItemID); if (!madeDropTableNode.CheckIfGivenPathWithXmlInfoExists("Card", innerCardNode.GetAttributesSafe("ID"))) { madeDropTableNode.AddXmlInfoByPath("Card", innerCardNode.GetAttributesSafe("ID")); DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.subNodes.Add(madeDropTableNode); } } MainWindow.mainWindow.UpdateDebugInfo(); }, (string deletedDropTableItemID) => { if (DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.CheckIfGivenPathWithXmlInfoExists("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", deletedDropTableItemID } })) { List <DM.XmlDataNode> foundCardDropTableNode = (DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", deletedDropTableItemID } })); if (foundCardDropTableNode.Count > 0) { DM.XmlDataNode FOUND_CARD_DROP_TABLE_NODE = foundCardDropTableNode[0]; List <DM.XmlDataNode> baseCardDropTableNode = DM.GameInfos.staticInfos["CardDropTable"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", deletedDropTableItemID } }); if (baseCardDropTableNode.Count > 0) { DM.XmlDataNode FOUND_CARD_DROP_TABLE_IN_GAME = baseCardDropTableNode[0]; List <string> foundCardDropTablesInGameItems = new List <string>(); FOUND_CARD_DROP_TABLE_IN_GAME.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { foundCardDropTablesInGameItems.Add(cardNode.innerText); }); if (DM.EditGameData_CardInfos.StaticCard.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Card", attributeToCheck: new Dictionary <string, string>() { { "ID", innerCardNode.GetAttributesSafe("ID") } }).Count == 1 && !foundCardDropTablesInGameItems.Contains(innerCardNode.GetAttributesSafe("ID"))) { FOUND_CARD_DROP_TABLE_NODE.RemoveXmlInfosByPath("Card", innerCardNode.GetAttributesSafe("ID")); } List <string> foundCardDropTables = new List <string>(); FOUND_CARD_DROP_TABLE_NODE.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { foundCardDropTables.Add(cardNode.innerText); }); if (foundCardDropTables.Count == foundCardDropTablesInGameItems.Count && foundCardDropTables.Except(foundCardDropTablesInGameItems).Count() == 0 && DM.EditGameData_CardInfos.StaticCard.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Card", attributeToCheck: new Dictionary <string, string>() { { "ID", innerCardNode.GetAttributesSafe("ID") } }).Count == 1) { bool isContainAnyExistCard = false; DM.EditGameData_CardInfos.StaticCard.rootDataNode.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { if (foundCardDropTables.Contains(cardNode.GetAttributesSafe("ID")) && cardNode.GetAttributesSafe("ID") != innerCardNode.GetAttributesSafe("ID")) { isContainAnyExistCard = true; } }); if (!isContainAnyExistCard) { DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.RemoveXmlInfosByPath("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", deletedDropTableItemID } }, deleteOnce: true); } } } } MainWindow.mainWindow.UpdateDebugInfo(); } }, selectedCardDropTables, SubWindows.AddItemToListWindow_PRESET.DROP_TABLE).ShowDialog(); List <string> selectedCardDropTablesToCheck = new List <string>(); DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.GetXmlDataNodesByPath("DropTable").ForEachSafe((DM.XmlDataNode cardDropTableID) => { if (cardDropTableID.CheckIfGivenPathWithXmlInfoExists("Card", innerCardNode.attribute["ID"])) { selectedCardDropTablesToCheck.Add(cardDropTableID.attribute["ID"]); } }); if (selectedCardDropTablesToCheck.Count > 0) { string extraInfo = ""; selectedCardDropTablesToCheck.ForEach((string dropBookInfo) => { extraInfo += $"{DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(dropBookInfo)}\n"; }); extraInfo = extraInfo.TrimEnd('\n'); BtnDropCards.Background = Tools.ColorTools.GetImageBrushFromPath(this, "../Resources/iconYesDropBook.png"); BtnDropCards.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnDropCards_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.BOOK_INFO, $"Inputted")})\n{extraInfo}"; } else { BtnDropCards.Background = Tools.ColorTools.GetImageBrushFromPath(this, "../Resources/iconNoDropBook.png"); BtnDropCards.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnDropCards_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.BOOK_INFO, $"NotInputted")})"; } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD_DROP_TABLE); break; case "BtnCopyCard": DM.EditGameData_CardInfos.StaticCard.rootDataNode.subNodes.Add(innerCardNode.Copy()); initStack(); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD); break; case "BtnDelete": if (DM.EditGameData_CardInfos.LocalizedBattleCards.rootDataNode.CheckIfGivenPathWithXmlInfoExists("cardDescList/BattleCardDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", innerCardNode.GetAttributesSafe("ID") } })) { DM.EditGameData_CardInfos.LocalizedBattleCards.rootDataNode.RemoveXmlInfosByPath("cardDescList/BattleCardDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", innerCardNode.GetAttributesSafe("ID") } }, deleteOnce: true); } DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.GetXmlDataNodesByPath("DropTable").ForEach((DM.XmlDataNode dropTableNode) => { List <DM.XmlDataNode> baseCardDropTableNode = DM.GameInfos.staticInfos["CardDropTable"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", dropTableNode.GetAttributesSafe("ID") } }); if (baseCardDropTableNode.Count > 0) { DM.XmlDataNode FOUND_CARD_DROP_TABLE_IN_GAME = baseCardDropTableNode[0]; List <string> foundCardDropTablesInGameItems = new List <string>(); FOUND_CARD_DROP_TABLE_IN_GAME.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { foundCardDropTablesInGameItems.Add(cardNode.innerText); }); if (DM.EditGameData_CardInfos.StaticCard.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Card", attributeToCheck: new Dictionary <string, string>() { { "ID", innerCardNode.GetAttributesSafe("ID") } }).Count == 1 && !foundCardDropTablesInGameItems.Contains(innerCardNode.GetAttributesSafe("ID"))) { dropTableNode.RemoveXmlInfosByPath("Card", innerCardNode.GetAttributesSafe("ID")); } List <string> foundCardDropTables = new List <string>(); dropTableNode.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { foundCardDropTables.Add(cardNode.innerText); }); if (foundCardDropTables.Count == foundCardDropTablesInGameItems.Count && foundCardDropTables.Except(foundCardDropTablesInGameItems).Count() == 0 && DM.EditGameData_CardInfos.StaticCard.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Card", attributeToCheck: new Dictionary <string, string>() { { "ID", innerCardNode.GetAttributesSafe("ID") } }).Count == 1) { bool isContainAnyExistCard = false; DM.EditGameData_CardInfos.StaticCard.rootDataNode.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { if (foundCardDropTables.Contains(cardNode.GetAttributesSafe("ID")) && cardNode.GetAttributesSafe("ID") != innerCardNode.GetAttributesSafe("ID")) { isContainAnyExistCard = true; } }); if (!isContainAnyExistCard) { DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.RemoveXmlInfosByPath("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", dropTableNode.GetAttributesSafe("ID") } }, deleteOnce: true); } } } }); DM.EditGameData_CardInfos.StaticCard.rootDataNode.subNodes.Remove(innerCardNode); initStack(); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD); break; } }
/// <summary> /// Button events that need search window /// </summary> private void SelectItemButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnStage": new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) => { DM.GameInfos.staticInfos["StageInfo"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Stage", attributeToCheck: new Dictionary <string, string>() { { "id", selectedItem } }).ActionOneItemSafe((DM.XmlDataNode stageNode) => { innerStageNode.SetXmlInfoByPath("Chapter", stageNode.GetInnerTextByPath("Chapter")); innerStageNode.SetXmlInfoByPath("StoryType", stageNode.GetInnerTextByPath("StoryType")); innerStageNode.RemoveXmlInfosByPath("Story"); DM.XmlDataNode copyedStageNode = stageNode.Copy(); innerStageNode.subNodes.AddRange(copyedStageNode.GetXmlDataNodesByPath("Story")); string EPISODE_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"EPISODE"); BtnStage.ToolTip = $"{EPISODE_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStage(selectedItem)}"; LblStage.Content = $"{EPISODE_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStage(selectedItem)}";; BtnStage.Content = " "; }); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); }, SubWindows.InputInfoWithSearchWindow_PRESET.EPISODE).ShowDialog(); break; case "BtnStageCustom": new SubWindows.Global_MultipleValueInputed(new Dictionary <string, string>() { { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"Chapter"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"Chapter_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"StoryType"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"StoryType_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"Story_Start_Conditon"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"Story_Start_Conditon_ToolTip") }, { DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"Story_End_Conditon"), DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"Story_End_Conditon_TooTip") } }, new List <string>() { innerStageNode.GetInnerTextByPath("Chapter"), innerStageNode.GetInnerTextByPath("StoryType"), innerStageNode.GetInnerTextByAttributeWithPath("Story", "Condition", "Start"), innerStageNode.GetInnerTextByAttributeWithPath("Story", "Condition", "End") }, new List <Action <string> >() { (string inputedVar) => { innerStageNode.SetXmlInfoByPathAndEmptyWillRemove("Chapter", inputedVar); }, (string inputedVar) => { innerStageNode.SetXmlInfoByPathAndEmptyWillRemove("StoryType", inputedVar); }, (string inputedVar) => { innerStageNode.ActionXmlDataNodesByAttributeWithPath("Story", "Condition", "Start", (DM.XmlDataNode storyNode) => { storyNode.innerText = inputedVar; }); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); }, (string inputedVar) => { innerStageNode.ActionXmlDataNodesByAttributeWithPath("Story", "Condition", "End", (DM.XmlDataNode storyNode) => { storyNode.innerText = inputedVar; }); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); } }).ShowDialog(); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); string STORY_TYPE = innerStageNode.GetInnerTextByPath("StoryType"); string EPISODE_WORD_EX = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"EPISODE"); BtnStage.ToolTip = $"{EPISODE_WORD_EX} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStage(STORY_TYPE)}"; LblStage.Content = $"{EPISODE_WORD_EX} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStage(STORY_TYPE)}";; BtnStage.Content = " "; break; case "BtnFloor": new SubWindows.Global_ListSeleteWindow((string floorNumStr) => { innerStageNode.SetXmlInfoByPath("FloorNum", floorNumStr); string FLOOR_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"AVALIABLE_FLOOR"); BtnFloor.ToolTip = $"{FLOOR_WORD} : {floorNumStr}"; LblFloor.Content = $"{FLOOR_WORD} : {floorNumStr}"; BtnFloor.Content = " "; MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); }, SubWindows.Global_ListSeleteWindow_PRESET.FLOORS).ShowDialog(); break; case "BtnInvitation": List <string> selectedDropBooks = new List <string>(); innerStageNode.ActionXmlDataNodesByPath("Invitation/Book", (DM.XmlDataNode xmlDataNode) => { selectedDropBooks.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(xmlDataNode.innerText)); }); new SubWindows.Global_AddItemToListWindow((string addedDropBookItemID) => { innerStageNode.ActionXmlDataNodesByPath("Invitation", (DM.XmlDataNode invitationNode) => { invitationNode.AddXmlInfoByPath("Book", addedDropBookItemID); }); }, (string deletedDropBookItemID) => { innerStageNode.ActionXmlDataNodesByPath("Invitation", (DM.XmlDataNode invitationNode) => { invitationNode.RemoveXmlInfosByPath("Book", deletedDropBookItemID); }); }, selectedDropBooks, SubWindows.AddItemToListWindow_PRESET.DROP_BOOK).ShowDialog(); if (innerStageNode.GetXmlDataNodesByPath("Invitation/Book").Count > 0) { string extraInfo = ""; innerStageNode.ActionXmlDataNodesByPath("Invitation/Book", (DM.XmlDataNode xmlDataNode) => { extraInfo += $"{DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(xmlDataNode.GetInnerTextSafe())}/"; }); extraInfo = extraInfo.TrimEnd('/'); string INVITATION_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"INVITATION_BOOK"); LblInvitation.Content = $"{INVITATION_WORD} : {extraInfo}"; BtnInvitation.ToolTip = $"{INVITATION_WORD} : {extraInfo}"; BtnInvitation.Content = " "; } else { LblInvitation.Content = ""; BtnInvitation.ToolTip = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"%BtnInvitation_ToolTip%").Split('$')[0]; BtnInvitation.Content = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"%BtnInvitation%").Split('$')[0]; } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); break; case "BtnAddWave": innerStageNode.subNodes.Add(DM.EditGameData_StageInfo.MakeNewWaveInfoBase()); InitSqlWaves(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); break; } }
private void SelectItemButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnBookIcon": new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) => { string ICON_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.BOOK_INFO, $"ICON"); innerBookNode.SetXmlInfoByPath("BookIcon", selectedItem); BtnBookIcon.ToolTip = $"{ICON_WORD} : {selectedItem}"; LblBookIcon.Content = $"{ICON_WORD} : {selectedItem}"; BtnBookIcon.Content = " "; }, SubWindows.InputInfoWithSearchWindow_PRESET.BOOK_ICON).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DROP_BOOK_INFO); break; case "BtnChapter": new SubWindows.Global_ListSeleteWindow((string selectedChapterDes) => { string CHAPTER_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Chapter"); innerBookNode.SetXmlInfoByPath("Chapter", selectedChapterDes.Split(':').Last()); BtnChapter.ToolTip = $"{CHAPTER_WORD} : {selectedChapterDes}"; LblChapter.Content = $"{CHAPTER_WORD} : {selectedChapterDes}"; BtnChapter.Content = " "; }, SubWindows.Global_ListSeleteWindow_PRESET.CHAPTERS).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DROP_BOOK_INFO); break; case "BtnSelectKeyPage": List <string> keyPageList = new List <string>(); innerBookNode.ActionXmlDataNodesByPath("DropItem", (DM.XmlDataNode dropItemNode) => { keyPageList.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForKeyBook(dropItemNode.innerText)); }); new SubWindows.Global_AddItemToListWindow((string addedItem) => { innerBookNode.AddXmlInfoByPath("DropItem", addedItem, attributePairsToSet: new Dictionary <string, string>() { { "Type", "Equip" } }); }, (string deletedItem) => { innerBookNode.RemoveXmlInfosByPath("DropItem", deletedItem, deleteOnce: true); }, keyPageList, SubWindows.AddItemToListWindow_PRESET.CRITICAL_BOOKS).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DROP_BOOK_INFO); InitLbxKeyPage(); break; case "BtnSelectCards": List <string> cardList = new List <string>(); DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "ID", innerBookNode.GetAttributesSafe("ID"), (DM.XmlDataNode cardDropTableNode) => { cardDropTableNode.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { cardList.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForCard(cardNode.innerText)); }); }); new SubWindows.Global_AddItemToListWindow((string addedItem) => { List <DM.XmlDataNode> cardDropTablesToCheck = DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("DropTable", attributeToCheck: new Dictionary <string, string>() { { "ID", innerBookNode.GetAttributesSafe("ID") } }); if (cardDropTablesToCheck.Count <= 0) { DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.AddXmlInfoByPath("DropTable", attributePairsToSet: new Dictionary <string, string>() { { "ID", innerBookNode.GetAttributesSafe("ID") } }); } DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "ID", innerBookNode.GetAttributesSafe("ID"), (DM.XmlDataNode cardDropTableNode) => { cardDropTableNode.AddXmlInfoByPath("Card", addedItem); }); }, (string deletedItem) => { DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "ID", innerBookNode.GetAttributesSafe("ID"), (DM.XmlDataNode cardDropTableNode) => { cardDropTableNode.RemoveXmlInfosByPath("Card", deletedItem); }); }, cardList, SubWindows.AddItemToListWindow_PRESET.CARDS).ShowDialog(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD_DROP_TABLE_INFO); InitLbxCards(); break; } }