This commit is contained in:
SandPoot
2023-01-31 16:40:17 -03:00
parent 2d5e163916
commit ed06e686e1
29 changed files with 759 additions and 14 deletions

View File

@@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/UI_style = null
var/outline_enabled = TRUE
var/outline_color = COLOR_THEME_MIDNIGHT
var/screentip_pref = TRUE
var/screentip_pref = SCREENTIP_PREFERENCE_ENABLED
var/screentip_color = "#ffd391"
var/buttons_locked = FALSE
var/hotkeys = FALSE
@@ -2913,7 +2913,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(pickedOutlineColor != pickedOutlineColor)
outline_color = pickedOutlineColor // nullable
if("screentip_pref")
screentip_pref = !screentip_pref
var/choice = tgalert(user, "Choose your screentip preference", "Screentipping?", "Yes", "Context Only", "No")
switch(choice)
if("Yes")
screentip_pref = SCREENTIP_PREFERENCE_ENABLED
if("Context Only")
screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY
else
screentip_pref = SCREENTIP_PREFERENCE_DISABLED
if("screentip_color")
var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null
if(pickedScreentipColor)

View File

@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 56
#define SAVEFILE_VERSION_MAX 57
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -56,6 +56,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
be_special -= "NO_ANTAGS"
for(var/be_special_type in be_special)
be_special[be_special_type] = 1
if(current_version < 57)
if(screentip_pref)
screentip_pref = SCREENTIP_PREFERENCE_ENABLED
else
// Let's give it a little chance okay, change if you don't like still.
screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY
/datum/preferences/proc/update_character(current_version, savefile/S)
if(current_version < 19)

View File

@@ -8,6 +8,7 @@
GLOB.carbon_list += src
blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio)
add_movespeed_modifier(/datum/movespeed_modifier/carbon_crawling)
register_context()
/mob/living/carbon/Destroy()
//This must be done first, so the mob ghosts correctly before DNA etc is nulled

View File

@@ -0,0 +1,50 @@
/mob/living/carbon/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if (!isnull(held_item))
return .
if (!ishuman(user))
return .
var/combat_mode = SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE)
switch(user.a_intent)
if(INTENT_HELP)
if(user == src)
context[SCREENTIP_CONTEXT_LMB] = "Check injuries"
else if(!lying)
context[SCREENTIP_CONTEXT_LMB] = "Comfort"
else if (health >= 0 && !HAS_TRAIT(src, TRAIT_FAKEDEATH))
context[SCREENTIP_CONTEXT_LMB] = "Shake"
else
context[SCREENTIP_CONTEXT_LMB] = "CPR"
if(INTENT_DISARM)
context[SCREENTIP_CONTEXT_LMB] = "Disarm"
if(combat_mode)
context[SCREENTIP_CONTEXT_RMB] = "Shove"
if(INTENT_GRAB)
if(src != user)
if (pulledby == user)
switch (user.grab_state)
if (GRAB_PASSIVE)
context[SCREENTIP_CONTEXT_LMB] = "Grip"
if (GRAB_AGGRESSIVE)
context[SCREENTIP_CONTEXT_LMB] = "Choke"
if (GRAB_NECK)
context[SCREENTIP_CONTEXT_LMB] = "Strangle"
else
return .
else
context[SCREENTIP_CONTEXT_LMB] = "Pull"
if(INTENT_HARM)
context[SCREENTIP_CONTEXT_LMB] = "Attack"
// Did you know we cannot upgrade grabs from ctrl-click, that's cool
if(pulledby != user)
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Pull"
// Happens on any intent i believe
if((user == src) && combat_mode && lying)
context[SCREENTIP_CONTEXT_RMB] = "Force to get up"
return CONTEXTUAL_SCREENTIP_SET

View File

@@ -0,0 +1,12 @@
/* // Nothing unique, yet.
/mob/living/carbon/human/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if (!ishuman(user))
return .
if (user == src)
return .
return CONTEXTUAL_SCREENTIP_SET
*/

View File

@@ -3,6 +3,8 @@
return
/mob/living/carbon/get_bodypart(zone)
RETURN_TYPE(/obj/item/bodypart)
if(!zone)
zone = BODY_ZONE_CHEST
for(var/X in bodyparts)