Exemplo n.º 1
0
 public void InitLbxKeyPage()
 {
     LbxKeyPage.Items.Clear();
     innerBookNode.ActionXmlDataNodesByPath("DropItem", (DM.XmlDataNode dropItemNode) =>
     {
         LbxKeyPage.Items.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForKeyBook(dropItemNode.innerText));
     });
 }
Exemplo n.º 2
0
        private void NomalButtonClickEvents(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            switch (btn.Name)
            {
            case "BtnDiceType":
                GldInfo.Visibility             = Visibility.Collapsed;
                GldChangeAttackType.Visibility = Visibility.Visible;
                break;

            case "BtnEffect":
                new SubWindows.Global_InputInfoWithSearchWindow((string selectedItem) =>
                {
                    innerBehaviourNode.attribute["Script"] = selectedItem;
                    UpdateEffectGrid();
                    MainWindow.mainWindow.UpdateDebugInfo();
                }, SubWindows.InputInfoWithSearchWindow_PRESET.DICE_ABILITES).ShowDialog();
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD);
                break;

            case "BtnDeleteDice":
                innerCardCardNode.ActionXmlDataNodesByPath("BehaviourList", (DM.XmlDataNode behaviourListNode) =>
                {
                    behaviourListNode.subNodes.Remove(innerBehaviourNode);
                    MainWindow.mainWindow.UpdateDebugInfo();
                    stackInitFunc();
                });
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD);
                break;
            }
        }
Exemplo n.º 3
0
 public void InitLbxCards()
 {
     LbxCards.Items.Clear();
     innerDeckNode.ActionXmlDataNodesByPath("Card", (DM.XmlDataNode cardNode) =>
     {
         LbxCards.Items.Add(DM.FullyLoclalizedGameDescriptions.GetFullDescriptionForCard(cardNode.innerText));
     });
 }
Exemplo n.º 4
0
        /// <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;
            }
        }
Exemplo n.º 5
0
 private void InitRewards()
 {
     SqlRewards.Children.Clear();
     innerEnemyNode.ActionXmlDataNodesByPath("DropTable", (DM.XmlDataNode dropTableNode) =>
     {
         string EMOTION_LEVEL = dropTableNode.GetAttributesSafe("Level");
         dropTableNode.ActionXmlDataNodesByPath("DropItem", (DM.XmlDataNode dropItem) =>
         {
             SqlRewards.Children.Add(new EditEmotionReward(dropItem, EMOTION_LEVEL));
         });
     });
 }
Exemplo n.º 6
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;
            }
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Type loop button events
        /// </summary>
        private void TypeLoopButtonEvents(object sender, MouseButtonEventArgs e)
        {
            Button loopButton = sender as Button;

            List <string> LOOP_LIST = null;

            if (loopButton.Name == "BtnRangeType")
            {
                LOOP_LIST = RANGE_LOOP_LIST;
            }
            else if (loopButton.Name == "BtnUnqueType")
            {
                LOOP_LIST = OPTION_LOOP_LIST;
            }
            if (LOOP_LIST == null)
            {
                return;
            }

            if (loopButton.Tag == null || LOOP_LIST.IndexOf(loopButton.Tag.ToString()) < 0)
            {
                loopButton.Tag = LOOP_LIST[0];
            }
            // Down index
            else if (e.LeftButton == MouseButtonState.Pressed)
            {
                int LEFT_INDEX = LOOP_LIST.IndexOf(loopButton.Tag.ToString()) - 1;
                if (LEFT_INDEX < 0)
                {
                    LEFT_INDEX = LOOP_LIST.Count - 1;
                }
                loopButton.Tag = LOOP_LIST[LEFT_INDEX];
            }
            // Up index
            else
            {
                int RIGHT_INDEX = LOOP_LIST.IndexOf(loopButton.Tag.ToString()) + 1;
                if (RIGHT_INDEX >= LOOP_LIST.Count)
                {
                    RIGHT_INDEX = 0;
                }
                loopButton.Tag = LOOP_LIST[RIGHT_INDEX];
            }

            if (loopButton.Name == "BtnRangeType")
            {
                loopButton.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/Type{loopButton.Tag}.png");
                loopButton.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_{loopButton.Tag}")})";
                innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) => {
                    specNode.attribute["Range"] = loopButton.Tag.ToString();
                });

                switch (loopButton.Tag.ToString())
                {
                case "FarArea":
                case "FarAreaEach":
                    innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) =>
                    {
                        specNode.attribute["Affection"] = "Team";
                    });
                    MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD);
                    break;

                default:
                    innerCardNode.ActionXmlDataNodesByPath("Spec", (DM.XmlDataNode specNode) =>
                    {
                        if (specNode.attribute.ContainsKey("Affection"))
                        {
                            specNode.attribute.Remove("Affection");
                        }
                    });
                    MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD);
                    break;
                }
            }
            else if (loopButton.Name == "BtnUnqueType")
            {
                string UNIQUE_NAME = (string.IsNullOrEmpty(loopButton.Tag.ToString()) ? "NoOption" : loopButton.Tag.ToString());
                loopButton.Background = Tools.ColorTools.GetImageBrushFromPath(this, $"../Resources/Type{UNIQUE_NAME}.png");
                loopButton.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_{UNIQUE_NAME}")})";
                innerCardNode.SetXmlInfoByPathAndEmptyWillRemove("Option", loopButton.Tag.ToString());
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_CARD);
            }
            MainWindow.mainWindow.UpdateDebugInfo();
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        /// <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;
            }
        }