Exemple #1
0
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            GUILayout.Label("Settings", styles.LargeLabel);
            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Enable Features", styles.LargeLabel);
            NoteStreakEnabled      = GUILayout.Toggle(NoteStreakEnabled, "Note Streak", styles.Toggle);
            HotStartEnabled        = GUILayout.Toggle(HotStartEnabled, "Hot Start", styles.Toggle);
            StarPowerActiveEnabled = GUILayout.Toggle(StarPowerActiveEnabled, "Star Power Active", styles.Toggle);
            GUILayout.Label("Prevents the labels from fading out", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });

            if (GUILayout.Button("Test Indicator", styles.Button))
            {
                ComboIndicator.Instance.CreateDancingText("Here is a test!", true);
            }

            GUILayout.Space(25.0f);
            Indicator.ConfigureGUI(styles);
        }
Exemple #2
0
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            GUILayout.Label("Settings", styles.LargeLabel);
            Enabled = GUILayout.Toggle(Enabled, "Enabled", styles.Toggle);

            GUILayout.Label("Pan Time (ms)", styles.SmallLabel);
            PanSpeed = (int)GUILayout.HorizontalSlider(PanSpeed, 0.0f, 10000, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(PanSpeed.ToString(), styles.TextField), out float panSpeed))
            {
                PanSpeed = panSpeed;
            }

            GUILayout.Space(25.0f);
            GUILayout.Label("Enable/Disable Keybind", styles.LargeLabel);
            EnabledKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            if (GUILayout.Button("Save Config", styles.Button))
            {
                SaveConfig();
            }
        }
 public virtual void ConfigureGUI(GUIConfigurationStyles styles)
 {
     if (!DraggableWindowsEnabled)
     {
         GUILayout.Label("X", styles.SmallLabel);
         X = (int)GUILayout.HorizontalSlider(X, -3840.0f, 3840.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
         if (int.TryParse(GUILayout.TextField(X.ToString(), styles.TextField), out int x))
         {
             X = x;
         }
     }
     else
     {
         GUILayout.Label($"X - {X.ToString()}", styles.SmallLabel);
     }
     if (!DraggableWindowsEnabled)
     {
         GUILayout.Label("Y", styles.SmallLabel);
         Y = (int)GUILayout.HorizontalSlider(Y, -2160, 2160.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
         if (int.TryParse(GUILayout.TextField(Y.ToString(), styles.TextField), out int y))
         {
             Y = y;
         }
     }
     else
     {
         GUILayout.Label($"Y - {Y.ToString()}", styles.SmallLabel);
     }
 }
Exemple #4
0
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            GUILayout.Label("Settings", styles.LargeLabel);
            Enabled = GUILayout.Toggle(Enabled, "Enabled", styles.Toggle);
            FC      = GUILayout.Toggle(FC, "FC Mode", styles.Toggle);
            GUILayout.Label("Note Miss Limit (inclusive)", styles.SmallLabel);
            NotesMissed = (int)GUILayout.HorizontalSlider(NotesMissed, 0.0f, 100.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (int.TryParse(GUILayout.TextField(NotesMissed.ToString(), styles.TextField), out int notesMissed))
            {
                NotesMissed = notesMissed;
            }
            GUILayout.Label("Fail Delay Before Restart", styles.SmallLabel);
            FailDelay = GUILayout.HorizontalSlider(FailDelay, 0.0f, 10.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(FailDelay.ToString(), styles.TextField), out float failDelay))
            {
                FailDelay = failDelay;
            }

            GUILayout.Space(25.0f);
            GUILayout.Label("Enable/Disable Keybind", styles.LargeLabel);
            EnabledKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Debugging Tools", styles.LargeLabel);
            LayoutTest = GUILayout.Toggle(LayoutTest, "Test Layout", styles.Toggle);
            GUILayout.Label("Prevents the labels from fading out", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            DraggableLabelsEnabled = GUILayout.Toggle(DraggableLabelsEnabled, "Draggable Labels", styles.Toggle);
            GUILayout.Label("Allows you to drag each label with a window", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            GUILayout.Label("(this disables some options in this window)", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            DisplayImage.DraggableWindowsEnabled       = DraggableLabelsEnabled;
            RemainingNotesLeft.DraggableWindowsEnabled = DraggableLabelsEnabled;
            RestartIndicator.DraggableWindowsEnabled   = DraggableLabelsEnabled;

            GUILayout.Space(25.0f);
            GUILayout.Label("Active Display Indicator", styles.LargeLabel);
            DisplayImage.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Remaining Notes Indicator", styles.LargeLabel);
            RemainingNotesLeft.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Restart Time Indicator", styles.LargeLabel);
            RestartIndicator.ConfigureGUI(styles);
        }
Exemple #5
0
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            GUILayout.Label("Settings", styles.LargeLabel);
            Enabled = GUILayout.Toggle(Enabled, "Enabled", styles.Toggle);

            GUILayout.Label("Font Size", styles.SmallLabel);
            FontSize = (int)GUILayout.HorizontalSlider(FontSize, 0.0f, 100.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (int.TryParse(GUILayout.TextField(FontSize.ToString(), styles.TextField), out int fontSize))
            {
                FontSize = fontSize;
            }

            GUILayout.Label("Twitch Channel", styles.SmallLabel);
            TwitchChannel = GUILayout.TextField(TwitchChannel, styles.TextField);

            GUILayout.Label("Update Speed (ms)", styles.SmallLabel);
            UpdateSpeed = (int)GUILayout.HorizontalSlider(UpdateSpeed, 0.0f, 10000.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(UpdateSpeed.ToString(), styles.TextField), out float updateSpeed))
            {
                UpdateSpeed = updateSpeed;
            }

            GUILayout.Label("Chat Width", styles.SmallLabel);
            ChatWidth = (int)GUILayout.HorizontalSlider(ChatWidth, 0.0f, Screen.width, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(ChatWidth.ToString(), styles.TextField), out float chatWidth))
            {
                ChatWidth = chatWidth;
            }

            GUILayout.Label("Chat Height", styles.SmallLabel);
            ChatHeight = (int)GUILayout.HorizontalSlider(ChatHeight, 0.0f, Screen.height, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(ChatHeight.ToString(), styles.TextField), out float chatHeight))
            {
                ChatHeight = chatHeight;
            }

            GUILayout.Space(25.0f);
            GUILayout.Label("Enable/Disable Keybind", styles.LargeLabel);
            EnabledKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            if (GUILayout.Button("Save Config", styles.Button))
            {
                SaveConfig();
            }
        }
Exemple #6
0
        private void OnWindowHead(int id)
        {
            var smallLabelStyle = new GUIStyle {
                fontSize  = 14,
                alignment = TextAnchor.UpperLeft,
                normal    = new GUIStyleState {
                    textColor = Color.white,
                }
            };
            var largeLabelStyle = new GUIStyle {
                fontSize  = 20,
                alignment = TextAnchor.UpperLeft,
                normal    = new GUIStyleState {
                    textColor = Color.white,
                }
            };
            var styles = new GUIConfigurationStyles {
                LargeLabel            = largeLabelStyle,
                SmallLabel            = smallLabelStyle,
                Window                = settingsWindowStyle,
                Toggle                = settingsToggleStyle,
                Button                = settingsButtonStyle,
                TextArea              = settingsTextAreaStyle,
                TextField             = settingsTextFieldStyle,
                Label                 = settingsLabelStyle,
                Box                   = settingsBoxStyle,
                HorizontalSlider      = settingsHorizontalSliderStyle,
                HorizontalSliderThumb = settingsHorizontalSliderThumbStyle
            };

            GUILayout.Label("Settings", largeLabelStyle);
            if (GUILayout.Button("Time", settingsButtonStyle))
            {
                settingsOnWindow = OnWindowTime;
            }
            if (GUILayout.Button("Current Star", settingsButtonStyle))
            {
                settingsOnWindow = OnWindowCurrentStar;
            }
            if (GUILayout.Button("Seven Star", settingsButtonStyle))
            {
                settingsOnWindow = OnWindowSevenStar;
            }
            if (GUILayout.Button("Notes", settingsButtonStyle))
            {
                settingsOnWindow = OnWindowNotes;
            }
            if (GUILayout.Button("Star Power", settingsButtonStyle))
            {
                settingsOnWindow = OnWindowStarPower;
            }
            if (GUILayout.Button("Combo", settingsButtonStyle))
            {
                settingsOnWindow = OnWindowCombo;
            }

            GUILayout.Space(25.0f);
            GUILayout.Label("Enable/Disable Keybind", largeLabelStyle);
            config.EnabledKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", largeLabelStyle);
            config.ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Debugging Tools", largeLabelStyle);
            config.DraggableLabelsEnabled = GUILayout.Toggle(config.DraggableLabelsEnabled, "Draggable Labels", styles.Toggle);
            GUILayout.Label("Allows you to drag each label with a window", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            GUILayout.Label("(this disables some options in this window)", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            config.TimeName.DraggableWindowsEnabled                      = config.DraggableLabelsEnabled;
            config.SongTime.DraggableWindowsEnabled                      = config.DraggableLabelsEnabled;
            config.SongLength.DraggableWindowsEnabled                    = config.DraggableLabelsEnabled;
            config.SongTimePercentage.DraggableWindowsEnabled            = config.DraggableLabelsEnabled;
            config.CurrentStarProgressName.DraggableWindowsEnabled       = config.DraggableLabelsEnabled;
            config.CurrentStarProgressScore.DraggableWindowsEnabled      = config.DraggableLabelsEnabled;
            config.CurrentStarProgressEndScore.DraggableWindowsEnabled   = config.DraggableLabelsEnabled;
            config.CurrentStarProgressPercentage.DraggableWindowsEnabled = config.DraggableLabelsEnabled;
            config.SevenStarProgressName.DraggableWindowsEnabled         = config.DraggableLabelsEnabled;
            config.SevenStarProgressScore.DraggableWindowsEnabled        = config.DraggableLabelsEnabled;
            config.SevenStarProgressEndScore.DraggableWindowsEnabled     = config.DraggableLabelsEnabled;
            config.SevenStarProgressPercentage.DraggableWindowsEnabled   = config.DraggableLabelsEnabled;
            config.NotesName.DraggableWindowsEnabled                     = config.DraggableLabelsEnabled;
            config.NotesHitCounter.DraggableWindowsEnabled               = config.DraggableLabelsEnabled;
            config.NotesPassedCounter.DraggableWindowsEnabled            = config.DraggableLabelsEnabled;
            config.TotalNotesCounter.DraggableWindowsEnabled             = config.DraggableLabelsEnabled;
            config.SeenNotesHitPercentage.DraggableWindowsEnabled        = config.DraggableLabelsEnabled;
            config.NotesHitPercentage.DraggableWindowsEnabled            = config.DraggableLabelsEnabled;
            config.NotesMissedCounter.DraggableWindowsEnabled            = config.DraggableLabelsEnabled;
            config.StarPowerName.DraggableWindowsEnabled                 = config.DraggableLabelsEnabled;
            config.StarPowersGottenCounter.DraggableWindowsEnabled       = config.DraggableLabelsEnabled;
            config.TotalStarPowersCounter.DraggableWindowsEnabled        = config.DraggableLabelsEnabled;
            config.StarPowerPercentage.DraggableWindowsEnabled           = config.DraggableLabelsEnabled;
            config.CurrentStarPower.DraggableWindowsEnabled              = config.DraggableLabelsEnabled;
            config.ComboName.DraggableWindowsEnabled                     = config.DraggableLabelsEnabled;
            config.CurrentComboCounter.DraggableWindowsEnabled           = config.DraggableLabelsEnabled;
            config.HighestComboCounter.DraggableWindowsEnabled           = config.DraggableLabelsEnabled;

            GUILayout.Space(20.0f);
            config.Enabled = !GUILayout.Toggle(!config.Enabled, "Hide all extra UI", settingsToggleStyle);
            GUILayout.Space(20.0f);
            if (GUILayout.Button("Save Config", settingsButtonStyle))
            {
                config.SaveConfig();
            }
            GUILayout.Space(50.0f);

            GUILayout.Label($"Extra Song UI v{versionCheck.AssemblyVersion}");
            GUILayout.Label("Tweak by Biendeo");
            GUILayout.Label("Thankyou for using this!");
            GUI.DragWindow();
        }
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            GUILayout.Label("Settings", styles.LargeLabel);
            Enabled = GUILayout.Toggle(Enabled, "Enabled", styles.Toggle);
            GUILayout.Label("Time on-screen", styles.SmallLabel);
            TimeOnScreen = GUILayout.HorizontalSlider(TimeOnScreen, 0.0f, 5.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(TimeOnScreen.ToString(), styles.TextField), out float timeOnScreen))
            {
                TimeOnScreen = timeOnScreen;
            }

            GUILayout.Space(25.0f);
            GUILayout.Label("Enable/Disable Keybind", styles.LargeLabel);
            EnabledKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Debugging Tools", styles.LargeLabel);
            LayoutTest = GUILayout.Toggle(LayoutTest, "Test Layout", styles.Toggle);
            GUILayout.Label("Prevents the labels from fading out", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            DraggableLabelsEnabled = GUILayout.Toggle(DraggableLabelsEnabled, "Draggable Labels", styles.Toggle);
            GUILayout.Label("Allows you to drag each label with a window", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            GUILayout.Label("(this disables some options in this window)", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            AccuracyTime.DraggableWindowsEnabled    = DraggableLabelsEnabled;
            AccuracyMessage.DraggableWindowsEnabled = DraggableLabelsEnabled;
            AverageAccuracy.DraggableWindowsEnabled = DraggableLabelsEnabled;

            GUILayout.Space(25.0f);
            GUILayout.Label("Accuracy Time Indicator", styles.LargeLabel);
            AccuracyTime.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Accuracy Message Indicator", styles.LargeLabel);
            AccuracyMessage.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Average Accuracy Indicator", styles.LargeLabel);
            GUILayout.Label("(this is mostly for testing latency)", new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            });
            AverageAccuracy.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Perfect", styles.LargeLabel);
            ColorPerfect.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Missed", styles.LargeLabel);
            ColorMissed.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Slightly Early", styles.LargeLabel);
            GUILayout.Label("Cutoff time", styles.SmallLabel);
            CutoffSlightlyEarly = GUILayout.HorizontalSlider(CutoffSlightlyEarly, 0.0f, 0.07f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CutoffSlightlyEarly.ToString(), styles.TextField), out float cutoffSlightlyEarly))
            {
                CutoffSlightlyEarly = cutoffSlightlyEarly;
            }
            ColorSlightlyEarly.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Early", styles.LargeLabel);
            GUILayout.Label("Cutoff time", styles.SmallLabel);
            CutoffEarly = GUILayout.HorizontalSlider(CutoffEarly, 0.0f, 0.07f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CutoffEarly.ToString(), styles.TextField), out float cutoffEarly))
            {
                CutoffEarly = cutoffEarly;
            }
            ColorEarly.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Very Early", styles.LargeLabel);
            GUILayout.Label("Cutoff time", styles.SmallLabel);
            CutoffVeryEarly = GUILayout.HorizontalSlider(CutoffVeryEarly, 0.0f, 0.07f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CutoffVeryEarly.ToString(), styles.TextField), out float cutoffVeryEarly))
            {
                CutoffVeryEarly = cutoffVeryEarly;
            }
            ColorVeryEarly.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Slightly Late", styles.LargeLabel);
            GUILayout.Label("Cutoff time", styles.SmallLabel);
            CutoffSlightlyLate = GUILayout.HorizontalSlider(CutoffSlightlyLate, 0.0f, 0.07f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CutoffSlightlyLate.ToString(), styles.TextField), out float cutoffSlightlyLate))
            {
                CutoffSlightlyLate = cutoffSlightlyLate;
            }
            ColorSlightlyLate.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Late", styles.LargeLabel);
            GUILayout.Label("Cutoff time", styles.SmallLabel);
            CutoffLate = GUILayout.HorizontalSlider(CutoffLate, 0.0f, 0.07f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CutoffLate.ToString(), styles.TextField), out float cutoffLate))
            {
                CutoffLate = cutoffLate;
            }
            ColorLate.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Colors - Very Late", styles.LargeLabel);
            GUILayout.Label("Cutoff time", styles.SmallLabel);
            CutoffVeryLate = GUILayout.HorizontalSlider(CutoffVeryLate, 0.0f, 0.07f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CutoffVeryLate.ToString(), styles.TextField), out float cutoffVeryLate))
            {
                CutoffVeryLate = cutoffVeryLate;
            }
            ColorVeryLate.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            if (GUILayout.Button("Save Config", styles.Button))
            {
                SaveConfig();
            }
        }
Exemple #8
0
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            var noteLabelStyle = new GUIStyle(styles.SmallLabel)
            {
                fontStyle = FontStyle.Italic
            };

            GUILayout.Label("Settings", styles.LargeLabel);
            Enabled = GUILayout.Toggle(Enabled, "Enabled", styles.Toggle);
            VanillaSplashMessages = GUILayout.Toggle(VanillaSplashMessages, "Vanilla Splash Messages", styles.Toggle);
            DragonforceOverride   = GUILayout.Toggle(Enabled, "DragonForce Override", styles.Toggle);
            AprilFoolsSplashes    = GUILayout.Toggle(Enabled, "April Fools Splashes", styles.Toggle);
            GUILayout.Label("Cycle Time", styles.SmallLabel);
            CycleTime = (float)GUILayout.HorizontalSlider(CycleTime, 0.016f, 120.0f, styles.HorizontalSlider, styles.HorizontalSliderThumb);
            if (float.TryParse(GUILayout.TextField(CycleTime.ToString(), styles.TextField), out float cycleTime))
            {
                CycleTime = cycleTime;
            }
            if (GUILayout.Button("Randomly select new splash"))
            {
                ResetSplashes();
            }

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Splash Messages", styles.LargeLabel);
            GUILayout.Label("Note: Please drop out any user profiles\nbefore typing into these text areas as\ninput will be passed to the background.", noteLabelStyle);
            GUILayout.Space(15.0f);
            bool isMainMenuActive = SceneManager.GetActiveScene().name == "Main Menu";

            for (int i = 0; i < Messages.Count; ++i)
            {
                GUILayout.Label($"#{i + 1}", styles.SmallLabel);
                Messages[i] = GUILayout.TextArea(Messages[i], styles.TextArea);
                if (isMainMenuActive)
                {
                    if (GUILayout.Button("Preview message"))
                    {
                        PreviewMessage(i);
                    }
                }
                GUILayout.BeginHorizontal();
                if (i > 0 && GUILayout.Button("Shift up"))
                {
                    string temp = Messages[i - 1];
                    Messages[i - 1] = Messages[i];
                    Messages[i]     = temp;
                    ShiftUpMessage(i);
                }
                if (i < Messages.Count - 1 && GUILayout.Button("Shift down"))
                {
                    string temp = Messages[i + 1];
                    Messages[i + 1] = Messages[i];
                    Messages[i]     = temp;
                    ShiftDownMessage(i);
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Delete"))
                {
                    Messages.RemoveAt(i);
                    DeleteMessage(i--);
                }
                if (GUILayout.Button("Insert new"))
                {
                    Messages.Insert(i + 1, "Type your splash message here!");
                    InsertMessage(i);
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(15.0f);
            }
            if (Messages.Count == 0)
            {
                if (GUILayout.Button("Insert"))
                {
                    Messages.Add("Type your splash message here!");
                    InsertMessage(-1);
                }
            }

            GUILayout.Space(25.0f);
            if (GUILayout.Button("Reload Config", styles.Button))
            {
                ReloadConfig();
            }
            if (GUILayout.Button("Save Config", styles.Button))
            {
                SaveConfig();
            }
        }
        public void ConfigureGUI(GUIConfigurationStyles styles)
        {
            GUILayout.Label("Settings", styles.LargeLabel);
            Enabled = GUILayout.Toggle(Enabled, "Enabled", styles.Toggle);

            GUILayout.Space(25.0f);
            GUILayout.Label("Configuration Keybind", styles.LargeLabel);
            ConfigKeyBind.ConfigureGUI(styles);

            GUILayout.Space(25.0f);
            GUILayout.Label("Splash Messages", styles.LargeLabel);
            bool isMainMenuActive = SceneManager.GetActiveScene().name == "Main Menu";

            for (int i = 0; i < Messages.Count; ++i)
            {
                GUILayout.Label($"#{i + 1}", styles.SmallLabel);
                Messages[i] = GUILayout.TextField(Messages[i], styles.TextField);
                if (isMainMenuActive)
                {
                    if (GUILayout.Button("Preview message"))
                    {
                        ChangeActiveTextFunction(Messages[i]);
                    }
                }
                GUILayout.BeginHorizontal();
                if (i > 0 && GUILayout.Button("Shift up"))
                {
                    string temp = Messages[i - 1];
                    Messages[i - 1] = Messages[i];
                    Messages[i]     = temp;
                }
                if (i < Messages.Count - 1 && GUILayout.Button("Shift down"))
                {
                    string temp = Messages[i + 1];
                    Messages[i + 1] = Messages[i];
                    Messages[i]     = temp;
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Delete"))
                {
                    Messages.RemoveAt(i);
                    --i;
                }
                if (GUILayout.Button("Insert new"))
                {
                    Messages.Insert(i + 1, "Type your splash message here!");
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(15.0f);
            }
            if (Messages.Count == 0)
            {
                if (GUILayout.Button("Insert"))
                {
                    Messages.Add("Type your splash message here!");
                }
            }

            GUILayout.Space(25.0f);
            if (GUILayout.Button("Save Config", styles.Button))
            {
                SaveConfig();
            }
        }
Exemple #10
0
        private void OnWindow(int id)
        {
            var smallLabelStyle = new GUIStyle {
                fontSize  = 14,
                alignment = TextAnchor.UpperLeft,
                normal    = new GUIStyleState {
                    textColor = Color.white,
                }
            };
            var largeLabelStyle = new GUIStyle {
                fontSize  = 20,
                alignment = TextAnchor.UpperLeft,
                normal    = new GUIStyleState {
                    textColor = Color.white,
                }
            };
            var styles = new GUIConfigurationStyles {
                LargeLabel            = largeLabelStyle,
                SmallLabel            = smallLabelStyle,
                Window                = settingsWindowStyle,
                Toggle                = settingsToggleStyle,
                Button                = settingsButtonStyle,
                TextArea              = settingsTextAreaStyle,
                TextField             = settingsTextFieldStyle,
                Label                 = settingsLabelStyle,
                Box                   = settingsBoxStyle,
                HorizontalSlider      = settingsHorizontalSliderStyle,
                HorizontalSliderThumb = settingsHorizontalSliderThumbStyle
            };

            if (settingsCurrentlyEditing == null)
            {
                settingsScrollPosition = GUILayout.BeginScrollView(settingsScrollPosition);
                GUILayout.Label("Settings", largeLabelStyle);

                GUILayout.Space(25.0f);
                GUILayout.Label("Enable/Disable Keybind", largeLabelStyle);
                config.EnabledKeyBind.ConfigureGUI(styles);

                GUILayout.Space(25.0f);
                GUILayout.Label("Configuration Keybind", largeLabelStyle);
                config.ConfigKeyBind.ConfigureGUI(styles);

                GUILayout.Space(25.0f);
                GUILayout.Label("Debugging Tools", largeLabelStyle);
                config.DraggableLabelsEnabled = GUILayout.Toggle(config.DraggableLabelsEnabled, "Draggable Labels", styles.Toggle);
                GUILayout.Label("Allows you to drag each label with a window", new GUIStyle(styles.SmallLabel)
                {
                    fontStyle = FontStyle.Italic
                });
                GUILayout.Label("(this disables some options in this window)", new GUIStyle(styles.SmallLabel)
                {
                    fontStyle = FontStyle.Italic
                });

                foreach (var layout in config.Layout)
                {
                    foreach (var label in layout)
                    {
                        label.DraggableWindowsEnabled = config.DraggableLabelsEnabled;
                    }
                }

                GUILayout.Space(20.0f);
                config.Enabled = !GUILayout.Toggle(!config.Enabled, "Hide all extra UI", settingsToggleStyle);

                GUILayout.Space(20.0f);
                GUILayout.Label("Layout for the following players:");
                GUILayout.BeginHorizontal();
                for (int i = 0; i < bandIndex; ++i)
                {
                    if (GUILayout.Toggle(config.LayoutIndexSelected == i, $"{i + 1}", settingsToggleStyle))
                    {
                        config.LayoutIndexSelected = i;
                    }
                }
                GUILayout.EndHorizontal();
                config.Enabled = !GUILayout.Toggle(!config.Enabled, "Hide all extra UI", settingsToggleStyle);

                GUILayout.Space(20.0f);
                for (int i = 0; i < config.Layout[config.LayoutIndexSelected].Count; ++i)
                {
                    GUILayout.Label($"#{i + 1}", styles.SmallLabel);
                    var layout = config.Layout[config.LayoutIndexSelected];
                    var label  = layout[i];
                    if (GUILayout.Button($"Edit: {label.Name}", styles.Button))
                    {
                        settingsCurrentlyEditing = label;
                    }
                    GUILayout.BeginHorizontal();
                    if (i > 0 && GUILayout.Button("Shift up"))
                    {
                        layout[i]     = layout[i - 1];
                        layout[i - 1] = label;
                    }
                    if (i < layout.Count - 1 && GUILayout.Button("Shift down"))
                    {
                        layout[i]     = layout[i + 1];
                        layout[i + 1] = label;
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button("Delete"))
                    {
                        layout.RemoveAt(i);
                        var existingLabel = labels.FirstOrDefault(l => l.Item1 == label);
                        if (existingLabel != default)
                        {
                            Destroy(existingLabel.Item2);
                            labels.Remove(existingLabel);
                        }
                    }
                    if (GUILayout.Button("Insert new"))
                    {
                        layout.Insert(i + 1, new SongUILabel {
                            Name      = "New Label",
                            Format    = "EDIT ME",
                            X         = Screen.width / 2,
                            Y         = Screen.height / 2,
                            Size      = 50,
                            Alignment = TextAnchor.MiddleCenter,
                            Bold      = true,
                            Italic    = false,
                            Visible   = true,
                            Color     = new ColorARGB(Color.white)
                        });
                        if (SceneManager.GetActiveScene().name == "Gameplay")
                        {
                            Transform canvasTransform = FadeBehaviourWrapper.Instance.FadeGraphic.canvas.transform;
                            CreateGameplayLabel(canvasTransform, layout[i + 1]);
                        }
                    }
                    GUILayout.EndHorizontal();
                    GUILayout.Space(15.0f);
                }
                if (config.Layout[config.LayoutIndexSelected].Count == 0)
                {
                    if (GUILayout.Button("Insert"))
                    {
                        config.Layout[config.LayoutIndexSelected].Add(new SongUILabel {
                            Name      = "New Label",
                            Format    = "EDIT ME",
                            X         = Screen.width / 2,
                            Y         = Screen.height / 2,
                            Size      = 50,
                            Alignment = TextAnchor.MiddleCenter,
                            Bold      = true,
                            Italic    = false,
                            Visible   = true,
                            Color     = new ColorARGB(Color.white)
                        });
                        if (SceneManager.GetActiveScene().name == "Gameplay")
                        {
                            Transform canvasTransform = FadeBehaviourWrapper.Instance.FadeGraphic.canvas.transform;
                            CreateGameplayLabel(canvasTransform, config.Layout[config.LayoutIndexSelected][0]);
                        }
                    }
                }

                GUILayout.Space(20.0f);
                if (GUILayout.Button("Reload Config", styles.Button))
                {
                    DestroyLabels();
                    config.ReloadConfig(ConfigPath);
                }
                if (GUILayout.Button("Save Config", settingsButtonStyle))
                {
                    config.SaveConfig(ConfigPath);
                }
                GUILayout.Space(50.0f);

                GUILayout.Label($"Extra Song UI v{versionCheck.AssemblyVersion}");
                GUILayout.Label("Tweak by Biendeo");
                GUILayout.Label("Thankyou for using this!");
                GUILayout.EndScrollView();
            }
            else
            {
                settingsCurrentlyEditing.ConfigureGUI(styles);

                if (GUILayout.Button("Back", styles.Button))
                {
                    settingsCurrentlyEditing = null;
                }
            }
            GUI.DragWindow();
        }
Exemple #11
0
 public override void ConfigureGUI(GUIConfigurationStyles styles)
 {
     GUILayout.Label("Name:", styles.SmallLabel);
     Name = GUILayout.TextField(Name, styles.TextField);
     base.ConfigureGUI(styles);
 }
Exemple #12
0
        private void OnWindow(int id)
        {
            var smallLabelStyle = new GUIStyle
            {
                fontSize  = 14,
                alignment = TextAnchor.UpperLeft,
                normal    = new GUIStyleState
                {
                    textColor = Color.white,
                }
            };
            var largeLabelStyle = new GUIStyle
            {
                fontSize  = 20,
                alignment = TextAnchor.UpperLeft,
                normal    = new GUIStyleState
                {
                    textColor = Color.white,
                }
            };
            var styles = new GUIConfigurationStyles
            {
                LargeLabel            = largeLabelStyle,
                SmallLabel            = smallLabelStyle,
                Window                = settingsWindowStyle,
                Toggle                = settingsToggleStyle,
                Button                = settingsButtonStyle,
                TextArea              = settingsTextAreaStyle,
                TextField             = settingsTextFieldStyle,
                Label                 = settingsLabelStyle,
                Box                   = settingsBoxStyle,
                HorizontalSlider      = settingsHorizontalSliderStyle,
                HorizontalSliderThumb = settingsHorizontalSliderThumbStyle
            };

            if (!currentlyEditing)
            {
                settingsScrollPosition = GUILayout.BeginScrollView(settingsScrollPosition);
                GUILayout.Label("Settings", largeLabelStyle);

                GUILayout.Label("Move lyrics", largeLabelStyle);
                config.Enabled = GUILayout.Toggle(config.Enabled, "Enabled", styles.Toggle);

                GUILayout.Space(25.0f);
                GUILayout.Label("Enable/Disable Keybind", largeLabelStyle);
                config.EnabledKeyBind.ConfigureGUI(styles);

                GUILayout.Space(25.0f);
                GUILayout.Label("Configuration Keybind", largeLabelStyle);
                config.ConfigKeyBind.ConfigureGUI(styles);

                GUILayout.Space(25.0f);
                GUILayout.Label("Move lyrics", largeLabelStyle);
                config.DraggableLabelsEnabled = GUILayout.Toggle(config.DraggableLabelsEnabled, "Draggable Label", styles.Toggle);
                GUILayout.Label("Allows you to drag the lyrics with a window", new GUIStyle(styles.SmallLabel)
                {
                    fontStyle = FontStyle.Italic
                });

                config.Position.DraggableWindowsEnabled = config.DraggableLabelsEnabled;
                GUILayout.Space(20.0f);

                currentlyEditing = GUILayout.Button($"Edit position", styles.Button);

                GUILayout.Space(20.0f);
                if (GUILayout.Button("Save Config", settingsButtonStyle))
                {
                    config.SaveConfig(ConfigPath);
                }
                GUILayout.Space(50.0f);

                GUILayout.Label($"Move Lyrics v{typeof(MoveLyrics).Assembly.GetName().Version}");
                GUILayout.Label("Tweak by Joosthoi1");
                GUILayout.Label("Thank you for using this!");
                GUILayout.EndScrollView();
            }
            else
            {
                config.Position.ConfigureGUI(styles);
                if (GUILayout.Button("Back", styles.Button))
                {
                    currentlyEditing = false;
                }
            }

            GUI.DragWindow();
        }