From a1c2fb2d57f9c4851bd545b35a998de81dfc692e Mon Sep 17 00:00:00 2001 From: Ben <91219575+Ben10083@users.noreply.github.com> Date: Tue, 30 Jan 2024 05:52:43 -0500 Subject: [PATCH] Chameleon Items TGUI (#18303) * Chameleon Gun UI * All other Uis * Changelog --------- Co-authored-by: Ben10083 --- code/modules/clothing/chameleon.dm | 54 ++++++++++++------- .../Ben10083 - Chameleon_Gun_UI.yml | 41 ++++++++++++++ 2 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 html/changelogs/Ben10083 - Chameleon_Gun_UI.yml diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 6711dd09675..fda82fa24bb 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -70,12 +70,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/under/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/under/chameleon/verb/change() set name = "Change Jumpsuit Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -110,12 +112,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/head/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/head/chameleon/verb/change() set name = "Change Hat/Helmet Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -148,12 +152,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/suit/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/suit/chameleon/verb/change() set name = "Change Oversuit Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -189,12 +195,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/shoes/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/shoes/chameleon/verb/change() set name = "Change Footwear Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -230,12 +238,14 @@ var/mob/M = src.loc M.update_inv_back() -/obj/item/storage/backpack/chameleon/verb/change(picked in clothing_choices) +/obj/item/storage/backpack/chameleon/verb/change() set name = "Change Backpack Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -274,12 +284,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/gloves/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/gloves/chameleon/verb/change() set name = "Change Gloves Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -311,12 +323,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/mask/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/mask/chameleon/verb/change() set name = "Change Mask Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -349,12 +363,14 @@ update_icon() update_clothing_icon() -/obj/item/clothing/glasses/chameleon/verb/change(picked in clothing_choices) +/obj/item/clothing/glasses/chameleon/verb/change() set name = "Change Glasses Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(clothing_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", clothing_choices) + + if(!picked) return disguise(clothing_choices[picked]) @@ -435,12 +451,14 @@ else copy_projectile = null -/obj/item/gun/energy/chameleon/verb/change(picked in gun_choices) +/obj/item/gun/energy/chameleon/verb/change() set name = "Change Gun Appearance" set category = "Chameleon Items" set src in usr - if(!ispath(gun_choices[picked])) + var/picked = tgui_input_list(usr, "Select disguise.", "Disguise", gun_choices) + + if(!picked) return disguise(gun_choices[picked]) diff --git a/html/changelogs/Ben10083 - Chameleon_Gun_UI.yml b/html/changelogs/Ben10083 - Chameleon_Gun_UI.yml new file mode 100644 index 00000000000..5ea4d226f74 --- /dev/null +++ b/html/changelogs/Ben10083 - Chameleon_Gun_UI.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Ben10083 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - refactor: "Chameleon items now use TGUI."