Commit Graph

29 Commits

Author SHA1 Message Date
Kyle Spier-Swenson
2bf57113df Command bar typing indicators (client side html version) (#83081)
This uses a browser skin element to spy on the command bar and report
back to the server what verb is currently in it and how many characters
it has. it skips reporting if the text hasn't changed since the last
report.

im intentionally not providing the full text in the command bar to the
server, while designing the system so new verbs can be given typing
indicators by editing DM code, not html code.

The report rate is once a second but this could be lowered or tweaked.

Both the tgui say window being open and this system being active because
the command bar starts with `say "` is undefined behavior, mostly the
first one to end the indicator will just freeze indicators for the other
one until it too ends its current indicator session.

The system waits until something besides the `"` is in the argument to
say.

It is enabled for verbs `say`, `me`, and `whisper`.

I don't actually know if this is the case for tgui say. this is a one
line tweak anyways so let me know if this should be changed.

[(This pr closes a
bounty)](https://tgstation13.org/phpBB/viewtopic.php?p=726634#p726634)

🆑 MrStonedOne & Lilah Novi
add: Say commands typed in the command bar now trigger typing indicators
/🆑

---------

Co-authored-by: san7890 <the@san7890.com>
2024-05-08 19:35:30 -06:00
Zephyr
cf4cc89902 Revert of a Revert | ListInputModal (#82854)
This reverts commit 9acf5bd821.

MSO determined that because we use `file(...)` instead of a string
instead of an asset being locked to its initial state via a cache object
we are sending it as it is on disk every time. which means that when a
new server deployment updates the tgui it will send this new tgui code
even if the currently running DM code does not support it.
2024-04-26 00:47:28 -07:00
Kyle Spier-Swenson
9acf5bd821 Revert "Converts ListInputModal to actually be a Modal | Adds ListInputWindow which uses it" (#82841)
Reverts tgstation/tgstation#82792
2024-04-23 02:50:47 +00:00
Zephyr
b218130a2c Converts ListInputModal to actually be a Modal | Adds ListInputWindow which uses it (#82792)
## About The Pull Request

If we say something is a Modal it should actually be a Modal

## Why It's Good For The Game

You can now use this system in other windows if you want.
Fixed the misnomer.

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2024-04-22 18:02:24 -07:00
Zephyr
7f8752be14 Admin Verb Datums MkIII | Now with functional command bar (#82511) 2024-04-12 12:27:09 -07:00
Ghom
0ebeaf1907 Fixes tgui text input trimming the last char if the input hits the max length (#81869)
## About The Pull Request
There's a one character discrepancy between the maximum length in the
tgui input panel and that of the copied text, that's because
`copytext("123456", 6)` will actually return `"12345"`, cutting off the
last digit, so we need to increment the `max_length` by one if we want
the right amount of characters to be return. This is also somewhat
detailed in the DM lang "bluebook", and is in line with how
`list.Copy()` also works.


## Why It's Good For The Game
This fixes the museum password pad, which trimmed the last character of
the input because of this oversight.

## Changelog

🆑
fix: Fixed the tgui text input trimming the last character of the input
if it hits the maximum length.
fix: This also fixes the PIN pad leading to the right wing of the museum
away mission.
/🆑
2024-03-07 21:20:58 -07:00
jimmyl
683e2ecfbf bindable action buttons (#81371)
## About The Pull Request
### work started 12/12/2023


you may alt-click action buttons to bind them to a key
these are subject to click cooldown and if an action successfully
triggers click cooldown is triggered so you cant instantly do multiple
alt-click again to unbind
## Why It's Good For The Game

moving your mouse to the top left corner to do combat is not good
gameplay

## Changelog
🆑
qol: you may altclick action buttons to bind them to a key
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2024-02-16 23:10:15 +01:00
Bloop
f34174414d Cleans up some extra args in Destroy() (#80642)
## About The Pull Request

After https://github.com/tgstation/tgstation/pull/80628, these shouldn't
be needed anymore right?

## Why It's Good For The Game

Cleans up some vestigial code

## Changelog
EDIT: Not player-facing.
2023-12-30 03:54:07 +01:00
GoldenAlpharex
c2e5e2f0a8 Fixes the typing indicator (#80153)
## About The Pull Request
It was very specifically broken by [this
commit](94d00aa526),
because it wrongfully changed the logic. Now the typing indicator is
back, it's no longer just the thinking indicator.

## Why It's Good For The Game
Typing indicator is meant to be there, now it's back! No more awkward
flickering!

## Changelog

🆑 GoldenAlpharex
fix: The typing indicator has overcome its shyness and is now back to
its usual form.
/🆑
2023-12-06 19:52:28 -07:00
san7890
904c81bbcd Moves thinking_IC variable to a trait (#80122)
## About The Pull Request

This was another boolean that was used to just manage stuff codeside
that really was not accessed _too_ much and is ultimately not useful as
a variable on `/mob`. This just moves it to a trait because it's only
really used in a few spots for a similar intent+purpose.
## Why It's Good For The Game

Less stuff to deal with in the average view variables window whenever
looking at a mob, which is really nice and welcome.
## Changelog
Doesn't concern players.
2023-12-05 02:22:07 -05:00
Watermelon914
00be4978ae Adds a user type to integrated circuits, refactors the list pick component. (#79412)
## About The Pull Request
Added a user type to integrated circuits that can't be stored as a user
type but can be typecasted to entity. Useful for components that
directly ask for an input from the user, like the list pick component.

Refactored the list pick component to use this user port and to also
send failure signals whenever a success signal is not sent.
Removed the triggered port for the list pick component.

Also fixes a runtime that occurs with the list pick component if the
list passed in only contains null values.

## Why It's Good For The Game
Can't force a prompt onto people who haven't interacted with your
circuit.

## Changelog
🆑
add: Added a user type to integrated circuits
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2023-11-06 23:10:04 +01:00
san7890
89ce531194 Nullchecks Client on tgui_alert() and siblings (#79322)
## About The Pull Request

Fixes #79321

```dm
/datum/tgui/proc/open()
	if(!user.client)
		return FALSE
```
The TGUI window won't even `open()` and do any work if we don't have a
client, so let's just explicitly get the hell out of dodge if we don't
have a client associated with a mob in these procs. Adding a `?` to
handle the runtime in the linked issue only obfuscates the deeper issue
because of the aforementioned code snippet.

## Why It's Good For The Game

Clientless monkeys will still somehow be able to interact with stuff
through their random behavior, and this is still plausible enough to
show up on live servers every so often, so let's just patch it out
early. These alerts are meant for player user input, so if we don't have
a player, let's bounce.
## Changelog
A player would never ever notice this.
2023-10-31 17:01:38 -07:00
Jeremiah
4cc4f4828e Fixes tgui say flash on load (#78879)
## About The Pull Request
Hides the TGUI say window from popping up briefly during load
## Why It's Good For The Game
Just annoying for it to "jump scare" players
Fixes #75716
## Changelog
🆑
fix: TGUI Say should no longer flash during initialization
/🆑
2023-10-16 15:11:14 +02:00
Jeremiah
aa74657f69 Tgui say v1.1 (#75431)
## About The Pull Request
"It's better! I promise!"

When I wrote it, I was inexperienced and pretty angry. Not that I'm any
better of a person now, but the code should be. I consolidated instead
of relying on heavy abstractions. I simplified logic and wrote more
tests.

The result should look and feel much more like intended. The bundle size
is reduced by ~43%. Types are much stricter. The logic and css classes
are much more precise.

No major style changes yet
![Screenshot 2023-05-15
003339](https://github.com/tgstation/tgstation/assets/42397676/edeabdcf-5cc6-44ba-9e98-9015bb863547)

## Why It's Good For The Game
Less javascript is better, and being even a few fractions of a second
faster might make better gameplay
## Changelog
🆑
refactor: Tgui Say is rewritten, becoming "much more performant". Hey,
that's what it says on the tin! I'm not from marketing!
fix: Tguisay drag zones are now ever so slightly larger around the
corner of the window
fix: Pressing one of the chat open keys (T/Y/M/O) will no longer change
channels if it's already open
/🆑
2023-05-16 20:19:04 -06:00
nikothedude
bf4926fec8 [NO GBP] Adds a UI state to number inputs because Im an idiot and I forgot (#75103)
## About The Pull Request

Title.

## Why It's Good For The Game

I broke everything.
2023-05-02 01:02:49 +00:00
nikothedude
7cd1c47e67 Allows TGUI input datums to accept a ui_state as an argument (#75029)
## About The Pull Request

Title. Adds a new argument to the factory proc, the New(), adds a
variable, and changes ui_state() to return that variable. The variable
is always_state by default.

## Why It's Good For The Game
It allows custom behavior to be injected into the ui_state logic of the
basic input datums. This is good because there are circumstances where
always_state isn't acceptable. Ex. you open tgui_input_list(mob/user),
and the mob dies or is deleted. The list stays open, the contents can be
picked, despite this not being what the author wants. With this PR, you
can make sure the list closes and inputs are invalid in circumstances of
your choosing without having to completely re-make the input procs via
copypasting.
## Changelog
🆑
code: TGUI input datums can now accept custom ui_states
/🆑
2023-05-01 15:05:26 -07:00
NamelessFairy
0c0803817a Admins can now customize the space vines event. Also fixes a space vine event bugs. (#74704)
## About The Pull Request

Admins can now customize the location, potency and production stats for
the space vines event, they can also use the new checkbox input system
to select any number of mutations for the vine.
Also fixes a bug where random event kudzu was always spawning without
mutations.
Also adds support for minimum number of options for the checkbox system
rather than it being hardcoded to one (0 mutation kudzu support)
## Why It's Good For The Game

Space vines was practically begging to have admin customization added to
it since its very impractical for admins to make custom kudzu, with this
admins can create space vine threats tailored to the round by selecting
interesting locations/mutations based on current station circumstances.

Also bugfix + dehardcoding a thing.
## Changelog
🆑
admin: Admins can now control the spawn location, potency, production
and starting mutations of the space vines event.
fix: The space vine event will now correctly give vines mutations when
they spawn rather than always being mutation free.
code: Checkbox tgui inputs now support setting a minimum number of
inputs rather than it being hardcoded to 1.
/🆑
2023-04-15 21:29:02 -06:00
Jeremiah
1499fcd272 Tgui input checkboxes (#74544)
## About The Pull Request
A request from @NamelessFairy: A tgui window that gives the user
multiple items to select. The window returns the list of items selected.

The ui design is open to critique, reviews, etc. Pretty simplistic.
![Screenshot 2023-04-07
174056](https://user-images.githubusercontent.com/42397676/230695947-bc6b6d94-c984-4a2e-b290-a21cb7f8961e.png)

## Why It's Good For The Game
Sequentially asking yes/no is pretty ugly
## Changelog
🆑
ui: Adds a new tgui input window for checkboxes.
/🆑

---------

Co-authored-by: Jeremiah <jlsnow301@pm.me>
2023-04-13 05:35:28 -04:00
scriptis
4e1fc078d7 literally just hook asay into tgui say (#73212)
## About The Pull Request

pressing f3 now opens asay in tgui say
## Why It's Good For The Game

![john willard gets
banned](https://user-images.githubusercontent.com/12202230/216750445-addb4f3f-0df4-47da-891d-4ef4820a10ab.png)

also fixes double-escaped special characters caused by #72407 and
finally gets rid of the gross regular tgui input popup
## Changelog
🆑
fix: asays are no longer double-escaped
admin: asay now uses tgui say
/🆑

---------

Co-authored-by: Scriptis <scriptis@duck.com>
2023-02-04 23:25:53 -07:00
AnturK
435109ffb9 Lets tgui input actually accept decimals where allowed to (#71453)
It was rounded off ui side even if dm side allowed it.
2022-11-23 13:43:38 -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
Tastyfish
b98f177551 [NO GBP] Fixes blindness icons on lower station z-levels (#70608)
I previously tested that footsteps worked when hearing them from a lower Z-level but forgot to test if you can see them while on a lower z-level.

It didn't occur to me that offsetted planecube planes wouldn't work with being over the fullscreen blindness mask past the top level but that makes sense in retrospect.

So the blindness effects (via play_fov_effect()) are now on the fullscreen plane. Partially reverted doing this with manually talking bubbles as well so they look normal again, and then added a FOV effect as well for chat bubbles.

NOTE: Runetext is in general also only above the blind mask on the highest station level and below on others for the same planecube issue but that's a whole other can of worms.
2022-10-25 19:51:13 -07:00
LemonInTheDark
cd3a778915 PKP Mind Virus: Glorfing Cigs edition (#69904)
* PKP Mind Virus: Glorfing Cigs edition

If you glorf while smoking you'll get the cig stuck in your throat, leaving you unable to breath, speak, or eat. Based off the sort of cig you have a random delay before you vomit up the cig. (Pipes last forever don't philoso-larp kids). Other players can help you by using the help action on you while you're hurt, which leads to something imitating the himelich manuver, a broken chest, and a vomited up blockage. Other forms of vomiting will work too, if that's even applicable.

Oh I fixed a bug in vomit code. Because paralyzing you forces you to the ground, thus changing your dir, paralyzing vomits always went down. This is cringe, easy fix tho.

Ah and I added some extra functionality to sound loops too. You can set them to pick and take from the provided list, then refilling it once it's empty. This keeps some variety while preventing the risk of repeat sounds

Oh and I added some new signals. Some misc ones, for force say and a different kind of help then the existing one, which I renamed. One for breathing, which I used to clean up leroxin. I was planning to hook this but didn't need to in the end.

One for vomiting too. and eating. Also added a way to update looping timer delays. Forgot about that, I also added variable delay for sound loops, because I thought it sounded better here.

Features audio courtesy of our very own san7890, and the quake jump sound.
2022-10-19 06:34:45 -04:00
Tastyfish
087c74290b Fixes FOV (blindness) effects and typing indicator while blind (#70276)
* fix FOV effects

* Typing indicators and make it offsettable
2022-10-03 22:15:46 -04:00
skylord-a52
be0e6efdf6 [IDB IGNORE] [MDB IGNORE] Makes the icons/mob folder sane (#69302)
About The Pull Request

Reorganizes the entire icons/mob folder.

Added the following new subfolders:

    nonhuman-player (this was initially just called "antag", but then I realized guardians aren't technically antags)
    simplemob
    silicon
    effects (for bloodstains, fire, etc)
    simplemob/held-pets (for exactly that -- I wasn't sure if this should go in inhands instead)
    species/monkey

Moves the following stuff:

    All human parts moved into species, with moth, lizard, monkey, etc parts moved to corresponding subfolders. Previously, there were some moth parts in mob/species/moth, and others just loose in mob. Other species were similar.
    icemoon, lavaland, and jungle folders made into subfolders of simplemob
    All AI and silicon stuff, as well as Beepsky et al. into the silicon folder, simplemobs into the simplemob folder, aliens into the nonhuman-player folder, etc.
    Split up animal_parts.dmi into two bodyparts.dmi which were put in their respective folders (species/alien and species/monkey)

Code changes:

    Filepath changes to account for all of this
    Adds a check when performing surgery on monkeys and xenos, because we can no longer assume their limbs are in the same file
    Turns some hardcoded statues and showcases that were built into maps into objects instead

Things I'd like to do in the future but cant be assed right now:

    Remove primarily-antag sprites from simplemob/mob.dmi (Revenant, Morph, etc.) and put them in the nonhuman-player folder
    Split up mutant_bodyparts.dmi into different files for Tizirans, Felinids, monkeys, etc and put them in their own folders. Those may have once been meant primarily for mutated humans but that's now how they're being used right now.
2022-09-03 11:52:54 -07:00
John Willard
c3132671e1 Makes typing indicators use your bubble icon (#67872)
About The Pull Request

Typing indicators now rely on what bubble icon you have, rather than all being the default.

Most speech bubbles with Admin Combo HUD: https://cdn.discordapp.com/attachments/751307359351210014/992025794207551538/speechbubbles.mp4

A new sprite has been added for every bubble type for this to properly work, and nearly all bubble icons have been resprited by @Crumpaloo

All bubbles have been moved to the right side of the user as to not cover their HUDs, so it is now consistent with the default bubbles.
Why It's Good For The Game

This sucks:
https://user-images.githubusercontent.com/53777086/174477936-98d92891-7d2d-409c-8b9b-f92cd046edc4.mp4

It also lets us re-add one of the main perks of the Lawyer's badge, which is currently locked to not being on runechat, an option that might not exist in the future.
Changelog

cl Crumpaloo, jlsnow301, JohnFulpWillard
add: Typing indicators now use your speech bubble type, rather than all being the same, so Cyborgs no longer look like a human when typing, and Lawyers have that cool speech bubble again.
/cl
2022-07-06 12:43:52 +12:00
Jeremiah
c62195450d TGUI Say no longer deletes your currently typed message on history (#67971)
first commit
2022-06-28 10:12:08 -04:00
GoldenAlpharex
001c7d2fd5 Fixes TGUI light mode preference-related runtime (#67880)
It runtimed every time a client would connect, because they had no mob. Whoops!
Why It's Good For The Game

Runtime man bad.
Changelog

cl GoldenAlpharex
fix: Fixed a runtime related to the TGUI white mode preference that would happen every time someone would connect to the server.
/cl
2022-06-21 12:11:10 +12:00
Jeremiah
acfa5e4fdd TGUI Say: Upgrades chat input with modern features (#67116)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
Co-authored-by: KubeRoot <6917698+KubeRoot@users.noreply.github.com>
Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
Co-authored-by: Iamgoofball <4081722+Iamgoofball@users.noreply.github.com>
Co-authored-by: DomitiusKnack <56321744+DomitiusKnack@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Wallem <66052067+Wallemations@users.noreply.github.com>
2022-06-16 17:21:21 -07:00