RQ Overlay: оверлей заработка и статистики для Royal Quest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 12:46:52 +03:00
commit 7f89dba5f8
43 changed files with 4253 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using RQOverlay.Plugins.Builtin;
namespace RQOverlay.Views;
public partial class MobsSessionView : UserControl
{
ListCollectionView? _view;
public MobsSessionView()
{
InitializeComponent();
// Только мобы, убитые в этой сессии; больше всего убийств — сверху. Всё обновляется на лету.
DataContextChanged += (_, _) =>
{
if (DataContext is not MobStatsPlugin plugin) return;
_view = new ListCollectionView(plugin.Rows) { Filter = o => ((MobStat)o).SessionKills > 0 };
_view.SortDescriptions.Add(new SortDescription(nameof(MobStat.SessionKills), ListSortDirection.Descending));
_view.IsLiveFiltering = true;
_view.LiveFilteringProperties.Add(nameof(MobStat.SessionKills));
_view.IsLiveSorting = true;
_view.LiveSortingProperties.Add(nameof(MobStat.SessionKills));
((INotifyCollectionChanged)_view).CollectionChanged += (_, _) => UpdateEmpty();
MobGrid.ItemsSource = _view;
UpdateEmpty();
};
}
void UpdateEmpty()
{
bool empty = _view is null || _view.Count == 0;
Empty.Visibility = empty ? Visibility.Visible : Visibility.Collapsed;
Table.Visibility = empty ? Visibility.Collapsed : Visibility.Visible;
}
/// <summary>Таблица стоит внутри прокручиваемой страницы — колесо мыши передаём странице.</summary>
void Grid_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
e.Handled = true;
var copy = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta) { RoutedEvent = MouseWheelEvent, Source = sender };
((UIElement)((FrameworkElement)sender).Parent).RaiseEvent(copy);
}
}