Example #1
0
        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 InitRetreatButton()
 {
     if (innerEnemyNode.GetInnerTextByPath("Retreat") == "true")
     {
         BtnRetreat.Background = Tools.ColorTools.GetImageBrushFromPath(this, "../Resources/IconYesRetreat.png");
         BtnRetreat.ToolTip    = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"%BtnRetreat_ToolTip%")} (ON)";
     }
     else
     {
         BtnRetreat.Background = Tools.ColorTools.GetImageBrushFromPath(this, "../Resources/IconNoRetreat.png");
         BtnRetreat.ToolTip    = $"{DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.ENEMY_INFO, $"%BtnRetreat_ToolTip%")} (OFF)";
     }
 }
        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);
        }
Example #4
0
        /// <summary>
        /// Init content by using name
        /// </summary>
        /// <param name="window">Window to use</param>
        /// <param name="nodeToUse">Xml data node to get</param>
        /// <param name="ignoreNameList">Name list that will be ingnored</param>
        public static void InitTextBoxControlsByUsingName(Control rootControl, DM.XmlDataNode nodeToUse, List <string> ignoreNameList = null)
        {
            FindLogicalChildren <TextBox>(rootControl).ForEachSafe((TextBox tbx) =>
            {
                if (ignoreNameList != null && ignoreNameList.Contains(tbx.Text))
                {
                    return;
                }

                List <string> SPLIT_NAME = tbx.Name.Split('_').ToList();
                if (SPLIT_NAME.Count == 2)
                {
                    tbx.Text = nodeToUse.GetInnerTextByPath(SPLIT_NAME.Last());
                }
                else if (SPLIT_NAME.Count > 2)
                {
                    tbx.Text = nodeToUse.GetInnerTextByPath(String.Join("/", SPLIT_NAME.Skip(1)));
                }
            });
        }
        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 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);
        }
Example #7
0
        public EditWave(DM.XmlDataNode waveNode, DM.XmlDataNode stageNode, Action stackInitFunc)
        {
            InitializeComponent();
            Tools.WindowControls.LocalizeWindowControls(this, DM.LANGUAGE_FILE_NAME.STAGE_INFO);
            this.stageNode     = stageNode;
            this.stackInitFunc = stackInitFunc;

            waveNode.ActionIfInnertTextIsNotNullOrEmpty("Formation", (string innerText) =>
            {
                string FORMATION_WORD = DM.LocalizeCore.GetLanguageData(DM.LANGUAGE_FILE_NAME.STAGE_INFO, $"FORMATION");
                BtnFormation.ToolTip  = $"{FORMATION_WORD} : {DM.LocalizedGameDescriptions.GetDescriptionForFormation(innerText)}";

                LblFormation.Content = $"{FORMATION_WORD} : {DM.LocalizedGameDescriptions.GetDescriptionForFormation(innerText)}";
                BtnFormation.Content = "          ";
            });

            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 = "          ";
                }
            }

            TbxAvailableUnit.Text = waveNode.GetInnerTextByPath("AvailableUnit");
            this.waveNode         = waveNode;
            MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO);
        }
Example #8
0
        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);
        }
Example #9
0
        /// <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;
            }
        }
Example #10
0
        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);
        }
Example #11
0
        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);
        }
Example #12
0
        /// <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;
            }
        }
Example #13
0
        /// <summary>
        /// Reflect text chagnes in TextBox
        /// </summary>
        private void ReflectTextChangeInTextBox(object sender, TextChangedEventArgs e)
        {
            if (innerBookNode == null)
            {
                return;
            }

            TextBox tbx = sender as TextBox;

            switch (tbx.Name)
            {
            case "TbxBookID":
                string PREV_BOOK_ID = innerBookNode.GetAttributesSafe("ID");
                #region Card drop table info ID refrect
                DM.EditGameData_DropBookInfo.StaticCardDropTableInfo.rootDataNode.ActionXmlDataNodesByAttributeWithPath("DropTable", "ID", PREV_BOOK_ID,
                                                                                                                        (DM.XmlDataNode cardTableNode) => {
                    cardTableNode.attribute["ID"] = tbx.Text;
                });
                #endregion
                innerBookNode.attribute["ID"] = tbx.Text;
                MainWindow.mainWindow.UpdateDebugInfo();
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD_DROP_TABLE_INFO);
                break;

            case "TbxNameID":
                string PREV_TEXT_ID = innerBookNode.GetInnerTextByPath("TextId");
                innerBookNode.SetXmlInfoByPath("TextId", tbx.Text);
                #region Make new name ID
                List <DM.XmlDataNode> foundLocalizeBookNamesNameID = DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("text",
                                                                                                                                                                      attributeToCheck: new Dictionary <string, string>()
                {
                    { "id", innerBookNode.GetInnerTextByPath("TextId") }
                });
                if (foundLocalizeBookNamesNameID.Count <= 0 && !string.IsNullOrEmpty(tbx.Text))
                {
                    DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.subNodes.Add(DM.EditGameData_DropBookInfo.MakeNewDropBookNameBase(tbx.Text, TbxBookName.Text));
                }
                #endregion
                #region Remove prev name ID
                List <DM.XmlDataNode> foundLocalizeBookNameID = DM.EditGameData_DropBookInfo.StaticDropBookInfo.rootDataNode.GetXmlDataNodesByPathWithXmlInfo("BookUse/TextId",
                                                                                                                                                              PREV_TEXT_ID);
                if (foundLocalizeBookNameID.Count <= 0 && !string.IsNullOrEmpty(tbx.Text))
                {
                    DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.RemoveXmlInfosByPath("text",
                                                                                                         attributeToCheck: new Dictionary <string, string>()
                    {
                        { "id", PREV_TEXT_ID }
                    });
                }
                else if (string.IsNullOrEmpty(tbx.Text))
                {
                    DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.RemoveXmlInfosByPath("text",
                                                                                                         attributeToCheck: new Dictionary <string, string>()
                    {
                        { "id", PREV_TEXT_ID }
                    });
                }
                #endregion
                MainWindow.mainWindow.UpdateDebugInfo();
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_DROP_BOOK_NAME);
                break;

            case "TbxBookName":
                if (DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.CheckIfGivenPathWithXmlInfoExists("text",
                                                                                                                      attributeToCheck: new Dictionary <string, string>()
                {
                    { "id", innerBookNode.GetInnerTextByPath("TextId") }
                }) &&
                    !string.IsNullOrEmpty(innerBookNode.GetInnerTextByPath("TextId")))
                {
                    DM.EditGameData_DropBookInfo.LocalizedDropBookName.rootDataNode.ActionXmlDataNodesByAttributeWithPath("text",
                                                                                                                          "id", innerBookNode.GetInnerTextByPath("TextId"), (DM.XmlDataNode nameNode) => {
                        nameNode.innerText = tbx.Text;
                    });
                }
                MainWindow.mainWindow.UpdateDebugInfo();
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.LOCALIZED_DROP_BOOK_NAME);
                break;
            }
            MainWindow.mainWindow.UpdateDebugInfo();
        }