// Constructor.
        public SelectBackgroundWindow(Project p)
        {
            InitializeComponent();

            MyProject = p;

            MyProject.GetBackgroundStatus(out bool HasBackground, out bool HasLayer2);
            DefaultBgCheck.IsChecked = HasBackground;
            if (MyProject.LevelDataPtr == 0)
            {
                Layer2Check.IsEnabled = false;
            }
            else
            {
                Layer2Check.IsChecked = HasLayer2;
            }
            BackgroundSelect.ItemsSource = MyProject.BackgroundNames;
            if (!HasBackground)
            {
                BackgroundSelect.IsEnabled = false;
                BackgroundImage.Visibility = Visibility.Hidden;
            }
            else
            {
                BackgroundSelect.SelectedIndex = MyProject.BackgroundIndex;
                BackgroundSelect.ScrollIntoView(BackgroundSelect.SelectedItem);
            }
        }
Exemple #2
0
 public override void SelectThis()
 {
     BackgroundSelect.SelectX(rectTransform.anchoredPosition.x);
 }