update_appearance
This commit is contained in:
@@ -83,3 +83,19 @@
|
|||||||
#define COMBAT_MODE_ACTIVE (1<<1)
|
#define COMBAT_MODE_ACTIVE (1<<1)
|
||||||
/// combat mode is not active
|
/// combat mode is not active
|
||||||
#define COMBAT_MODE_INACTIVE (1<<2)
|
#define COMBAT_MODE_INACTIVE (1<<2)
|
||||||
|
|
||||||
|
// Update flags for [/atom/proc/update_appearance]
|
||||||
|
/// Update the atom's name
|
||||||
|
#define UPDATE_NAME (1<<0)
|
||||||
|
/// Update the atom's desc
|
||||||
|
#define UPDATE_DESC (1<<1)
|
||||||
|
/// Update the atom's icon state
|
||||||
|
#define UPDATE_ICON_STATE (1<<2)
|
||||||
|
/// Update the atom's overlays
|
||||||
|
#define UPDATE_OVERLAYS (1<<3)
|
||||||
|
/// Update the atom's greyscaling
|
||||||
|
#define UPDATE_GREYSCALE (1<<4)
|
||||||
|
/// Update the atom's smoothing. (More accurately, queue it for an update)
|
||||||
|
#define UPDATE_SMOOTHING (1<<5)
|
||||||
|
/// Update the atom's icon
|
||||||
|
#define UPDATE_ICON (UPDATE_ICON_STATE|UPDATE_OVERLAYS)
|
||||||
|
|||||||
@@ -74,11 +74,30 @@
|
|||||||
#define EXAMINE_POSITION_BEFORE (1<<1)
|
#define EXAMINE_POSITION_BEFORE (1<<1)
|
||||||
//End positions
|
//End positions
|
||||||
#define COMPONENT_EXNAME_CHANGED (1<<0)
|
#define COMPONENT_EXNAME_CHANGED (1<<0)
|
||||||
#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon" //from base of atom/update_icon(): ()
|
///from base of [/atom/proc/update_appearance]: (updates)
|
||||||
#define COMSIG_ATOM_NO_UPDATE_ICON_STATE 1
|
#define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance"
|
||||||
#define COMSIG_ATOM_NO_UPDATE_OVERLAYS 2
|
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its name.
|
||||||
#define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays" //from base of atom/update_overlays(): (list/new_overlays)
|
#define COMSIG_ATOM_NO_UPDATE_NAME UPDATE_NAME
|
||||||
#define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon" //from base of atom/update_icon(): (signalOut, did_anything)
|
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its desc.
|
||||||
|
#define COMSIG_ATOM_NO_UPDATE_DESC UPDATE_DESC
|
||||||
|
/// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its icon.
|
||||||
|
#define COMSIG_ATOM_NO_UPDATE_ICON UPDATE_ICON
|
||||||
|
///from base of [/atom/proc/update_name]: (updates)
|
||||||
|
#define COMSIG_ATOM_UPDATE_NAME "atom_update_name"
|
||||||
|
///from base of [/atom/proc/update_desc]: (updates)
|
||||||
|
#define COMSIG_ATOM_UPDATE_DESC "atom_update_desc"
|
||||||
|
///from base of [/atom/update_icon]: ()
|
||||||
|
#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon"
|
||||||
|
/// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its icon state.
|
||||||
|
#define COMSIG_ATOM_NO_UPDATE_ICON_STATE UPDATE_ICON_STATE
|
||||||
|
/// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its overlays.
|
||||||
|
#define COMSIG_ATOM_NO_UPDATE_OVERLAYS UPDATE_OVERLAYS
|
||||||
|
///from base of [atom/update_icon_state]: ()
|
||||||
|
#define COMSIG_ATOM_UPDATE_ICON_STATE "atom_update_icon_state"
|
||||||
|
///from base of [/atom/update_overlays]: (list/new_overlays)
|
||||||
|
#define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays"
|
||||||
|
///from base of [/atom/update_icon]: (signalOut, did_anything)
|
||||||
|
#define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon"
|
||||||
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable/entering, /atom)
|
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable/entering, /atom)
|
||||||
#define COMSIG_ATOM_EXIT "atom_exit" //from base of atom/Exit(): (/atom/movable/exiting, /atom/newloc)
|
#define COMSIG_ATOM_EXIT "atom_exit" //from base of atom/Exit(): (/atom/movable/exiting, /atom/newloc)
|
||||||
#define COMPONENT_ATOM_BLOCK_EXIT 1
|
#define COMPONENT_ATOM_BLOCK_EXIT 1
|
||||||
@@ -361,6 +380,10 @@
|
|||||||
|
|
||||||
// /machinery signals
|
// /machinery signals
|
||||||
#define COMSIG_MACHINE_EJECT_OCCUPANT "eject_occupant" //from base of obj/machinery/dropContents() (occupant)
|
#define COMSIG_MACHINE_EJECT_OCCUPANT "eject_occupant" //from base of obj/machinery/dropContents() (occupant)
|
||||||
|
///from base power_change() when power is lost
|
||||||
|
#define COMSIG_MACHINERY_POWER_LOST "machinery_power_lost"
|
||||||
|
///from base power_change() when power is restored
|
||||||
|
#define COMSIG_MACHINERY_POWER_RESTORED "machinery_power_restored"
|
||||||
|
|
||||||
// /obj/item signals
|
// /obj/item signals
|
||||||
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
|
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
|
||||||
|
|||||||
+49
-11
@@ -531,37 +531,75 @@
|
|||||||
if(!LAZYLEN(.)) // lol ..length
|
if(!LAZYLEN(.)) // lol ..length
|
||||||
return list("<span class='notice'><i>You examine [src] closer, but find nothing of interest...</i></span>")
|
return list("<span class='notice'><i>You examine [src] closer, but find nothing of interest...</i></span>")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the appearence of the icon
|
||||||
|
*
|
||||||
|
* Mostly delegates to update_name, update_desc, and update_icon
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* - updates: A set of bitflags dictating what should be updated. Defaults to [ALL]
|
||||||
|
*/
|
||||||
|
/atom/proc/update_appearance(updates=ALL)
|
||||||
|
//SHOULD_NOT_SLEEP(TRUE)
|
||||||
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
|
|
||||||
|
. = NONE
|
||||||
|
updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_APPEARANCE, updates)
|
||||||
|
if(updates & UPDATE_NAME)
|
||||||
|
. |= update_name(updates)
|
||||||
|
if(updates & UPDATE_DESC)
|
||||||
|
. |= update_desc(updates)
|
||||||
|
if(updates & UPDATE_ICON)
|
||||||
|
. |= update_icon(updates)
|
||||||
|
|
||||||
|
/// Updates the name of the atom
|
||||||
|
/atom/proc/update_name(updates=ALL)
|
||||||
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
|
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME, updates)
|
||||||
|
|
||||||
|
/// Updates the description of the atom
|
||||||
|
/atom/proc/update_desc(updates=ALL)
|
||||||
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
|
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_DESC, updates)
|
||||||
|
|
||||||
/// Updates the icon of the atom
|
/// Updates the icon of the atom
|
||||||
/atom/proc/update_icon()
|
/atom/proc/update_icon(updates=ALL)
|
||||||
// I expect we're going to need more return flags and options in this proc
|
SIGNAL_HANDLER
|
||||||
var/signalOut = SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON)
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
. = FALSE
|
|
||||||
|
|
||||||
if(!(signalOut & COMSIG_ATOM_NO_UPDATE_ICON_STATE))
|
. = NONE
|
||||||
|
updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON, updates)
|
||||||
|
if(updates & UPDATE_ICON_STATE)
|
||||||
update_icon_state()
|
update_icon_state()
|
||||||
. = TRUE
|
. |= UPDATE_ICON_STATE
|
||||||
|
|
||||||
if(!(signalOut & COMSIG_ATOM_NO_UPDATE_OVERLAYS))
|
if(updates & UPDATE_OVERLAYS)
|
||||||
var/list/new_overlays = update_overlays()
|
if(LAZYLEN(managed_vis_overlays))
|
||||||
|
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||||
|
|
||||||
|
var/list/new_overlays = update_overlays(updates)
|
||||||
if(managed_overlays)
|
if(managed_overlays)
|
||||||
cut_overlay(managed_overlays)
|
cut_overlay(managed_overlays)
|
||||||
managed_overlays = null
|
managed_overlays = null
|
||||||
if(length(new_overlays))
|
if(length(new_overlays))
|
||||||
managed_overlays = new_overlays
|
managed_overlays = new_overlays
|
||||||
add_overlay(new_overlays)
|
add_overlay(new_overlays)
|
||||||
. = TRUE
|
. |= UPDATE_OVERLAYS
|
||||||
|
|
||||||
SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, signalOut, .)
|
. |= SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, updates, .)
|
||||||
|
|
||||||
/// Updates the icon state of the atom
|
/// Updates the icon state of the atom
|
||||||
/atom/proc/update_icon_state()
|
/atom/proc/update_icon_state()
|
||||||
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
|
return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON_STATE)
|
||||||
|
|
||||||
/// Updates the overlays of the atom
|
/// Updates the overlays of the atom
|
||||||
/atom/proc/update_overlays()
|
/atom/proc/update_overlays()
|
||||||
SHOULD_CALL_PARENT(TRUE)
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
. = list()
|
. = list()
|
||||||
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_OVERLAYS, .)
|
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_OVERLAYS, .)
|
||||||
|
|
||||||
|
|
||||||
/atom/proc/relaymove(mob/living/user)
|
/atom/proc/relaymove(mob/living/user)
|
||||||
if(!istype(user))
|
if(!istype(user))
|
||||||
return //why are you buckling nonliving mobs to atoms?
|
return //why are you buckling nonliving mobs to atoms?
|
||||||
|
|||||||
@@ -176,6 +176,17 @@ Class Procs:
|
|||||||
/obj/machinery/proc/process_atmos()//If you dont use process why are you here
|
/obj/machinery/proc/process_atmos()//If you dont use process why are you here
|
||||||
return PROCESS_KILL
|
return PROCESS_KILL
|
||||||
|
|
||||||
|
///Called when we want to change the value of the stat variable. Holds bitflags.
|
||||||
|
/obj/machinery/proc/set_machine_stat(new_value)
|
||||||
|
if(new_value == stat)
|
||||||
|
return
|
||||||
|
. = stat
|
||||||
|
stat = new_value
|
||||||
|
on_machine_stat_update(stat)
|
||||||
|
|
||||||
|
/obj/machinery/proc/on_machine_stat_update(stat)
|
||||||
|
return
|
||||||
|
|
||||||
/obj/machinery/emp_act(severity)
|
/obj/machinery/emp_act(severity)
|
||||||
. = ..()
|
. = ..()
|
||||||
if(use_power && !stat && !(. & EMP_PROTECT_SELF))
|
if(use_power && !stat && !(. & EMP_PROTECT_SELF))
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
var/load_audio = "sound/weapons/gun_magazine_insert_empty_1.ogg"
|
var/load_audio = "sound/weapons/gun_magazine_insert_empty_1.ogg"
|
||||||
var/ammo_type
|
var/ammo_type
|
||||||
|
|
||||||
/obj/item/mecha_ammo/proc/update_name()
|
/obj/item/mecha_ammo/update_name()
|
||||||
if(!rounds)
|
if(!rounds)
|
||||||
name = "empty ammo box"
|
name = "empty ammo box"
|
||||||
desc = "An exosuit ammuniton box that has since been emptied. Please recycle."
|
desc = "An exosuit ammuniton box that has since been emptied. Please recycle."
|
||||||
|
|||||||
@@ -446,7 +446,7 @@
|
|||||||
mood_message = null
|
mood_message = null
|
||||||
cheer_up()
|
cheer_up()
|
||||||
|
|
||||||
/obj/item/toy/plush/proc/update_desc()
|
/obj/item/toy/plush/update_desc()
|
||||||
desc = normal_desc
|
desc = normal_desc
|
||||||
if(mood_message)
|
if(mood_message)
|
||||||
desc += mood_message
|
desc += mood_message
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
update_desc()
|
update_desc()
|
||||||
|
|
||||||
/obj/item/stack/spacecash/proc/update_desc()
|
/obj/item/stack/spacecash/update_desc()
|
||||||
var/total_worth = get_item_credit_value()
|
var/total_worth = get_item_credit_value()
|
||||||
desc = "It's worth [total_worth] credit[( total_worth > 1 ) ? "s" : ""]"
|
desc = "It's worth [total_worth] credit[( total_worth > 1 ) ? "s" : ""]"
|
||||||
|
|
||||||
|
|||||||
@@ -269,7 +269,7 @@
|
|||||||
. += get_airlock_overlay("glass_construction", overlays_file)
|
. += get_airlock_overlay("glass_construction", overlays_file)
|
||||||
. += get_airlock_overlay("panel_c[state+1]", overlays_file)
|
. += get_airlock_overlay("panel_c[state+1]", overlays_file)
|
||||||
|
|
||||||
/obj/structure/door_assembly/proc/update_name()
|
/obj/structure/door_assembly/update_name()
|
||||||
name = ""
|
name = ""
|
||||||
switch(state)
|
switch(state)
|
||||||
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
|
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
/obj/item/organ/genital/proc/update_size()
|
/obj/item/organ/genital/proc/update_size()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/organ/genital/proc/update_appearance()
|
/obj/item/organ/genital/proc/update_appearance_genitals()
|
||||||
if(!owner || owner.stat == DEAD)
|
if(!owner || owner.stat == DEAD)
|
||||||
aroused_state = FALSE
|
aroused_state = FALSE
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
if(.)
|
if(.)
|
||||||
update()
|
update()
|
||||||
RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance)
|
RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance_genitals)
|
||||||
if(genital_flags & GENITAL_THROUGH_CLOTHES)
|
if(genital_flags & GENITAL_THROUGH_CLOTHES)
|
||||||
owner.exposed_genitals += src
|
owner.exposed_genitals += src
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
var/is_knotted = FALSE
|
var/is_knotted = FALSE
|
||||||
//Lists moved to _cit_helpers.dm as globals so they're not instanced individually
|
//Lists moved to _cit_helpers.dm as globals so they're not instanced individually
|
||||||
|
|
||||||
/obj/item/dildo/proc/update_appearance()
|
/obj/item/dildo/update_appearance()
|
||||||
icon_state = "[dildo_type]_[dildo_shape]_[dildo_size]"
|
icon_state = "[dildo_type]_[dildo_shape]_[dildo_size]"
|
||||||
var/sizeword = ""
|
var/sizeword = ""
|
||||||
switch(dildo_size)
|
switch(dildo_size)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
|
|
||||||
|
|
||||||
/obj/item/reagent_containers/food/snacks/customizable/proc/update_name(obj/item/reagent_containers/food/snacks/S)
|
/obj/item/reagent_containers/food/snacks/customizable/update_name(obj/item/reagent_containers/food/snacks/S)
|
||||||
for(var/obj/item/I in ingredients)
|
for(var/obj/item/I in ingredients)
|
||||||
if(!istype(S, I.type))
|
if(!istype(S, I.type))
|
||||||
customname = "custom"
|
customname = "custom"
|
||||||
|
|||||||
@@ -430,7 +430,7 @@
|
|||||||
src.pixel_x = rand(-5, 5)
|
src.pixel_x = rand(-5, 5)
|
||||||
src.pixel_y = rand(-5, 5)
|
src.pixel_y = rand(-5, 5)
|
||||||
|
|
||||||
/obj/item/disk/plantgene/proc/update_name()
|
/obj/item/disk/plantgene/update_name()
|
||||||
if(gene)
|
if(gene)
|
||||||
name = "[gene.get_name()] (plant data disk)"
|
name = "[gene.get_name()] (plant data disk)"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
|
coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]")
|
||||||
regenerate_icons()
|
regenerate_icons()
|
||||||
|
|
||||||
/mob/living/simple_animal/slime/proc/update_name()
|
/mob/living/simple_animal/slime/update_name()
|
||||||
if(slime_name_regex.Find(name))
|
if(slime_name_regex.Find(name))
|
||||||
number = rand(1, 1000)
|
number = rand(1, 1000)
|
||||||
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
|
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
|
||||||
|
|||||||
@@ -104,15 +104,23 @@
|
|||||||
/obj/machinery/proc/removeStaticPower(value, powerchannel)
|
/obj/machinery/proc/removeStaticPower(value, powerchannel)
|
||||||
addStaticPower(-value, powerchannel)
|
addStaticPower(-value, powerchannel)
|
||||||
|
|
||||||
/obj/machinery/proc/power_change() // called whenever the power settings of the containing area change
|
/obj/machinery/proc/power_change()
|
||||||
// by default, check equipment channel & set flag
|
//SIGNAL_HANDLER
|
||||||
// can override if needed
|
//SHOULD_CALL_PARENT(TRUE)
|
||||||
if(powered(power_channel))
|
|
||||||
stat &= ~NOPOWER
|
|
||||||
else
|
|
||||||
|
|
||||||
stat |= NOPOWER
|
if(stat & BROKEN)
|
||||||
return
|
return
|
||||||
|
if(powered(power_channel))
|
||||||
|
if(stat & NOPOWER)
|
||||||
|
SEND_SIGNAL(src, COMSIG_MACHINERY_POWER_RESTORED)
|
||||||
|
. = TRUE
|
||||||
|
set_machine_stat(stat & ~NOPOWER)
|
||||||
|
else
|
||||||
|
if(!(stat & NOPOWER))
|
||||||
|
SEND_SIGNAL(src, COMSIG_MACHINERY_POWER_LOST)
|
||||||
|
. = TRUE
|
||||||
|
set_machine_stat(stat | NOPOWER)
|
||||||
|
update_appearance()
|
||||||
|
|
||||||
// connect the machine to a powernet if a node cable is present on the turf
|
// connect the machine to a powernet if a node cable is present on the turf
|
||||||
/obj/machinery/power/proc/connect_to_network()
|
/obj/machinery/power/proc/connect_to_network()
|
||||||
|
|||||||
@@ -28,11 +28,10 @@
|
|||||||
|
|
||||||
/obj/machinery/nanite_program_hub/update_overlays()
|
/obj/machinery/nanite_program_hub/update_overlays()
|
||||||
. = ..()
|
. = ..()
|
||||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
|
||||||
if((stat & (NOPOWER|MAINT|BROKEN)) || panel_open)
|
if((stat & (NOPOWER|MAINT|BROKEN)) || panel_open)
|
||||||
return
|
return
|
||||||
SSvis_overlays.add_vis_overlay(src, icon, "nanite_program_hub_on", layer, plane)
|
. += mutable_appearance(icon, "nanite_program_hub_on")
|
||||||
SSvis_overlays.add_vis_overlay(src, icon, "nanite_program_hub_on", EMISSIVE_LAYER, EMISSIVE_PLANE)
|
. += mutable_appearance(icon, "nanite_program_hub_on", layer, EMISSIVE_PLANE)
|
||||||
|
|
||||||
/obj/machinery/nanite_program_hub/attackby(obj/item/I, mob/user)
|
/obj/machinery/nanite_program_hub/attackby(obj/item/I, mob/user)
|
||||||
if(istype(I, /obj/item/disk/nanite_program))
|
if(istype(I, /obj/item/disk/nanite_program))
|
||||||
|
|||||||
@@ -13,11 +13,10 @@
|
|||||||
|
|
||||||
/obj/machinery/nanite_programmer/update_overlays()
|
/obj/machinery/nanite_programmer/update_overlays()
|
||||||
. = ..()
|
. = ..()
|
||||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
|
||||||
if((stat & (NOPOWER|MAINT|BROKEN)) || panel_open)
|
if((stat & (NOPOWER|MAINT|BROKEN)) || panel_open)
|
||||||
return
|
return
|
||||||
SSvis_overlays.add_vis_overlay(src, icon, "nanite_programmer_on", layer, plane)
|
. += mutable_appearance(icon, "nanite_programmer_on")
|
||||||
SSvis_overlays.add_vis_overlay(src, icon, "nanite_programmer_on", EMISSIVE_LAYER, EMISSIVE_PLANE)
|
. += mutable_appearance(icon, "nanite_programmer_on", layer, EMISSIVE_PLANE)
|
||||||
|
|
||||||
/obj/machinery/nanite_programmer/attackby(obj/item/I, mob/user)
|
/obj/machinery/nanite_programmer/attackby(obj/item/I, mob/user)
|
||||||
if(istype(I, /obj/item/disk/nanite_program))
|
if(istype(I, /obj/item/disk/nanite_program))
|
||||||
|
|||||||
Reference in New Issue
Block a user