Adjusts the failure balloon alerts to have a !, which is standard.
Remove the balloon alert for rotating/flipping things, as the visual feedback is already there: it's the thing getting rotated/flipped. Plus it's too long.
This adds some new defines and flags for the rotation component that lets us remove lots of c/p code chunks. I also added documentation to all the rotation defines that currently exist and in other spots that had weird behavior.
New rotation flags:
ROTATION_GHOSTS_ALLOWED - checks if ghosts are able to manipulate objects in config and lets them rotate the object
ROTATION_IGNORE_ANCHORED - this skips checking if an object is anchored (which normally prevents us from rotating) Used mainly for chairs.
ROTATION_NO_FLIPPING - this removes the flip verb from possible right click rotation options. Used for pipes that have custom flipping verbs instead
ROTATION_NEEDS_ROOM - this checks if an object needs to have an empty spot available in target direction. Used for windows and railings.
Objects can now be rotated in the direction based on which LMB or RMB you click with when you ALT click it. LMB is counter clockwise. RMB is clockwise. Before some objects could only be rotated clockwise. Now any object that inherits the rotation component can be rotated in either direction.
There was also a bug with wheelchairs that existed from when they were ported over from another codebase. The rotation logic was broken and never allowed anyone to rotate them. This has been fixed.
Rotation for IV_drips was enabled however Alt Click was being used for another proc and rotation was ignored because of this. I removed the rotation component due to this since I didn't want to change the hotkeys for IV drips since those have an actual effect on gameplay interactions while rotation does not.
Fingerprints are no longer added when something gets rotated. Only a few objects had this enabled but I believe this interaction was very spammy and unnecessary. I can readd this as a flag if needed but for now it's removed.
Alert balloons have replaced a lot of rotation to_chat() messages for the same reason as fingerprints. Rotating objects has almost no effect on gameplay and will only clutter a player's message log.
The hotkeys for pipe interactions had to be redone since Alt clicking was already being used in some situations. For regular pipes: Right clicking now changes the pipe layer. Alt clicking rotates the pipe. For Trinary pipes: Right clicking now flips the pipe device. Alt clicking rotates the device.
ComponentInitialize() is a deprecated function and the AddComponent proc was moved to Initialize for several objects.
* Renames RemoveComponent, as its purpose was unclear. Fixes up some dumb uses, and properly docs its status as a helper proc for transfering components
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.
Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.
(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm
We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous.
There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this.
Hi codeowners!
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
Adds SIGNAL_HANDLER, a macro that sets SHOULD_NOT_SLEEP(TRUE). This should ideally be required on all new signal callbacks.
Adds BLOCKING_SIGNAL_HANDLER, a macro that does nothing except symbolize "this is an older signal that didn't necessitate a code rewrite". It should not be allowed for new work.
This comes from discussion around #52735, which yields by calling input, and (though it sets the return type beforehand) will not properly return the flag to prevent attack from slapping.
To fix 60% of the yielding cases, WrapAdminProcCall no longer waits for another admin's proc call to finish. I'm not an admin, so I don't know how many behinds this has saved, but if this is problematic for admins I can just make it so that it lets you do it anyway. I'm not sure what the point of this babysitting was anyway.
Requested by @optimumtact.
Changelog
cl
admin: Calling a proc while another admin is calling one will no longer wait for the first to finish. You will simply just have to call it again.
/cl
About The Pull Request
This PR adds signals for all basic tool acts.
Replaced signals places where it's appropriate.
Why It's Good For The Game
It's kinda dirty how we used to do attackby and then check for tool behaviour. Since we now have stuff like plumbing and possibly that one laser PR, we need signals that directly relate to tool behaviour.
Changelog
cl
code: Added signals for all basic tool acts.
/cl
* 1/4 done? maybe?
* more
* stuff
* incremental stuff
* stuff
* stuff & things
* mostly done but not yet
* stuffing
* stuffing 2: electric boogaloo
* Git Commit and the Kingdom of the Crystal Skull
* make it actually compile
* found more stuff
* fixes
* fix AI laws appearing out of order
* fix windows
* should be the remaining stuff
* this time for real
* i guess it should compile too
* fix sechuds
one of three things.
1. They don't use RegisterWithParent or UnregisterFromParent to unregister
and register signals
2. They use callbacks which refer to a source object, which is usually deleted
on transfer, or lost in some manner, or simply makes no sense at all to be
transferred
3. the component was never designed to be transferred at all
TransferComponents gave no shits about any of this and just blindly transferred
all components, if they were actually capable of it or not.
I only noticed this because it was causing chairs to break as they would not register signals
and verbs correctly for rotation after being picked up and then placed down, and a player
reported that issue via ahelp.
Luckily we caught it before the rot got anywhere, only chairs and the shuttle subystem
tend to use this proc (Shuttle uses it on turfs), can you imagine if everything was using
this LMAO
Which is good because it's more dangerous than a loaded gun
I have added a can_transfer var, that is true when a component is valid to
actually transfer, which means the dev has actually thought about what happens when
you take the parent object away and swap it for another and all the crazy that is entailed
by this
I have done my best to audit what components are actually
transferable, but things are basically a hot mess (Thanks @Cyberboss )
The following components required edits:
Forensics:
did not register/deregister the clean_act signal properly, did not checkblood on new parent
Rotation:
did not use RegisterWithParent or UnregisterFromParent, turned out
to not be transferable anyway due to having callbacks that can be
passed in to the parent with unknown sources that we can't feasibly
reuse (i.e if you're transferred from a chair to a bed, your old rotation
call backs are no longer valid). Turns out the use case it was for (just chairs)
didn't need it anyway, so I just made it non valid for transfer.
Wet Floor:
Honestly this one is just a hot mess, it should be a subtype of the slippery
component with the extra wet turf handling.
As it is it basically manages a slippery component on top of it's own extra
functionality, so that's a major code smell.
I added registration/unregistration of the signals, and made it's pretransfer
remove the slippery component and the posttransfer add it back (via update_flags)
Components that seem transferable without issues
mirage_border
orbiter
decal
spill
storage (I hope to earth)