diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 65994dda5a..ae38cd4765 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -32,7 +32,7 @@ #define COMSIG_ELEMENT_DETACH "element_detach" /// sent to the component itself when unregistered from a parent -#define COMSIG_COMPONENT_UNREGISTER_PARENT "component_unregister_parent" +#define COMSIG_COMPONENT_UNREGISTER_PARENT "component_unregister_parent" /// sent to the component itself when registered to a parent #define COMSIG_COMPONENT_REGISTER_PARENT "component_register_parent" @@ -43,6 +43,8 @@ // /atom signals //from base of atom/proc/Initialize(): sent any time a new atom is created #define COMSIG_ATOM_CREATED "atom_created" +//from SSatoms InitAtom - Only if the atom was not deleted or failed initialization +#define COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE "atom_init_success" #define COMSIG_PARENT_ATTACKBY "atom_attackby" //from base of atom/attackby(): (/obj/item, /mob/living, params) #define COMPONENT_NO_AFTERATTACK 1 //Return this in response if you don't want afterattack to be called #define COMSIG_ATOM_HULK_ATTACK "hulk_attack" //from base of atom/attack_hulk(): (/mob/living/carbon/human) diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index db1fced637..b9a4785f49 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -90,6 +90,8 @@ SUBSYSTEM_DEF(atoms) qdeleted = TRUE else if(!(A.flags_1 & INITIALIZED_1)) BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT + else + SEND_SIGNAL(A,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE) return qdeleted || QDELING(A) diff --git a/code/datums/elements/decal.dm b/code/datums/elements/decal.dm index 5ddd5bd03e..a20d46c813 100644 --- a/code/datums/elements/decal.dm +++ b/code/datums/elements/decal.dm @@ -41,19 +41,27 @@ var/atom/A = target num_decals_per_atom[A]-- if(!num_decals_per_atom[A]) - UnregisterSignal(A, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE, COMSIG_ATOM_UPDATE_OVERLAYS)) + UnregisterSignal(A, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE, + COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE, COMSIG_ATOM_UPDATE_OVERLAYS)) LAZYREMOVE(num_decals_per_atom, A) apply(A) return ..() /datum/element/decal/proc/apply(atom/target) - target.update_icon() + if(target.flags_1 & INITIALIZED_1) + target.update_icon() //could use some queuing here now maybe. + else if(!QDELETED(target) && num_decals_per_atom[target] == 1) + RegisterSignal(target, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE, .proc/late_update_icon) if(isitem(target)) addtimer(CALLBACK(target, /obj/item/.proc/update_slot_icon), 0, TIMER_UNIQUE) +/datum/element/decal/proc/late_update_icon(atom/source) + source.update_icon() + UnregisterSignal(source,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE) + /datum/element/decal/proc/apply_overlay(atom/source, list/overlay_list) if(first_dir) - pic.dir = turn(first_dir, -dir2angle(source.dir)) + pic.dir = first_dir == SOUTH ? source.dir : turn(first_dir, dir2angle(source.dir)-180) //Never turn a dir by 0. for(var/i in 1 to num_decals_per_atom[source]) overlay_list += pic diff --git a/code/game/objects/effects/decals/decal.dm b/code/game/objects/effects/decals/decal.dm index b280851888..5f312f2bf3 100644 --- a/code/game/objects/effects/decals/decal.dm +++ b/code/game/objects/effects/decals/decal.dm @@ -46,4 +46,5 @@ var/turf/T = loc if(!istype(T)) //you know this will happen somehow CRASH("Turf decal initialized in an object/nullspace") - T.AddElement(/datum/element/decal, icon, icon_state, dir, CLEAN_GOD, color, null, null, alpha) + var/turn_dir = 180 - dir2angle(T.dir) //Turning a dir by 0 results in a roulette of random dirs. + T.AddElement(/datum/element/decal, icon, icon_state, turn_dir ? turn(dir, turn_dir) : dir, CLEAN_GOD, color, null, null, alpha) diff --git a/code/modules/cargo/packs/goodies.dm b/code/modules/cargo/packs/goodies.dm index 5d07e85bac..423d2fc743 100644 --- a/code/modules/cargo/packs/goodies.dm +++ b/code/modules/cargo/packs/goodies.dm @@ -52,8 +52,8 @@ cost = 300 contains = list(/obj/item/storage/toolbox/mechanical) -/datum/supply_pack/goody/electrical_toolbox // mostly just to water down coupon probability - name = "Mechanical Toolbox" +/datum/supply_pack/goody/electrical_toolbox + name = "Electrical Toolbox" desc = "A fully stocked electrical toolbox, for when you're too lazy to just print them out." cost = 300 contains = list(/obj/item/storage/toolbox/electrical) diff --git a/code/modules/clothing/under/costume.dm b/code/modules/clothing/under/costume.dm index 18cd104ff8..f8292738ee 100644 --- a/code/modules/clothing/under/costume.dm +++ b/code/modules/clothing/under/costume.dm @@ -267,7 +267,7 @@ mutantrace_variation = STYLE_DIGITIGRADE|STYLE_NO_ANTHRO_ICON|USE_TAUR_CLIP_MASK /obj/item/clothing/under/costume/christmas/croptop/green - name = "green feminine christmas suit" + name = "green croptop christmas suit" desc = "A simple green christmas suit. Smells minty!" icon_state = "christmasfemaleg" item_state = "christmasfemaleg"