feat: autohide improvements
- Adds new setting "Enable inactivity hide during battle" (default: true) which determines whether autohide should apply during battle (thanks @aurieh) - Adds new setting "Chat channels considered for activity" which allows customizing which channels incoming messages must match to "bump" the inactivity timer - Adds new per-tab setting "Unhide the chat window on activity" to configure whether it will be considered for "bumping" the inactivity timer when receiving messages that match the new channel filter. Note that the foreground tab is currently always considered. - Extends autohide code to apply to poped-out tabs as well. Each popout window has its own inactivity timer, but focusing the main window will restore all popped out windows. Co-authored-by: Auri <me@aurieh.me>
This commit is contained in:
@@ -124,6 +124,17 @@ internal partial class Message
|
||||
return new Message(0, 0, code, [], content, new SeString(), new SeString());
|
||||
}
|
||||
|
||||
internal bool Matches(Dictionary<ChatType, ChatSource> channels, bool allExtraChatChannels, HashSet<Guid> extraChatChannels)
|
||||
{
|
||||
if (ExtraChatChannel != Guid.Empty)
|
||||
return allExtraChatChannels || extraChatChannels.Contains(ExtraChatChannel);
|
||||
|
||||
return Code.Type.IsGm()
|
||||
|| channels.TryGetValue(Code.Type, out var sources)
|
||||
&& (Code.Source is 0 or (ChatSource) 1
|
||||
|| sources.HasFlag(Code.Source));
|
||||
}
|
||||
|
||||
private int GenerateHash()
|
||||
{
|
||||
return SortCode.GetHashCode()
|
||||
|
||||
Reference in New Issue
Block a user