Xenoarch Tweaks (#12429)
* Xenoarch feedback print out reports, weight node traversal, dialog for destroy menu, slight effect tweaks * make the popup not bad * the popup, jimbo...
This commit is contained in:
@@ -31,6 +31,10 @@ public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
SendMessage(new AnalysisConsoleScanButtonPressedMessage());
|
||||
};
|
||||
_consoleMenu.OnPrintButtonPressed += _ =>
|
||||
{
|
||||
SendMessage(new AnalysisConsolePrintButtonPressedMessage());
|
||||
};
|
||||
_consoleMenu.OnDestroyButtonPressed += _ =>
|
||||
{
|
||||
SendMessage(new AnalysisConsoleDestroyButtonPressedMessage());
|
||||
@@ -44,8 +48,7 @@ public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface
|
||||
switch (state)
|
||||
{
|
||||
case AnalysisConsoleScanUpdateState msg:
|
||||
_consoleMenu?.SetDestroyButtonDisabled(msg);
|
||||
_consoleMenu?.SetScanButtonDisabled(msg);
|
||||
_consoleMenu?.SetButtonsDisabled(msg);
|
||||
_consoleMenu?.UpdateInformationDisplay(msg);
|
||||
_consoleMenu?.UpdateProgressBar(msg);
|
||||
break;
|
||||
@@ -58,6 +61,7 @@ public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface
|
||||
|
||||
if (!disposing)
|
||||
return;
|
||||
_consoleMenu?.AnalysisDestroyWindow?.Close();
|
||||
_consoleMenu?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
Text="{Loc 'analysis-console-scan-button'}"
|
||||
ToolTip="{Loc 'analysis-console-scan-tooltip-info'}">
|
||||
</Button>
|
||||
<BoxContainer MinHeight="5"></BoxContainer>
|
||||
<Button Name="PrintButton"
|
||||
Text="{Loc 'analysis-console-print-button'}"
|
||||
ToolTip="{Loc 'analysis-console-print-tooltip-info'}">
|
||||
</Button>
|
||||
<BoxContainer MinHeight="10"></BoxContainer>
|
||||
<Button Name="DestroyButton"
|
||||
Text="{Loc 'analysis-console-destroy-button'}"
|
||||
|
||||
@@ -17,8 +17,11 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
||||
[Dependency] private readonly IEntityManager _ent = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
|
||||
public AnalysisDestroyWindow? AnalysisDestroyWindow;
|
||||
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnServerSelectionButtonPressed;
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnScanButtonPressed;
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnPrintButtonPressed;
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnDestroyButtonPressed;
|
||||
|
||||
public AnalysisConsoleMenu()
|
||||
@@ -28,18 +31,34 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
||||
|
||||
ServerSelectionButton.OnPressed += a => OnServerSelectionButtonPressed?.Invoke(a);
|
||||
ScanButton.OnPressed += a => OnScanButtonPressed?.Invoke(a);
|
||||
DestroyButton.OnPressed += a => OnDestroyButtonPressed?.Invoke(a);
|
||||
PrintButton.OnPressed += a => OnPrintButtonPressed?.Invoke(a);
|
||||
DestroyButton.OnPressed += _ => OnDestroyButton();
|
||||
}
|
||||
|
||||
public void SetScanButtonDisabled(AnalysisConsoleScanUpdateState state)
|
||||
private void OnDestroyButton()
|
||||
{
|
||||
var disabled = !state.CanScan;
|
||||
// check if window is already open
|
||||
if (AnalysisDestroyWindow is { IsOpen: true })
|
||||
{
|
||||
AnalysisDestroyWindow.MoveToFront();
|
||||
return;
|
||||
}
|
||||
|
||||
ScanButton.Disabled = disabled;
|
||||
// open a new one
|
||||
AnalysisDestroyWindow = new ();
|
||||
AnalysisDestroyWindow.OpenCentered();
|
||||
|
||||
AnalysisDestroyWindow.OnYesButton += a =>
|
||||
{
|
||||
OnDestroyButtonPressed?.Invoke(a);
|
||||
};
|
||||
}
|
||||
|
||||
public void SetDestroyButtonDisabled(AnalysisConsoleScanUpdateState state)
|
||||
public void SetButtonsDisabled(AnalysisConsoleScanUpdateState state)
|
||||
{
|
||||
ScanButton.Disabled = !state.CanScan;
|
||||
PrintButton.Disabled = !state.CanPrint;
|
||||
|
||||
var disabled = !state.ServerConnected || !state.CanScan;
|
||||
|
||||
DestroyButton.Disabled = disabled;
|
||||
@@ -77,6 +96,7 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("analysis-console-info-scanner"));
|
||||
Information.SetMessage(message);
|
||||
UpdateArtifactIcon(null); //set it to blank
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,5 +173,12 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
||||
("seconds", (int) state.TotalTime.TotalSeconds - (int) state.TimeRemaining.TotalSeconds));
|
||||
ProgressBar.Value = (float) state.TimeRemaining.Divide(state.TotalTime);
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
base.Close();
|
||||
|
||||
AnalysisDestroyWindow?.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
Content.Client/Xenoarchaeology/Ui/AnalysisDestroyWindow.xaml
Normal file
22
Content.Client/Xenoarchaeology/Ui/AnalysisDestroyWindow.xaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<controls:FancyWindow
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
||||
Title="{Loc 'analysis-destroy-window-title'}"
|
||||
MinSize="256 100">
|
||||
<BoxContainer
|
||||
Margin="10 10"
|
||||
HorizontalExpand="True"
|
||||
Orientation="Vertical"
|
||||
VerticalExpand="True">
|
||||
<Label Text="{Loc 'analysis-destroy-window-text'}" />
|
||||
<BoxContainer
|
||||
Margin="10 10 10 10"
|
||||
VerticalAlignment="Bottom"
|
||||
Orientation="Horizontal"
|
||||
HorizontalExpand="True">
|
||||
<Button Name="YesButton" Text="{Loc 'analysis-destroy-window-yes'}" HorizontalExpand="True"></Button>
|
||||
<BoxContainer SetSize="10 10"></BoxContainer>
|
||||
<Button Name="NoButton" Text="{Loc 'analysis-destroy-window-no'}" HorizontalExpand="True"></Button>
|
||||
</BoxContainer>
|
||||
</BoxContainer>
|
||||
</controls:FancyWindow>
|
||||
@@ -0,0 +1,26 @@
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Xenoarchaeology.Ui;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class AnalysisDestroyWindow : FancyWindow
|
||||
{
|
||||
public event Action<BaseButton.ButtonEventArgs>? OnYesButton;
|
||||
|
||||
public AnalysisDestroyWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
YesButton.AddStyleClass(StyleBase.ButtonCaution);
|
||||
YesButton.OnPressed += a =>
|
||||
{
|
||||
OnYesButton?.Invoke(a);
|
||||
Close();
|
||||
};
|
||||
NoButton.OnPressed += _ => Close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user