Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accessory removal menu is now radial #6274

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions code/modules/clothing/clothing_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,20 @@
return
var/obj/item/clothing/accessory/A
AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
26 changes: 21 additions & 5 deletions code/modules/mob/living/carbon/human/human_stripping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]]

AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
if(!istype(accessory))
return
sourcemob.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has had their accessory ([accessory]) removed by [key_name(user)]</font>")
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down
Loading