private Control AddGameFileColumn(int lastRowPlusOne, int columnCount, string headerKey, LocalizationFileObject gameLocalizationFile)
        {
            SortedSet <string> allCommonValuesSorted = gameLocalizationFile.HeaderKeyToCommonValuesMap.GetValueOrDefault(headerKey);
            List <string>      allCommonValues       = new List <string>(allCommonValuesSorted);

            if (allCommonValues == null)
            {
                allCommonValues = new List <string>();
            }
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
            newCommonValuesBox.AddToolTip(headerKey);
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            newCommonValuesBox.SetComboBox(allCommonValues);
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
        private Control AddChangesColumn(int lastRowPlusOne, int columnCount)
        {
            List <string> changesColumn = new List <string>()
            {
                "", "New"
            };

            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());

            newCommonValuesBox.AddToolTip("changes");
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            newCommonValuesBox.SetComboBox(changesColumn);
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
Exemple #3
0
 private void SetBackgroundColor()
 {
     GameRecordScrollViewer.Background            = BackgroundColorController.GetBackgroundColor();
     LocalizationPreviewBox.Background            = BackgroundColorController.GetBackgroundColor();
     LocalizationOutputLabel.Background           = BackgroundColorController.GetBackgroundColor();
     GameLocalizationRecordOutputLabel.Background = BackgroundColorController.GetBackgroundColor();
     GameKeySelectionComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     ModSelectionComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
 }
 private void SetBackgroundForComboBoxes()
 {
     LoadedModFilesSearchViewComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     LoadedModsSearchViewComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     LoadedModsCenterViewComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     CurrentModFilesCenterViewComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     SearchTreeLoadedFilesComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     NewObjectViewLoadedFilesComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     CurrentGameFilesCenterViewComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
 }
 private void SetBackgroundFromSetting(bool removeExistingResources = false)
 {
     this.Background = BackgroundColorController.GetBackgroundColor();
     this.XmlOutputBox.Background = BackgroundColorController.GetBackgroundColor();
     if (removeExistingResources)
     {
         RemoveExistingColorFromComboBoxResource();
     }
     SetBackgroundForComboBoxes();
 }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance == this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
        private void AddClearButton(int rowCount, int columnCount)
        {
            //Add the first column, the clear button
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            Button clearRowButton = new Button {
                Content = "Clear row", FontSize = 18, Tag = rowCount, Background = BackgroundColorController.GetBackgroundColor()
            };

            clearRowButton.Click += ClearRowButton_Click;
            Grid.SetRow(clearRowButton, rowCount);
            Grid.SetColumn(clearRowButton, columnCount);
            topGrid.Children.Add(clearRowButton);
        }
        private void AddNumberColumn(int rowCount, int column)
        {
            int numberForColumn = rowCount + 1;

            //Need to increase the row count to make sure the numbers line up with the file
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            TextBox clearRowButton = new TextBox {
                Text = numberForColumn + "", FontSize = 18, Background = BackgroundColorController.GetBackgroundColor()
            };

            Grid.SetRow(clearRowButton, rowCount);
            Grid.SetColumn(clearRowButton, column);
            topGrid.Children.Add(clearRowButton);
        }
        //Creates a ComboBox using a list object
        public static ComboBox CreateComboBoxFromList <T>(this IList <T> listToUse, string name = null, SolidColorBrush forgroundColor = null, bool isEditable = true)
        {
            ComboBox newBox = new ComboBox();

            if (forgroundColor != null)
            {
                newBox.Foreground = forgroundColor;
            }
            newBox.Background = BackgroundColorController.GetBackgroundColor();
            newBox.IsEditable = isEditable;
            newBox.SetComboBox(listToUse, true, name);
            newBox.SelectedIndex = 0;
            return(newBox);
        }
 private void SetBackgroundColor()
 {
     this.Background            = BackgroundColorController.GetBackgroundColor();
     AllTagsComboBox.Background = BackgroundColorController.GetBackgroundColor();
     AllTagsComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     ChangeNameAllTagsComboBox.Background = BackgroundColorController.GetBackgroundColor();
     ChangeNameAllTagsComboBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
     ModInfoNameBox.Background                = BackgroundColorController.GetBackgroundColor();
     ModInfoDescriptionBox.Background         = BackgroundColorController.GetBackgroundColor();
     ModInfoAuthorBox.Background              = BackgroundColorController.GetBackgroundColor();
     ModInfoVersionBox.Background             = BackgroundColorController.GetBackgroundColor();
     ModInfoXmlPreviewAvalonEditor.Background = BackgroundColorController.GetBackgroundColor();
     CurrentSelectedModTextBox.Background     = BackgroundColorController.GetBackgroundColor();
 }
        private void AddDummyColumn(int row, int columnCount, string textForTextBox = "", int fontSize = 18)
        {
            //Add a dummy column for the clear button.
            topGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            TextBox emptyTextBox = new TextBox()
            {
                Text = textForTextBox, FontSize = fontSize, Background = BackgroundColorController.GetBackgroundColor()
            };

            Grid.SetRow(emptyTextBox, row);
            Grid.SetColumn(emptyTextBox, columnCount);
            topGrid.Children.Add(emptyTextBox);
        }
Exemple #12
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            var textBox = Template.FindName("PART_EditableTextBox", this) as TextBox;

            MyTextBox     = textBox;
            MyTextBox.Tag = this.Parent;
            MyTextBox.Uid = ObjectNode == null ? "" : ObjectNode.Name;
            XmlObjectsListWrapper wrapperToUse = MainWindowViewController.LoadedListWrappers.GetValueOrDefault(this.Uid);

            if (IsGameFileSearchTree)
            {
                TreeViewGenerator.AddTargetContextMenuToControl(MyTextBox, wrapperToUse);
            }
            MyTextBox.Background = BackgroundColorController.GetBackgroundColor();
            this.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
        }
        public static void SetComboBox <T>(this ComboBox comboBox, IList <T> listToUse, bool includeEmptyItem = false, string name = null)
        {
            comboBox.Background = BackgroundColorController.GetBackgroundColor();
            if (name != null)
            {
                comboBox.Name = name;
            }
            ObservableCollection <string> allItems = new ObservableCollection <string>();

            if (includeEmptyItem)
            {
                allItems.Add("              ");
            }
            foreach (var nextString in listToUse.OrderBy(i => i))
            {
                allItems.Add(nextString.ToString());
            }
            comboBox.ItemsSource = allItems;
        }
        private void AddFieldColumns(int rowCount, int startingColumn, List <string> record, List <Control> allBoxesInRow = null, int skipHeadersCount = 0)
        {
            if (allBoxesInRow == null)
            {
                allBoxesInRow = new List <Control>();
            }
            int columnCount = startingColumn;
            //Each field
            TextBox newRecordTextbox = null;

            foreach (string nextRecordField in record)
            {
                topGrid.ColumnDefinitions.Add(new ColumnDefinition());
                newRecordTextbox = new TextBox()
                {
                    Text       = nextRecordField,
                    Tag        = ",",
                    FontSize   = 18,
                    Background = BackgroundColorController.GetBackgroundColor()
                };
                if (skipHeadersCount < this.LocalizationFileObject.HeaderValues.Length)
                {
                    newRecordTextbox.AddToolTip((rowCount + 1) + " : " + this.LocalizationFileObject.HeaderValues[skipHeadersCount]);
                }
                newRecordTextbox.TextChanged += NewRecordTextbox_TextChanged;
                newRecordTextbox.LostFocus   += NewRecordTextbox_LostFocus;
                Grid.SetRow(newRecordTextbox, rowCount);
                Grid.SetColumn(newRecordTextbox, columnCount);
                topGrid.Children.Add(newRecordTextbox);
                allBoxesInRow.Add(newRecordTextbox);
                columnCount++;
                skipHeadersCount++;
            }
            if (newRecordTextbox != null)
            {
                newRecordTextbox.Tag = "\n";
            }
            if (allBoxesInRow.Count > 0)
            {
                TextBoxRowDictionary.Add(rowCount, allBoxesInRow);
            }
        }
Exemple #15
0
        private Control AddModKeysColumn(int lastRowPlusOne, int columnCount, List <XmlObjectsListWrapper> xmlWrappersForGameKeys)
        {
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                Tag        = lastRowPlusOne,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
            newCommonValuesBox.AddToolTip("key");
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            AddModAttributesFromWrappers(xmlWrappersForGameKeys, newCommonValuesBox);
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
        public static MyComboBox CreateMyComboBoxList <T>(this IList <T> listToUse, XmlNode objectNode, bool isGameFileSearchTree = true, string name = null)
        {
            MyComboBox newBox = new MyComboBox(objectNode, isGameFileSearchTree)
            {
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            if (name != null)
            {
                newBox.Name = name;
            }
            ObservableCollection <string> allItems = new ObservableCollection <string>();

            foreach (var nextString in listToUse.OrderBy(i => i))
            {
                allItems.Add(nextString.ToString());
            }
            newBox.ItemsSource = allItems;
            return(newBox);
        }
        private Control AddModKeysColumn(int lastRowPlusOne, int columnCount, XmlObjectsListWrapper selectedModItemsWrapper, XmlObjectsListWrapper selectedModBlocksWrapper)
        {
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
            newCommonValuesBox.AddToolTip("key");
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            if (selectedModItemsWrapper != null)
            {
                Dictionary <string, List <string> > attributeDictinaryForItems = selectedModItemsWrapper.ObjectNameToAttributeValuesMap.GetValueOrDefault("item");
                if (attributeDictinaryForItems != null)
                {
                    List <string> commonAttributes = attributeDictinaryForItems.GetValueOrDefault("name");
                    commonAttributes.Insert(0, "");
                    newCommonValuesBox.SetComboBox(commonAttributes);
                }
            }
            if (selectedModBlocksWrapper != null)
            {
                Dictionary <string, List <string> > attributeDictinaryForBlocks = selectedModBlocksWrapper.ObjectNameToAttributeValuesMap.GetValueOrDefault("block");
                if (attributeDictinaryForBlocks != null)
                {
                    List <string> commonAttributes = attributeDictinaryForBlocks.GetValueOrDefault("name");
                    newCommonValuesBox.SetComboBox(commonAttributes);
                }
            }
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
        private void CreateHeaderRow(int row)
        {
            //Go throh the keys for the header row
            RowDefinition rowDefinition = new RowDefinition();

            topGrid.RowDefinitions.Add(rowDefinition);

            int columnCount = 0;
            int numberForLineCountColumn = row + 1;

            AddDummyColumn(row, columnCount, numberForLineCountColumn + "");
            columnCount++;
            AddDummyColumn(row, columnCount);
            columnCount++;
            TextBox nextHeaderTextBox = null;

            foreach (string headerField in LocalizationFileObject.HeaderKeyToCommonValuesMap.Keys)
            {
                //Set the Headers
                topGrid.ColumnDefinitions.Add(new ColumnDefinition()
                {
                    Width = GridLength.Auto
                });
                nextHeaderTextBox = new TextBox()
                {
                    Text = headerField, FontSize = 22, Background = BackgroundColorController.GetBackgroundColor()
                };
                Grid.SetRow(nextHeaderTextBox, row);
                Grid.SetColumn(nextHeaderTextBox, columnCount);
                topGrid.Children.Add(nextHeaderTextBox);
                nextHeaderTextBox.Tag = ",";
                columnCount++;
            }
            if (nextHeaderTextBox != null)
            {
                nextHeaderTextBox.Tag = "\n";
            }
        }
Exemple #19
0
    // Use this for initialization
    void Start()
    {
        iceCollider     = GameObject.Find("IceCollider").transform;
        comboHolder     = GameObject.Find("ComboHolder");
        forceImage      = GameObject.Find("PowerBar").GetComponent <Image>();
        scoreText       = GameObject.Find("Score").GetComponent <Text>();
        camController   = GameObject.Find("Main Camera Container").GetComponent <CameraController>();
        bgController    = GameObject.Find("Main Camera").GetComponent <BackgroundColorController>();
        coinsController = GameObject.FindObjectOfType <CoinsController>();
        playerParticles = this.GetComponent <EllipsoidParticleEmitter>();

        Time.timeScale = 3.67f;

        rb = this.GetComponent <Rigidbody>();

        spotPrefab.GetComponent <SpriteRenderer>().sprite = spotSprites[0];
        currentSpot = (GameObject)Instantiate(spotPrefab, new Vector2(this.transform.position.x, this.transform.position.y + 5.925f - ((float)Random.Range(0, 450) / 100)), Quaternion.identity);

        iceCollider.transform.rotation = Quaternion.Euler(new Vector3(90, 0, 0));
        this.transform.rotation        = Quaternion.identity;

        scoreText.text = score.ToString();
    }
        private void CreateSingleRecordGrid()
        {
            RowDefinition rowDefinition = new RowDefinition();
            int           row           = 0;

            topGrid.RowDefinitions.Add(rowDefinition);
            int numberForLineCountColumn = row + 1;
            int columnCount = 0;

            AddDummyColumn(row, columnCount, numberForLineCountColumn + "");
            columnCount++;
            AddDummyColumn(row, columnCount, "Header", 22);
            columnCount++;
            AddDummyColumn(row, columnCount, "Value", 22);
            List <string> record = null;

            if (this.LocalizationFileObject.RecordList.Count > 0)
            {
                record = this.LocalizationFileObject.RecordList[0];
            }
            TextBox nextHeaderTextBox = null;

            foreach (string headerField in LocalizationFileObject.HeaderKeyToCommonValuesMap.Keys)
            {
                columnCount = 0;
                //Go throh the keys for the header row
                rowDefinition = new RowDefinition();
                //Make sure the record is retrieved before increasing the row.
                string nextField = record[row];
                row++;
                topGrid.RowDefinitions.Add(rowDefinition);
                numberForLineCountColumn = row + 1;
                AddDummyColumn(row, columnCount, numberForLineCountColumn + "");
                columnCount++;
                //Set the Headers
                topGrid.ColumnDefinitions.Add(new ColumnDefinition()
                {
                    Width = GridLength.Auto
                });
                nextHeaderTextBox = new TextBox()
                {
                    Text = headerField, FontSize = 22, Tag = ",", Background = BackgroundColorController.GetBackgroundColor()
                };
                Grid.SetRow(nextHeaderTextBox, row);
                Grid.SetColumn(nextHeaderTextBox, columnCount);
                topGrid.Children.Add(nextHeaderTextBox);
                columnCount++;
                topGrid.ColumnDefinitions.Add(new ColumnDefinition()
                {
                    Width = GridLength.Auto
                });
                nextHeaderTextBox = new TextBox()
                {
                    Text = nextField, FontSize = 22, Tag = ",", Background = BackgroundColorController.GetBackgroundColor()
                };
                Grid.SetRow(nextHeaderTextBox, row);
                Grid.SetColumn(nextHeaderTextBox, columnCount);
                topGrid.Children.Add(nextHeaderTextBox);
            }
            if (nextHeaderTextBox != null)
            {
                nextHeaderTextBox.Tag = "\n";
            }
        }
 private void SetBackgroundColor()
 {
     this.XmlOutputBox.Background = BackgroundColorController.GetBackgroundColor();
 }