From ee6969bcaccdf880c4533caa80810328a84d270b Mon Sep 17 00:00:00 2001 From: Matt <116982774+Burzah@users.noreply.github.com> Date: Thu, 30 May 2024 16:02:49 +0000 Subject: [PATCH] Animalize tgui (#25455) --- code/modules/admin/topic.dm | 5 +++-- code/modules/mob/transform_procs.dm | 13 ++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index ba2d9b6432e..63395600f6b 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1567,13 +1567,14 @@ usr.client.cmd_admin_robotize(H) else if(href_list["makeanimal"]) - if(!check_rights(R_SPAWN)) return + if(!check_rights(R_SPAWN)) + return var/mob/M = locateUID(href_list["makeanimal"]) if(isnewplayer(M)) to_chat(usr, "This cannot be used on instances of type /mob/new_player") return - if(alert(usr, "Confirm make animal?", null, "Yes", "No") != "Yes") + if(tgui_alert(usr, "Confirm make animal?", "Confirm Choice", list("Yes", "No")) != "Yes") return usr.client.cmd_admin_animalize(M) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index f5529fab46e..ed96ca9e34c 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -203,7 +203,10 @@ /mob/living/carbon/human/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) - var/mobpath = input("Which type of mob should [src] turn into?", "Choose a type") in mobtypes + var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a Type", mobtypes) + + if(!mobpath) + return if(notransform) return @@ -222,8 +225,6 @@ new_mob.key = key new_mob.a_intent = INTENT_HARM - - to_chat(new_mob, "You suddenly feel more... animalistic.") new_mob.update_pipe_vision() qdel(src) @@ -231,7 +232,10 @@ /mob/proc/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) - var/mobpath = input("Which type of mob should [src] turn into?", "Choose a type") in mobtypes + var/mobpath = tgui_input_list(usr, "Which type of mob should [src] turn into?", "Choose a Type", mobtypes) + + if(!mobpath) + return var/mob/new_mob = new mobpath(src.loc) @@ -239,7 +243,6 @@ new_mob.a_intent = INTENT_HARM to_chat(new_mob, "You feel more... animalistic") new_mob.update_pipe_vision() - qdel(src)