mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 21:07:59 +09:00
Rename const, add xmldoc and make protected
This commit is contained in:
parent
bb36d1614f
commit
c1d67976e6
@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
public void TestScreenOffsettingOnSettingsOverlay()
|
public void TestScreenOffsettingOnSettingsOverlay()
|
||||||
{
|
{
|
||||||
AddStep("open settings", () => Game.Settings.Show());
|
AddStep("open settings", () => Game.Settings.Show());
|
||||||
AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == SettingsPanel.WIDTH * OsuGame.SCREEN_OFFSET_RATIO);
|
AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == SettingsPanel.WIDTH * TestOsuGame.SIDE_OVERLAY_OFFSET_RATIO);
|
||||||
|
|
||||||
AddStep("hide settings", () => Game.Settings.Hide());
|
AddStep("hide settings", () => Game.Settings.Hide());
|
||||||
AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
|
AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
|
||||||
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.Menus
|
|||||||
public void TestScreenOffsettingOnNotificationOverlay()
|
public void TestScreenOffsettingOnNotificationOverlay()
|
||||||
{
|
{
|
||||||
AddStep("open notifications", () => Game.Notifications.Show());
|
AddStep("open notifications", () => Game.Notifications.Show());
|
||||||
AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == -NotificationOverlay.WIDTH * OsuGame.SCREEN_OFFSET_RATIO);
|
AddUntilStep("right screen offset applied", () => Game.ScreenOffsetContainer.X == -NotificationOverlay.WIDTH * TestOsuGame.SIDE_OVERLAY_OFFSET_RATIO);
|
||||||
|
|
||||||
AddStep("hide notifications", () => Game.Notifications.Hide());
|
AddStep("hide notifications", () => Game.Notifications.Hide());
|
||||||
AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
|
AddUntilStep("screen offset removed", () => Game.ScreenOffsetContainer.X == 0f);
|
||||||
|
@ -96,6 +96,8 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
|
|
||||||
public class TestOsuGame : OsuGame
|
public class TestOsuGame : OsuGame
|
||||||
{
|
{
|
||||||
|
public new const float SIDE_OVERLAY_OFFSET_RATIO = OsuGame.SIDE_OVERLAY_OFFSET_RATIO;
|
||||||
|
|
||||||
public new ScreenStack ScreenStack => base.ScreenStack;
|
public new ScreenStack ScreenStack => base.ScreenStack;
|
||||||
|
|
||||||
public new BackButton BackButton => base.BackButton;
|
public new BackButton BackButton => base.BackButton;
|
||||||
|
@ -64,7 +64,10 @@ namespace osu.Game
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class OsuGame : OsuGameBase, IKeyBindingHandler<GlobalAction>
|
public class OsuGame : OsuGameBase, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
public const float SCREEN_OFFSET_RATIO = 0.125f;
|
/// <summary>
|
||||||
|
/// The amount of global offset to apply when a left/right anchored overlay is displayed (ie. settings or notifications).
|
||||||
|
/// </summary>
|
||||||
|
protected const float SIDE_OVERLAY_OFFSET_RATIO = 0.125f;
|
||||||
|
|
||||||
public Toolbar Toolbar;
|
public Toolbar Toolbar;
|
||||||
|
|
||||||
@ -1016,9 +1019,9 @@ namespace osu.Game
|
|||||||
var horizontalOffset = 0f;
|
var horizontalOffset = 0f;
|
||||||
|
|
||||||
if (Settings.IsLoaded && Settings.IsPresent)
|
if (Settings.IsLoaded && Settings.IsPresent)
|
||||||
horizontalOffset += ToLocalSpace(Settings.ScreenSpaceDrawQuad.TopRight).X * SCREEN_OFFSET_RATIO;
|
horizontalOffset += ToLocalSpace(Settings.ScreenSpaceDrawQuad.TopRight).X * SIDE_OVERLAY_OFFSET_RATIO;
|
||||||
if (Notifications.IsLoaded && Notifications.IsPresent)
|
if (Notifications.IsLoaded && Notifications.IsPresent)
|
||||||
horizontalOffset += (ToLocalSpace(Notifications.ScreenSpaceDrawQuad.TopLeft).X - DrawWidth) * SCREEN_OFFSET_RATIO;
|
horizontalOffset += (ToLocalSpace(Notifications.ScreenSpaceDrawQuad.TopLeft).X - DrawWidth) * SIDE_OVERLAY_OFFSET_RATIO;
|
||||||
|
|
||||||
ScreenOffsetContainer.X = horizontalOffset;
|
ScreenOffsetContainer.X = horizontalOffset;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user