public LocalizationSettingWindow(Dictionary <string, XmlObjectsListWrapper> loadedListWrappers)
        {
            InitializeComponent();

            Closing += new CancelEventHandler(LocalizatonSettingWindow_Closing);

            AddTooltips();

            StartingMod             = Properties.Settings.Default.ModTagSetting;
            WindowTitle             = StartingMod.ToString();
            this.Title              = GetTitleForWindow();
            this.LoadedListWrappers = loadedListWrappers;

            string pathToModLocalizationFile = XmlFileManager.ModConfigOutputPath + LocalizationFileObject.LOCALIZATION_FILE_NAME;

            ModLocalizationGridUserControl = new LocalizationGridUserControl(pathToModLocalizationFile);
            GridAsCSVAfterUpdate           = ModLocalizationGridUserControl.Maingrid.GridAsCSV();

            List <string> allCustomTagDirectories = XmlFileManager.GetCustomModFoldersInOutput();

            foreach (string nextModTag in allCustomTagDirectories)
            {
                ModSelectionComboBox.AddUniqueValueTo(nextModTag);
            }
            ModSelectionComboBox.SelectedItem = Properties.Settings.Default.ModTagSetting;

            ModSelectionComboBox.DropDownClosed += ModSelectionComboBox_DropDownClosed;

            ModLocalizationScrollViewer.Content = ModLocalizationGridUserControl;

            string pathToGameLocalizationFile = XmlFileManager.LoadedFilesPath + LocalizationFileObject.LOCALIZATION_FILE_NAME;

            GameLocalizationFile = new LocalizationFileObject(pathToGameLocalizationFile);
            TextEditorOptions newOptions = new TextEditorOptions
            {
                EnableRectangularSelection = true,
                EnableTextDragDrop         = true,
                HighlightCurrentLine       = true,
                ShowTabs = true
            };

            LocalizationPreviewBox.ShowLineNumbers  = true;
            LocalizationPreviewBox.TextArea.Options = newOptions;
            LocalizationPreviewBox.Text             = ModLocalizationGridUserControl.Maingrid.GridAsCSV();
            LocalizationPreviewBox.LostFocus       += LocalizationPreviewBox_LostFocus;
            SearchPanel.Install(LocalizationPreviewBox);
            ModLocalizationScrollViewer.GotFocus  += Maingrid_GotOrLostFocus;
            ModLocalizationScrollViewer.LostFocus += Maingrid_GotOrLostFocus;

            SortedSet <string> gameFileKeysSorted = GameLocalizationFile.HeaderKeyToCommonValuesMap.GetValueOrDefault(GameLocalizationFile.KeyColumn);
            List <string>      gameFileKeys       = new List <string>(gameFileKeysSorted);

            GameKeySelectionComboBox.SetComboBox(gameFileKeys);
            GameKeySelectionComboBox.IsEditable      = true;
            GameKeySelectionComboBox.DropDownClosed += GameKeySelectionComboBox_DropDownClosed;
            GameKeySelectionComboBox.PreviewKeyDown += GameKeySelectionComboBox_PreviewKeyDown;

            SetBackgroundColor();
        }
Exemplo n.º 2
0
 private void AddTooltips()
 {
     LocalizationOutputLabel.AddToolTip("Just below is a direct visualization of the selected mod's Localization.txt additions\n" +
                                        "This text box can be used to directy edit the contents of the file");
     GameLocalizationRecordOutputLabel.AddToolTip("Just below is a Game record visualization tool\n" +
                                                  "Here you can view, and copy existing game Localization records");
     GameKeySelectionComboBox.AddToolTip("Select a value in the box or type out the record and hit enter\n" +
                                         " to get an instant Localization snapshot above ");
     CopyGameRecordButton.AddToolTip("Copies the game record above directly into the grid below\n\n" +
                                     "Any language headers included in your mod's\n" +
                                     "localization headers will be included automatically");
     ModSelectionComboBox.AddToolTip("Use this box to switch between mods and modify the Localization of different Mods easily");
     SaveLocalizationTableButton.AddToolTip("Click here to write out all Localization changes");
     AddEmptyRowButton.AddToolTip("Click here to add an empty row to the grid\n\n" +
                                  "The first column in each row is a combobox that contains\n" +
                                  "any added items/blocks from the curret selected mod.");
 }