<controls:RecordedSplitContainer Name="ScreenContainer" HorizontalExpand="True" VerticalExpand="True" SplitWidth="0" StretchDirection="TopLeft">
<LayoutContainer Name="ViewportContainer" HorizontalExpand="True" VerticalExpand="True">
<controls:MainViewport Name="MainViewport"/>
- <BoxContainer Name="VoteMenu" Access="Public" Orientation="Vertical"/>
<widgets:GhostGui Name="Ghost" Access="Protected" />
<hotbar:HotbarGui Name="Hotbar" Access="Protected" />
- <actions:ActionsBar Name="Actions" Access="Protected" />
+ <BoxContainer Name="TopLeftContainer" Orientation="Vertical">
+ <actions:ActionsBar Name="Actions" Access="Protected" />
+ <BoxContainer Name="VoteMenu" Access="Public" Orientation="Vertical"/>
+ </BoxContainer>
<alerts:AlertsUI Name="Alerts" Access="Protected" />
</LayoutContainer>
<PanelContainer HorizontalExpand="True" MinWidth="300">
SetAnchorPreset(ScreenContainer, LayoutPreset.Wide);
SetAnchorPreset(ViewportContainer, LayoutPreset.Wide);
SetAnchorPreset(MainViewport, LayoutPreset.Wide);
- SetAnchorAndMarginPreset(VoteMenu, LayoutPreset.TopLeft, margin: 10);
- SetAnchorAndMarginPreset(Actions, LayoutPreset.TopLeft, margin: 10);
+ SetAnchorAndMarginPreset(TopLeftContainer, LayoutPreset.TopLeft, margin: 10);
SetAnchorAndMarginPreset(Ghost, LayoutPreset.BottomWide, margin: 80);
SetAnchorAndMarginPreset(Hotbar, LayoutPreset.BottomWide, margin: 5);
SetAnchorAndMarginPreset(Alerts, LayoutPreset.CenterRight, margin: 10);
public void RegisterActionContainer(ActionButtonContainer container)
{
+ if (_container != null)
+ {
+ _container.ActionPressed -= OnActionPressed;
+ _container.ActionUnpressed -= OnActionUnpressed;
+ }
+
_container = container;
_container.ActionPressed += OnActionPressed;
_container.ActionUnpressed += OnActionUnpressed;
public void UpdateBackground()
{
- if (_action == null)
+ _controller ??= UserInterfaceManager.GetUIController<ActionUIController>();
+ if (_action != null ||
+ _controller.IsDragging && GetPositionInParent() == Parent?.ChildCount - 1)
{
- Button.Texture = null;
+ Button.Texture = _buttonBackgroundTexture;
}
else
{
- Button.Texture = _buttonBackgroundTexture;
+ Button.Texture = null;
}
}
{
base.FrameUpdate(args);
+ UpdateBackground();
+
Cooldown.Visible = _action != null && _action.Cooldown != null;
if (_action == null)
return;
// it's only depress-able if it's usable, so if we're depressed
// show the depressed style
- if (_depressed)
+ if (_depressed && !_beingHovered)
{
HighlightRect.Visible = false;
SetOnlyStylePseudoClass(ContainerButton.StylePseudoClassPressed);