-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Inertia dampeners Initial push need to disable buttons need to look into issue with max speed diagonal flying and changing directions * adding new station component hide the anchoring buttons on stations (exploit prevention) apply station component to all POI's * navscreen, StationComp->StationDampeningComp * StationDampeningComp, "anchor" tense * restore needed using statement * Server-based dampening state * fix entity in NfGetInertialDampeningMode * past tense event, whitespace, comments * ToggleStabilizer->SetInertiaDampening * ShuttleSystem: check for shuttle deed * Default dampening value: off->dampen * Inertia dampeners Initial push need to disable buttons need to look into issue with max speed diagonal flying and changing directions * adding new station component hide the anchoring buttons on stations (exploit prevention) apply station component to all POI's * ShuttleSystem: initial query * shuttle fix: ShuttleDeedComponent belongs to grid * adding some logging * Cleanup & bugfixes * ShuttleConsole BUI: add Frontier comments * console.ftl: dampening btns: "Cruise, Drive, Park" --------- Co-authored-by: neuPanda <[email protected]> Co-authored-by: Dvir <[email protected]> Co-authored-by: Whatstone <[email protected]>
- Loading branch information
1 parent
51258ee
commit 7818749
Showing
16 changed files
with
462 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Content.Client/_NF/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// New Frontiers - This file is licensed under AGPLv3 | ||
// Copyright (c) 2024 New Frontiers Contributors | ||
// See AGPLv3.txt for details. | ||
using Content.Client.Shuttles.UI; | ||
using Content.Shared._NF.Shuttles.Events; | ||
|
||
namespace Content.Client.Shuttles.BUI | ||
{ | ||
public sealed partial class ShuttleConsoleBoundUserInterface | ||
{ | ||
private void NfOpen() | ||
{ | ||
_window ??= new ShuttleConsoleWindow(); | ||
_window.OnInertiaDampeningModeChanged += OnInertiaDampeningModeChanged; | ||
} | ||
private void OnInertiaDampeningModeChanged(NetEntity? entityUid, InertiaDampeningMode mode) | ||
{ | ||
SendMessage(new SetInertiaDampeningRequest | ||
{ | ||
ShuttleEntityUid = entityUid, | ||
Mode = mode, | ||
}); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// New Frontiers - This file is licensed under AGPLv3 | ||
// Copyright (c) 2024 New Frontiers Contributors | ||
// See AGPLv3.txt for details. | ||
using Content.Shared._NF.Shuttles.Events; | ||
using Robust.Client.UserInterface.Controls; | ||
|
||
namespace Content.Client.Shuttles.UI | ||
{ | ||
public sealed partial class NavScreen | ||
{ | ||
private readonly ButtonGroup _buttonGroup = new(); | ||
public event Action<NetEntity?, InertiaDampeningMode>? OnInertiaDampeningModeChanged; | ||
|
||
private void NfInitialize() | ||
{ | ||
// Frontier - IFF search | ||
IffSearchCriteria.OnTextChanged += args => OnIffSearchChanged(args.Text); | ||
|
||
// Frontier - Maximum IFF Distance | ||
MaximumIFFDistanceValue.GetChild(0).GetChild(1).Margin = new Thickness(8, 0, 0, 0); | ||
MaximumIFFDistanceValue.OnValueChanged += args => OnRangeFilterChanged(args); | ||
|
||
DampenerOff.OnPressed += _ => SetDampenerMode(InertiaDampeningMode.Off); | ||
DampenerOn.OnPressed += _ => SetDampenerMode(InertiaDampeningMode.Dampen); | ||
AnchorOn.OnPressed += _ => SetDampenerMode(InertiaDampeningMode.Anchor); | ||
|
||
DampenerOff.Group = _buttonGroup; | ||
DampenerOn.Group = _buttonGroup; | ||
AnchorOn.Group = _buttonGroup; | ||
|
||
// Send off a request to get the current dampening mode. | ||
_entManager.TryGetNetEntity(_shuttleEntity, out var shuttle); | ||
OnInertiaDampeningModeChanged?.Invoke(shuttle, InertiaDampeningMode.Query); | ||
} | ||
|
||
private void SetDampenerMode(InertiaDampeningMode mode) | ||
{ | ||
NavRadar.DampeningMode = mode; | ||
_entManager.TryGetNetEntity(_shuttleEntity, out var shuttle); | ||
OnInertiaDampeningModeChanged?.Invoke(shuttle, mode); | ||
} | ||
|
||
private void NfUpdateState() | ||
{ | ||
if (NavRadar.DampeningMode == InertiaDampeningMode.Station) | ||
{ | ||
DampenerModeButtons.Visible = false; | ||
} | ||
else | ||
{ | ||
DampenerModeButtons.Visible = true; | ||
DampenerOff.Pressed = NavRadar.DampeningMode == InertiaDampeningMode.Off; | ||
DampenerOn.Pressed = NavRadar.DampeningMode == InertiaDampeningMode.Dampen; | ||
AnchorOn.Pressed = NavRadar.DampeningMode == InertiaDampeningMode.Anchor; | ||
} | ||
} | ||
|
||
// Frontier - Maximum IFF Distance | ||
private void OnRangeFilterChanged(int value) | ||
{ | ||
NavRadar.MaximumIFFDistance = (float) value; | ||
} | ||
|
||
private void NfAddShuttleDesignation(EntityUid? shuttle) | ||
{ | ||
// Frontier - PR #1284 Add Shuttle Designation | ||
if (_entManager.TryGetComponent<MetaDataComponent>(shuttle, out var metadata)) | ||
{ | ||
var shipNameParts = metadata.EntityName.Split(' '); | ||
var designation = shipNameParts[^1]; | ||
if (designation.Length > 2 && designation[2] == '-') | ||
{ | ||
NavDisplayLabel.Text = string.Join(' ', shipNameParts[..^1]); | ||
ShuttleDesignation.Text = designation; | ||
} | ||
else | ||
NavDisplayLabel.Text = metadata.EntityName; | ||
} | ||
// End Frontier - PR #1284 | ||
} | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Content.Client/_NF/Shuttles/UI/ShuttleConsoleWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// New Frontiers - This file is licensed under AGPLv3 | ||
// Copyright (c) 2024 New Frontiers Contributors | ||
// See AGPLv3.txt for details. | ||
using Content.Shared._NF.Shuttles.Events; | ||
|
||
namespace Content.Client.Shuttles.UI | ||
{ | ||
public sealed partial class ShuttleConsoleWindow | ||
{ | ||
public event Action<NetEntity?, InertiaDampeningMode>? OnInertiaDampeningModeChanged; | ||
|
||
private void NfInitialize() | ||
{ | ||
NavContainer.OnInertiaDampeningModeChanged += (entity, mode) => | ||
{ | ||
OnInertiaDampeningModeChanged?.Invoke(entity, mode); | ||
}; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.