From c2a26c81e7ecb7b82f16a6aae84fcf7ef8235b28 Mon Sep 17 00:00:00 2001 From: AnturK Date: Tue, 8 Sep 2015 14:41:15 +0200 Subject: [PATCH] Adds Create Custom Outfit admin verb Sechud fix --- code/datums/outfit.dm | 17 +-- code/game/jobs/job/job.dm | 1 + code/modules/admin/admin_verbs.dm | 3 +- code/modules/admin/topic.dm | 29 +++- code/modules/admin/verbs/debug.dm | 13 +- code/modules/admin/verbs/randomverbs.dm | 178 ++++++++++++++++++++++++ 6 files changed, 222 insertions(+), 19 deletions(-) diff --git a/code/datums/outfit.dm b/code/datums/outfit.dm index 9ee454ce6f0..80da62ee49e 100644 --- a/code/datums/outfit.dm +++ b/code/datums/outfit.dm @@ -72,19 +72,4 @@ post_equip(H) - return 1 -//Example -/datum/outfit/test - name = "Test Outfit" - - uniform = /obj/item/clothing/under/color/grey - suit = /obj/item/clothing/suit/space - shoes = /obj/item/clothing/shoes/sneakers/black - head = /obj/item/clothing/head/helmet/space - back = /obj/item/weapon/storage/backpack - mask = /obj/item/clothing/mask/breath - backpack_contents = list(/obj/item/weapon/c4=5,/obj/item/weapon/kitchen/knife=1) - r_hand = /obj/item/weapon/c4 - -/datum/outfit/test/post_equip(mob/living/carbon/human/H) - H.say("I love bombs!") \ No newline at end of file + return 1 \ No newline at end of file diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 6ed57ced1d4..a7b0ab3ca3b 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -163,6 +163,7 @@ C.registered_name = H.real_name C.assignment = H.job C.update_label() + H.sec_hud_set_ID() var/obj/item/device/pda/PDA = H.get_item_by_slot(pda_slot) PDA.owner = H.real_name diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 82e0c143345..a52769f13f2 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -131,7 +131,8 @@ var/list/admin_verbs_debug = list( /proc/machine_upgrade, /client/proc/populate_world, /client/proc/cmd_display_del_log, - /client/proc/reset_latejoin_spawns + /client/proc/reset_latejoin_spawns, + /client/proc/create_outfits ) var/list/admin_verbs_possess = list( /proc/possess, diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 10ef2d85e33..d1275930c8c 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2109,4 +2109,31 @@ message_admins("[key_name_admin(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]") log_admin("[key_name(usr)] has kicked [afkonly ? "all AFK" : "all"] clients from the lobby. [length(listkicked)] clients kicked: [strkicked ? strkicked : "--"]") else - usr << "You may only use this when the game is running" \ No newline at end of file + usr << "You may only use this when the game is running" + + else if(href_list["create_outfit"]) + if(!check_rights(R_ADMIN)) + return + + var/datum/outfit/O = new /datum/outfit + //swap this for js dropdowns sometime + O.name = href_list["outfit_name"] + O.uniform = text2path(href_list["outfit_uniform"]) + O.shoes = text2path(href_list["outfit_shoes"]) + O.gloves = text2path(href_list["outfit_gloves"]) + O.suit = text2path(href_list["outfit_suit"]) + O.head = text2path(href_list["outfit_head"]) + O.back = text2path(href_list["outfit_back"]) + O.mask = text2path(href_list["outfit_mask"]) + O.glasses = text2path(href_list["outfit_glasses"]) + O.r_hand = text2path(href_list["outfit_r_hand"]) + O.l_hand = text2path(href_list["outfit_l_hand"]) + O.suit_store = text2path(href_list["outfit_s_store"]) + O.l_pocket = text2path(href_list["outfit_l_pocket"]) + O.r_pocket = text2path(href_list["outfit_r_pocket"]) + O.id = text2path(href_list["outfit_id"]) + O.belt = text2path(href_list["outfit_belt"]) + O.ears = text2path(href_list["outfit_ears"]) + + custom_outfits.Add(O) + message_admins("[key_name(usr)] created \"[O.name]\" outfit!") \ No newline at end of file diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 1c25137d533..4912c073fbf 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -627,7 +627,7 @@ var/global/list/g_fancy_list_of_types = null var/list/outfits = list("Naked","Custom","As Job...") - var/list/paths = typesof(/datum/outfit) - /datum/outfit + var/list/paths = typesof(/datum/outfit) - /datum/outfit - typesof(/datum/outfit/job) for(var/path in paths) var/datum/outfit/O = path //not much to initalize here but whatever outfits[initial(O.name)] = path @@ -645,6 +645,16 @@ var/global/list/g_fancy_list_of_types = null jobdatum = SSjob.GetJob(jobname) + var/datum/outfit/custom = null + if (dresscode == "Custom") + var/list/custom_names = list() + for(var/datum/outfit/D in custom_outfits) + custom_names[D.name] = D + var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in custom_names + custom = custom_names[selected_name] + if(isnull(custom)) + return + feedback_add_details("admin_verb","SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! for (var/obj/item/I in M) if (istype(I, /obj/item/weapon/implant)) @@ -655,6 +665,7 @@ var/global/list/g_fancy_list_of_types = null //do nothing if ("Custom") //use custom one + M.equipOutfit(custom) if ("As Job...") if(jobdatum) dresscode = jobdatum.title diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index e886190f079..6b1a1d37eb2 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -758,3 +758,181 @@ Traitors and the like can also be revived with the previous role mostly intact. log_admin("[key_name(usr)] removed latejoin spawnpoints.") message_admins("[key_name_admin(usr)] removed latejoin spawnpoints.") + + + + +var/list/datum/outfit/custom_outfits = list() //Admin created outfits + +/client/proc/create_outfits() + set category = "Debug" + set name = "Create Custom Outfit" + + if(!check_rights(R_DEBUG)) return + + holder.create_outfit() + +/datum/admins/proc/create_outfit() + var/list/uniforms = typesof(/obj/item/clothing/under) + var/list/suits = typesof(/obj/item/clothing/suit) + var/list/gloves = typesof(/obj/item/clothing/gloves) + var/list/shoes = typesof(/obj/item/clothing/shoes) + var/list/headwear = typesof(/obj/item/clothing/head) + var/list/glasses = typesof(/obj/item/clothing/glasses) + var/list/masks = typesof(/obj/item/clothing/mask) + var/list/ids = typesof(/obj/item/weapon/card/id) + + var/uniform_select = "" + + var/suit_select = "" + + var/gloves_select = "" + + var/shoes_select = "" + + var/head_select = "" + + var/glasses_select = "" + + var/mask_select = "" + + var/id_select = "" + + var/dat = {" + Create Outfit +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name: + +
Uniform: + [uniform_select] +
Suit: + [suit_select] +
Back: + +
Belt: + +
Gloves: + [gloves_select] +
Shoes: + [shoes_select] +
Head: + [head_select] +
Mask: + [mask_select] +
Ears: + +
Glasses: + [glasses_select] +
ID: + [id_select] +
Left Pocket: + +
Right Pocket: + +
Suit Store: + +
Right Hand: + +
Left Hand: + +
+
+ +
+ "} + usr << browse(dat, "window=dressup;size=550x600") \ No newline at end of file