Skip to content

Commit

Permalink
Changes for SplitContainer Engine PR (#20383)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored and DebugOk committed Oct 8, 2023
1 parent 549a7fe commit 83f5481
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
24 changes: 0 additions & 24 deletions Content.Client/UserInterface/Controls/RecordedSplitContainer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Numerics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;

namespace Content.Client.UserInterface.Controls;

Expand All @@ -10,8 +8,6 @@ namespace Content.Client.UserInterface.Controls;
/// </summary>
public sealed class RecordedSplitContainer : SplitContainer
{
public Action<Vector2, Vector2>? OnSplitResizeFinish;

public double? DesiredSplitCenter;

protected override Vector2 ArrangeOverride(Vector2 finalSize)
Expand All @@ -30,24 +26,4 @@ protected override Vector2 ArrangeOverride(Vector2 finalSize)

return base.ArrangeOverride(finalSize);
}

protected override void KeyBindUp(GUIBoundKeyEventArgs args)
{
base.KeyBindUp(args);

if (args.Function != EngineKeyFunctions.UIClick)
{
return;
}

if (ChildCount != 2)
{
return;
}

var first = GetChild(0);
var second = GetChild(1);

OnSplitResizeFinish?.Invoke(first.Size, second.Size);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public SeparatedChatGameScreen()
SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);

ScreenContainer.OnSplitResizeFinish += (first, second) =>
ScreenContainer.OnSplitResizeFinished += () =>
OnChatResized?.Invoke(new Vector2(ScreenContainer.SplitFraction, 0));
}

Expand Down

0 comments on commit 83f5481

Please sign in to comment.