Add display of current renderer

This commit is contained in:
Dean Herbert
2023-03-26 20:09:35 +09:00
parent 91da546ba2
commit e346b02ebf
2 changed files with 12 additions and 1 deletions

View File

@ -24,6 +24,11 @@ namespace osu.Game.Localisation
/// </summary> /// </summary>
public static LocalisableString Renderer => new TranslatableString(getKey(@"renderer"), @"Renderer"); public static LocalisableString Renderer => new TranslatableString(getKey(@"renderer"), @"Renderer");
/// <summary>
/// "Current renderer is &quot;{0}&quot;"
/// </summary>
public static LocalisableString CurrentRenderer(string arg0) => new TranslatableString(getKey(@"current_renderer"), @"Current renderer is ""{0}""", arg0);
/// <summary> /// <summary>
/// "Frame limiter" /// "Frame limiter"
/// </summary> /// </summary>

View File

@ -4,6 +4,7 @@
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Framework.Platform; using osu.Framework.Platform;
@ -25,9 +26,11 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
var renderer = config.GetBindable<RendererType>(FrameworkSetting.Renderer); var renderer = config.GetBindable<RendererType>(FrameworkSetting.Renderer);
automaticRendererInUse = renderer.Value == RendererType.Automatic; automaticRendererInUse = renderer.Value == RendererType.Automatic;
SettingsEnumDropdown<RendererType> rendererDropdown;
Children = new Drawable[] Children = new Drawable[]
{ {
new SettingsEnumDropdown<RendererType> rendererDropdown = new SettingsEnumDropdown<RendererType>
{ {
LabelText = GraphicsSettingsStrings.Renderer, LabelText = GraphicsSettingsStrings.Renderer,
Current = renderer, Current = renderer,
@ -67,6 +70,9 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
renderer.Value = r.OldValue; renderer.Value = r.OldValue;
})); }));
}); });
if (renderer.Value == RendererType.Automatic)
rendererDropdown.SetNoticeText(GraphicsSettingsStrings.CurrentRenderer(host.ResolvedRenderer.GetDescription()));
} }
} }
} }