public GuiScreenCreate() : base(0, 0, 0, 0)
        {
            _tb = new GuiTextBox(0, 0, 256, 64)
            {
                Centered = true, Focused = true
            };
            _btnCreate = new GuiButton(0, 0, 0, 256, 64, "CREATE", false);
            _btnBack   = new GuiButton(1, 0, 0, 256, 64, "BACK", false);

            _lbl.Color = Color.FromArgb(255, 255, 255);

            OnResize(EditorWindow.Instance.ClientSize);

            Buttons.Add(_btnCreate);
            Buttons.Add(_btnBack);

            if (File.Exists(Path.Combine(EditorWindow.Instance.LauncherDir, "background_menu.png")))
            {
                bgImg = true;
                using (Bitmap img = new Bitmap(Path.Combine(EditorWindow.Instance.LauncherDir, "background_menu.png")))
                {
                    _textureId = TextureManager.GetOrRegister("createbg", img, true);
                }
            }
        }
Esempio n. 2
0
        public GuiScreenCreate() : base(0, 0, 0, 0)
        {
            _tb = new GuiTextBox(0, 0, 256, 64)
            {
                Centered = true, Focused = true
            };
            _btnCreate = new GuiButton(0, 0, 0, 256, 64, "CREATE");
            _btnBack   = new GuiButton(1, 0, 0, 256, 64, "BACK");

            _lbl.Color = Color.FromArgb(0, 255, 200);

            OnResize(EditorWindow.Instance.ClientSize);

            Buttons.Add(_btnCreate);
            Buttons.Add(_btnBack);
        }
        public GuiScreenTimings() : base(0, 0, 0, 0)
        {
            BPMBox = new GuiTextBox(0, 0, 256, 48)
            {
                Text = GuiTrack.Bpm.ToString(), Centered = true, Numeric = true, CanBeNegative = false, Timings = true
            };
            OffsetBox = new GuiTextBox(0, 0, 256, 48)
            {
                Text = GuiTrack.BpmOffset.ToString(), Centered = true, Numeric = true, CanBeNegative = false, Timings = true
            };

            AddPoint    = new GuiButton(0, 0, 0, 256, 48, "ADD POINT", true);
            RemovePoint = new GuiButton(1, 0, 0, 256, 48, "REMOVE POINT", true);
            UpdatePoint = new GuiButton(2, 0, 0, 256, 48, "UPDATE POINT", true);
            CurrentMs   = new GuiButton(3, 0, 0, 256, 48, "USE CURRENT MS", true);

            BPMLabel.Color    = Color.FromArgb(255, 255, 255);
            OffsetLabel.Color = Color.FromArgb(255, 255, 255);

            BPMBox.Focused    = true;
            OffsetBox.Focused = true;
            BPMBox.OnKeyDown(Key.Right, false);
            OffsetBox.OnKeyDown(Key.Right, false);
            BPMBox.Focused    = false;
            OffsetBox.Focused = false;

            ScrollBar = new GuiSlider(0, 0, 20, 100)
            {
                MaxValue = GuiTrack.BPMs.Count,
                Value    = GuiTrack.BPMs.Count,
            };

            OnResize(TimingPoints.Instance.ClientSize);

            Buttons.Add(AddPoint);
            Buttons.Add(RemovePoint);
            Buttons.Add(UpdatePoint);
            Buttons.Add(CurrentMs);
            Buttons.Add(ScrollBar);
        }
        public GuiScreenEditor() : base(0, EditorWindow.Instance.ClientSize.Height - 64, EditorWindow.Instance.ClientSize.Width - 512 - 64, 64)
        {
            _toast = new GuiLabel(0, 0, "")
            {
                Centered = true,
                FontSize = 36
            };

            var playPause = new GuiButtonPlayPause(0, EditorWindow.Instance.ClientSize.Width - 512 - 64, EditorWindow.Instance.ClientSize.Height - 64, 64, 64);

            Bpm = new GuiTextBox(0, 0, 128, 32)
            {
                Text     = "0",
                Centered = true,
                Numeric  = true,
                Decimal  = true
            };
            Offset = new GuiTextBox(0, 0, 128, 32)
            {
                Text          = "0",
                Centered      = true,
                Numeric       = true,
                CanBeNegative = true
            };
            Reposition      = new GuiCheckBox(1, "Offset Notes", 10, 0, 32, 32, false);
            BeatSnapDivisor = new GuiSlider(0, 0, 256, 40);
            Timeline        = new GuiSliderTimeline(0, 0, EditorWindow.Instance.ClientSize.Width, 64);
            Tempo           = new GuiSlider(0, 0, 512, 64)
            {
                MaxValue = 8,
                Value    = 8
            };

            Timeline.Snap            = false;
            BeatSnapDivisor.Value    = Track.BeatDivisor - 1;
            BeatSnapDivisor.MaxValue = 23;

            MasterVolume = new GuiSlider(0, 0, 40, 256)
            {
                MaxValue = 50
            };
            SfxVolume = new GuiSlider(0, 0, 40, 256)
            {
                MaxValue = 50
            };

            SetOffset  = new GuiButton(2, 0, 0, 64, 32, "SET");
            BackButton = new GuiButton(3, 0, 0, Grid.ClientRectangle.Width + 1, 42, "BACK TO MENU");
            CopyButton = new GuiButton(4, 0, 0, Grid.ClientRectangle.Width + 1, 42, "COPY MAP DATA");

            Autoplay          = new GuiCheckBox(5, "Autoplay", 0, 0, 32, 32, Settings.Default.Autoplay);
            ApproachSquares   = new GuiCheckBox(5, "Approach Squares", 0, 0, 32, 32, Settings.Default.ApproachSquares);
            GridNumbers       = new GuiCheckBox(5, "Grid Numbers", 0, 0, 32, 32, Settings.Default.GridNumbers);
            AnimateBackground = new GuiCheckBox(5, "Animate Background", 0, 0, 32, 32, Settings.Default.AnimateBackground);

            Bpm.Focused    = true;
            Offset.Focused = true;
            Bpm.OnKeyDown(Key.Right, false);
            Offset.OnKeyDown(Key.Right, false);
            Bpm.Focused    = false;
            Offset.Focused = false;

            Buttons.Add(playPause);
            Buttons.Add(Timeline);
            Buttons.Add(Tempo);
            Buttons.Add(MasterVolume);
            Buttons.Add(SfxVolume);
            Buttons.Add(BeatSnapDivisor);
            Buttons.Add(Reposition);
            Buttons.Add(Autoplay);
            Buttons.Add(ApproachSquares);
            Buttons.Add(GridNumbers);
            Buttons.Add(AnimateBackground);
            Buttons.Add(SetOffset);
            Buttons.Add(BackButton);
            Buttons.Add(CopyButton);

            OnResize(EditorWindow.Instance.ClientSize);

            EditorWindow.Instance.MusicPlayer.Volume = (float)Settings.Default.MasterVolume;

            MasterVolume.Value = (int)(Settings.Default.MasterVolume * MasterVolume.MaxValue);
            SfxVolume.Value    = (int)(Settings.Default.SFXVolume * SfxVolume.MaxValue);
        }
        //private object TimingPanel;
        //TimingPoints TimingPoints;

        public GuiScreenEditor() : base(0, EditorWindow.Instance.ClientSize.Height - 64, EditorWindow.Instance.ClientSize.Width - 512 - 64, 64)
        {
            if (File.Exists(Path.Combine(EditorWindow.Instance.LauncherDir, "background_editor.png")))
            {
                this.bgImg = true;
                using (Bitmap img = new Bitmap(Path.Combine(EditorWindow.Instance.LauncherDir, "background_editor.png")))
                {
                    this._textureId = TextureManager.GetOrRegister("bg", img, true);
                }
            }

            _toast = new GuiLabel(0, 0, "", false)
            {
                Centered = true,
                FontSize = 36
            };

            var playPause = new GuiButtonPlayPause(0, EditorWindow.Instance.ClientSize.Width - 512 - 64, EditorWindow.Instance.ClientSize.Height - 64, 64, 64);

            Offset = new GuiTextBox(0, 0, 128, 32)
            {
                Text          = "0",
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };
            JumpMSBox = new GuiTextBox(0, 0, 128, 32)
            {
                Text          = "0",
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false,
            };
            RotateBox = new GuiTextBox(0, 0, 128, 32)
            {
                Text          = "0",
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false,
            };
            SfxOffset = new GuiTextBox(EditorWindow.Instance.ClientSize.Width - 128, 0, 128, 32)
            {
                Text          = "0",
                Centered      = true,
                Numeric       = true,
                CanBeNegative = true
            };
            NoteAlign = new GuiSlider(0, 0, 256, 40)
            {
                MaxValue = 59,
                Value    = 2
            };
            BeatSnapDivisor = new GuiSlider(0, 0, 256, 40);
            Timeline        = new GuiSliderTimeline(0, 0, EditorWindow.Instance.ClientSize.Width, 64);
            Tempo           = new GuiSlider(0, 0, 512, 64)
            {
                MaxValue = 26,
                Value    = 16
            };

            Timeline.Snap            = false;
            BeatSnapDivisor.Value    = GuiTrack.BeatDivisor - 1;
            BeatSnapDivisor.MaxValue = 31;

            MasterVolume = new GuiSlider(0, 0, 40, 256)
            {
                MaxValue = 50
            };
            SfxVolume = new GuiSlider(0, 0, 40, 256)
            {
                MaxValue = 50
            };

            SetOffset  = new GuiButton(2, 0, 0, 64, 32, "SET", false);
            BackButton = new GuiButton(3, 0, 0, Grid.ClientRectangle.Width + 1, 42, "BACK TO MENU", false);
            CopyButton = new GuiButton(4, 0, 0, (Grid.ClientRectangle.Width - 5) / 2, 42, "COPY MAP DATA", false);
            PlayButton = new GuiButton(99, 0, 0, (Grid.ClientRectangle.Width - 5) / 2, 42, "PLAY MAP", false);

            JumpMSButton = new GuiButton(6, 0, 0, 64, 32, "JUMP", false);
            RotateButton = new GuiButton(7, 0, 0, 64, 32, "ROTATE", false);

            OpenTimings  = new GuiButton(8, 0, 0, 200, 32, "OPEN TIMING SETUP PANEL", false);
            UseCurrentMs = new GuiButton(9, 0, 0, 200, 32, "USE CURRENT MS", false);

            Autoplay         = new GuiCheckBox(5, "Autoplay", 0, 0, 32, 32, Settings.Default.Autoplay);
            ApproachSquares  = new GuiCheckBox(5, "Approach Squares", 0, 0, 32, 32, Settings.Default.ApproachSquares);
            GridNumbers      = new GuiCheckBox(5, "Grid Numbers", 0, 0, 32, 32, Settings.Default.GridNumbers);
            Quantum          = new GuiCheckBox(5, "Quantum", 0, 0, 32, 32, Settings.Default.Quantum);
            AutoAdvance      = new GuiCheckBox(5, "Auto-Advance", 0, 0, 32, 32, Settings.Default.AutoAdvance);
            Numpad           = new GuiCheckBox(5, "Use Numpad", 0, 0, 32, 32, Settings.Default.Numpad);
            QuantumGridLines = new GuiCheckBox(5, "Quantum Grid Lines", 0, 0, 32, 32, Settings.Default.QuantumGridLines);
            QuantumGridSnap  = new GuiCheckBox(5, "Snap to Grid", 0, 0, 32, 32, Settings.Default.QuantumGridSnap);
            Metronome        = new GuiCheckBox(5, "Metronome", 0, 0, 32, 32, Settings.Default.Metronome);
            //LegacyBPM = new GuiCheckBox(5, "Use Legacy Panel", 0, 0, 24, 24, Settings.Default.LegacyBPM);

            Offset.Focused    = true;
            SfxOffset.Focused = true;
            JumpMSBox.Focused = true;
            RotateBox.Focused = true;

            Offset.OnKeyDown(Key.Right, false);
            SfxOffset.OnKeyDown(Key.Right, false);
            JumpMSBox.OnKeyDown(Key.Right, false);
            RotateBox.OnKeyDown(Key.Right, false);

            Offset.Focused    = false;
            SfxOffset.Focused = false;
            JumpMSBox.Focused = false;
            RotateBox.Focused = false;

            Buttons.Add(playPause);
            Buttons.Add(Timeline);
            Buttons.Add(Tempo);
            Buttons.Add(NoteAlign);
            Buttons.Add(MasterVolume);
            Buttons.Add(SfxVolume);
            Buttons.Add(BeatSnapDivisor);
            Buttons.Add(Autoplay);
            Buttons.Add(ApproachSquares);
            Buttons.Add(GridNumbers);
            Buttons.Add(Quantum);
            Buttons.Add(AutoAdvance);
            Buttons.Add(Numpad);
            Buttons.Add(QuantumGridLines);
            Buttons.Add(QuantumGridSnap);
            Buttons.Add(Metronome);
            //Buttons.Add(LegacyBPM);
            Buttons.Add(SetOffset);
            Buttons.Add(BackButton);
            Buttons.Add(CopyButton);
            Buttons.Add(PlayButton);
            Buttons.Add(JumpMSButton);
            Buttons.Add(RotateButton);
            Buttons.Add(OpenTimings);
            Buttons.Add(UseCurrentMs);

            OnResize(EditorWindow.Instance.ClientSize);

            EditorWindow.Instance.MusicPlayer.Volume = (float)Settings.Default.MasterVolume;

            SfxOffset.Text     = Settings.Default.SfxOffset;
            MasterVolume.Value = (int)(Settings.Default.MasterVolume * MasterVolume.MaxValue);
            SfxVolume.Value    = (int)(Settings.Default.SFXVolume * SfxVolume.MaxValue);
            // NoteAlign.Value = (int)(Settings.Default.NoteAlign * NoteAlign.MaxValue);

            SfxOffset.OnChanged += (_, value) =>
            {
                Settings.Default.SfxOffset = SfxOffset.Text;
            };
        }
        public GuiScreenSettings() : base(0, 0, EditorWindow.Instance.ClientSize.Width, EditorWindow.Instance.ClientSize.Height)
        {
            color1TextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.Color1,
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            color2TextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.Color2,
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            NoteColor1TextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.NoteColor1,
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            NoteColor2TextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.NoteColor2,
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            EditorBGOpacityTextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.EditorBGOpacity.ToString(),
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            GridOpacityTextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.GridOpacity.ToString(),
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            TrackOpacityTextBox = new GuiTextBox(0, 0, 200, 50)
            {
                Text          = EditorSettings.TrackOpacity.ToString(),
                Centered      = true,
                Numeric       = true,
                CanBeNegative = false
            };

            WaveformCheckbox = new GuiCheckBox(1, "Waveform", 0, 0, 72, 72, 32, EditorSettings.Waveform);
            //BPMFormCheckbox = new GuiCheckBox(1, "Use Timings Form", 0, 0, 72, 72, 32, EditorSettings.BPMForm);

            Buttons.Add(_openFolderButton);
            Buttons.Add(_resetButton);
            Buttons.Add(_backButton);
            Buttons.Add(WaveformCheckbox);
            //Buttons.Add(BPMFormCheckbox);

            if (File.Exists(Path.Combine(EditorWindow.Instance.LauncherDir, "background_menu.png")))
            {
                bgImg = true;
                using (Bitmap img = new Bitmap(Path.Combine(EditorWindow.Instance.LauncherDir, "background_menu.png")))
                {
                    _textureId = TextureManager.GetOrRegister("settingsbg", img, true);
                }
            }

            OnResize(EditorWindow.Instance.ClientSize);
        }