More outfit improvements

This commit is contained in:
Mark van Alphen
2019-06-09 22:47:47 +02:00
parent f2e32dad07
commit 3728e5efe4
6 changed files with 40 additions and 23 deletions
+1 -1
View File
@@ -1280,7 +1280,7 @@
src.debug_variables(DAT)
if(href_list["copyoutfit"])
if(!check_rights(R_SPAWN))
if(!check_rights(R_EVENT))
return
var/mob/living/carbon/human/H = locateUID(href_list["copyoutfit"])
if(istype(H))
+9 -9
View File
@@ -179,14 +179,14 @@
/datum/outfit/proc/save_to_file(mob/admin)
var/stored_data = get_json_data()
var/json = json_encode(stored_data)
//Kinda annoying but as far as i can tell you need to make actual file.
// Kinda annoying but as far as I can tell you need to make actual file.
var/f = file("data/TempOutfitUpload")
fdel(f)
WRITE_FILE(f, json)
admin << ftp(f, "[name].json")
/datum/outfit/proc/load_from(list/outfit_data)
//This could probably use more strict validation
// This could probably use more strict validation.
name = outfit_data["name"]
uniform = text2path(outfit_data["uniform"])
suit = text2path(outfit_data["suit"])
@@ -200,13 +200,13 @@
r_ear = text2path(outfit_data["r_ear"])
glasses = text2path(outfit_data["glasses"])
id = text2path(outfit_data["id"])
pda = text2path(outfit_data["pda"])
l_pocket = text2path(outfit_data["l_pocket"])
r_pocket = text2path(outfit_data["r_pocket"])
suit_store = text2path(outfit_data["suit_store"])
r_hand = text2path(outfit_data["r_hand"])
l_hand = text2path(outfit_data["l_hand"])
pda = text2path(outfit_data["pda"])
internals_slot = outfit_data["internals_slot"]
internals_slot = text2path(outfit_data["internals_slot"])
var/list/backpack = outfit_data["backpack_contents"]
backpack_contents = list()
@@ -226,16 +226,16 @@
var/list/cybernetic_impl = outfit_data["cybernetic_implants"]
cybernetic_implants = list()
for(var/I in cybernetic_impl)
var/imptype = text2path(I)
if(imptype)
cybernetic_implants += cybernetic_impl
var/cybtype = text2path(I)
if(cybtype)
cybernetic_implants += cybtype
var/list/accessories = outfit_data["accessories"]
accessories = list()
for(var/A in accessories)
var/accessorytype = text2path(A)
if(accessorytype)
accessories += A
accessories += accessorytype
return TRUE
@@ -255,12 +255,12 @@
.["r_ear"] = r_ear
.["glasses"] = glasses
.["id"] = id
.["pda"] = pda
.["l_pocket"] = l_pocket
.["r_pocket"] = r_pocket
.["suit_store"] = suit_store
.["r_hand"] = r_hand
.["l_hand"] = l_hand
.["pda"] = pda
.["internals_slot"] = internals_slot
.["backpack_contents"] = backpack_contents
.["box"] = box
+2
View File
@@ -35,6 +35,8 @@
glasses = item_path
if(slot_wear_id)
id = item_path
if(slot_wear_pda)
pda = item_path
if(slot_s_store)
suit_store = item_path
if(slot_l_store)
+14 -1
View File
@@ -4,7 +4,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
set category = "Debug"
set name = "Outfit Manager"
if(!check_rights(R_DEBUG))
if(!check_rights(R_EVENT))
return
holder.outfit_manager(usr)
@@ -59,6 +59,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
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/pdas = typesof(/obj/item/pda)
var/list/ids = typesof(/obj/item/card/id)
var/uniform_select = "<select name=\"outfit_uniform\"><option value=\"\">None</option>"
@@ -101,6 +102,11 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
id_select += "<option value=\"[path]\">[path]</option>"
id_select += "</select>"
var/pda_select = "<select name=\"outfit_id\"><option value=\"\">None</option>"
for(var/path in pdas)
pda_select += "<option value=\"[path]\">[path]</option>"
pda_select += "</select>"
var/dat = {"
<html><head><title>Create Outfit</title></head><body>
<form name="outfit" action="byond://?src=[UID()];" method="get">
@@ -185,6 +191,12 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
[id_select]
</td>
</tr>
<tr>
<th>PDA:</th>
<td>
[pda_select]
</td>
</tr>
<tr>
<th>Left Pocket:</th>
<td>
@@ -241,6 +253,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits
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.pda = text2path(href_list["outfit_pda"])
O.belt = text2path(href_list["outfit_belt"])
O.l_ear = text2path(href_list["outfit_l_ear"])
O.r_ear = text2path(href_list["outfit_r_ear"])
+5 -5
View File
@@ -3373,24 +3373,24 @@
log_admin("[key_name_admin(usr)] forcefully unlinked the discord account belonging to [target_ckey]")
else if(href_list["create_outfit_finalize"])
if(!check_rights(R_ADMIN))
if(!check_rights(R_EVENT))
return
create_outfit_finalize(usr,href_list)
else if(href_list["load_outfit"])
if(!check_rights(R_ADMIN))
if(!check_rights(R_EVENT))
return
load_outfit(usr)
else if(href_list["create_outfit_menu"])
if(!check_rights(R_ADMIN))
if(!check_rights(R_EVENT))
return
create_outfit(usr)
else if(href_list["delete_outfit"])
if(!check_rights(R_ADMIN))
if(!check_rights(R_EVENT))
return
var/datum/outfit/O = locate(href_list["chosen_outfit"]) in GLOB.custom_outfits
delete_outfit(usr,O)
else if(href_list["save_outfit"])
if(!check_rights(R_ADMIN))
if(!check_rights(R_EVENT))
return
var/datum/outfit/O = locate(href_list["chosen_outfit"]) in GLOB.custom_outfits
save_outfit(usr,O)
+9 -7
View File
@@ -625,19 +625,20 @@ BLIND // can't see anything
/obj/item/clothing/under/proc/can_attach_accessory(obj/item/clothing/accessory/A)
if(istype(A))
. = 1
. = TRUE
else
return 0
return FALSE
if(accessories.len)
for(var/obj/item/clothing/accessory/AC in accessories)
if((A.slot in list(ACCESSORY_SLOT_UTILITY, ACCESSORY_SLOT_ARMBAND)) && AC.slot == A.slot)
return 0
return FALSE
if(!A.allow_duplicates && AC.type == A.type)
return 0
return FALSE
/obj/item/clothing/under/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clothing/accessory))
attach_accessory(I, user)
attach_accessory(I, user, TRUE)
if(accessories.len)
for(var/obj/item/clothing/accessory/A in accessories)
@@ -646,10 +647,11 @@ BLIND // can't see anything
. = ..()
/obj/item/clothing/under/proc/attach_accessory(obj/item/clothing/accessory/A, mob/user)
/obj/item/clothing/under/proc/attach_accessory(obj/item/clothing/accessory/A, mob/user, unequip = FALSE)
if(can_attach_accessory(A))
if(!user.unEquip(A)) // Make absolutely sure this accessory is removed from hands
if(check_unequip && !user.unEquip(A)) // Make absolutely sure this accessory is removed from hands
return FALSE
accessories += A
A.on_attached(src, user)