From 0fbd27fcfb8ef9723d57d8b57ad0eb55cdba63f5 Mon Sep 17 00:00:00 2001 From: Detective Google <48196179+Detective-Google@users.noreply.github.com> Date: Fri, 21 Aug 2020 14:57:11 -0500 Subject: [PATCH] reskin_obj is now a radial --- code/game/objects/objs.dm | 24 +++++++++++++----------- code/modules/clothing/suits/armor.dm | 4 +++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 79dd13b0ae..a9ee06b450 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -304,18 +304,20 @@ /obj/proc/reskin_obj(mob/M) if(!LAZYLEN(unique_reskin)) return - var/dat = "Reskin options for [name]:\n" - for(var/V in unique_reskin) - var/output = icon2html(src, M, unique_reskin[V]) - dat += "[V]: [output]\n" - to_chat(M, dat) - - var/choice = input(M, always_reskinnable ? "Choose the a reskin for [src]" : "Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin - if(QDELETED(src) || !choice || (current_skin && !always_reskinnable) || M.incapacitated() || !in_range(M,src) || !unique_reskin[choice] || unique_reskin[choice] == current_skin) - return - current_skin = choice + var/list/skins = list() + for(var/S in unique_reskin) + skins[S] = image(icon = icon, icon_state = unique_reskin[S]) + var/choice = show_radial_menu(M, src, skins, custom_check = CALLBACK(src, .proc/check_skinnable, M), radius = 40, require_near = TRUE) + if(!choice) + return FALSE icon_state = unique_reskin[choice] - to_chat(M, "[src] is now skinned as '[choice]'.") + current_skin = choice + return + +/obj/proc/check_skinnable(/mob/M) + if(current_skin) + return FALSE + return TRUE //Called when the object is constructed by an autolathe //Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index cf7dbc7462..6732f1c86c 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -80,7 +80,9 @@ item_state = "hostrench" flags_inv = 0 strip_delay = 80 - unique_reskin = list("Coat" = "hostrench", "Cloak" = "trenchcloak") + unique_reskin = list("Coat" = "hostrench", + "Cloak" = "trenchcloak" + ) /obj/item/clothing/suit/armor/vest/warden name = "warden's jacket"