diff --git a/EndlessClient/HUD/HudStateActions.cs b/EndlessClient/HUD/HudStateActions.cs index 635d5ead5..cb77610f0 100644 --- a/EndlessClient/HUD/HudStateActions.cs +++ b/EndlessClient/HUD/HudStateActions.cs @@ -48,7 +48,7 @@ public void SwitchToState(InGameStates newState) var targetPanel = _hudControlProvider.HudPanels.Single(x => IsPanelForRequestedState(x, newState)); targetPanel.Visible = !targetPanel.Visible; - if (targetPanel.Visible) + if (targetPanel.Visible && _clientWindowSizeProvider.Resizable) targetPanel.DrawOrder = _hudControlProvider.HudPanels.Select(x => x.DrawOrder).Max() + 1; } diff --git a/EndlessClient/HUD/Panels/InventoryPanel.cs b/EndlessClient/HUD/Panels/InventoryPanel.cs index a964c0816..82d675f3e 100644 --- a/EndlessClient/HUD/Panels/InventoryPanel.cs +++ b/EndlessClient/HUD/Panels/InventoryPanel.cs @@ -53,7 +53,7 @@ public class InventoryPanel : DraggableHudPanel, IHudPanel, IDraggableItemContai private readonly IActiveDialogProvider _activeDialogProvider; private readonly ISfxPlayer _sfxPlayer; private readonly IConfigurationProvider _configProvider; - + private readonly IClientWindowSizeProvider _clientWindowSizeProvider; private readonly List _childItems = new List(); private readonly IXNALabel _weightLabel; @@ -98,6 +98,7 @@ public InventoryPanel(INativeGraphicsManager nativeGraphicsManager, _activeDialogProvider = activeDialogProvider; _sfxPlayer = sfxPlayer; _configProvider = configProvider; + _clientWindowSizeProvider = clientWindowSizeProvider; _weightLabel = new XNALabel(Constants.FontSize08pt5) { @@ -161,6 +162,19 @@ public override void Initialize() base.Initialize(); } + protected override void OnDrawOrderChanged(object sender, EventArgs args) + { + base.OnDrawOrderChanged(sender, args); + + if (_clientWindowSizeProvider.Resizable) + { + // ensure labels have a high enough draw order when in resizable mode + // this is because draw order is updated when panels are opened in resizable mode + foreach (var label in ChildControls.OfType()) + label.DrawOrder = DrawOrder + 70; + } + } + protected override void OnUpdateControl(GameTime gameTime) { _cachedStats.Match(