예제 #1
0
 private static void Postfix(Text ___text)
 {
     if (GCS.speedTrialMode && GCS.currentSpeedRun.ToString("0.0") == "1.0")
     {
         ___text.text = RDString.Get("status.getReady");
     }
 }
예제 #2
0
        public void LearnUnitTest()
        {
            List <string> lstExpected = RDFile.ReadAllLine("sorted-names-list.txt");
            List <string> lstActual   = RDString.SortByLastWord(RDFile.ReadAllLine("unsorted-names-list.txt"), ' ');

            CollectionAssert.AreEqual(lstExpected, lstActual);
        }
예제 #3
0
        /// <summary>
        /// Unity's Awake lifecycle event handler. Creates the text with a drop
        /// shadow.
        /// </summary>
        protected void Awake()
        {
            Canvas canvas = gameObject.AddComponent <Canvas>();

            canvas.renderMode = RenderMode.ScreenSpaceOverlay;
            CanvasScaler scaler = gameObject.AddComponent <CanvasScaler>();

            scaler.uiScaleMode         = CanvasScaler.ScaleMode.ScaleWithScreenSize;
            scaler.referenceResolution = new Vector2(1920, 1080);

            ContentSizeFitter fitter;

            GameObject shadowObject = new GameObject();

            fitter               = shadowObject.AddComponent <ContentSizeFitter>();
            fitter.verticalFit   = ContentSizeFitter.FitMode.PreferredSize;
            fitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize;
            shadowObject.transform.SetParent(transform);
            shadowText       = shadowObject.AddComponent <Text>();
            shadowText.font  = RDString.GetFontDataForLanguage(RDString.language).font;
            shadowText.color = Color.black.WithAlpha(0.4f);

            GameObject mainObject = new GameObject();

            mainObject.transform.SetParent(transform);
            fitter               = mainObject.AddComponent <ContentSizeFitter>();
            fitter.verticalFit   = ContentSizeFitter.FitMode.PreferredSize;
            fitter.horizontalFit = ContentSizeFitter.FitMode.PreferredSize;
            mainText             = mainObject.AddComponent <Text>();
            mainText.font        = RDString.GetFontDataForLanguage(RDString.language).font;
        }
예제 #4
0
        /// <inheritdoc/>
        public override void OnSettingsGUI()
        {
            bool newVal;

            newVal = GUILayout.Toggle(
                Settings.HideEverything,
                TweakStrings.Get(TranslationKeys.HideUiElements.EVERYTHING));
            if (newVal != Settings.HideEverything)
            {
                Settings.HideEverything = newVal;
                ShowOrHideElements();
            }
            if (Settings.HideEverything)
            {
                return;
            }

            GUILayout.Space(8f);

            Settings.HideJudgment =
                GUILayout.Toggle(
                    Settings.HideJudgment,
                    TweakStrings.Get(
                        TranslationKeys.HideUiElements.JUDGE_TEXT,
                        RDString.Get("HitMargin." + HitMargin.Perfect),
                        RDString.Get("HitMargin." + HitMargin.EarlyPerfect)));

            Settings.HideMissIndicators =
                GUILayout.Toggle(
                    Settings.HideMissIndicators,
                    TweakStrings.Get(TranslationKeys.HideUiElements.MISSES));

            newVal = GUILayout.Toggle(
                Settings.HideTitle, TweakStrings.Get(TranslationKeys.HideUiElements.SONG_TITLE));
            if (newVal != Settings.HideTitle)
            {
                Settings.HideTitle = newVal;
                ShowOrHideElements();
            }

            newVal = GUILayout.Toggle(
                Settings.HideOtto, TweakStrings.Get(TranslationKeys.HideUiElements.AUTO));
            if (newVal != Settings.HideOtto)
            {
                Settings.HideOtto = newVal;
                ShowOrHideElements();
            }

            newVal = GUILayout.Toggle(
                Settings.HideBeta, TweakStrings.Get(TranslationKeys.HideUiElements.BETA_BUILD));
            if (newVal != Settings.HideBeta)
            {
                Settings.HideBeta = newVal;
                ShowOrHideElements();
            }
        }
            public static void Postfix(scrCountdown __instance)
            {
                if (invokedFailAction)
                {
                    invokedFailAction = false;

                    FieldInfo field = typeof(scrCountdown).GetField("text", AccessTools.all);
                    Text      text  = (Text)field.GetValue(__instance);
                    text.text =
                        Settings.CustomDeathString.Replace(
                            "{judgment}", RDString.Get("HitMargin." + FAMargin.ToString()));
                    field.SetValue(__instance, text);
                }
            }
        /// <inheritdoc/>
        public override void OnSettingsGUI()
        {
            for (int i = 0; i < TOTAL_JUDGMENTS; i++)
            {
                Settings.RestrictJudgments[i] = GUILayout.Toggle(
                    Settings.RestrictJudgments[i],
                    TweakStrings.Get(
                        TranslationKeys.RestrictJudgments.RESTRICT,
                        RDString.Get("HitMargin." + (HitMargin)i)));
            }

            GUILayout.Label(TweakStrings.Get(TranslationKeys.RestrictJudgments.CUSTOM_DEATH));
            Settings.CustomDeathString = GUILayout.TextField(Settings.CustomDeathString);
        }
예제 #7
0
        void OnGUI()
        {
            if (Main.Settings.TextShadow > 0)
            {
                GUIStyle shadow = new GUIStyle();
                shadow.fontSize         = Main.Settings.TextSize;
                shadow.font             = RDString.GetFontDataForLanguage(SystemLanguage.Korean).font;
                shadow.normal.textColor = Color.black.WithAlpha((float)Main.Settings.TextShadow / 100);

                GUI.Label(new Rect(Main.Settings.PositionX + 12, Main.Settings.PositionY - 8, Screen.width, Screen.height), Content, shadow);
            }

            GUIStyle style = new GUIStyle();

            style.fontSize         = Main.Settings.TextSize;
            style.font             = RDString.GetFontDataForLanguage(RDString.language).font;
            style.normal.textColor = Color.white;

            GUI.Label(new Rect(Main.Settings.PositionX + 10, Main.Settings.PositionY - 10, Screen.width, Screen.height), Content, style);
        }
예제 #8
0
        /// <inheritdoc/>
        public override void OnSettingsGUI()
        {
            // Glitch flip
            Settings.DisableGlitchFlip =
                GUILayout.Toggle(
                    Settings.DisableGlitchFlip,
                    TweakStrings.Get(
                        TranslationKeys.Miscellaneous.GLITCH_FLIP,
                        RDString.GetEnumValue(Filter.Glitch)));

            // Editor zoom
            Settings.DisableEditorZoom =
                GUILayout.Toggle(
                    Settings.DisableEditorZoom,
                    TweakStrings.Get(TranslationKeys.Miscellaneous.EDITOR_ZOOM));

            // Hitsound volume
            if (Settings.SetHitsoundVolume =
                    GUILayout.Toggle(
                        Settings.SetHitsoundVolume,
                        TweakStrings.Get(TranslationKeys.Miscellaneous.SET_HITSOUND_VOLUME)))
            {
                bool valueChanged = Settings.HitsoundVolumeScale * 1 == (
                    Settings.HitsoundVolumeScale =
                        Mathf.Min(
                            MoreGUILayout.NamedSlider(
                                TweakStrings.Get(TranslationKeys.Miscellaneous.CURRENT_HITSOUND_VOLUME),
                                Settings.HitsoundVolumeScale * 100,
                                0,
                                100.0001f,
                                200f,
                                roundNearest: 0.001f,
                                valueFormat: "{0:0.#}%") / 100, 1));
                if (valueChanged)
                {
                    Settings.UpdateVolume();
                }
            }
        }
 public static void changeAllTexts(string txt)
 {
     for (int i = 0; i < 10; i++)
     {
         Scene scene   = SceneManager.GetSceneAt(i);
         var   objects = scene.GetRootGameObjects();
         foreach (var O in objects)
         {
             foreach (var Text in O.GetComponentsInChildren <Text>())
             {
                 FontData fnt = RDString.GetFontDataForLanguage(RDString.language);
                 if (Text.text != "")
                 {
                     Text.text = txt;
                 }
             }
             foreach (var Text in O.GetComponentsInChildren <TextMesh>())
             {
                 FontData fnt = RDString.GetFontDataForLanguage(RDString.language);
                 if (Text.text != "")
                 {
                     Text.text = txt;
                 }
             }
             foreach (var Text in O.GetComponentsInChildren <TextEditor>())
             {
                 FontData fnt = RDString.GetFontDataForLanguage(RDString.language);
                 L.og(Text.text);
                 if (Text.text != "")
                 {
                     Text.text = txt;
                 }
             }
         }
     }
 }
예제 #10
0
        private void OnGUI()
        {
            GUI.Box(new Rect(20, 20, 240, 200), "Pixel Printer v1.0");

            GUI.Label(new Rect(40, 180, 140, 20), "Made by PatrickKR, Idea by 보성녹차");

            if (GUI.Button(new Rect(40, 60, 200, 20), "Open Image"))
            {
                var files = StandaloneFileBrowser.OpenFilePanel("Open Image", Persistence.GetLastUsedFolder(), new[] {
                    new ExtensionFilter(RDString.Get("editor.dialog.imageFileFormat"), GCS.SupportedImageFiles)
                }, false);

                if (files.Length == 0 || string.IsNullOrEmpty(files[0]))
                {
                    _image.Dispose();
                    _image  = null;
                    enabled = false;
                }
                else
                {
                    _image        = new Bitmap(File.OpenRead(files[0]));
                    _widthString  = _image.Width.ToString();
                    _heightString = _image.Height.ToString();
                    _enabled      = true;
                }
            }

            if (_image == null)
            {
                return;
            }

            GUI.Label(new Rect(40, 90, 140, 20), "Width (1 ~ " + _image.Width + ")");

            _width       = 0;
            _widthString = GUI.TextField(new Rect(190, 90, 40, 20), _widthString);
            int.TryParse(_widthString, out _width);

            GUI.Label(new Rect(40, 120, 140, 20), "Height (1 ~ " + _image.Height + ")");

            _height       = 0;
            _heightString = GUI.TextField(new Rect(190, 120, 40, 20), _heightString);
            int.TryParse(_heightString, out _height);

            if (_width < 1 || _width > _image.Width || _height < 1 || _height > _image.Height)
            {
                return;
            }

            if (GUI.Button(new Rect(40, 150, 200, 20), "Run!") && _enabled)
            {
                GC.Collect();
                Resources.UnloadUnusedAssets();

                var instance  = scnEditor.instance;
                var levelData = instance.levelData;

                instance.InvokeMethod("ClearAllFloorOffsets");
                instance.InvokeMethod("DeselectAnyUIGameObject");

                levelData.pathData = new StringBuilder(_width * _height - 1).Insert(0, "R", _width * _height - 1).ToString();

                var settingsInfo = GCS.settingsInfo;
                levelData.songSettings       = new LevelEvent(0, LevelEventType.SongSettings, settingsInfo["SongSettings"]);
                levelData.levelSettings      = new LevelEvent(0, LevelEventType.LevelSettings, settingsInfo["LevelSettings"]);
                levelData.trackSettings      = new LevelEvent(0, LevelEventType.TrackSettings, settingsInfo["TrackSettings"]);
                levelData.backgroundSettings = new LevelEvent(0, LevelEventType.BackgroundSettings, settingsInfo["BackgroundSettings"]);
                levelData.cameraSettings     = new LevelEvent(0, LevelEventType.CameraSettings, settingsInfo["CameraSettings"]);
                levelData.miscSettings       = new LevelEvent(0, LevelEventType.MiscSettings, settingsInfo["MiscSettings"]);

                levelData.cameraSettings.data["relativeTo"] = CamMovementType.Tile;
                levelData.cameraSettings.data["position"]   = new Vector2(_width / 2f - 0.5f, -_height / 2f + 0.5f);
                levelData.cameraSettings.data["zoom"]       = Math.Max(_width * 9, _height * 16);

                levelData.miscSettings.data["stickToFloors"] = Toggle.Enabled;

                instance.events.Clear();

                instance.events.Add(new LevelEvent(0, LevelEventType.MoveTrack)
                {
                    data = new Dictionary <string, object> {
                        {
                            "startTile", new Tuple <int, TileRelativeTo>(0, TileRelativeTo.Start)
                        },
                        {
                            "endTile", new Tuple <int, TileRelativeTo>(0, TileRelativeTo.End)
                        },
                        {
                            "duration", 0.0f
                        },
                        {
                            "positionOffset", Vector2.zero
                        },
                        {
                            "rotationOffset", 0.0f
                        },
                        {
                            "scale", 200
                        },
                        {
                            "opacity", 100
                        },
                        {
                            "angleOffset", 0.0f
                        },
                        {
                            "ease", Ease.Linear
                        },
                        {
                            "eventTag", ""
                        }
                    }
                });

                for (var floor = 1; floor < _height; floor++)
                {
                    instance.events.Add(new LevelEvent(floor * _width, LevelEventType.PositionTrack)
                    {
                        data = new Dictionary <string, object> {
                            {
                                "positionOffset", new Vector2(-_width, -1)
                            },
                            {
                                "editorOnly", Toggle.Disabled
                            }
                        }
                    });
                }

                using (var newImage = new Bitmap(_width, _height))
                {
                    using (var graphics = System.Drawing.Graphics.FromImage(newImage))
                    {
                        graphics.SmoothingMode     = SmoothingMode.AntiAlias;
                        graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
                        graphics.PixelOffsetMode   = PixelOffsetMode.HighQuality;
                        // graphics.SmoothingMode = SmoothingMode.None;
                        // graphics.InterpolationMode = InterpolationMode.NearestNeighbor;
                        // graphics.PixelOffsetMode = PixelOffsetMode.None;
                        graphics.DrawImage(_image, new Rectangle(0, 0, _width, _height));

                        var lastHex = "debb7bff";

                        for (var y = 0; y < _height; y++)
                        {
                            for (var x = 0; x < _width; x++)
                            {
                                var hex = newImage.GetPixel(x, y).ToHex();

                                if (hex == lastHex)
                                {
                                    continue;
                                }

                                lastHex = hex;

                                instance.events.Add(new LevelEvent(x + y * _width, LevelEventType.ColorTrack)
                                {
                                    data = new Dictionary <string, object> {
                                        {
                                            "trackColorType", TrackColorType.Single
                                        },
                                        {
                                            "trackColor", lastHex
                                        },
                                        {
                                            "secondaryTrackColor", "ffffff"
                                        },
                                        {
                                            "trackColorAnimDuration", 2.0f
                                        },
                                        {
                                            "trackColorPulse", TrackColorPulse.None
                                        },
                                        {
                                            "trackPulseLength", 10
                                        },
                                        {
                                            "trackStyle", TrackStyle.Standard
                                        }
                                    }
                                });
                            }
                        }

                        instance.RemakePath();
                        instance.InvokeMethod("SelectFirstFloor");
                        instance.UpdateSongAndLevelSettings();
                        instance.customLevel.ReloadAssets();
                        instance.customLevel.UpdateDecorationSprites();
                        instance.ShowFileActionsPanel(false);
                        instance.ShowShortcutsPanel(false);
                    }
                }
            }
        }
예제 #11
0
        public void OnGUI()
        {
            if (shouldDisplaySettings)
            {
                GUI.Box(new Rect(sW, sH, 250, 220), "Settings");
                GUI.Label(new Rect(sW + 10, sH + 30, 155, 100), "Acc X Pos: " + x.ToString());
                x = (int)GUI.HorizontalSlider(new Rect(sW + 110, sH + 30, 110, 20), x, 0, Screen.width);
                GUI.Label(new Rect(sW + 10, sH + 50, 155, 100), "Acc Y Pos: " + y.ToString());
                y = (int)GUI.HorizontalSlider(new Rect(sW + 110, sH + 50, 110, 20), y, 0, Screen.height);
                GUI.Label(new Rect(sW + 10, sH + 70, 155, 100), "Hits X Pos: " + hitsX.ToString());
                hitsX = (int)GUI.HorizontalSlider(new Rect(sW + 110, sH + 70, 110, 20), hitsX, 0, Screen.width);
                GUI.Label(new Rect(sW + 10, sH + 90, 155, 100), "Hits Y Pos: " + hitsY.ToString());
                hitsY = (int)GUI.HorizontalSlider(new Rect(sW + 110, sH + 90, 110, 20), hitsY, 0, Screen.height);
                GUI.Label(new Rect(sW + 10, sH + 110, 155, 100), "Font Size: " + fontSize.ToString());
                fontSize = (int)GUI.HorizontalSlider(new Rect(sW + 110, sH + 110, 110, 20), fontSize, 0, 100);
                if (GUI.Button(new Rect(sW + 10, sH + 130, 230, 20), minimalistEnabled == 0 ? "Enable Minimalist" : "Disable Minimalist"))
                {
                    if (minimalistEnabled == 0)
                    {
                        minimalistEnabled = 1;
                    }
                    else
                    {
                        minimalistEnabled = 0;
                    }
                }
                if (GUI.Button(new Rect(sW + 10, sH + 150, 230, 20), "Save Settings"))
                {
                    PlayerPrefs.SetInt("accX", x);
                    PlayerPrefs.SetInt("accY", y);
                    PlayerPrefs.SetInt("accHitsX", hitsX);
                    PlayerPrefs.SetInt("accHitsY", hitsY);
                    PlayerPrefs.SetInt("accFontSize", fontSize);
                    PlayerPrefs.SetInt("accMinEn", minimalistEnabled);
                }
                if (GUI.Button(new Rect(sW + 10, sH + 170, 230, 20), "Donate"))
                {
                    System.Diagnostics.Process.Start("https://paypal.me/maxbridgland");
                }
                GUI.Label(new Rect(sW + 10, sH + 190, 230, 20), "Created by macs#0420");
            }
            if (FindObjectOfType <ADOBase>().controller.mistakesManager != null && shouldShowAcc)
            {
                if (myFont == null)
                {
                    myFont = RDString.GetFontDataForLanguage(RDString.language).font;
                }
                GUIStyle style = new GUIStyle();
                style.fontStyle        = FontStyle.Bold;
                style.font             = myFont;
                style.fontSize         = fontSize;
                style.normal.textColor = Color.black;
                Rect rect2      = new Rect(x - 2, y - 2, w + 3, h + 3);
                Rect percRectBG = new Rect(rect2.x, rect2.y - 40, w + 3, h + 3);
                Rect hitsRectBG = new Rect(hitsX - 2, hitsY - 2, w + 3, h + 3);
                foreach (KeyValuePair <HitMargin, int> kp in this.hitDict)
                {
                    switch (kp.Key)
                    {
                    case HitMargin.TooEarly:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += 45;
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Too Early: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.VeryEarly:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += (45 * 2);
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Very Early: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.EarlyPerfect:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += (45 * 3);
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Early Perfect: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.Perfect:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += (45 * 4);
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Perfect: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.LatePerfect:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += (45 * 5);
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Late Perfect: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.VeryLate:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += (45 * 6);
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Very Late: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.TooLate:
                        hitsRectBG.y  = hitsY - 2;
                        hitsRectBG.y += (45 * 7);
                        GUI.Label(hitsRectBG, minimalistEnabled == 0 ? "Too Late: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    default:
                        break;
                    }
                }
                GUI.Label(rect2, minimalistEnabled == 0 ? "Accuracy: " + (currAcc * 100).ToString() : (currAcc * 100).ToString() + "%", style);
                GUI.Label(percRectBG, minimalistEnabled == 0 ? "Percentage: " + ((Math.Truncate(currPerc * 100.0) / 100.0)).ToString() + "%" : ((Math.Truncate(currPerc * 100.0) / 100.0)).ToString() + "%", style);
                switch (currAcc)
                {
                case float n when(n >= 1):
                    style.normal.textColor = Color.green;

                    break;

                case float n when(n < 1 && n >= 0.90):
                    style.normal.textColor = Color.yellow;

                    break;

                case float n when(n < 0.90):
                    style.normal.textColor = Color.red;

                    break;

                case float n when(n < 0.001):
                    style.normal.textColor = Color.green;

                    break;

                default:
                    style.normal.textColor = Color.green;
                    break;
                }
                Rect rect     = new Rect(x, y, w, h);
                Rect percRect = new Rect(rect.x, rect.y - 45, w + 3, h + 3);
                GUI.Label(rect, minimalistEnabled == 0 ? "Accuracy: " + (currAcc * 100).ToString() + "%" : (currAcc * 100).ToString() + "%", style);
                Rect hitsRect = new Rect(hitsX, hitsY, w, h);
                style.normal.textColor = Color.green;
                GUI.Label(percRect, minimalistEnabled == 0 ? "Percentage: " + ((Math.Truncate(currPerc * 100.0) / 100.0)).ToString() + "%" : ((Math.Truncate(currPerc * 100.0) / 100.0)).ToString() + "%", style);
                foreach (KeyValuePair <HitMargin, int> kp in this.hitDict)
                {
                    switch (kp.Key)
                    {
                    case HitMargin.TooEarly:
                        style.normal.textColor = Color.red;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += 45;
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Too Early: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.VeryEarly:
                        style.normal.textColor = Color.red;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += (45 * 2);
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Very Early: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.EarlyPerfect:
                        style.normal.textColor = Color.yellow;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += (45 * 3);
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Early Perfect: " + kp.Value.ToString() : "" + kp.Value.ToString(), style);
                        break;

                    case HitMargin.Perfect:
                        style.normal.textColor = Color.green;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += (45 * 4);
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Perfect: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.LatePerfect:
                        style.normal.textColor = Color.yellow;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += (45 * 5);
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Late Perfect: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.VeryLate:
                        style.normal.textColor = Color.red;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += (45 * 6);
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Very Late: " + kp.Value.ToString() : kp.Value.ToString(), style);
                        break;

                    case HitMargin.TooLate:
                        style.normal.textColor = Color.red;
                        hitsRect.y             = hitsY - 2;
                        hitsRect.y            += (45 * 7);
                        GUI.Label(hitsRect, minimalistEnabled == 0 ? "Too Late: " + kp.Value.ToString() : "" + kp.Value.ToString(), style);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
예제 #12
0
        /// <inheritdoc/>
        public override void OnSettingsGUI()
        {
            // Filter
            if (Settings.DisableFilter =
                    GUILayout.Toggle(
                        Settings.DisableFilter,
                        TweakStrings.Get(
                            TranslationKeys.DisableEffects.FILTER,
                            RDString.GetEnumValue(Filter.Grayscale),
                            RDString.GetEnumValue(Filter.Arcade))))
            {
                /*
                 * // Enable specific filter
                 * if (GUILayout.Button(TweakStrings.Get("")))
                 * {
                 *  //
                 * }
                 *
                 * // Disable specific filter
                 * if (GUILayout.Button(TweakStrings.Get("")))
                 * {
                 *  //
                 * }
                 */
            }

            // Bloom
            Settings.DisableBloom =
                GUILayout.Toggle(
                    Settings.DisableBloom,
                    TweakStrings.Get(TranslationKeys.DisableEffects.BLOOM));

            // Flash
            Settings.DisableFlash =
                GUILayout.Toggle(
                    Settings.DisableFlash,
                    TweakStrings.Get(TranslationKeys.DisableEffects.FLASH));

            // Hall of mirrors
            Settings.DisableHallOfMirrors =
                GUILayout.Toggle(
                    Settings.DisableHallOfMirrors,
                    TweakStrings.Get(
                        TranslationKeys.DisableEffects.HALL_OF_MIRRORS,
                        RDString.Get("editor." + LevelEventType.HallOfMirrors)));

            // Screen shake
            Settings.DisableScreenShake =
                GUILayout.Toggle(
                    Settings.DisableScreenShake,
                    TweakStrings.Get(TranslationKeys.DisableEffects.SCREEN_SHAKE));

            // Move track
            string trackMaxFormat =
                Settings.MoveTrackMax > DisableEffectsSettings.MOVE_TRACK_UPPER_BOUND
                    ? TweakStrings.Get(TranslationKeys.DisableEffects.TILE_MOVEMENT_UNLIMITED)
                    : "{0}";
            float newTrackMax =
                MoreGUILayout.NamedSlider(
                    TweakStrings.Get(TranslationKeys.DisableEffects.TILE_MOVEMENT_MAX),
                    Settings.MoveTrackMax,
                    5,
                    DisableEffectsSettings.MOVE_TRACK_UPPER_BOUND + 5,
                    300f,
                    roundNearest: 5,
                    valueFormat: trackMaxFormat);

            Settings.MoveTrackMax = Mathf.RoundToInt(newTrackMax);
        }
예제 #13
0
        /// <inheritdoc/>
        public override void OnSettingsGUI()
        {
            Settings.ShowHitErrorMeter =
                GUILayout.Toggle(
                    Settings.ShowHitErrorMeter,
                    TweakStrings.Get(TranslationKeys.JudgmentVisuals.SHOW_HIT_ERROR_METER));

            if (Settings.ShowHitErrorMeter)
            {
                MoreGUILayout.BeginIndent();

                // Scale slider
                float newScale =
                    MoreGUILayout.NamedSlider(
                        TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_SCALE),
                        Settings.ErrorMeterScale,
                        0.25f,
                        4f,
                        200f,
                        roundNearest: 0.125f,
                        valueFormat: "{0}x");
                if (newScale != Settings.ErrorMeterScale)
                {
                    Settings.ErrorMeterScale = newScale;
                    HitErrorMeter.Instance.UpdateLayout();
                }

                // X position slider
                float newX =
                    MoreGUILayout.NamedSlider(
                        TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_X_POS),
                        Settings.ErrorMeterXPos,
                        0f,
                        1f,
                        300f,
                        roundNearest: 0.01f,
                        valueFormat: "{0:0.##}");
                if (newX != Settings.ErrorMeterXPos)
                {
                    Settings.ErrorMeterXPos = newX;
                    HitErrorMeter.Instance.UpdateLayout();
                }

                // Y position slider
                float newY =
                    MoreGUILayout.NamedSlider(
                        TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_Y_POS),
                        Settings.ErrorMeterYPos,
                        0f,
                        1f,
                        300f,
                        roundNearest: 0.01f,
                        valueFormat: "{0:0.##}");
                if (newY != Settings.ErrorMeterYPos)
                {
                    Settings.ErrorMeterYPos = newY;
                    HitErrorMeter.Instance.UpdateLayout();
                }

                // Tick life slider
                Settings.ErrorMeterTickLife =
                    MoreGUILayout.NamedSlider(
                        TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_TICK_LIFE),
                        Settings.ErrorMeterTickLife,
                        1f,
                        10f,
                        200f,
                        roundNearest: 1f,
                        valueFormat: TweakStrings.Get(
                            TranslationKeys.JudgmentVisuals.ERROR_METER_TICK_SECONDS));

                // Sensitivity slider
                GUILayout.BeginHorizontal();
                GUILayout.Label(
                    TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_SENSITIVITY));
                GUILayout.Space(16f);
                GUILayout.Label(
                    TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_MORE_STABLE));
                GUILayout.Space(8f);
                float newSens =
                    GUILayout.HorizontalSlider(
                        Settings.ErrorMeterSensitivity, 0.05f, 0.5f, GUILayout.Width(200f));
                newSens *= 20;
                newSens  = Mathf.Round(newSens);
                newSens /= 20;
                if (Settings.ErrorMeterSensitivity != newSens)
                {
                    Settings.ErrorMeterSensitivity = newSens;
                }
                GUILayout.Space(8f);
                GUILayout.Label(
                    TweakStrings.Get(TranslationKeys.JudgmentVisuals.ERROR_METER_LESS_STABLE));
                GUILayout.Space(8f);
                GUILayout.Label($"({Settings.ErrorMeterSensitivity})");
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();

                MoreGUILayout.EndIndent();
            }

            // Hide perfects
            Settings.HidePerfects =
                GUILayout.Toggle(
                    Settings.HidePerfects,
                    TweakStrings.Get(
                        TranslationKeys.JudgmentVisuals.HIDE_PERFECTS,
                        RDString.Get("HitMargin." + HitMargin.Perfect)));
        }
예제 #14
0
 public void Start()
 {
     OverloadText.font             = RDString.GetFontDataForLanguage(RDString.language).font;
     OverloadText.fontSize         = Mathf.RoundToInt(35 * RDString.GetFontDataForLanguage(RDString.language).fontScale);
     OverloadText.normal.textColor = UnityEngine.Color.white;
 }
예제 #15
0
            public static bool Prefix(scnCLS __instance, string sub, ref string ___searchParameter, List <string> ___sortedLevelKeys)
            {
                void Invoke(MethodBase methodBase, params object[] parameters)
                {
                    methodBase.Invoke(__instance, parameters);
                }

                ___searchParameter = sub;
                List <CustomLevelTile> source = new List <CustomLevelTile>();

                foreach (string sortedLevelKey in ___sortedLevelKeys)
                {
                    CustomLevelTile loadedLevelTile = __instance.loadedLevelTiles[sortedLevelKey];
                    LevelData       loadedLevel     = __instance.loadedLevels[sortedLevelKey];
                    string[]        strArray        =
                    {
                        RDUtils.RemoveRichTags(loadedLevel.artist),
                        RDUtils.RemoveRichTags(loadedLevel.author),
                        RDUtils.RemoveRichTags(loadedLevel.song)
                    };
                    bool flag = false;
                    if (!sub.IsNullOrEmpty())
                    {
                        foreach (string str in strArray)
                        {
                            if (str.ToLower().Contains(sub.ToLower()))
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    else
                    {
                        flag = true;
                    }

                    if (flag)
                    {
                        source.Add(loadedLevelTile);
                    }
                    else
                    {
                        loadedLevelTile.gameObject.SetActive(false);
                    }
                }

                int num = Mathf.RoundToInt(__instance.controller.chosenplanet.transform.position.y);

                for (int index = 0; index < source.Count; ++index)
                {
                    CustomLevelTile customLevelTile = source[index];
                    customLevelTile.gameObject.SetActive(true);
                    customLevelTile.transform.MoveY(num - index);
                }

                bool flag1 = source.Count >= (double)__instance.levelCountForLoop;

                if (source.Count != 0)
                {
                    CustomLevelTile customLevelTile1 = source.First();
                    CustomLevelTile customLevelTile2 = source.Last();
                    if (flag1)
                    {
                        __instance.gemTop.MoveY(customLevelTile1.transform.position.y + 1f);
                        __instance.gemTopY = Mathf.RoundToInt(__instance.gemTop.position.y);
                        __instance.gemBottom.MoveY(customLevelTile2.transform.position.y - 1f);
                        __instance.gemBottomY = Mathf.RoundToInt(__instance.gemBottom.position.y);
                    }
                    else
                    {
                        __instance.chainTop.transform.MoveY(customLevelTile1.transform.position.y);
                        __instance.chainBottom.transform.MoveY(customLevelTile2.transform.position.y);
                    }
                }
                else
                {
                    __instance.chainTop.transform.MoveY((float)num);
                    __instance.chainBottom.transform.MoveY((float)num);
                }

                __instance.gemTop.gameObject.SetActive(flag1);
                __instance.gemBottom.gameObject.SetActive(flag1);
                __instance.chainTop.gameObject.SetActive(!flag1);
                __instance.chainBottom.gameObject.SetActive(!flag1);
                if (source.Count != 0)
                {
                    __instance.SelectLevel(source[0], true);
                }
                else
                {
                    __instance.DisplayLevel();
                    Invoke(_stopCurrentLevelSong);
                }

                string str1 = RDString.Get("cls.shortcut.find");

                if (!sub.IsNullOrEmpty())
                {
                    str1 = str1 + " <color=#ffd000><i>" +
                           RDString.Get("cls.currentlySearching").Replace("[filter]", sub) + "</i></color>";
                }
                __instance.currentSearchText.text = str1;
                return(false);
            }