artifact extract tweaks (#17164)
* make extract button green, rename Destroy internally to Extract * 5 --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -35,9 +35,9 @@ public sealed class AnalysisConsoleBoundUserInterface : BoundUserInterface
|
|||||||
{
|
{
|
||||||
SendMessage(new AnalysisConsolePrintButtonPressedMessage());
|
SendMessage(new AnalysisConsolePrintButtonPressedMessage());
|
||||||
};
|
};
|
||||||
_consoleMenu.OnDestroyButtonPressed += () =>
|
_consoleMenu.OnExtractButtonPressed += () =>
|
||||||
{
|
{
|
||||||
SendMessage(new AnalysisConsoleDestroyButtonPressedMessage());
|
SendMessage(new AnalysisConsoleExtractButtonPressedMessage());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
Text="{Loc 'analysis-console-print-button'}"
|
Text="{Loc 'analysis-console-print-button'}"
|
||||||
ToolTip="{Loc 'analysis-console-print-tooltip-info'}">
|
ToolTip="{Loc 'analysis-console-print-tooltip-info'}">
|
||||||
</Button>
|
</Button>
|
||||||
<BoxContainer MinHeight="10"></BoxContainer>
|
<BoxContainer MinHeight="5"></BoxContainer>
|
||||||
<Button Name="DestroyButton"
|
<Button Name="ExtractButton"
|
||||||
Text="{Loc 'analysis-console-destroy-button'}"
|
Text="{Loc 'analysis-console-extract-button'}"
|
||||||
ToolTip="{Loc 'analysis-console-destroy-button-info'}">
|
ToolTip="{Loc 'analysis-console-extract-button-info'}">
|
||||||
</Button>
|
</Button>
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
<BoxContainer Orientation="Vertical">
|
<BoxContainer Orientation="Vertical">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
|||||||
public event Action? OnServerSelectionButtonPressed;
|
public event Action? OnServerSelectionButtonPressed;
|
||||||
public event Action? OnScanButtonPressed;
|
public event Action? OnScanButtonPressed;
|
||||||
public event Action? OnPrintButtonPressed;
|
public event Action? OnPrintButtonPressed;
|
||||||
public event Action? OnDestroyButtonPressed;
|
public event Action? OnExtractButtonPressed;
|
||||||
|
|
||||||
public AnalysisConsoleMenu()
|
public AnalysisConsoleMenu()
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
|||||||
ServerSelectionButton.OnPressed += _ => OnServerSelectionButtonPressed?.Invoke();
|
ServerSelectionButton.OnPressed += _ => OnServerSelectionButtonPressed?.Invoke();
|
||||||
ScanButton.OnPressed += _ => OnScanButtonPressed?.Invoke();
|
ScanButton.OnPressed += _ => OnScanButtonPressed?.Invoke();
|
||||||
PrintButton.OnPressed += _ => OnPrintButtonPressed?.Invoke();
|
PrintButton.OnPressed += _ => OnPrintButtonPressed?.Invoke();
|
||||||
DestroyButton.OnPressed += _ => OnDestroyButtonPressed?.Invoke();
|
ExtractButton.OnPressed += _ => OnExtractButtonPressed?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetButtonsDisabled(AnalysisConsoleScanUpdateState state)
|
public void SetButtonsDisabled(AnalysisConsoleScanUpdateState state)
|
||||||
@@ -35,15 +35,15 @@ public sealed partial class AnalysisConsoleMenu : FancyWindow
|
|||||||
|
|
||||||
var disabled = !state.ServerConnected || !state.CanScan || state.PointAmount <= 0;
|
var disabled = !state.ServerConnected || !state.CanScan || state.PointAmount <= 0;
|
||||||
|
|
||||||
DestroyButton.Disabled = disabled;
|
ExtractButton.Disabled = disabled;
|
||||||
|
|
||||||
if (disabled)
|
if (disabled)
|
||||||
{
|
{
|
||||||
DestroyButton.RemoveStyleClass(StyleBase.ButtonCaution);
|
ExtractButton.RemoveStyleClass("ButtonColorGreen");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DestroyButton.AddStyleClass(StyleBase.ButtonCaution);
|
ExtractButton.AddStyleClass("ButtonColorGreen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ public sealed class AnalysisConsoleComponent : Component
|
|||||||
public readonly string LinkingPort = "ArtifactAnalyzerSender";
|
public readonly string LinkingPort = "ArtifactAnalyzerSender";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The sound played when an artifact is destroyed.
|
/// The sound played when an artifact has points extracted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("destroySound")]
|
[DataField("extractSound")]
|
||||||
public SoundSpecifier DestroySound = new SoundPathSpecifier("/Audio/Effects/radpulse11.ogg");
|
public SoundSpecifier ExtractSound = new SoundPathSpecifier("/Audio/Effects/radpulse11.ogg");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The entity spawned by a report.
|
/// The entity spawned by a report.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Content.Server.Xenoarchaeology.Equipment.Components;
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A machine that is combined and linked to the <see cref="AnalysisConsoleComponent"/>
|
/// A machine that is combined and linked to the <see cref="AnalysisConsoleComponent"/>
|
||||||
/// in order to analyze and destroy artifacts.
|
/// in order to analyze artifacts and extract points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public sealed class ArtifactAnalyzerComponent : Component
|
public sealed class ArtifactAnalyzerComponent : Component
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsoleServerSelectionMessage>(OnServerSelectionMessage);
|
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsoleServerSelectionMessage>(OnServerSelectionMessage);
|
||||||
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsoleScanButtonPressedMessage>(OnScanButton);
|
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsoleScanButtonPressedMessage>(OnScanButton);
|
||||||
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsolePrintButtonPressedMessage>(OnPrintButton);
|
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsolePrintButtonPressedMessage>(OnPrintButton);
|
||||||
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsoleDestroyButtonPressedMessage>(OnDestroyButton);
|
SubscribeLocalEvent<AnalysisConsoleComponent, AnalysisConsoleExtractButtonPressedMessage>(OnExtractButton);
|
||||||
|
|
||||||
SubscribeLocalEvent<AnalysisConsoleComponent, ResearchClientServerSelectedMessage>((e,c,_) => UpdateUserInterface(e,c),
|
SubscribeLocalEvent<AnalysisConsoleComponent, ResearchClientServerSelectedMessage>((e,c,_) => UpdateUserInterface(e,c),
|
||||||
after: new []{typeof(ResearchSystem)});
|
after: new []{typeof(ResearchSystem)});
|
||||||
@@ -339,12 +339,12 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// destroys the artifact and updates the server points
|
/// Extracts points from the artifact and updates the server points
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="uid"></param>
|
/// <param name="uid"></param>
|
||||||
/// <param name="component"></param>
|
/// <param name="component"></param>
|
||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
private void OnDestroyButton(EntityUid uid, AnalysisConsoleComponent component, AnalysisConsoleDestroyButtonPressedMessage args)
|
private void OnExtractButton(EntityUid uid, AnalysisConsoleComponent component, AnalysisConsoleExtractButtonPressedMessage args)
|
||||||
{
|
{
|
||||||
if (component.AnalyzerEntity == null)
|
if (component.AnalyzerEntity == null)
|
||||||
return;
|
return;
|
||||||
@@ -358,13 +358,14 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
|
|
||||||
var pointValue = _artifact.GetResearchPointValue(artifact.Value);
|
var pointValue = _artifact.GetResearchPointValue(artifact.Value);
|
||||||
|
|
||||||
|
// no new nodes triggered so nothing to add
|
||||||
if (pointValue == 0)
|
if (pointValue == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_research.ModifyServerPoints(server.Value, pointValue, serverComponent);
|
_research.ModifyServerPoints(server.Value, pointValue, serverComponent);
|
||||||
_artifact.AdjustConsumedPoints(artifact.Value, pointValue);
|
_artifact.AdjustConsumedPoints(artifact.Value, pointValue);
|
||||||
|
|
||||||
_audio.PlayPvs(component.DestroySound, component.AnalyzerEntity.Value, AudioParams.Default.WithVolume(2f));
|
_audio.PlayPvs(component.ExtractSound, component.AnalyzerEntity.Value, AudioParams.Default.WithVolume(2f));
|
||||||
|
|
||||||
_popup.PopupEntity(Loc.GetString("analyzer-artifact-extract-popup"),
|
_popup.PopupEntity(Loc.GetString("analyzer-artifact-extract-popup"),
|
||||||
component.AnalyzerEntity.Value, PopupType.Large);
|
component.AnalyzerEntity.Value, PopupType.Large);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public sealed class AnalysisConsolePrintButtonPressedMessage : BoundUserInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public sealed class AnalysisConsoleDestroyButtonPressedMessage : BoundUserInterfaceMessage
|
public sealed class AnalysisConsoleExtractButtonPressedMessage : BoundUserInterfaceMessage
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ analysis-console-scan-button = Scan
|
|||||||
analysis-console-scan-tooltip-info = Scan artifacts to learn information about their structure.
|
analysis-console-scan-tooltip-info = Scan artifacts to learn information about their structure.
|
||||||
analysis-console-print-button = Print
|
analysis-console-print-button = Print
|
||||||
analysis-console-print-tooltip-info = Print out the current information about the artifact.
|
analysis-console-print-tooltip-info = Print out the current information about the artifact.
|
||||||
analysis-console-destroy-button = Extract
|
analysis-console-extract-button = Extract
|
||||||
analysis-console-destroy-button-info = Extract points from an artifact based on the explored nodes.
|
analysis-console-extract-button-info = Extract points from an artifact based on the newly explored nodes.
|
||||||
|
|
||||||
analysis-console-info-no-scanner = No analyzer connected! Please connect one using a multitool.
|
analysis-console-info-no-scanner = No analyzer connected! Please connect one using a multitool.
|
||||||
analysis-console-info-no-artifact = No artifact present! Place one on the pad then scan for information.
|
analysis-console-info-no-artifact = No artifact present! Place one on the pad then scan for information.
|
||||||
@@ -31,4 +31,4 @@ analyzer-artifact-component-upgrade-analysis = analysis duration
|
|||||||
analysis-console-print-popup = The console printed out a report.
|
analysis-console-print-popup = The console printed out a report.
|
||||||
analyzer-artifact-extract-popup = Energy shimmers on the artifact's surface!
|
analyzer-artifact-extract-popup = Energy shimmers on the artifact's surface!
|
||||||
|
|
||||||
analysis-report-title = Artifact Report: Node {$id}
|
analysis-report-title = Artifact Report: Node {$id}
|
||||||
|
|||||||
Reference in New Issue
Block a user