Commit Graph

20 Commits

Author SHA1 Message Date
SyncIt21
9c9a5d28ff Some alt & ctrl click improvements (#84203)
## About The Pull Request
Improved code quality of both so they resemble each other. Some of the
new specs are as follows

1. Moved` COMSIG_CLICK_ALT` & `COMSIG_CLICK_ALT_SECONDARY` up i.e.
before `can_perform_action()` making them pure hooks not bound by any
action checks giving components full control over them
2. Removed range check(`CAN_I_SEE`) & view check(`is_blind()`) out of
the base alt click proc. They now only apply to living mobs and don't
apply to ghosts(ghosts don't get blind & see everything) & revenants
(the range check still applies for revenants though).

This was actually a bug because these 2 checks were only meant to see if
the loot panel could be opened (as stated in
https://github.com/tgstation/tgstation/pull/83736#discussion_r1628097941)
but because they are at the top of the proc they also apply to all alt
click actions which is not intended. Also, by moving these checks down
to mob subtype levels some of the snowflake checks like this
7579e0e173/code/_onclick/click_alt.dm (L23)
can be removed. We should not check for subtypes within the parent type
proc but instead have subtypes override their parent procs to implement
custom behaviour
3. Removed redundant signals like` COMSIG_XENO_SLIME_CLICK_ALT` in
favour of just `COMSIG_MOB_ALTCLICKON`
4. While looking for alt click signal overrides I found alt click for
style meter was run timing, that's fixed now

## Changelog
🆑
fix: alt click runtime no more when using style meter
code: improved alt & ctrl click code
/🆑
2024-06-25 16:06:59 -07:00
MrMelbert
6fea9d999d Small playsound audit, particularly involving portal sounds (#83893)
## About The Pull Request

I was looking at sounds (as you do) and I noticed this


![image](https://github.com/tgstation/tgstation/assets/51863163/25b298ca-31ac-48a0-9f86-c65a8becd532)

These sounds don't exist

We have `portal_open_1`, not `portal_open1`. 
This wasn't caught on compile because they used `""` and not `''`.

So I went through and audited a bunch of playsound uses that don't use
`''`. Only one error, fortunately

Likewise there was a ton of places running `get_sfx` pointlessly
(because `playsound` does it for you) so I clened that up.

However while auditing the portal stuff I noticed a few oddities, so I
cleaned it up a bit.

Also also I added the portal sounds to the wormholes event and gave it a
free ™️ optimization because it was an in-world loop

## Changelog

🆑 Melbert
sound: Portals made by portal guns now make sounds as expected
sound: Wormholes from the wormhole event now make sounds when formed
/🆑
2024-06-13 23:47:37 -06:00
Jeremiah
8e3f635b98 Alt click refactor (#82656)
## About The Pull Request
Rewrites how alt click works. 
Based heavily on #82625. What a cool concept, it flows nicely with
#82533.

Fixes #81242 
(tm bugs fixed)
Fixes #82668

<details><summary>More info for devs</summary>

Handy regex used for alt click s&r:
`AltClick\((.*).*\)(\n\t.*\.\.\(\))?`
`click_alt($1)` (yes I am aware this only copies the first arg. there
are no other args!)

### Obj reskins
No reason for obj reskin to check on every single alt click for every
object. It applies to only a few items.
- Moved to obj/item
- Made into signal
- Added screentips

### Ventcrawling
Every single atmospherics machine checked for ventcrawling capability on
alt click despite only 3 objects needing that functionality. This has
been moved down to those individual items.
</details>

## Why It's Good For The Game
For players: 
- Alt clicking should work more logically, not causing double actions
like eject disk and open item window
- Added context menus for reskinnable items
- Removed adjacency restriction on loot panel

For devs:
- Makes alt click interactions easier to work with, no more click chain
nonsense and redundant guard clauses.
- OOP hell reduced
- Pascal Case reduced
- Glorious snake case

## Changelog
🆑
add: The lootpanel now works at range.
add: Screentips for reskinnable items.
fix: Alt click interactions have been refactored, which may lead to
unintentional changes to gameplay. Report any issues, please.
/🆑
2024-04-16 17:48:03 -06:00
LemonInTheDark
70651816c2 Fixes complex lights not handling moving well, renames lighting defines (#81423)
## About The Pull Request

[Fixes static lights not
moving](ffef43c05a)

Worked fine when the owner moved, but if the owner was inside something
else, it would try and trigger an update on the PARENT's lights, which
are obviously not us.

[Renames MOVABLE_LIGHT and STATIC_LIGHT to better describe what they
do](de73a63bd4)

People keep trying to change the lighting system of lamps and it makes
me mad.
I choose OVERLAY_LIGHT and COMPLEX_LIGHT here, I couldn't figure out a
better name for turf matrix lighting. Suggestions welcome

## Why It's Good For The Game

Closes #80005
Hopefully improves understanding of lighting at a glance
## Changelog
🆑
fix: Fixes fancy lights not updating their source location when picked
up and moved
/🆑
2024-02-12 20:50:20 +01: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
YesterdaysPromise
fb10121022 Icons folder cleaning wave two (#76788)
## About The Pull Request

Further continous organizing and cleaning the Icons folder. There are
still some minior nitpicks left to do, but I reached my daily sanity
expenses limit again, and the faster these get in the less issues for
both me and others later. Also cleans some mess I caused by my blindness
last PR.

## Why It's Good For The Game

Saner spriters = better sprites
2023-07-14 18:36:41 +00:00
Andrew
0818d6ae4c Crafting/Cooking menu update (#71779)
## About The Pull Request

Updated crafting menu, adding a lot of new functions and recipes that
were not in the crafting menu before.

<img alt="cult"
src="https://user-images.githubusercontent.com/3625094/206009533-aec3a1dd-cbe5-45eb-8515-1b75fabb65c5.PNG">

<img alt="nH77dLyyGx"
src="https://user-images.githubusercontent.com/3625094/206009786-b6706f70-0599-40bf-b051-8f499de43abd.png">


![image](https://user-images.githubusercontent.com/3625094/206623881-12d8abfc-de5e-458e-a01c-3daac8dbe9bd.png)


https://user-images.githubusercontent.com/3625094/206009841-738e4a03-0660-45b7-8d83-15eeb6501967.mp4

## Why It's Good For The Game

It is easier to use, and it has a lot of recipes that were spread
throughout the game, some of which weren't even on the wiki.
Crafting and cooking now count about 1200 recipes in total, including
conditionally available ones.

## Changelog

🆑
qol: Rewrote the crafting/cooking menu UI
qol: Split crafting and cooking menus in two different menus
qol: Crafting is no longer blocking the entire UI, only the "Make"
buttons are disabled
qol: Added stack crafting recipes to the crafting menu
qol: Added cooking recipes that were absent in the crafting menu before
(tool recipes, machine recipes, reactions)
qol: Added option to search recipes by title
qol: Added option to filter recipes by required materials/ingredients
qol: Added food types to the cooking menu, highlighting diet of your
species (liked, disliked foods)
qol: Added total nutrition value of the result to the cooking menu
qol: Added option to filter cooking recipes by the food type of the
resulting food
qol: Added "Can make" category that lists all currently craftable
recipes throughout all categories
refactor: changed categories and reshuffled some items in them
code: Reagents now have default container to get an icon from the
reagent datum
code: Objects now have `desc_controls` var for OOC information about
mouse controls that are visible on examine, but not in the description
fix: Fixed alignment on many food icons
fix: Fixed missing icon for beef stroganoff
/🆑

Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
2022-12-25 12:27:49 -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
tattle
fd9f50c552 [IDB IGNORE] Renames the inhand/misc folder to inhand/items (#69573)
Also adds balloons to inhand/items
2022-09-01 03:29:10 +02:00
Gandalf
684eab3d31 Converts SFX keys into DEFINES (#65146)
About The Pull Request

Simply converts all instances of soundkeys that use get_sfx from strings into defines.

E.g. "sparks" is now SFX_SPARKS
Why It's Good For The Game

It makes life a lot easier when you're looking for a sound effect. You just type SFX_ and you get suggestions in VSC. Plus, it looks better.

image
Changelog

Not player facing.
2022-03-11 10:09:18 +13:00
tralezab
6c01cc2c01 every case of initialize that should have mapload, does (#61623)
## About The Pull Request

stop forgetting to include mapload, if you don't include it then every single subtype past it by default doesn't include it

for example, `obj/item` didn't include mapload so every single item by default didn't fill in mapload

![](https://media.discordapp.net/attachments/823293417186000909/875122648605147146/image0.gif)

## Regex used:

procs without args, not even regex

`/Initialize()`

procs with args
`\/Initialize\((?!mapload)((.)*\w)?`

cleanup of things i didn't want to mapload:
`\/datum\/(.)*\/Initialize\(mapload`
2021-09-24 17:56:50 -04:00
Watermelon914
126411f405 Refactors how components are triggered and refactors how ports are ordered (#60934)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2021-09-03 02:22:39 -07:00
Colovorat
786faef4a7 Fixes right click on circuit controller (#60840)
Co-authored-by: Colovorat <lolqwert569@gmail.com>
2021-08-15 15:47:49 -07:00
Watermelon914
96f1c2abae Adds the bare minimum admin components and allows admins to define list literals. (#60240)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: carshalash <carshalash@gmail.com>
Co-authored-by: tgstation-server <tgstation-server@tgstation13.org>
2021-08-02 01:50:06 -07:00
Gurkenglas
aa018a857a Circuit component descriptions and module names are now visible to the naked eye. (#60545) 2021-07-31 21:19:43 -07:00
Watermelon914
ac2efd9b86 Removes Destroy overrides from most circuit components (#60492)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
2021-07-28 18:31:42 -07:00
Timberpoes
75a3717a04 Modifies right click logic so that it is not the same priority as modifier keys. (#59656)
Strips out the existing right click code - Due to the myriad of ways right clicking has been implemented, dedicated signals and procs for right clicking without modifiers are fundamentally incompatible with our system of primary and secondary attacks.

Adds additional signals to attacking code. These signals allow atoms to cancel the attack chain early on secondary attacks, or override the standard procs and not send signals to prevent any undesired behaviour from signal handlers.

Items that used RightClick procs have been converted to attack_hand_secondary.

The slaughter demon, having its own set of snowflake code as poor OOP principles have been applied in UnarmedAttack() procs with lacking calls to parent procs and arbitrary redefinition of behaviour, checks for a right click in its own UnarmedAttack() and performs a bodyslam off that.

Storage components now hijack the secondary attackby stage via signals to handle their opening and closing shortcuts on right click. When you right click a storage component equipped item with an object in your active hand, the object has an opportunity to perform its logic in pre secondary attack code and cancel the attack chain. If it does not cancel the attack chain in pre-attack, then the storage component takes over for attackby and, if possible, opens the relevant inventory and ends the attack chain.

The forensic scanner is a proof-of-concept of this working in action. With its scan logic moved from afterattack code to pre attack code for right clicking, right clicking with the scanner will now perform a scan where previously one was impossible. Left clicking still does what it always does - Scans at the very end of the attack chain.

The logic still isn't perfect - For example, you still can't attack containers in melee even in combat mode (you'll either open them or put your weapon into them regardless of which option you choose) - But this is a better setup overall which allows for items to at least override this behaviour in pre-attack if needed.
2021-06-24 14:30:33 -03:00
Watermelon914
f92403f3ed Added circuit component UI details, added multiplexer and allowed inserting components directly into shells. (#59635)
Adds the multiplexer circuit component - en.wikipedia.org/wiki/Multiplexer
Circuit components can now be directly inserted into shells rather than having to take the integrated circuit out.
Special information can be accessed from components now through the "Info" button besides the eject button on a component.
2021-06-23 18:34:19 -03:00
Mothblocks
6a9b030b57 Rebind alt-right-click to right-click for circuit controllers (#59337)
Easier key combination.
2021-06-02 22:37:52 -03:00
Watermelon914
b84a9f97b2 Integrated Circuits (Wiremod) (#59232)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
Co-authored-by: Maurukas <66576896+Maurukas@users.noreply.github.com>
2021-05-25 11:15:36 -07:00