-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into FSB-Nightlight
- Loading branch information
Showing
348 changed files
with
3,580 additions
and
437 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Content.Server._CD.Engraving; | ||
|
||
/// <summary> | ||
/// Allows an items' description to be modified with an engraving | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(EngraveableSystem))] | ||
public sealed partial class EngraveableComponent : Component | ||
{ | ||
/// <summary> | ||
/// Message given to user to notify them a message was sent | ||
/// </summary> | ||
[DataField] | ||
public string EngravedMessage = string.Empty; | ||
|
||
/// <summary> | ||
/// The inspect text to use when there is no engraving | ||
/// </summary> | ||
[DataField] | ||
public LocId NoEngravingText = "engraving-generic-no-message"; // Frontier: "dogtags"<"generic" | ||
|
||
/// <summary> | ||
/// The message to use when successfully engraving the item | ||
/// </summary> | ||
[DataField] | ||
public LocId EngraveSuccessMessage = "engraving-generic-succeed"; // Frontier: "dogtags"<"generic" | ||
|
||
/// <summary> | ||
/// The inspect text to use when there is an engraving. The message will be shown seperately afterwards. | ||
/// </summary> | ||
[DataField] | ||
public LocId HasEngravingText = "engraving-generic-has-message"; // Frontier: "dogtags"<"generic" | ||
} |
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 @@ | ||
using Content.Server.Administration; | ||
using Content.Server.Administration.Logs; | ||
using Content.Server.Popups; | ||
using Content.Shared.Database; | ||
using Content.Shared.Popups; | ||
using Content.Shared.Examine; | ||
using Content.Shared.Verbs; | ||
using Robust.Shared.Player; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Server._CD.Engraving; | ||
|
||
public sealed class EngraveableSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IAdminLogManager _adminLogger = default!; | ||
[Dependency] private readonly PopupSystem _popup = default!; | ||
[Dependency] private readonly QuickDialogSystem _dialog = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<EngraveableComponent, ExaminedEvent>(OnExamined); | ||
SubscribeLocalEvent<EngraveableComponent, GetVerbsEvent<ActivationVerb>>(AddEngraveVerb); | ||
} | ||
|
||
private void OnExamined(Entity<EngraveableComponent> ent, ref ExaminedEvent args) | ||
{ | ||
var msg = new FormattedMessage(); | ||
// Frontier: don't localize the message, use args in fluent entries | ||
if (ent.Comp.EngravedMessage == string.Empty) | ||
msg.AddMarkupOrThrow(Loc.GetString(ent.Comp.NoEngravingText, ("object", ent))); | ||
else | ||
msg.AddMarkupOrThrow(Loc.GetString(ent.Comp.HasEngravingText, ("object", ent), ("message", ent.Comp.EngravedMessage))); | ||
// End Frontier | ||
|
||
args.PushMessage(msg, 1); | ||
} | ||
|
||
private void AddEngraveVerb(Entity<EngraveableComponent> ent, ref GetVerbsEvent<ActivationVerb> args) | ||
{ | ||
// First check if it's already been engraved. If it has, don't let them do it again. | ||
if (ent.Comp.EngravedMessage != string.Empty) | ||
return; | ||
|
||
// We need an actor to give the verb. | ||
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) | ||
return; | ||
|
||
// Make sure ghosts can't engrave stuff. | ||
if (!args.CanInteract) | ||
return; | ||
|
||
var engraveVerb = new ActivationVerb | ||
{ | ||
Text = Loc.GetString("engraving-verb-engrave"), | ||
Act = () => | ||
{ | ||
_dialog.OpenDialog(actor.PlayerSession, | ||
Loc.GetString("engraving-verb-engrave"), | ||
Loc.GetString("engraving-popup-ui-message"), | ||
(string message) => | ||
{ | ||
// If either the actor or comp have magically vanished | ||
if (actor.PlayerSession.AttachedEntity == null || !HasComp<EngraveableComponent>(ent)) | ||
return; | ||
|
||
ent.Comp.EngravedMessage = message; | ||
_popup.PopupEntity(Loc.GetString(ent.Comp.EngraveSuccessMessage, ("object", ent)), // Frontier: add object argument | ||
actor.PlayerSession.AttachedEntity.Value, | ||
actor.PlayerSession, | ||
PopupType.Medium); | ||
_adminLogger.Add(LogType.Action, | ||
LogImpact.Low, | ||
$"{ToPrettyString(actor.PlayerSession.AttachedEntity):player} engraved an item with message: {message}"); | ||
}); | ||
}, | ||
Impact = LogImpact.Low, | ||
}; | ||
engraveVerb.Impact = LogImpact.Low; | ||
args.Verbs.Add(engraveVerb); | ||
} | ||
} |
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
3 changes: 0 additions & 3 deletions
3
Content.Server/_NF/Shuttles/Components/FTLKnockdownImmuneComponent.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
engraving-verb-engrave = Engrave | ||
engraving-popup-ui-message = Description | ||
# Frontier: generic engraving messages | ||
engraving-generic-no-message = There isn't anything engraved on {THE($object)}. | ||
engraving-generic-has-message = There's a message engraved on {THE($object)}. It reads: {$message} | ||
engraving-generic-succeed = You successfully engrave {THE($object)} with your message. |
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,6 @@ | ||
marking-MothWingsClassicSelene = Wings (Selene, Classic) | ||
marking-MothWingsSelene-selene_primary = Primary | ||
marking-MothWingsSelene-selene_secondary = Secondary | ||
marking-MothWingsSelene-selene_tertiary = Tertiary | ||
marking-MothWingsSelene = Wings (Selene) |
Oops, something went wrong.