mirror of
https://github.com/ppy/osu.git
synced 2025-02-10 08:13:19 +08:00
Integrate ChatOverlayV2
into main game
This commit is contained in:
parent
7d93778355
commit
58d39734d0
@ -40,7 +40,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
typeof(DashboardOverlay),
|
typeof(DashboardOverlay),
|
||||||
typeof(NewsOverlay),
|
typeof(NewsOverlay),
|
||||||
typeof(ChannelManager),
|
typeof(ChannelManager),
|
||||||
typeof(ChatOverlay),
|
typeof(ChatOverlayV2),
|
||||||
typeof(SettingsOverlay),
|
typeof(SettingsOverlay),
|
||||||
typeof(UserProfileOverlay),
|
typeof(UserProfileOverlay),
|
||||||
typeof(BeatmapSetOverlay),
|
typeof(BeatmapSetOverlay),
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
channelManager,
|
channelManager,
|
||||||
chatOverlay = new TestChatOverlayV2 { RelativeSizeAxes = Axes.Both },
|
chatOverlay = new TestChatOverlayV2(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Configuration
|
|||||||
|
|
||||||
SetDefault(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation);
|
SetDefault(OsuSetting.RandomSelectAlgorithm, RandomSelectAlgorithm.RandomPermutation);
|
||||||
|
|
||||||
SetDefault(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2f, 1f);
|
SetDefault(OsuSetting.ChatDisplayHeight, ChatOverlayV2.DEFAULT_HEIGHT, 0.2f, 1f);
|
||||||
|
|
||||||
SetDefault(OsuSetting.BeatmapListingCardSize, BeatmapCardSize.Normal);
|
SetDefault(OsuSetting.BeatmapListingCardSize, BeatmapCardSize.Normal);
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
public Toolbar Toolbar;
|
public Toolbar Toolbar;
|
||||||
|
|
||||||
private ChatOverlay chatOverlay;
|
private ChatOverlayV2 chatOverlay;
|
||||||
|
|
||||||
private ChannelManager channelManager;
|
private ChannelManager channelManager;
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ namespace osu.Game
|
|||||||
loadComponentSingleFile(news = new NewsOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(news = new NewsOverlay(), overlayContent.Add, true);
|
||||||
var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true);
|
var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal, true);
|
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal, true);
|
||||||
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(chatOverlay = new ChatOverlayV2(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(new MessageNotifier(), AddInternal, true);
|
loadComponentSingleFile(new MessageNotifier(), AddInternal, true);
|
||||||
loadComponentSingleFile(Settings = new SettingsOverlay(), leftFloatingOverlayContent.Add, true);
|
loadComponentSingleFile(Settings = new SettingsOverlay(), leftFloatingOverlayContent.Add, true);
|
||||||
loadComponentSingleFile(changelogOverlay = new ChangelogOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(changelogOverlay = new ChangelogOverlay(), overlayContent.Add, true);
|
||||||
|
@ -47,8 +47,9 @@ namespace osu.Game.Overlays
|
|||||||
private bool isDraggingTopBar;
|
private bool isDraggingTopBar;
|
||||||
private float dragStartChatHeight;
|
private float dragStartChatHeight;
|
||||||
|
|
||||||
|
public const float DEFAULT_HEIGHT = 0.4f;
|
||||||
|
|
||||||
private const int transition_length = 500;
|
private const int transition_length = 500;
|
||||||
private const float default_chat_height = 0.4f;
|
|
||||||
private const float top_bar_height = 40;
|
private const float top_bar_height = 40;
|
||||||
private const float side_bar_width = 190;
|
private const float side_bar_width = 190;
|
||||||
private const float chat_bar_height = 60;
|
private const float chat_bar_height = 60;
|
||||||
@ -70,7 +71,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public ChatOverlayV2()
|
public ChatOverlayV2()
|
||||||
{
|
{
|
||||||
Height = default_chat_height;
|
Height = DEFAULT_HEIGHT;
|
||||||
|
|
||||||
Masking = true;
|
Masking = true;
|
||||||
|
|
||||||
@ -82,6 +83,7 @@ namespace osu.Game.Overlays
|
|||||||
Margin = new MarginPadding { Bottom = -corner_radius };
|
Margin = new MarginPadding { Bottom = -corner_radius };
|
||||||
Padding = new MarginPadding { Bottom = corner_radius };
|
Padding = new MarginPadding { Bottom = corner_radius };
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
Anchor = Anchor.BottomCentre;
|
Anchor = Anchor.BottomCentre;
|
||||||
Origin = Anchor.BottomCentre;
|
Origin = Anchor.BottomCentre;
|
||||||
}
|
}
|
||||||
@ -294,6 +296,10 @@ namespace osu.Game.Overlays
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mark channel as read when channel switched
|
||||||
|
if (newChannel.Messages.Any())
|
||||||
|
channelManager.MarkChannelAsRead(newChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual ChatOverlayDrawableChannel CreateDrawableChannel(Channel newChannel) => new ChatOverlayDrawableChannel(newChannel);
|
protected virtual ChatOverlayDrawableChannel CreateDrawableChannel(Channel newChannel) => new ChatOverlayDrawableChannel(newChannel);
|
||||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
private UserProfileOverlay userOverlay { get; set; }
|
private UserProfileOverlay userOverlay { get; set; }
|
||||||
|
|
||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private ChatOverlay chatOverlay { get; set; }
|
private ChatOverlayV2 chatOverlay { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider apiProvider { get; set; }
|
private IAPIProvider apiProvider { get; set; }
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(ChatOverlay chat)
|
private void load(ChatOverlayV2 chat)
|
||||||
{
|
{
|
||||||
StateContainer = chat;
|
StateContainer = chat;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user