Hover examine buttons (#35206)
* hover examine verbs (not aligned to the left yet) * handle click hovers and align them to the left * revert contrabandsystem changes (this is for another PR) * add support for markup tags
This commit is contained in:
@@ -298,10 +298,28 @@ namespace Content.Client.Examine
|
||||
{
|
||||
Name = "ExamineButtonsHBox",
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
HorizontalAlignment = Control.HAlignment.Right,
|
||||
HorizontalAlignment = Control.HAlignment.Stretch,
|
||||
VerticalAlignment = Control.VAlignment.Bottom,
|
||||
};
|
||||
|
||||
var hoverExamineBox = new BoxContainer
|
||||
{
|
||||
Name = "HoverExamineHBox",
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
HorizontalAlignment = Control.HAlignment.Left,
|
||||
VerticalAlignment = Control.VAlignment.Center,
|
||||
HorizontalExpand = true
|
||||
};
|
||||
|
||||
var clickExamineBox = new BoxContainer
|
||||
{
|
||||
Name = "ClickExamineHBox",
|
||||
Orientation = LayoutOrientation.Horizontal,
|
||||
HorizontalAlignment = Control.HAlignment.Right,
|
||||
VerticalAlignment = Control.VAlignment.Center,
|
||||
HorizontalExpand = true
|
||||
};
|
||||
|
||||
// Examine button time
|
||||
foreach (var verb in verbs)
|
||||
{
|
||||
@@ -316,8 +334,15 @@ namespace Content.Client.Examine
|
||||
|
||||
var button = new ExamineButton(examine);
|
||||
|
||||
button.OnPressed += VerbButtonPressed;
|
||||
buttonsHBox.AddChild(button);
|
||||
if (examine.HoverVerb)
|
||||
{
|
||||
hoverExamineBox.AddChild(button);
|
||||
}
|
||||
else
|
||||
{
|
||||
button.OnPressed += VerbButtonPressed;
|
||||
clickExamineBox.AddChild(button);
|
||||
}
|
||||
}
|
||||
|
||||
var vbox = _examineTooltipOpen?.GetChild(0).GetChild(0);
|
||||
@@ -334,6 +359,8 @@ namespace Content.Client.Examine
|
||||
{
|
||||
vbox.Children.Remove(hbox.First());
|
||||
}
|
||||
buttonsHBox.AddChild(hoverExamineBox);
|
||||
buttonsHBox.AddChild(clickExamineBox);
|
||||
vbox.AddChild(buttonsHBox);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user