Merge remote-tracking branch 'upstream/master' into TGUI_Updoot

This commit is contained in:
Artur
2020-09-02 19:05:18 +03:00
19 changed files with 116 additions and 96 deletions

View File

@@ -163,6 +163,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
)
var/custom_speech_verb = "default" //if your say_mod is to be something other than your races
var/custom_tongue = "default" //if your tongue is to be something other than your races
var/chosen_limb_id //body sprite selected to load for the users limbs, null means default, is sanitized when loaded
/// Security record note section
var/security_records
@@ -246,7 +247,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/// Which of the 5 persistent scar slots we randomly roll to load for this round, if enabled. Actually rolled in [/datum/preferences/proc/load_character(slot)]
var/scars_index = 1
var/chosen_limb_id //body sprite selected to load for the users limbs, null means default, is sanitized when loaded
var/hide_ckey = FALSE //pref for hiding if your ckey shows round-end or not
/datum/preferences/New(client/C)
parent = C
@@ -372,6 +373,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "[medical_records]"
else
dat += "[TextPreview(medical_records)]...<BR>"
dat += "<br><a href='?_src_=prefs;preference=hide_ckey;task=input'><b>Hide ckey: [hide_ckey ? "Enabled" : "Disabled"]</b></a><br>"
dat += "</tr></table>"
//Character Appearance
@@ -1448,6 +1450,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(!isnull(msg))
features["ooc_notes"] = msg
if("hide_ckey")
hide_ckey = !hide_ckey
if(user)
user.mind?.hide_ckey = hide_ckey
if("hair")
var/new_hair = input(user, "Choose your character's hair colour:", "Character Preference","#"+hair_color) as color|null
if(new_hair)

View File

@@ -515,7 +515,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["scars4"] >> scars_list["4"]
S["scars5"] >> scars_list["5"]
S["chosen_limb_id"] >> chosen_limb_id
S["hide_ckey"] >> hide_ckey //saved per-character
//Custom names
for(var/custom_name_id in GLOB.preferences_custom_names)
@@ -859,6 +859,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["joblessrole"] , joblessrole)
//Write prefs
WRITE_FILE(S["job_preferences"] , job_preferences)
WRITE_FILE(S["hide_ckey"] , hide_ckey)
//Quirks
WRITE_FILE(S["all_quirks"] , all_quirks)
@@ -874,6 +875,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["scars4"] , scars_list["4"])
WRITE_FILE(S["scars5"] , scars_list["5"])
//gear loadout
if(chosen_gear.len)
var/text_to_save = chosen_gear.Join("|")

View File

@@ -106,6 +106,7 @@
set_colour(new_colour)
. = ..()
AddComponent(/datum/component/footstep, FOOTSTEP_MOB_SLIME, 7.5)
set_nutrition(rand(650, 800))
/mob/living/simple_animal/slime/Destroy()
for (var/A in actions)

View File

@@ -50,6 +50,8 @@
var/datum/callback/CB = foo
CB.Invoke()
mind?.hide_ckey = client?.prefs?.hide_ckey
log_message("Client [key_name(src)] has taken ownership of mob [src]([src.type])", LOG_OWNERSHIP)
SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client)

View File

@@ -431,7 +431,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
/mob/living/getImplant(type)
return locate(type) in implants
/proc/offer_control(mob/M)
/proc/offer_control(mob/M,ignore_category=null)
to_chat(M, "Control of your mob has been offered to dead players.")
if(usr)
log_admin("[key_name(usr)] has offered control of ([key_name(M)]) to ghosts.")
@@ -445,7 +445,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
var/datum/antagonist/A = M.mind.has_antag_datum(/datum/antagonist/)
if(A)
poll_message = "[poll_message] Status:[A.name]."
var/list/mob/candidates = pollCandidatesForMob(poll_message, ROLE_PAI, null, FALSE, 100, M)
var/list/mob/candidates = pollCandidatesForMob(poll_message, ROLE_PAI, null, FALSE, 100, M, ignore_category)
if(LAZYLEN(candidates))
var/mob/C = pick(candidates)

View File

@@ -3,6 +3,7 @@
#ifdef UNIT_TESTS
#include "anchored_mobs.dm"
#include "character_saving.dm"
#include "component_tests.dm"
#include "reagent_id_typos.dm"
#include "reagent_recipe_collisions.dm"

View File

@@ -0,0 +1,14 @@
/datum/unit_test/character_saving/Run()
try
var/datum/preferences/P = new
P.load_path("test")
P.features["flavor_text"] = "Foo"
P.features["ooc_notes"] = "Bar"
P.save_character()
P.load_character()
if(P.features["flavor_text"] != "Foo")
Fail("Flavor text is failing to save.")
if(P.features["ooc_notes"] != "Bar")
Fail("OOC text is failing to save.")
catch(var/exception/e)
Fail("Failed to save and load character due to exception [e.name]")

View File

@@ -26,7 +26,12 @@
/obj/item/clothing/under/shorts/polychromic/pantsu = 3,
/obj/item/clothing/under/misc/poly_bottomless = 3,
/obj/item/clothing/under/misc/poly_tanktop = 3,
/obj/item/clothing/under/misc/poly_tanktop/female = 3
/obj/item/clothing/under/misc/poly_tanktop/female = 3,
/obj/item/autosurgeon/penis = 3,
/obj/item/autosurgeon/testicles = 3,
/obj/item/storage/pill_bottle/penis_enlargement = 5,
/obj/item/storage/pill_bottle/breast_enlargement = 5,
/obj/item/storage/daki = 4
)
contraband = list(
/obj/item/clothing/neck/petcollar/locked = 2,