diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 909b6e0842..a926888571 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -56,7 +56,7 @@ namespace osu.Game OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, Alpha = 0.001f, }, - Chat = new ChatConsole(), + Chat = new ChatConsole(API), new VolumeControl { VolumeGlobal = Audio.Volume, diff --git a/osu.Game/Overlays/ChatConsole.cs b/osu.Game/Overlays/ChatConsole.cs index d6626a1d9e..0d457fe116 100644 --- a/osu.Game/Overlays/ChatConsole.cs +++ b/osu.Game/Overlays/ChatConsole.cs @@ -27,8 +27,6 @@ namespace osu.Game.Overlays { public class ChatConsole : Container, IStateful { - private APIAccess api => ((OsuGameBase)Game).API; - private ChannelDisplay channelDisplay; private ScheduledDelegate messageRequest; @@ -37,8 +35,12 @@ namespace osu.Game.Overlays protected override Container Content => content; - public ChatConsole() + private APIAccess api; + + public ChatConsole(APIAccess api) { + this.api = api; + RelativeSizeAxes = Axes.X; Size = new Vector2(1, 300); Anchor = Anchor.BottomLeft;