From 95cc0e9ae65e233e17be834c3583c7b689f1e4fe Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Fri, 10 May 2024 20:32:59 +0300
Subject: [PATCH 1/7] q
---
code/modules/clothing/clothing_accessories.dm | 17 ++++++++----
.../living/carbon/human/human_stripping.dm | 26 +++++++++++++++----
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index a07e83db7381..2111a652fc77 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -132,13 +132,20 @@
return
var/obj/item/clothing/accessory/A
var/list/removables = list()
+ var/list/choice_to_accessory = list()
for(var/obj/item/clothing/accessory/ass in accessories)
- if(ass.removable)
- removables |= ass
- if(LAZYLEN(accessories) > 1)
- A = tgui_input_list(usr, "Select an accessory to remove from [src]", "Remove accessory", removables)
+ if(!ass.removable)
+ continue
+ var/capitalized_name = capitalize_first_letters(ass.name)
+ removables[capitalized_name] = image(icon = ass.icon, icon_state = ass.icon_state)
+ choice_to_accessory[capitalized_name] = ass
+
+ if(LAZYLEN(removables) > 1)
+ var/use_radials = usr.client.prefs?.no_radials_preference ? FALSE : TRUE
+ var/choice = use_radials ? show_radial_menu(usr, src, removables, require_near = TRUE) : tgui_input_list(usr, "Select an accessory to remove from [src]", "Remove accessory", removables)
+ A = choice_to_accessory[choice]
else
- A = LAZYACCESS(accessories, 1)
+ A = choice_to_accessory[removables[1]]
if(!usr.Adjacent(src))
to_chat(usr, SPAN_WARNING("You're too far away!"))
return
diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm
index e346a0a7368b..84299b2f02ae 100644
--- a/code/modules/mob/living/carbon/human/human_stripping.dm
+++ b/code/modules/mob/living/carbon/human/human_stripping.dm
@@ -131,9 +131,25 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
var/obj/item/clothing/under/uniform = sourcemob.w_uniform
if(!LAZYLEN(uniform.accessories))
return FALSE
- var/obj/item/clothing/accessory/accessory = LAZYACCESS(uniform.accessories, 1)
+
+ var/obj/item/clothing/accessory/accessory
+ var/list/removables = list()
+ var/list/choice_to_accessory = list()
+
+ for(var/obj/item/clothing/accessory/acc in uniform.accessories)
+ if(!acc.removable)
+ continue
+ var/capitalized_name = capitalize_first_letters(acc.name)
+ removables[capitalized_name] = image(icon = acc.icon, icon_state = acc.icon_state)
+ choice_to_accessory[capitalized_name] = acc
+
if(LAZYLEN(uniform.accessories) > 1)
- accessory = tgui_input_list(user, "Select an accessory to remove from [uniform]", "Remove accessory", uniform.accessories)
+ var/use_radials = usr.client.prefs?.no_radials_preference ? FALSE : TRUE
+ var/choice = use_radials ? show_radial_menu(user, source, removables, require_near = TRUE) : tgui_input_list(user, "Select an accessory to remove from [src]", "Remove accessory", removables)
+ accessory = choice_to_accessory[choice]
+ else
+ accessory = choice_to_accessory[removables[1]]
+
if(!istype(accessory))
return
sourcemob.attack_log += text("\[[time_stamp()]\] Has had their accessory ([accessory]) removed by [key_name(user)]")
@@ -231,11 +247,11 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
if(tag.dogtag_taken)
to_chat(user, SPAN_WARNING("Someone's already taken [sourcemob]'s information tag."))
return
-
+
if(sourcemob.stat != DEAD)
to_chat(user, SPAN_WARNING("You can't take a dogtag's information tag while its owner is alive."))
return
-
+
to_chat(user, SPAN_NOTICE("You take [sourcemob]'s information tag, leaving the ID tag"))
tag.dogtag_taken = TRUE
tag.icon_state = "dogtag_taken"
@@ -244,7 +260,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
newtag.fallen_assgns = list(tag.assignment)
newtag.fallen_blood_types = list(tag.blood_type)
user.put_in_hands(newtag)
-
+
/datum/strippable_item/mob_item_slot/belt
From 793d8d686490c870efd69c1e1e6387ff4fd39504 Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Fri, 10 May 2024 22:47:39 +0300
Subject: [PATCH 2/7] Update human_stripping.dm
---
code/modules/mob/living/carbon/human/human_stripping.dm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm
index 84299b2f02ae..79a7f6c9ea5b 100644
--- a/code/modules/mob/living/carbon/human/human_stripping.dm
+++ b/code/modules/mob/living/carbon/human/human_stripping.dm
@@ -152,6 +152,11 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
if(!istype(accessory))
return
+
+ if(!user.Adjacent(sourcemob))
+ to_chat(user, SPAN_WARNING("You're too far away!"))
+ return
+
sourcemob.attack_log += text("\[[time_stamp()]\] Has had their accessory ([accessory]) removed by [key_name(user)]")
user.attack_log += text("\[[time_stamp()]\] Attempted to remove [key_name(sourcemob)]'s' accessory ([accessory])")
if(istype(accessory, /obj/item/clothing/accessory/holobadge) || istype(accessory, /obj/item/clothing/accessory/medal))
From 01b1908d773b7c86d17bed71331e142fcc28697b Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Wed, 15 May 2024 21:20:48 +0300
Subject: [PATCH 3/7] ???
---
code/modules/clothing/clothing_accessories.dm | 30 +++++++++++--------
.../living/carbon/human/human_stripping.dm | 27 +----------------
2 files changed, 18 insertions(+), 39 deletions(-)
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index 2111a652fc77..2ad07c6df1ae 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -124,13 +124,19 @@
set name = "Remove Accessory"
set category = "Object"
set src in usr
- if(!isliving(usr))
+
+ remove_accessory(usr, pick_accessory_to_remove(usr, usr))
+ if(!LAZYLEN(accessories))
+ verbs -= /obj/item/clothing/proc/removetie_verb
+
+/obj/item/clothing/proc/pick_accessory_to_remove(mob/user, mob/targetmob)
+ if(!isliving(user))
return
- if(usr.stat)
+ if(user.stat)
return
if(!LAZYLEN(accessories))
return
- var/obj/item/clothing/accessory/A
+ var/obj/item/clothing/accessory/accessory
var/list/removables = list()
var/list/choice_to_accessory = list()
for(var/obj/item/clothing/accessory/ass in accessories)
@@ -141,18 +147,16 @@
choice_to_accessory[capitalized_name] = ass
if(LAZYLEN(removables) > 1)
- var/use_radials = usr.client.prefs?.no_radials_preference ? FALSE : TRUE
- var/choice = use_radials ? show_radial_menu(usr, src, removables, require_near = TRUE) : tgui_input_list(usr, "Select an accessory to remove from [src]", "Remove accessory", removables)
- A = choice_to_accessory[choice]
+ var/use_radials = user.client.prefs?.no_radials_preference ? FALSE : TRUE
+ var/choice = use_radials ? show_radial_menu(user, targetmob, removables, require_near = FALSE) : tgui_input_list(user, "Select an accessory to remove from [src]", "Remove accessory", removables)
+ accessory = choice_to_accessory[choice]
else
- A = choice_to_accessory[removables[1]]
- if(!usr.Adjacent(src))
- to_chat(usr, SPAN_WARNING("You're too far away!"))
+ accessory = choice_to_accessory[removables[1]]
+ if(!user.Adjacent(src))
+ to_chat(user, SPAN_WARNING("You're too far away!"))
return
- src.remove_accessory(usr,A)
- removables -= A
- if(!removables.len)
- verbs -= /obj/item/clothing/proc/removetie_verb
+
+ return accessory
/obj/item/clothing/emp_act(severity)
. = ..()
diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm
index 79a7f6c9ea5b..12e17917978e 100644
--- a/code/modules/mob/living/carbon/human/human_stripping.dm
+++ b/code/modules/mob/living/carbon/human/human_stripping.dm
@@ -129,33 +129,8 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
return
var/obj/item/clothing/under/uniform = sourcemob.w_uniform
- if(!LAZYLEN(uniform.accessories))
- return FALSE
-
- var/obj/item/clothing/accessory/accessory
- var/list/removables = list()
- var/list/choice_to_accessory = list()
-
- for(var/obj/item/clothing/accessory/acc in uniform.accessories)
- if(!acc.removable)
- continue
- var/capitalized_name = capitalize_first_letters(acc.name)
- removables[capitalized_name] = image(icon = acc.icon, icon_state = acc.icon_state)
- choice_to_accessory[capitalized_name] = acc
-
- if(LAZYLEN(uniform.accessories) > 1)
- var/use_radials = usr.client.prefs?.no_radials_preference ? FALSE : TRUE
- var/choice = use_radials ? show_radial_menu(user, source, removables, require_near = TRUE) : tgui_input_list(user, "Select an accessory to remove from [src]", "Remove accessory", removables)
- accessory = choice_to_accessory[choice]
- else
- accessory = choice_to_accessory[removables[1]]
-
- if(!istype(accessory))
- return
- if(!user.Adjacent(sourcemob))
- to_chat(user, SPAN_WARNING("You're too far away!"))
- return
+ var/obj/item/clothing/accessory/accessory = uniform.pick_accessory_to_remove(user, sourcemob)
sourcemob.attack_log += text("\[[time_stamp()]\] Has had their accessory ([accessory]) removed by [key_name(user)]")
user.attack_log += text("\[[time_stamp()]\] Attempted to remove [key_name(sourcemob)]'s' accessory ([accessory])")
From a9a287d728946aeb41fcf18ed505d33e591a1832 Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Tue, 28 May 2024 16:29:51 +0300
Subject: [PATCH 4/7] review1
---
code/modules/mob/living/carbon/human/human_stripping.dm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/code/modules/mob/living/carbon/human/human_stripping.dm b/code/modules/mob/living/carbon/human/human_stripping.dm
index 12e17917978e..210e5f266fe0 100644
--- a/code/modules/mob/living/carbon/human/human_stripping.dm
+++ b/code/modules/mob/living/carbon/human/human_stripping.dm
@@ -132,6 +132,9 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
var/obj/item/clothing/accessory/accessory = uniform.pick_accessory_to_remove(user, sourcemob)
+ if(!accessory)
+ return
+
sourcemob.attack_log += text("\[[time_stamp()]\] Has had their accessory ([accessory]) removed by [key_name(user)]")
user.attack_log += text("\[[time_stamp()]\] Attempted to remove [key_name(sourcemob)]'s' accessory ([accessory])")
if(istype(accessory, /obj/item/clothing/accessory/holobadge) || istype(accessory, /obj/item/clothing/accessory/medal))
From d03bb8f523820ff009d785552838d1aef3ac3905 Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Tue, 28 May 2024 16:33:25 +0300
Subject: [PATCH 5/7] review 2
---
code/modules/clothing/clothing_accessories.dm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index 2ad07c6df1ae..d1026e0f685a 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -126,8 +126,6 @@
set src in usr
remove_accessory(usr, pick_accessory_to_remove(usr, usr))
- if(!LAZYLEN(accessories))
- verbs -= /obj/item/clothing/proc/removetie_verb
/obj/item/clothing/proc/pick_accessory_to_remove(mob/user, mob/targetmob)
if(!isliving(user))
@@ -156,6 +154,9 @@
to_chat(user, SPAN_WARNING("You're too far away!"))
return
+ if(!LAZYLEN(removables))
+ verbs -= /obj/item/clothing/proc/removetie_verb
+
return accessory
/obj/item/clothing/emp_act(severity)
From 3d0eab540c5a3e412244ed6f9c68a1443b7a8bd2 Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Fri, 31 May 2024 17:57:57 +0300
Subject: [PATCH 6/7] Update clothing_accessories.dm
---
code/modules/clothing/clothing_accessories.dm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index d1026e0f685a..f4d6cc62a916 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -118,6 +118,14 @@
A.on_removed(user, src)
LAZYREMOVE(accessories, A)
+ var/list/removables = list()
+ for(var/obj/item/clothing/accessory/accessory in accessories)
+ if(accessory.removable)
+ removables += accessory
+
+ if(!LAZYLEN(removables))
+ verbs -= /obj/item/clothing/proc/removetie_verb
+
update_clothing_icon()
/obj/item/clothing/proc/removetie_verb()
@@ -154,9 +162,6 @@
to_chat(user, SPAN_WARNING("You're too far away!"))
return
- if(!LAZYLEN(removables))
- verbs -= /obj/item/clothing/proc/removetie_verb
-
return accessory
/obj/item/clothing/emp_act(severity)
From 1312e32c88cd11dacd920a2e0d65ed7e68ed51f1 Mon Sep 17 00:00:00 2001
From: Drathek <76988376+Drulikar@users.noreply.github.com>
Date: Mon, 3 Jun 2024 09:43:11 -0700
Subject: [PATCH 7/7] Update code/modules/clothing/clothing_accessories.dm
---
code/modules/clothing/clothing_accessories.dm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm
index f4d6cc62a916..9c253fcb0371 100644
--- a/code/modules/clothing/clothing_accessories.dm
+++ b/code/modules/clothing/clothing_accessories.dm
@@ -118,12 +118,13 @@
A.on_removed(user, src)
LAZYREMOVE(accessories, A)
- var/list/removables = list()
+
+ var/any_removable = FALSE
for(var/obj/item/clothing/accessory/accessory in accessories)
if(accessory.removable)
- removables += accessory
-
- if(!LAZYLEN(removables))
+ any_removable = TRUE
+ break
+ if(!any_removable)
verbs -= /obj/item/clothing/proc/removetie_verb
update_clothing_icon()