Comments (12)
That might work for pens, but remember stamps use the same code, so the TryComp<PenComponent>
guard at the beginning will break normal stamps.
from frontier-station-14.
Pretty sure once you stamp a piece of paper, you can't write on in anymore. So if you attempt to write on it, it will just sign instead.
from frontier-station-14.
The dropdown for the pen shows the 'write' option is already selected; try clicking on 'sign' and you'll see it switch to sign. Stamped papers cannot be written to or modified, so clicking on the stamped paper even with the 'write' option will fall back to signing it.
However, it probably should say 'sign' instead of 'stamp' in the popup message.
from frontier-station-14.
It's very unintuitive to me that it would sign when it's not set to sign! This wasn't clear to an admin I spoke to before making the ticket either.
Perhaps it should simply reject writing on the paper if the paper has been signed but the pen is set to write. Could signing be made into an alt+click alternative action for convenience?
from frontier-station-14.
I think you are right. Looking at the code, I think that behavior is due to an oversight. It seems to be a little tricky to make a pen act as a pen and a stamp while avoiding modifying upstream code.
from frontier-station-14.
Wouldn't this do?
diff --git a/Content.Server/Paper/PaperSystem.cs b/Content.Server/Paper/PaperSystem.cs
index 7907c2db..ac5e46d6 100644
--- a/Content.Server/Paper/PaperSystem.cs
+++ b/Content.Server/Paper/PaperSystem.cs
@@ -114,11 +114,20 @@ private void OnInteractUsing(EntityUid uid, PaperComponent paperComp, InteractUs
{
// only allow editing if there are no stamps or when using a cyberpen
var editable = paperComp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
- if (_tagSystem.HasTag(args.Used, "Write") && editable)
+ if (_tagSystem.HasTag(args.Used, "Write"))
{
+ // pen on sign mode will fall through to stamp below
if (TryComp<PenComponent>(args.Used, out var penComp) && penComp.Pen == PenMode.PenSign);
else // Frontier - Else the rest
{
+ // a pen in write mode cannot edit a paper which has
+ // already been stamped
+ if(!editable) {
+ // TODO: emit some kind of message to the user that
+ // this action is not allowed?
+ return;
+ }
+
var writeEvent = new PaperWriteEvent(uid, args.User);
RaiseLocalEvent(args.Used, ref writeEvent);
if (!TryComp<ActorComponent>(args.User, out var actor))
from frontier-station-14.
Maybe. The code path is getting hard to follow and should probably be refactored. There's also some goofy stuff like this
frontier-station-14/Content.Server/Paper/PaperSystem.cs
Lines 245 to 249 in bc6bbc6
from frontier-station-14.
Sure, do you like this better? I haven't worked with SS14 before, but I'd be happy to start a PR if this is moving in the right direction.
I don't know what makes StampedPersonal
goofy. The fact that the localization string is the variable with no text?
private void sendLocalMessage(EntityUid user, String? selfMsg, String? otherMsg) {
if(otherMsg != null)
{
_popupSystem.PopupEntity(otherMsg, user, Filter.PvsExcept(user, entityManager: EntityManager), true);
}
if(selfMsg != null)
{
_popupSystem.PopupEntity(selfMsg, user, user);
};
}
private void OnInteractUsing(EntityUid uid, PaperComponent paperComp, InteractUsingEvent args)
{
// can't write or sign without a pen!
if (!TryComp<PenComponent>(args.Used, out var penComp))
return;
// if we're trying to write on the paper
if (_tagSystem.HasTag(args.Used, "Write") && penComp.Pen == PenMode.PenWrite)
{
// paper can only be edited if it hasn't been stamped yet, or using a cyberpen
var editable = paperComp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
if(!editable) {
// paper was already stamped, tell the user they can't write on it
this.sendLocalMessage(
args.User,
Loc.GetString(
"paper-component-action-stamp-paper-cantwrite",
("target", args.Target)
),
null
);
return;
}
var writeEvent = new PaperWriteEvent(uid, args.User);
RaiseLocalEvent(args.Used, ref writeEvent);
if (!TryComp<ActorComponent>(args.User, out var actor))
return;
paperComp.Mode = PaperAction.Write;
_uiSystem.TryOpen(uid, PaperUiKey.Key, actor.PlayerSession);
UpdateUserInterface(uid, paperComp, actor.PlayerSession);
args.Handled = true;
return;
// sign the paper
} else if (penComp.Pen == PenMode.PenSign) {
// attempt to stamp
if (!TryComp<StampComponent>(args.Used, out var stampComp) || !TryStamp(uid, GetStampInfo(stampComp), stampComp.StampState, paperComp))
return;
if (stampComp.StampedPersonal) // Frontier
stampComp.StampedName = Loc.GetString("stamp-component-signee-name", ("user", args.User)); // Frontier
// successfully stamped, play popup
this.sendLocalMessage(
args.User,
Loc.GetString(
"paper-component-action-stamp-paper-self",
("target", args.Target),
("stamp", args.Used)
),
Loc.GetString(
"paper-component-action-stamp-paper-other",
("user", args.User),
("target", args.Target),
("stamp", args.Used)
)
)
_audio.PlayPvs(stampComp.Sound, uid);
UpdateUserInterface(uid, paperComp);
}
}
from frontier-station-14.
If you want to make a PR on this then go ahead.
from frontier-station-14.
You might want to take a look at what Delta-V just did is doing relating to pen signing. It looks less convoluted than what we have now.
from frontier-station-14.
Try to sign again after upstream update I found the issue.
from frontier-station-14.
Fixed the issue on upstream merge that coming soon.
from frontier-station-14.
Related Issues (20)
- Pirate Latejoin is broken HOT 1
- There's a problem HOT 1
- EMP guns no longer work on thrusters and consoles and machines, only on APCs. HOT 1
- Hover Bike if used in space with a weapon, recoil will cause you to get unbuckled. HOT 3
- Contraband status obfuscated from players HOT 2
- NFSD To Nfsd HOT 4
- Mini Auth doesn't catch simultaneous connections HOT 1
- Attempting to deconstruct a tabletop shuttle console destroys the console
- Mercenary job does not have Mercenary access HOT 1
- Megafauna commiting suicide on lava planets or high tempature/dangerous atmos
- The requirement to sell all bought gear during a round before it ends is rather awkward. HOT 7
- Cannot open crew slots HOT 1
- LoneOpsSpawn Gamerule activating by itself through EventScheduler HOT 2
- Panic Bunker's "Connection Denied" message doesn't properly display the hours needed to bypass it HOT 1
- Contraband Clothing faction makes syndies friendly HOT 1
- Energy guns with a firemode select dont update
- Jugs in chemvend appear unlabeled HOT 1
- Unable to leave expedition manually
- SyringeCognizine only draws HOT 2
- Station Records computer shows empty till someone latejoins
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontier-station-14.