mirror of
https://github.com/osukey/osukey.git
synced 2025-05-31 10:27:26 +09:00
Single Visibility enum type.
This commit is contained in:
parent
b7976dce46
commit
acd54d1ebc
@ -113,10 +113,10 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Toolbar.State = ToolbarState.Hidden;
|
Toolbar.State = Visibility.Hidden;
|
||||||
Toolbar.Flush();
|
Toolbar.Flush();
|
||||||
|
|
||||||
Chat.State = ChatConsoleState.Hidden;
|
Chat.State = Visibility.Hidden;
|
||||||
Chat.Flush();
|
Chat.Flush();
|
||||||
|
|
||||||
intro.ModePushed += modeAdded;
|
intro.ModePushed += modeAdded;
|
||||||
@ -134,7 +134,7 @@ namespace osu.Game
|
|||||||
switch (args.Key)
|
switch (args.Key)
|
||||||
{
|
{
|
||||||
case Key.F8:
|
case Key.F8:
|
||||||
Chat.State = Chat.State == ChatConsoleState.Hidden ? ChatConsoleState.Visible : ChatConsoleState.Hidden;
|
Chat.State = Chat.State.Reverse();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,12 +152,12 @@ namespace osu.Game
|
|||||||
//central game mode change logic.
|
//central game mode change logic.
|
||||||
if (newMode is Player || newMode is Intro)
|
if (newMode is Player || newMode is Intro)
|
||||||
{
|
{
|
||||||
Toolbar.State = ToolbarState.Hidden;
|
Toolbar.State = Visibility.Hidden;
|
||||||
Chat.State = ChatConsoleState.Hidden;
|
Chat.State = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Toolbar.State = ToolbarState.Visible;
|
Toolbar.State = Visibility.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cursor.FadeIn(100);
|
Cursor.FadeIn(100);
|
||||||
|
@ -25,7 +25,7 @@ using osu.Framework;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class ChatConsole : Container, IStateful<ChatConsoleState>
|
public class ChatConsole : Container, IStateful<Visibility>
|
||||||
{
|
{
|
||||||
private ChannelDisplay channelDisplay;
|
private ChannelDisplay channelDisplay;
|
||||||
|
|
||||||
@ -140,9 +140,9 @@ namespace osu.Game.Overlays
|
|||||||
api.Queue(fetchReq);
|
api.Queue(fetchReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ChatConsoleState state;
|
private Visibility state;
|
||||||
|
|
||||||
public ChatConsoleState State
|
public Visibility State
|
||||||
{
|
{
|
||||||
get { return state; }
|
get { return state; }
|
||||||
|
|
||||||
@ -154,11 +154,11 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ChatConsoleState.Hidden:
|
case Visibility.Hidden:
|
||||||
MoveToY(-Size.Y, transition_length, EasingTypes.InQuint);
|
MoveToY(-Size.Y, transition_length, EasingTypes.InQuint);
|
||||||
FadeOut(transition_length, EasingTypes.InQuint);
|
FadeOut(transition_length, EasingTypes.InQuint);
|
||||||
break;
|
break;
|
||||||
case ChatConsoleState.Visible:
|
case Visibility.Visible:
|
||||||
MoveToY(0, transition_length, EasingTypes.OutQuint);
|
MoveToY(0, transition_length, EasingTypes.OutQuint);
|
||||||
FadeIn(transition_length, EasingTypes.OutQuint);
|
FadeIn(transition_length, EasingTypes.OutQuint);
|
||||||
break;
|
break;
|
||||||
@ -166,10 +166,4 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ChatConsoleState
|
|
||||||
{
|
|
||||||
Visible,
|
|
||||||
Hidden,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ using osu.Framework;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
public class Toolbar : Container, IStateful<ToolbarState>
|
public class Toolbar : Container, IStateful<Visibility>
|
||||||
{
|
{
|
||||||
const float height = 50;
|
const float height = 50;
|
||||||
|
|
||||||
@ -26,9 +26,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private ToolbarModeSelector modeSelector;
|
private ToolbarModeSelector modeSelector;
|
||||||
|
|
||||||
private ToolbarState state;
|
private Visibility state;
|
||||||
|
|
||||||
public ToolbarState State
|
public Visibility State
|
||||||
{
|
{
|
||||||
get { return state; }
|
get { return state; }
|
||||||
set
|
set
|
||||||
@ -39,11 +39,11 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case ToolbarState.Hidden:
|
case Visibility.Hidden:
|
||||||
MoveToY(-Size.Y, transition_time, EasingTypes.InQuint);
|
MoveToY(-Size.Y, transition_time, EasingTypes.InQuint);
|
||||||
FadeOut(transition_time, EasingTypes.InQuint);
|
FadeOut(transition_time, EasingTypes.InQuint);
|
||||||
break;
|
break;
|
||||||
case ToolbarState.Visible:
|
case Visibility.Visible:
|
||||||
MoveToY(0, transition_time, EasingTypes.OutQuint);
|
MoveToY(0, transition_time, EasingTypes.OutQuint);
|
||||||
FadeIn(transition_time, EasingTypes.OutQuint);
|
FadeIn(transition_time, EasingTypes.OutQuint);
|
||||||
break;
|
break;
|
||||||
@ -119,10 +119,4 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public void SetGameMode(PlayMode mode) => modeSelector.SetGameMode(mode);
|
public void SetGameMode(PlayMode mode) => modeSelector.SetGameMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ToolbarState
|
|
||||||
{
|
|
||||||
Visible,
|
|
||||||
Hidden,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
17
osu.Game/Overlays/Visibility.cs
Normal file
17
osu.Game/Overlays/Visibility.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays
|
||||||
|
{
|
||||||
|
public enum Visibility
|
||||||
|
{
|
||||||
|
Hidden,
|
||||||
|
Visible
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class OverlayVisibilityHelper
|
||||||
|
{
|
||||||
|
public static Visibility Reverse(this Visibility input)
|
||||||
|
=> input == Visibility.Visible ? Visibility.Hidden : Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
@ -160,6 +160,7 @@
|
|||||||
<Compile Include="Overlays\ToolbarButton.cs" />
|
<Compile Include="Overlays\ToolbarButton.cs" />
|
||||||
<Compile Include="Overlays\ToolbarModeButton.cs" />
|
<Compile Include="Overlays\ToolbarModeButton.cs" />
|
||||||
<Compile Include="Overlays\ToolbarModeSelector.cs" />
|
<Compile Include="Overlays\ToolbarModeSelector.cs" />
|
||||||
|
<Compile Include="Overlays\Visibility.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Users\User.cs" />
|
<Compile Include="Users\User.cs" />
|
||||||
<Compile Include="VolumeControl.cs" />
|
<Compile Include="VolumeControl.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user