mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
Add tooltip service and integrate with MinimapControl
- Introduced TuiTooltipService for managing tooltips across TUI components. - Updated MinimapControl to utilize the new tooltip service for enhanced entity information display. - Refactored tooltip rendering logic to improve visibility and interaction based on mouse position.
This commit is contained in:
parent
0566f2518b
commit
d427a6e160
3 changed files with 194 additions and 73 deletions
|
|
@ -45,6 +45,8 @@ namespace MinecraftClient.Tui
|
|||
private readonly MinimapControl _minimapControl;
|
||||
private volatile bool _minimapVisible;
|
||||
|
||||
private TuiTooltipService? _tooltipService;
|
||||
|
||||
private readonly Border _suggestionBorder;
|
||||
private readonly StackPanel _suggestionPanel;
|
||||
private CommandSuggestion[] _suggestions = Array.Empty<CommandSuggestion>();
|
||||
|
|
@ -57,6 +59,8 @@ namespace MinecraftClient.Tui
|
|||
private int MaxVisibleSuggestions =>
|
||||
Math.Max(1, Settings.Config.Console.CommandSuggestion.Max_Displayed_Suggestions);
|
||||
|
||||
public TuiTooltipService? TooltipService => _tooltipService;
|
||||
|
||||
public MainTuiView()
|
||||
{
|
||||
Background = Brushes.Black;
|
||||
|
|
@ -194,6 +198,10 @@ namespace MinecraftClient.Tui
|
|||
Children = { _mainContent, _minimapBorder, _notificationBorder, _suggestionBorder }
|
||||
};
|
||||
|
||||
_tooltipService = new TuiTooltipService(_rootPanel);
|
||||
_minimapControl.TooltipService = _tooltipService;
|
||||
_minimapControl.Position = mmCfg.Position;
|
||||
|
||||
Content = _rootPanel;
|
||||
|
||||
if (mmCfg.Enabled)
|
||||
|
|
@ -1083,6 +1091,7 @@ namespace MinecraftClient.Tui
|
|||
_minimapBorder.HorizontalAlignment = hAlign;
|
||||
_minimapBorder.VerticalAlignment = vAlign;
|
||||
_minimapBorder.Margin = margin;
|
||||
_minimapControl.Position = pos;
|
||||
Settings.Config.Console.Minimap.Position = pos;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue