/// <summary> /// Right menu button events /// </summary> private void RightMenuButtonEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; switch (btn.Name) { case "BtnRetreat": if (innerEnemyNode.CheckIfGivenPathWithXmlInfoExists("Retreat")) { innerEnemyNode.RemoveXmlInfosByPath("Retreat"); } else { innerEnemyNode.AddXmlInfoByPath("Retreat", "true"); } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); InitRetreatButton(); break; case "BtnCopyEnemy": DM.EditGameData_EnemyInfo.StaticEnemyUnitInfo.rootDataNode.subNodes.Add(innerEnemyNode.Copy()); initStack(); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); break; case "BtnDelete": if (DM.EditGameData_EnemyInfo.LocalizedCharactersName.rootDataNode.CheckIfGivenPathWithXmlInfoExists("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", innerEnemyNode.GetAttributesSafe("ID") } })) { DM.EditGameData_EnemyInfo.LocalizedCharactersName.rootDataNode.RemoveXmlInfosByPath("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", innerEnemyNode.GetAttributesSafe("id") } }); } DM.EditGameData_EnemyInfo.StaticEnemyUnitInfo.rootDataNode.subNodes.Remove(innerEnemyNode); initStack(); MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); break; } }
public EditCardAbility(DM.XmlDataNode innerAbilityNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.CARD_ABILITY_INFO); this.innerAbilityNode = innerAbilityNode; this.initStack = initStack; TbxAbilityID.Text = innerAbilityNode.GetAttributesSafe("ID"); TbxAbilityDes.Text = innerAbilityNode.GetInnerTextByPath("Desc"); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_CARD_ABILITY_DESC); }
public EditDeck(DM.XmlDataNode innerDeckNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.DECK_INFO); this.innerDeckNode = innerDeckNode; this.initStack = initStack; TbxDeckID.Text = innerDeckNode.GetAttributesSafe("ID"); InitLbxCards(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DECKS); }
public EditDice(DM.XmlDataNode innerCardCardNode, DM.XmlDataNode innerBehaviourNode, Action stackInitFunc) { this.innerCardCardNode = innerCardCardNode; this.stackInitFunc = stackInitFunc; InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.CARD_INFO); TbxMinDice_Min.Text = innerBehaviourNode.GetAttributesSafe("Min"); TbxMaxDice_Dice.Text = innerBehaviourNode.GetAttributesSafe("Dice"); TbxMotion.Text = innerBehaviourNode.GetAttributesSafe("Motion"); TbxEffectRes.Text = innerBehaviourNode.GetAttributesSafe("EffectRes"); TbxActionScript.Text = innerBehaviourNode.GetAttributesSafe("ActionScript"); this.innerBehaviourNode = innerBehaviourNode; BtnDiceType.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/icon_{innerBehaviourNode.attribute["Type"] }_{innerBehaviourNode.attribute["Detail"]}.png"); UpdateEffectGrid(); GldInfo.Visibility = Visibility.Visible; GldChangeAttackType.Visibility = Visibility.Collapsed; MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD); }
public EditBuff(DM.XmlDataNode innerBuffNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.BUFF_INFO); this.innerBuffNode = innerBuffNode; this.initStack = initStack; TbxBuffID.Text = innerBuffNode.GetAttributesSafe("ID"); TbxBuffName.Text = innerBuffNode.GetInnerTextByPath("Name"); TbxBuffDes.Text = innerBuffNode.GetInnerTextByPath("Desc"); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_BUFF_DESC); }
private void DiceTypeButtonClickEvents(object sender, RoutedEventArgs e) { Button btn = sender as Button; List <string> SPLIT_NAME = btn.Name.Split('_').ToList(); if (SPLIT_NAME.Count >= 3) { innerBehaviourNode.attribute["Type"] = SPLIT_NAME[1]; innerBehaviourNode.attribute["Detail"] = SPLIT_NAME[2]; BtnDiceType.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/icon_{innerBehaviourNode.attribute["Type"] }_{innerBehaviourNode.attribute["Detail"]}.png"); #region Motion Update switch (innerBehaviourNode.GetAttributesSafe("Detail")) { case "Guard": innerBehaviourNode.attribute["Motion"] = "G"; break; case "Evasion": innerBehaviourNode.attribute["Motion"] = "E"; break; case "Slash": innerBehaviourNode.attribute["Motion"] = "J"; break; case "Penetrate": innerBehaviourNode.attribute["Motion"] = "Z"; break; case "Hit": innerBehaviourNode.attribute["Motion"] = "H"; break; default: innerBehaviourNode.attribute["Motion"] = "H"; break; } innerBehaviourNode.attribute["EffectRes"] = ""; TbxMotion.Text = innerBehaviourNode.GetAttributesSafe("Motion"); TbxEffectRes.Text = ""; #endregion } GldInfo.Visibility = Visibility.Visible; GldChangeAttackType.Visibility = Visibility.Collapsed; MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD); }
public EditEmotionReward(DM.XmlDataNode dropItemNode, string emotionLevel) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.ENEMY_INFO); this.dropItemNode = dropItemNode; LblEmotionLevel.Content = emotionLevel; string BOOK_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"BOOK"); LblBookName.Content = $"{BOOK_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(dropItemNode.innerText)}"; LblBookName.ToolTip = $"{BOOK_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForDropBook(dropItemNode.innerText)}"; TbxBookCount.Text = dropItemNode.GetAttributesSafe("Prob"); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); }
public EditEnemyUnit(DM.XmlDataNode innerEnemyNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.ENEMY_INFO); this.innerEnemyNode = innerEnemyNode; this.initStack = initStack; TbxEnemyUniqueID.Text = innerEnemyNode.GetAttributesSafe("ID"); TbxNameID.Text = innerEnemyNode.GetInnerTextByPath("NameID"); TbxMinHeight.Text = innerEnemyNode.GetInnerTextByPath("MinHeight"); TbxMaxHeight.Text = innerEnemyNode.GetInnerTextByPath("MaxHeight"); List <DM.XmlDataNode> foundLocalizeCharNames = DM.GameInfos.localizeInfos["CharactersName"].rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", innerEnemyNode.GetInnerTextByPath("NameID") } }); if (foundLocalizeCharNames.Count > 0) { TbxEnemyName.Text = foundLocalizeCharNames[0].innerText; } innerEnemyNode.ActionIfInnertTextIsNotNullOrEmpty("BookId", (string innerText) => { string BOOK_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"BOOK"); BtnBookID.ToolTip = $"{BOOK_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForKeyBook(innerText)}"; LblBookID.Content = $"{BOOK_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForKeyBook(innerText)}"; BtnBookID.Content = " "; }); innerEnemyNode.ActionIfInnertTextIsNotNullOrEmpty("DeckId", (string innerText) => { string DECK_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"DECK"); BtnDeckID.ToolTip = $"{DECK_WORD} : {DM.LocalizedGameDescriptions.GetDecriptionForDeck(innerText)}"; LblDeckID.Content = $"{DECK_WORD} : {DM.LocalizedGameDescriptions.GetDecriptionForDeck(innerText)}"; BtnDeckID.Content = " "; }); InitRetreatButton(); InitRewards(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_ENEMY_INFO); }
public void InitLbxCards() { LbxCards.Items.Clear(); DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "ID", innerBookNode.GetAttributesSafe("ID"), (DM.XmlDataNode cardDropTableNode) => { cardDropTableNode.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) => { LbxCards.Items.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForCard(cardNode.innerText)); }); }); }
public EditPassive(DM.XmlDataNode innerPassiveNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.PASSIVE_INFO); this.initStack = initStack; this.innerPassiveNode = innerPassiveNode; switch (innerPassiveNode.GetInnerTextByPath("Rarity")) { case "Common": ChangeRarityButtonEvents(BtnRarity_Common, null); break; case "Uncommon": ChangeRarityButtonEvents(BtnRarity_Uncommon, null); break; case "Rare": ChangeRarityButtonEvents(BtnRarity_Rare, null); break; case "Unique": ChangeRarityButtonEvents(BtnRarity_Unique, null); break; } TbxCost.Text = innerPassiveNode.GetInnerTextByPath("Cost"); TbxPassiveID.Text = innerPassiveNode.GetAttributesSafe("ID"); DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.ActionXmlDataNodesByAttributeWithPath("PassiveDesc", "ID", innerPassiveNode.GetAttributesSafe("ID"), (DM.XmlDataNode passiveDescNode) => { TbxPassiveName.Text = passiveDescNode.GetInnerTextByPath("Name"); TbxPassiveDes.Text = passiveDescNode.GetInnerTextByPath("Desc"); }); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_PASSIVE_INTO); }
public EditDropBook(DM.XmlDataNode innerBookNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.DROP_BOOK_INFO); this.innerBookNode = innerBookNode; this.initStack = initStack; TbxBookID.Text = innerBookNode.GetAttributesSafe("ID"); TbxNameID.Text = innerBookNode.GetInnerTextByPath("TextId"); TbxBookName.Text = DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.GetInnerTextByAttributeWithPath("text", "id", innerBookNode.GetInnerTextByPath("TextId")); innerBookNode.ActionIfInnertTextIsNotNullOrEmpty("BookIcon", (string innerText) => { string ICON_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.BOOK_INFO, $"ICON"); BtnBookIcon.ToolTip = $"{ICON_WORD} : {innerText}"; LblBookIcon.Content = $"{ICON_WORD} : {innerText}"; BtnBookIcon.Content = " "; }); innerBookNode.ActionIfInnertTextIsNotNullOrEmpty("Chapter", (string innerText) => { string CHAPTER_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Chapter"); string CHPATER_DES = DM.LocalizedGameDescriptions.GetDescriptionForChapter(innerText); BtnChapter.ToolTip = $"{CHAPTER_WORD} : {CHPATER_DES}:{innerText}"; LblChapter.Content = $"{CHAPTER_WORD} : {CHPATER_DES}:{innerText}";; BtnChapter.Content = " "; }); InitLbxKeyPage(); InitLbxCards(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_DROP_BOOK_INFO); }
/// <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; } }
public EditCard(DM.XmlDataNode innerCardNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.CARD_INFO); this.innerCardNode = innerCardNode; this.initStack = initStack; innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) => { TbxCost.Text = specNode.GetAttributesSafe("Cost"); }); switch (innerCardNode.GetInnerTextByPath("Rarity")) { case "Common": ChangeRarityButtonEvents(BtnRarity_Common, null); break; case "Uncommon": ChangeRarityButtonEvents(BtnRarity_Uncommon, null); break; case "Rare": ChangeRarityButtonEvents(BtnRarity_Rare, null); break; case "Unique": ChangeRarityButtonEvents(BtnRarity_Unique, null); break; } TbxCardName.Text = innerCardNode.GetInnerTextByPath("Name"); TbxCardUniqueID.Text = innerCardNode.GetAttributesSafe("ID"); innerCardNode.ActionIfInnertTextIsNotNullOrEmpty("Artwork", (string innerText) => { string IMAGE_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"IMAGE"); BtnCardImage.ToolTip = $"{IMAGE_WORD} : {innerText}"; BtnCardImage.Content = " "; LblCardImage.Content = $"{IMAGE_WORD} : {innerText}"; }); innerCardNode.ActionIfInnertTextIsNotNullOrEmpty("Script", (string innerText) => { string ABILITY_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"ABILITY"); BtnCardEffect.ToolTip = $"{ABILITY_WORD} : {DM.LocalizedGameDescriptions.GetDescriptionForCardPassive(innerText)}:{innerText}"; BtnCardEffect.Content = " "; LblCardEffect.Content = $"{ABILITY_WORD} : {innerText}"; }); InitSqlDices(); UpdateExtrainfoIcon(); innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) => { BtnRangeType.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/Type{specNode.GetAttributesSafe("Range")}.png"); BtnRangeType.Tag = specNode.GetAttributesSafe("Range"); if (BtnRangeType.Tag != null && !string.IsNullOrEmpty(BtnRangeType.Tag.ToString())) { BtnRangeType.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnRangeType_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Current")} : {DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Type_{BtnRangeType.Tag}")})"; } }); List <DM.XmlDataNode> optionNodes = innerCardNode.GetXmlDataNodesByPath("Option"); if (optionNodes.Count > 0) { DM.XmlDataNode OPTION_NODE = optionNodes[0]; BtnUnqueType.Tag = OPTION_NODE.innerText; if (OPTION_LOOP_LIST.Contains(OPTION_NODE.innerText)) { BtnUnqueType.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/Type{OPTION_NODE.innerText}.png"); BtnUnqueType.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnUnqueType_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Current")} : {DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Type_{BtnUnqueType.Tag}")})"; } else { BtnUnqueType.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/TypeETC.png"); BtnUnqueType.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnUnqueType_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Current")} : {OPTION_NODE.innerText})"; } } else { BtnUnqueType.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/TypeNoOption.png"); BtnUnqueType.Tag = ""; BtnUnqueType.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"%BtnUnqueType_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Current")} : {DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.CARD_INFO, $"Type_NoOption")})"; } #region 드랍되는 곳 체크 List <string> selectedCardDropTables = new List <string>(); DM.EditGameData_CardInfos.StaticCardDropTable.rootDataNode.GetXmlDataNodesByPath("DropTable").ForEachSafe((DM.XmlDataNode cardDropTableID) => { if (cardDropTableID.CheckIfGivenPathWithXmlInfoExists("Card", innerCardNode.attribute["ID"])) { selectedCardDropTables.Add(cardDropTableID.attribute["ID"]); } }); if (selectedCardDropTables.Count > 0) { string extraInfo = ""; selectedCardDropTables.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}"; } #endregion MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD); }
public EditStage(DM.XmlDataNode stageNode, Action initStack) { InitializeComponent(); Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.STAGE_INFO); this.innerStageNode = stageNode; this.initStack = initStack; TbxStageName.Text = innerStageNode.GetInnerTextByPath("Name"); TbxStageUniqueID.Text = innerStageNode.GetAttributesSafe("id"); innerStageNode.ActionIfInnertTextIsNotNullOrEmpty("StoryType", (string innerText) => { string EPISODE_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"EPISODE"); BtnStage.ToolTip = $"{EPISODE_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStoryType(innerText)}"; LblStage.Content = $"{EPISODE_WORD} : {DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStoryType(innerText)}";; BtnStage.Content = " "; }); innerStageNode.ActionIfInnertTextIsNotNullOrEmpty("FloorNum", (string innerText) => { string FLOOR_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"AVALIABLE_FLOOR"); BtnFloor.ToolTip = $"{FLOOR_WORD} : {innerText}"; LblFloor.Content = $"{FLOOR_WORD} : {innerText}"; BtnFloor.Content = " "; }); 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 = " "; } if (innerStageNode.GetXmlDataNodesByPath("Condition/Stage").Count > 0) { string extraInfo = ""; innerStageNode.ActionXmlDataNodesByPath("Condition/Stage", (DM.XmlDataNode xmlDataNode) => { extraInfo += $"{DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForStage(xmlDataNode.GetInnerTextSafe())}\n"; }); extraInfo = extraInfo.TrimEnd('\n'); BtnCondition.Background = Tools.ColorTools.GetImageBrushFromPath(this, "../Resources/IconYesCondition.png"); BtnCondition.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"STAGE_CONDITION")}\n{extraInfo}"; } string MAP_INFO = innerStageNode.GetInnerTextByPath("MapInfo"); if (!string.IsNullOrEmpty(MAP_INFO)) { BtnMapInfo.Background = Tools.ColorTools.GetImageBrushFromPath(this, "../Resources/IconYesMapInfo.png"); BtnMapInfo.ToolTip = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"%BtnMapInfo_ToolTip%")} ({DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.BOOK_INFO, $"Inputted")})\n{DM.LocalizedGameDescriptions.GetDescriptionForMapInfo(innerStageNode.GetInnerTextByPath("MapInfo"))}"; } InitSqlWaves(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); }
/// <summary> /// Reflect text chagnes in TextBox /// </summary> private void ReflectTextChangeInTextBox(object sender, TextChangedEventArgs e) { if (innerStageNode == null) { return; } TextBox tbx = sender as TextBox; switch (tbx.Name) { case "TbxStageName": innerStageNode.SetXmlInfoByPath("Name", tbx.Text); if (DM.EditGameData_StageInfo.LocalizedStageName.rootDataNode.CheckIfGivenPathWithXmlInfoExists("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", innerStageNode.GetAttributesSafe("id") } })) { List <DM.XmlDataNode> foundXmlDataNode = DM.EditGameData_StageInfo.LocalizedStageName.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", innerStageNode.GetAttributesSafe("id") } }); if (foundXmlDataNode.Count > 0) { foundXmlDataNode[0].innerText = tbx.Text; } } else { DM.EditGameData_StageInfo.LocalizedStageName.rootDataNode.subNodes.Add(DM.EditGameData_StageInfo.MakeNewStageNameBase( innerStageNode.GetAttributesSafe("id"), innerStageNode.GetInnerTextByPath("Name"))); } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_STAGE_NAME); MainWindow.mainWindow.UpdateDebugInfo(); break; case "TbxStageUniqueID": string PREV_STAGE_ID = innerStageNode.attribute["id"]; #region Stage info localizing ID refrect if (DM.EditGameData_StageInfo.LocalizedStageName.rootDataNode.CheckIfGivenPathWithXmlInfoExists("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", PREV_STAGE_ID } })) { List <DM.XmlDataNode> foundXmlDataNode = DM.EditGameData_StageInfo.LocalizedStageName.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("Name", attributeToCheck: new Dictionary <string, string>() { { "ID", PREV_STAGE_ID } }); if (foundXmlDataNode.Count > 0) { foundXmlDataNode[0].attribute["ID"] = tbx.Text; } } #endregion innerStageNode.attribute["id"] = tbx.Text; MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO); MainWindow.mainWindow.UpdateDebugInfo(); break; } }
/// <summary> /// Reflect text chagnes in TextBox /// </summary> private void ReflectTextChangeInTextBox(object sender, TextChangedEventArgs e) { if (innerPassiveNode == null) { return; } TextBox tbx = sender as TextBox; switch (tbx.Name) { case "TbxCost": innerPassiveNode.SetXmlInfoByPath("Cost", tbx.Text); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_PASSIVE_INTO); break; case "TbxPassiveID": string PREV_PASSIVE_ID = innerPassiveNode.attribute["ID"]; #region Books info localizing ID refrect if (DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.CheckIfGivenPathWithXmlInfoExists("PassiveDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", PREV_PASSIVE_ID } })) { List <DM.XmlDataNode> foundPassiveDescsForID = DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("PassiveDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", PREV_PASSIVE_ID } }); if (foundPassiveDescsForID.Count > 0) { foundPassiveDescsForID[0].attribute["ID"] = tbx.Text; } } #endregion innerPassiveNode.attribute["ID"] = tbx.Text; MainWindow.mainWindow.UpdateDebugInfo(); MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_PASSIVE_INTO); break; case "TbxPassiveName": if (!DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.CheckIfGivenPathWithXmlInfoExists("PassiveDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", innerPassiveNode.GetAttributesSafe("ID") } }) && !string.IsNullOrEmpty(innerPassiveNode.GetAttributesSafe("ID"))) { DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.subNodes.Add( DM.EditGameData_PassiveInfo.MakeNewPassiveDescBase(TbxPassiveID.Text, TbxPassiveName.Text, TbxPassiveDes.Text)); } List <DM.XmlDataNode> foundPassiveDescsForName = DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("PassiveDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", innerPassiveNode.GetAttributesSafe("ID") } }); if (foundPassiveDescsForName.Count > 0) { foundPassiveDescsForName[0].SetXmlInfoByPath("Name", tbx.Text); } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_PASSIVE_DESC); break; case "TbxPassiveDes": if (!DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.CheckIfGivenPathWithXmlInfoExists("PassiveDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", innerPassiveNode.GetAttributesSafe("ID") } }) && !string.IsNullOrEmpty(innerPassiveNode.GetAttributesSafe("ID"))) { DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.subNodes.Add( DM.EditGameData_PassiveInfo.MakeNewPassiveDescBase(TbxPassiveID.Text, TbxPassiveName.Text, TbxPassiveDes.Text)); } List <DM.XmlDataNode> foundPassiveDescsForDesc = DM.EditGameData_PassiveInfo.LocalizedPassiveDesc.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("PassiveDesc", attributeToCheck: new Dictionary <string, string>() { { "ID", innerPassiveNode.GetAttributesSafe("ID") } }); if (foundPassiveDescsForDesc.Count > 0) { foundPassiveDescsForDesc[0].SetXmlInfoByPath("Desc", tbx.Text); } MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_PASSIVE_DESC); break; } }