DeltaV-Station / Delta-v

A fork of Space Station 14, embracing a mixture of classic SS13 chaos and experimentation only possible with the new engine
https://delta-v.org
GNU Affero General Public License v3.0
46 stars 203 forks source link

Senior ID cards get a custom job name: Attempt 2 #1418

Closed WarMechanic closed 1 week ago

WarMechanic commented 1 week ago

About the PR

So last time senior ID job titles tried to get implemented, it practically didn't work. I personally never saw senior IDs in effect, and they only applied to players at round-start without even influencing the crew manifest. I'm not quite done yet, but right now my solution catches both roundstart and latejoining players. It also applies the correct ID icons, so security will finally see some fancy "M"s walking around. Senior ID job name and icon also display correctly in crew manifest now.

Technical details

This solution reverts #1218 which relied on an event that was raised only after ready players spawned in at roundstart. Instead of a customJobName variable, we use job prototypes for senior roles and add logic before a player joins to use a 'virtualJob' based on your ID card. Senior ID cards now link to senior role prototypes instead of normal roles.

Media

Breaking changes

Not from what I've seen so far, although anything that relies on the redundant ID name change on spawn will have to be checked.

Changelog

:cl:

WarMechanic commented 1 week ago

its in a working state now but the crew manifest ended up being bugged because senior job prototypes werent listed in their respective departments :blunt:

ill have to review the logic to cull anything thats not needed.

WarMechanic commented 1 week ago

This is adding additional data that was the entire reason we avoided doing this in the first place. It should be investigated why the code was faulty and fixed, not removed and replaced by the one thing that was being avoided

is it including unnecessary data in prototypes, or the fact that there are prototypes in the first place that you want to avoid?

i added things like access to the senior job prototypes just as a formality although they will probably never be used so i can cull them if you want. i did initially try to parent the prototypes but that didn't work.

WarMechanic commented 1 week ago

also i originally attempted to work from your fix, but i determined that id have to put bandaids in multiple different scripts and stuff. i didnt think the solution would be very readable and would be more annoying to maintain by extension

here most of the code takes place in one script, and it uses job prototypes for compatibility.

WarMechanic commented 1 week ago

alright im going to assume the worst-case scenario in that you want me to remove the prototypes and replace them with components, ill start working on that now

WarMechanic commented 1 week ago

actually ill upload it as a separate PR in the case that this solution would be preferred