Commit Graph

21 Commits

Author SHA1 Message Date
Lucy
37ec7f8054 Changes all uses of notify_ghosts to use the real names of mobs (#90919)
## About The Pull Request

Quite simple - this changes every direct mention of a mob in a
`notify_ghosts` message to use `[mob.real_name]` instead of just `[mob]`

## Why It's Good For The Game

makes things less confusing - ghosts can see easily their actual
identity anyways, so it's not like there's much of a reason _not_ to do
this.

## Changelog
🆑
qol: Ghost notifications will now use the real names of mobs when
something happens (i.e no more "Unknown has completed an ascension
ritual!")
/🆑
2025-05-08 00:48:52 +00:00
san7890
c403a6eccc Wraps lowertext() to ensure proper stringification. (#82442)
## About The Pull Request

Fixes #82440

This PR just creates a new macro, `LOWER_TEXT()` (yes the irony is not
lost on me) to wrap around all calls of `lowertext()` and ensure that
whatever we input into that proc will be stringified using the `"[]"`
(or `tostring()` for the nerds) operator. very simple.

I also added a linter to enforce this (and prevent all forms of
regression) because I think that machines should do the menial work and
we shouldn't expect maintainers to remember this, let me know if you
disagree. if there is a time when it should be opted out for some
reason, the linter does respect it if you wrap your input with the
`UNLINT()` function.
2024-04-10 12:19:43 -07:00
Mothblocks
c1d68698fb Micro-optimize qdel by only permitting one parameter (#80628)
Productionizes #80615.

The core optimization is this:

```patch
-	var/hint = to_delete.Destroy(arglist(args.Copy(2))) // Let our friend know they're about to get fucked up.
+	var/hint = to_delete.Destroy(force) // Let our friend know they're about to get fucked up.
```

We avoid a heap allocation in the form of copying the args over to a new
list. A/B testing shows this results in 33% better overtime, and in a
real round shaving off a full second of self time and 0.4 seconds of
overtime--both of these would be doubled in the event this is merged as
the new proc was only being run 50% of the time.
2023-12-28 13:52:44 -08:00
Jeremiah
bbe440b3d6 More standardization for ghost notifications (READY) (#79596)
## About The Pull Request
I'm still not satisfied with how ghost notifications work. This gives
every notification with a source (99% of all notifications, in other
words) a link to jump/orbit. Currently, notifications with "play"
interactions would only get the interact link, so jumping to the source
was pretty annoying.

It removes posting the entire message in the alert tooltip, as some got
pretty lengthy and it didn't seem to fit. To replace this, they will
always use headers

After:


![image](https://github.com/tgstation/tgstation/assets/42397676/debfce52-3627-4a43-8663-33d61d893161)


![image](https://github.com/tgstation/tgstation/assets/42397676/01f299ae-dc6a-45f8-a97a-cb2c815088b2)


![image](https://github.com/tgstation/tgstation/assets/42397676/99567376-063e-458e-af2a-2dd4306747cc)

NOTIFY_JUMP and NOTIFY_ORBIT have been merged, since the only difference
seems to be whether it's a turf. The result shaves off some redundant
lines of code, since most-every usage of notify_ghosts uses
NOTIFY_ORBIT.
## Why It's Good For The Game
More standardization for the ghost notification system. Adds a few alert
headers that never had them. All in all, makes it easier for creators to
throw alerts at ghosts
## Changelog
🆑
qol: Nearly every ghost alert should now feature a "VIEW" button, even
those with click interaction.
del: Ghost alerts no longer show the entire message in the tooltip,
instead have been replaced with titles.
/🆑
2023-11-19 05:13:25 +01:00
Rhials
3c7005a37c Converts some notify_ghosts args to bitflags, multilines all notify_ghosts calls (#79320)
## About The Pull Request

This helps clean up my favorite helper proc in the whole codebase,
`notify_ghosts()`.

The notify_suiciders, ignore_mapload, and flashwindow args are GONE.
They have been replaced with the notify_flags bitflag argument. This was
intended to make deadchat announcements a bitflag argument too, but
those got reverted right before I originally wanted to submit this PR.

The on-screen popup now shows the notification body when you hover it
with your mouse again. The format is now `[notify_ghosts message] --
[click action (orbit/jump/play)]`

Every single `notify_ghosts()` call has been changed to multiline format
and has been given trailing commas. Pretty!
## Why It's Good For The Game

Cleans up a proc that is very popular and going through a lot of changes
at the time.

Allows for further flexibility when this proc inevitably gets tweaked or
improved. 12 -> 10 args is an improvement, and it doesn't impact the
helper's flexibility at all.
## Changelog
🆑 Rhials
code: The notify_ghosts proc has been cleaned up. Please report any
abnormal changes in deadchat notification behavior.
qol: The on-screen deadchat popups now contain the notification blurb
when hovered with your mouse again.
/🆑
2023-11-05 15:26:50 -08:00
Bloop
4c870f71ca Fixes a bunch of callbacks that were being qdeleted, and code cleanup (#77904)
## About The Pull Request


![image](https://github.com/tgstation/tgstation/assets/13398309/559eb50a-461c-4220-b628-55412baaffc3)

Continuing the work of
https://github.com/tgstation/tgstation/pull/77850.

it started with finding one that was being missed and causing a
runtime...then I noticed a whole lot more. While I was doing this I
found callbacks that weren't being nulled in `Destroy()`, so I added
that wherever I found these spots as well as some general code cleanup.

There were a lot more of these than I initially hoped to encounter so
I'm labeling it as a refactor.

## Why It's Good For The Game

Fixes lots of runtimes, improves code resiliency.

## Changelog

🆑
refactor: fixed a bunch of instances of callbacks being qdeleted and
cleaned up related code
/🆑
2023-08-25 16:03:27 -06:00
tattle
dfd4801122 Adds p_They (and friends) for capitalized pronoun helpers (#76910)
## About The Pull Request

![image](https://github.com/tgstation/tgstation/assets/66640614/f8afe149-85cf-40d2-a5c1-4c96a3ccdfe4)

Basically replaces p_they(TRUE) with p_They

## Why It's Good For The Game
Fewer ambiguous parameters (what does TRUE mean when passed to p_they?)
More comprehensive helper functions.

## Changelog
🆑 Tattle
spellcheck: Fixed the grammar on a few revenant messages
/🆑

---------

Co-authored-by: tattle <article.disaster@gmail.com>
2023-07-17 22:55:58 -07:00
LemonInTheDark
ae5a4f955d Pulls apart the vestiges of components still hanging onto signals (#75914)
## About The Pull Request

Signals were initially only usable with component listeners, which while
no longer the case has lead to outdated documentation, names, and a
similar location in code.

This pr pulls the two apart. Partially because mso thinks we should, but
also because they really aren't directly linked anymore, and having them
in this midstate just confuses people.

[Renames comp_lookup to listen_lookup, since that's what it
does](102b79694f)

[Moves signal procs over to their own
file](33d07d01fd)

[Renames the PREQDELETING and QDELETING comsigs to drop the parent bit
since they can hook to more then just comps
now](335ea4ad08)

[Does something similar to the attackby comsigs (PARENT ->
ATOM)](210e57051d)

[And finally passes over the examine
signals](65917658fb)

## Why It's Good For The Game

Code makes more sense, things are better teased apart, s just good imo

## Changelog
🆑
refactor: Pulled apart the last vestiges of names/docs directly linking
signals to components
/🆑
2023-06-09 06:14:31 +00:00
san7890
ccef887efe Lints Against Unmanaged Local Defines (#74333)
# MAINTAINER - USE THE BUTTON THAT SAYS "MERGE MASTER" THEN SET THE PR
TO AUTO-MERGE! IT'S MUCH EASIER FOR ME TO FIX THINGS BEFORE THEY SKEW
RATHER THAN AFTER THE FACT.

## About The Pull Request

Hey there,

This took a while to do, but here's the gist:

Python file now regexes every file in `/code` except for those that have
some valid reason to be tacking on more global defines. Some of those
reasons are simply just that I don't have the time right now (doing what
you see in this PR took a few hours) to refactor and parse what should
belong and what should be thrown out. For the time being though, this PR
will at least _halt_ people making the mistake of not `#undef`ing any
files they `#define` "locally", or within the scope of a file.

Most people forget to do this and this leads to a lot of mess later on
due to how many variables can be unmanaged on the global level. I've
made this mistake, you've made this mistake, it's a common thing. Let's
automatically check for it so it can be fixed no-stress.

Scenarios this PR corrects:

* Forgetting to undef a define but undeffing others.
* Not undeffing any defines in your file.
* Earmarking a define as a "file local" define, but not defining it.
* Having a define be a "file local" define, but having it be used
elsewhere.
* Having a "local" define not even be in the file that it only shows up
in.
* Having a completely unused define*

(* I kept some of these because they seemed important... Others were
junked.)
## Why It's Good For The Game

If you wanna use it across multiple files, no reason to not make it a
global define (maybe there's a few reasons but let's assume that this is
the 95% case).

Let me know if you don't like how I re-arranged some of the defines and
how you'd rather see it be implemented, and I'd be happy to do that.
This was mostly just "eh does it need it or not" sorta stuff.

I used a pretty cool way to detect if we should use the standardized
GitHub "error" output, you can see the results of that here
https://github.com/san7890/bruhstation/actions/runs/4549766579/jobs/8022186846#step:7:792
## Changelog
Nothing that really concerns players.

(I fixed up all this stuff using vscode, no regexes beyond what you see
in the python script. sorry downstreams)
2023-03-29 10:17:03 -07:00
NamelessFairy
e9930877bc Deadchat controlled mobs/objects now appear in the orbit menu. (#72628) 2023-01-13 22:35:14 -08:00
AnturK
4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00:00
cacogen
7d9a14affa Deadchat control alerts ghosts when they can input another command (#66621)
Makes it so deadchat control alerts ghosts when they can input another command. Also rounds the seconds values in the to_chat messages for deadchat control up, so they don't have a decimal point.

You don't have to keep trying to input something to see if the cooldown has expired yet. Removing the decimal point looks cleaner.
2022-05-06 18:04:06 -07:00
TemporalOroboros
f04511b637 Makes deadchat control inputs bypass automute. (#65195)
* Makes deadchat control inputs bypass automute.

It's slightly annoying when you get muted because you spent a minute trying to get the supermatter to move down.
2022-03-01 20:45:15 -08:00
Ghom
911005e03c Makes the "Ian's Adventure" station trait more interesting by making the dog deadchat controllable plus extra lives. (#62617)
About The Pull Request

Makes the "Ian Adventure" station trait more interesting by giving him deadchat control (democracy mode, 3 seconds cooldown on inputs) and a couple extra lives* to survive early round tiding.

*Basically, a new component that respawns the critter when he dies. The component itself is simple enough, but it sends a signal each respawn to allow other datums to expand this behavior how they want. I've contemplated adding a signal that can stop death, dusting and gibbing instead of respawning the mob at first but because death(), dust() and gib() were made with the assertion that the mob is always going to die I've quickly realized it'd require a refactor that's way too big and out of scope.

The deadchat control of corgis only include commands to change and drop hats, "speak" (random lines from the speak list of the mob) and spin (other than cardinal movement) for now. I'd have loved to add more complex commands (like, argumented) that can potentially be relayed to the AI controller, but I guess that'll have to wait until the thing gets refactored a little.
Why It's Good For The Game

"Ian's Adventure" is a really bland station trait at the moment. All it does is move Ian somewhere else at the start of the round. Even by the station traits standard of being small things this is insignificant, and also pretty bad considering Ian is not actually going on an adventure since he lacks the initiative to do anything being an npc dog.
This PR aims to breath fresh air into this station trait and push it toward a slighty more engaging direction, though it relies on observers to work, while still being a small """"cute"""" station trait.
Changelog

cl
expansion: The "Ian's Adventure" station trait now makes Ian deadchat controllable and gives him a couple extra lives (to survive early round tiding)
/cl
2021-11-18 13:13:57 +13:00
Watermelon914
375a20e49b Refactors most spans into span procs (#59645)
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)
2021-06-14 13:03:53 -07:00
Celotajs
190d0a0384 Replace alert usage with tgui_alert (#58419)
Pretty much every alert() call is replaced with tgui_alert, except one I replaced with tgalert as a fallback. If tgui_alert exists, why not use it?
2021-05-20 22:43:27 +12:00
MrMelbert
3539de2004 Makes deadchat control's examine only shows up for ghosts (#57926)
This PR early returns the on_examine proc for deadchat control if the examiner is not an observer.
So, only ghosts (deadchat) are allowed to see if something is under deadchat control. Humans don't need to know (or shouldn't know) if deadchat is expanding its reach into the physical realm.
2021-03-24 22:47:45 +00:00
Timberpoes
7c94f81028 Adds more admin memery and deadchat_control options to immovable rods. (#56888)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-02-15 15:35:00 -08:00
Timberpoes
b5332ee4db Deadchat plays everything - A simple way for admins to let deadchat control things. (#55314)
* Deadchat plays things

* Pocket lint

* View those variables

* Arr var

* Arrr save changes and don't code while drunk

* Loog dot exe

* Big ol' changes
2020-12-26 21:03:47 +01:00
Jared-Fogle
45c14f6330 Adds SIGNAL_HANDLER and SIGNAL_HANDLER_DOES_SLEEP to prevent signal callbacks from blocking (#52761)
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
2020-08-20 09:11:28 +12:00
TheChosenEvilOne
e0bcd2538f [Ready] Deadchat control component, also a chance for deadchat controlled birdboat. (#47110)
* Dead chat controlled singularity!
It just can't go wrong.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Renames the input_cooldown var to make more sense.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Begone ugly checks.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* oh yeah, I can just do this.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Replaced the deadchat control with a component.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Autodoc

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Removed the leftover global list.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Possessed goose, bye singularity.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* vomit

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Deadchat plays singularity

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Removed global mode completely, also reviews.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* Reviews.

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>

* alrighty then

Signed-off-by: TheChosenEvilOne <tceo-email@protonmail.com>
2019-10-23 22:00:22 +02:00