Improve vv /c/enthover and add keybind (#20127)

This commit is contained in:
Leon Friedrich
2023-09-16 16:09:51 +12:00
committed by GitHub
parent 8e351bbf68
commit 411fc8e27b
11 changed files with 74 additions and 27 deletions

View File

@@ -344,7 +344,7 @@ public sealed class ListContainer : Control
}
}
public sealed class ListContainerButton : ContainerButton
public sealed class ListContainerButton : ContainerButton, IEntityControl
{
public readonly ListData Data;
// public PanelContainer Background;
@@ -359,6 +359,8 @@ public sealed class ListContainerButton : ContainerButton
// PanelOverride = new StyleBoxFlat {BackgroundColor = new Color(55, 55, 68)}
// });
}
public EntityUid? UiEntity => (Data as EntityListData)?.Uid;
}
#region Data

View File

@@ -8,7 +8,7 @@ using Robust.Shared.Input;
namespace Content.Client.UserInterface.Controls
{
[Virtual]
public abstract class SlotControl : Control
public abstract class SlotControl : Control, IEntityControl
{
public static int DefaultButtonSize = 64;
@@ -20,7 +20,7 @@ namespace Content.Client.UserInterface.Controls
public TextureButton StorageButton { get; }
public CooldownGraphic CooldownDisplay { get; }
public EntityUid? Entity => SpriteView.Sprite?.Owner;
public EntityUid? Entity => SpriteView.Entity;
private bool _slotNameSet;
@@ -232,5 +232,7 @@ namespace Content.Client.UserInterface.Controls
ButtonRect.Texture = Theme.ResolveTextureOrNull(_buttonTexturePath)?.Texture;
HighlightRect.Texture = Theme.ResolveTextureOrNull(_highlightTexturePath)?.Texture;
}
EntityUid? IEntityControl.UiEntity => Entity;
}
}