[MIRROR] Fixes greyscale colors not updating when changing their colors via VV, and fixes some issues with accessories [MDB IGNORE] (#23346)

* Fixes greyscale colors not updating when changing their colors via VV, and fixes some issues with accessories (#77806)

## About The Pull Request

Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/23214

This fixes a few bugs and cleans up code a bit:

1) Greyscale colors that were changed via the VV modify greyscale menu
will now update the mob's worn clothing accordingly. It wasn't doing
this before. Accessories in particular needed a bit of extra work to
update in this way because it wasn't coded with this case in mind.

2) Accessories will call `equipped()` and `dropped()` when they get
added/removed. This will fix issues like item flags being incorrectly
set, action bars not being added, etc.

3) Accessories will now be returned by `get_all_gear()`. This will
probably fix a few issues I'm not aware of.

## Why It's Good For The Game

<details><summary>Works</summary>

![dreamseeker_xijzQB0ALa](https://github.com/tgstation/tgstation/assets/13398309/eccb35d5-e1ea-4e2c-9906-f5b8c2187d24)

</details>

<details><summary>get_all_gear()</summary>

![dreamseeker_WsG0Uu2tIe](https://github.com/tgstation/tgstation/assets/13398309/d5c272d4-1990-454c-b48f-4da7b6a5f859)

</details>

<details><summary>get_equipped_items()</summary>

![dreamseeker_qe4hMngAO3](https://github.com/tgstation/tgstation/assets/13398309/06469b93-2a58-49db-be7f-c748576bf481)

</details>

<details><summary>item_flags get set now, hopefully preventing future
issues related to that</summary>

![image](https://github.com/tgstation/tgstation/assets/13398309/29a0e25a-a88f-4547-99f8-888da6b85e4d)

</details>

## Changelog

🆑
fix: greyscale colors will now update on the mob when modifying them via
the VV menu
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>

* Fixes greyscale colors not updating when changing their colors via VV, and fixes some issues with accessories

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-08-26 16:38:29 -04:00
committed by GitHub
co-authored by Ghom Bloop
parent a30d7e389c
commit 00a584184b
16 changed files with 61 additions and 27 deletions
+9 -4
View File
@@ -385,9 +385,10 @@
*
* Argument(s):
* * Optional - include_pockets (TRUE/FALSE), whether or not to include the pockets and suit storage in the returned list
* * Optional - include_accessories (TRUE/FALSE), whether or not to include the accessories in the returned list
*/
/mob/living/proc/get_equipped_items(include_pockets = FALSE)
/mob/living/proc/get_equipped_items(include_pockets = FALSE, include_accessories = FALSE)
var/list/items = list()
for(var/obj/item/item_contents in contents)
if(item_contents.item_flags & IN_INVENTORY)
@@ -400,17 +401,21 @@
*
* Argument(s):
* * Optional - include_pockets (TRUE/FALSE), whether or not to include the pockets and suit storage in the returned list
* * Optional - include_accessories (TRUE/FALSE), whether or not to include the accessories in the returned list
*/
/mob/living/carbon/human/get_equipped_items(include_pockets = FALSE)
/mob/living/carbon/human/get_equipped_items(include_pockets = FALSE, include_accessories = FALSE)
var/list/items = ..()
if(!include_pockets)
items -= list(l_store, r_store, s_store)
if(include_accessories && w_uniform)
var/obj/item/clothing/under/worn_under = w_uniform
items += worn_under.attached_accessories
return items
/mob/living/proc/unequip_everything()
var/list/items = list()
items |= get_equipped_items(TRUE)
items |= get_equipped_items(include_pockets = TRUE)
for(var/I in items)
dropItemToGround(I)
drop_all_held_items()
@@ -536,7 +541,7 @@
//GetAllContents that is reasonable and not stupid
/mob/living/carbon/proc/get_all_gear()
var/list/processing_list = get_equipped_items(include_pockets = TRUE) + held_items
var/list/processing_list = get_equipped_items(include_pockets = TRUE, include_accessories = TRUE) + held_items
list_clear_nulls(processing_list) // handles empty hands
var/i = 0
while(i < length(processing_list) )
+1 -1
View File
@@ -288,7 +288,7 @@
SSblackbox.record_feedback("amount", "gorillas_created", 1)
var/Itemlist = get_equipped_items(TRUE)
var/Itemlist = get_equipped_items(include_pockets = TRUE)
Itemlist += held_items
for(var/obj/item/W in Itemlist)
dropItemToGround(W, TRUE)