コード例 #1
0
        private void ReflectTextChangeInTextBox(object sender, TextChangedEventArgs e)
        {
            if (waveNode == null)
            {
                return;
            }

            TextBox tbx = sender as TextBox;

            switch (tbx.Name)
            {
            case "TbxAvailableUnit":
                waveNode.SetXmlInfoByPathAndEmptyWillRemove("AvailableUnit", tbx.Text);
                MainWindow.mainWindow.ChangeDebugLocation(MainWindow.DEBUG_LOCATION.STATIC_STAGE_INFO);
                break;
            }
        }
コード例 #2
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();
        }
コード例 #3
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;
            }
        }