Typing indicator tweaks + typing indicator override element (#21298)

This commit is contained in:
SapphicOverload
2024-01-27 19:40:02 -05:00
committed by GitHub
parent 1c0fdf42af
commit 2743577f1c
34 changed files with 96 additions and 36 deletions

View File

@@ -139,3 +139,8 @@
///from mind/transfer_to. Sent after the mind has been transferred: (mob/previous_body)
#define COMSIG_MIND_TRANSFERRED "mind_transferred"
///from /mob/create_typing_indicator()
#define COMSIG_MOB_CREATE_TYPING_INDICATOR "create_typing_indicator"
///Icon used for the typing indicator
#define BUBBLE_ICON_STATE 1

View File

@@ -112,3 +112,18 @@
//Used in visible_message_flags, audible_message_flags and runechat_flags
#define EMOTE_MESSAGE (1<<0)
//Typing indicator defines, used in /mob/create_typing_indicator()
#define BUBBLE_DEFAULT "default"
#define BUBBLE_LAWYER "lawyer"
#define BUBBLE_ROBOT "robot"
#define BUBBLE_MACHINE "machine"
#define BUBBLE_SYNDIBOT "syndibot"
#define BUBBLE_SWARMER "swarmer"
#define BUBBLE_SLIME "slime"
#define BUBBLE_CLOCK "clock"
#define BUBBLE_ALIEN "alien"
#define BUBBLE_ALIENROYAL "alienroyal"
#define BUBBLE_DARKSPAWN "darkspawn"
#define BUBBLE_GUARDIAN "guardian"
#define BUBBLE_BLOB "blob"

View File

@@ -0,0 +1,27 @@
/datum/element/speech_bubble_override
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH_ON_HOST_DESTROY
argument_hash_start_idx = 2
var/bubble_type
/datum/element/speech_bubble_override/Attach(datum/target, bubble_type)
. = ..()
if(!ismob(target))
return ELEMENT_INCOMPATIBLE
src.bubble_type = bubble_type
RegisterSignal(target, COMSIG_MOB_SAY, PROC_REF(handle_speech))
RegisterSignal(target, COMSIG_MOB_CREATE_TYPING_INDICATOR, PROC_REF(handle_typing_indicator))
/datum/element/speech_bubble_override/Detach(datum/source, ...)
UnregisterSignal(source, COMSIG_MOB_SAY)
UnregisterSignal(source, COMSIG_MOB_CREATE_TYPING_INDICATOR)
return ..()
/datum/element/speech_bubble_override/proc/handle_speech(mob/target, list/speech_args)
SIGNAL_HANDLER
speech_args[SPEECH_BUBBLE_TYPE] = bubble_type
/datum/element/speech_bubble_override/proc/handle_typing_indicator(mob/target, list/bubble_args)
SIGNAL_HANDLER
bubble_args[BUBBLE_ICON_STATE] = bubble_type

View File

@@ -8,7 +8,7 @@
icon = 'icons/mob/blob.dmi'
pass_flags = PASSBLOB
faction = list(ROLE_BLOB)
bubble_icon = "blob"
bubble_icon = BUBBLE_BLOB
speak_emote = null //so we use verb_yell/verb_say/etc
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0

View File

@@ -16,7 +16,7 @@
verb_whisper = "imparts"
verb_yell = "harangues"
initial_language_holder = /datum/language_holder/clockmob
bubble_icon = "clock"
bubble_icon = BUBBLE_CLOCK
light_color = "#E42742"
deathsound = 'sound/magic/clockwork/anima_fragment_death.ogg'
speech_span = SPAN_ROBOT

View File

@@ -134,7 +134,7 @@
savedName = user.name
user.name = friendlyName
user.module.cyborg_base_icon = initial(selected_module.cyborg_base_icon)
user.bubble_icon = "robot"
user.bubble_icon = BUBBLE_ROBOT
user.module.name = input_module
active = TRUE
user.update_icons()

View File

@@ -316,13 +316,12 @@
/obj/item/clothing/accessory/lawyers_badge/on_clothing_equip(obj/item/clothing/U, user)
var/mob/living/L = user
if(L)
L.bubble_icon = "lawyer"
L.AddElement(/datum/element/speech_bubble_override, BUBBLE_LAWYER)
/obj/item/clothing/accessory/lawyers_badge/on_clothing_dropped(obj/item/clothing/U, user)
var/mob/living/L = user
if(L)
L.bubble_icon = initial(L.bubble_icon)
L.RemoveElement(/datum/element/speech_bubble_override, BUBBLE_LAWYER)
////////////////
//HA HA! NERD!//

View File

@@ -9,7 +9,7 @@
see_in_dark = 4
verb_say = "hisses"
initial_language_holder = /datum/language_holder/alien
bubble_icon = "alien"
bubble_icon = BUBBLE_ALIEN
type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab/xeno
var/obj/item/card/id/wear_id = null // Fix for station bounced radios -- Skie

View File

@@ -5,7 +5,7 @@
ventcrawler = VENTCRAWLER_NONE //pull over that ass too fat
unique_name = 0
pixel_x = -16
bubble_icon = "alienroyal"
bubble_icon = BUBBLE_ALIENROYAL
mob_size = MOB_SIZE_LARGE
layer = LARGE_MOB_LAYER //above most mobs, but below speechbubbles
pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper.

View File

@@ -162,6 +162,9 @@ GLOBAL_LIST_EMPTY(features_by_species)
///what type of gas is breathed
var/breathid = "o2"
/// Special typing indicators
var/bubble_icon = BUBBLE_DEFAULT
/// The icon_state of the fire overlay added when sufficently ablaze and standing. see onfire.dmi
var/fire_overlay = "human" //not used until monkey is added as a species type rather than a mob
@@ -434,6 +437,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
C.Digitigrade_Leg_Swap(FALSE)
C.mob_biotypes = inherent_biotypes
C.bubble_icon = bubble_icon
regenerate_organs(C,old_species)

View File

@@ -4,6 +4,7 @@
name = "IPC" //inherited from the real species, for health scanners and things
id = "ipc"
say_mod = "states" //inherited from a user's real species
bubble_icon = BUBBLE_ROBOT // beep boop
sexes = FALSE
species_traits = list(NOTRANSSTING,NOEYESPRITES,NO_DNA_COPY,NOZOMBIE,MUTCOLORS,NOHUSK,AGENDER,NOBLOOD,NO_UNDERWEAR)
inherent_traits = list(TRAIT_RESISTCOLD,TRAIT_RADIMMUNE,TRAIT_NOBREATH,TRAIT_LIMBATTACHMENT,TRAIT_EASYDISMEMBER,TRAIT_NOCRITDAMAGE,TRAIT_GENELESS,TRAIT_MEDICALIGNORE,TRAIT_NOCLONE,TRAIT_TOXIMMUNE,TRAIT_EASILY_WOUNDED,TRAIT_NODEFIB,TRAIT_POWERHUNGRY)

View File

@@ -2,6 +2,7 @@
name = "Android"
id = "android"
say_mod = "states"
bubble_icon = BUBBLE_ROBOT
sexes = FALSE
species_traits = list(NOBLOOD, NOZOMBIE, NOHUSK, NO_DNA_COPY, NOTRANSSTING)
inherent_traits = list(TRAIT_RESISTHEAT,TRAIT_COLDBLOODED,TRAIT_NOBREATH,TRAIT_RESISTCOLD,TRAIT_RESISTHIGHPRESSURE,TRAIT_RESISTLOWPRESSURE,TRAIT_RADIMMUNE,TRAIT_NOCLONE,TRAIT_TOXIMMUNE,TRAIT_GENELESS,TRAIT_NOFIRE,TRAIT_PIERCEIMMUNE,TRAIT_NOHUNGER,TRAIT_LIMBATTACHMENT,TRAIT_MEDICALIGNORE)

View File

@@ -5,6 +5,7 @@
id = "jelly"
default_color = "00FF90"
say_mod = "chirps"
bubble_icon = BUBBLE_SLIME
species_traits = list(MUTCOLORS, EYECOLOR, NOBLOOD, HAIR)
inherent_traits = list(TRAIT_TOXINLOVER)
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/slime

View File

@@ -11,6 +11,7 @@
liked_food = GROSS | MEAT | MICE
disliked_food = GRAIN | DAIRY | VEGETABLES | FRUIT
say_mod = "hisses"
bubble_icon = BUBBLE_ALIEN
species_language_holder = /datum/language_holder/polysmorph
brutemod = 0.9 //exoskeleton protects against brute
burnmod = 1.35 //residual plasma inside them, highly flammable

View File

@@ -77,8 +77,6 @@
var/health_doll_icon //if this exists AND the normal sprite is bigger than 32x32, this is the replacement icon state (because health doll size limitations). the icon will always be screen_gen.dmi
var/bubble_icon = "default" //what icon the mob uses for speechbubbles
var/last_bumped = 0
var/unique_name = 0 //if a mob's name should be appended with an id when created e.g. Mob (666)

View File

@@ -320,6 +320,8 @@ GLOBAL_LIST_INIT(special_radio_keys, list(
if(M.client)
speech_bubble_recipients.Add(M.client)
var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER)
if(a_intent == INTENT_HARM) // ANGRY!!!!
I.add_overlay("angry")
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay), I, speech_bubble_recipients, 30)

View File

@@ -5,7 +5,7 @@
icon_state = "robot"
maxHealth = 100
health = 100
bubble_icon = "robot"
bubble_icon = BUBBLE_ROBOT
designation = "Default" ///used for displaying the prefix & getting the current module of cyborg
has_limbs = 1
hud_type = /datum/hud/robot
@@ -920,7 +920,7 @@
/mob/living/silicon/robot/modules/syndicate
icon_state = "synd_sec"
faction = list(ROLE_SYNDICATE)
bubble_icon = "syndibot"
bubble_icon = BUBBLE_SYNDIBOT
req_access = list(ACCESS_SYNDICATE)
lawupdate = FALSE
scrambledcodes = TRUE // These are rogue borgs.

View File

@@ -8,7 +8,7 @@
initial_language_holder = /datum/language_holder/synthetic
see_in_dark = 8
infra_luminosity = 0
bubble_icon = "machine"
bubble_icon = BUBBLE_MACHINE
weather_immunities = list("ash")
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
mob_biotypes = MOB_ROBOTIC

View File

@@ -18,7 +18,7 @@
verb_exclaim = "declares"
verb_yell = "alarms"
initial_language_holder = /datum/language_holder/synthetic
bubble_icon = "machine"
bubble_icon = BUBBLE_MACHINE
speech_span = SPAN_ROBOT
faction = list("neutral", "silicon" , "turret")
light_system = MOVABLE_LIGHT

View File

@@ -38,7 +38,7 @@
mob_biotypes = MOB_ROBOTIC
speak_emote = list("chirps")
speech_span = SPAN_ROBOT
bubble_icon = "machine"
bubble_icon = BUBBLE_MACHINE
initial_language_holder = /datum/language_holder/drone
mob_size = MOB_SIZE_SMALL
has_unlimited_silicon_privilege = 1

View File

@@ -20,7 +20,7 @@
initial_language_holder = /datum/language_holder/drone/syndicate
faction = list(ROLE_SYNDICATE)
speak_emote = list("hisses")
bubble_icon = "syndibot"
bubble_icon = BUBBLE_SYNDIBOT
heavy_emp_damage = 10
laws = \
"1. Interfere.\n"+\
@@ -122,7 +122,7 @@
verb_exclaim = "proclaims"
verb_whisper = "imparts"
verb_yell = "harangues"
bubble_icon = "clock"
bubble_icon = BUBBLE_CLOCK
initial_language_holder = /datum/language_holder/clockmob
light_color = "#E42742"
heavy_emp_damage = 0

View File

@@ -12,7 +12,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians
speak_emote = list("hisses")
gender = NEUTER
mob_biotypes = MOB_INORGANIC|MOB_SPIRIT
bubble_icon = "guardian"
bubble_icon = BUBBLE_GUARDIAN
response_help = "passes through"
response_disarm = "flails at"
response_harm = "punches"

View File

@@ -23,7 +23,7 @@
attack_vis_effect = ATTACK_EFFECT_CLAW
attacktext = "slashes"
speak_emote = list("hisses")
bubble_icon = "alien"
bubble_icon = BUBBLE_ALIEN
a_intent = INTENT_HARM
attack_sound = 'sound/weapons/bladeslice.ogg'
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
@@ -133,7 +133,7 @@
icon_state = "alienq"
icon_living = "alienq"
icon_dead = "alienq_dead"
bubble_icon = "alienroyal"
bubble_icon = BUBBLE_ALIENROYAL
move_to_delay = 4
maxHealth = 400
health = 400

View File

@@ -29,7 +29,7 @@
verb_ask = "queries"
verb_exclaim = "declares"
verb_yell = "alarms"
bubble_icon = "machine"
bubble_icon = BUBBLE_MACHINE
speech_span = SPAN_ROBOT
gold_core_spawnable = HOSTILE_SPAWN
del_on_death = 1

View File

@@ -312,7 +312,7 @@
movement_type = FLYING
limb_destroyer = 1
speak_emote = list("states")
bubble_icon = "syndibot"
bubble_icon = BUBBLE_SYNDIBOT
gold_core_spawnable = HOSTILE_SPAWN
del_on_death = 1
deathmessage = "is smashed into pieces!"

View File

@@ -19,7 +19,7 @@
response_harm = "stomps on"
emote_see = list("jiggles", "bounces in place")
speak_emote = list("blorbles")
bubble_icon = "slime"
bubble_icon = BUBBLE_SLIME
initial_language_holder = /datum/language_holder/slime
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)

View File

@@ -141,6 +141,8 @@
var/datum/hud/hud_used = null
/// I have no idea tbh
var/research_scanner = FALSE
/// What icon the mob uses for typing indicators
var/bubble_icon = BUBBLE_DEFAULT
/// Is the mob throw intent on
var/in_throw_mode = 0

View File

@@ -20,7 +20,7 @@
desc = "Robotic constructs of unknown design, swarmers seek only to consume materials and replicate themselves indefinitely."
speak_emote = list("tones")
initial_language_holder = /datum/language_holder/swarmer
bubble_icon = "swarmer"
bubble_icon = BUBBLE_SWARMER
mob_biotypes = MOB_ROBOTIC
health = 40
maxHealth = 40

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -679,6 +679,7 @@
#include "code\datums\elements\movetype_handler.dm"
#include "code\datums\elements\regenerator.dm"
#include "code\datums\elements\rust.dm"
#include "code\datums\elements\speech_bubble_override.dm"
#include "code\datums\elements\squish.dm"
#include "code\datums\elements\update_icon_blocker.dm"
#include "code\datums\elements\decals\_decals.dm"
@@ -2999,6 +3000,7 @@
#include "code\modules\mob\living\simple_animal\hostile\megafauna\megafauna.dm"
#include "code\modules\mob\living\simple_animal\hostile\megafauna\stalwart.dm"
#include "code\modules\mob\living\simple_animal\hostile\megafauna\swarmer.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\ambusher.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\basilisk.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\curse_blob.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\drakeling.dm"
@@ -3010,7 +3012,6 @@
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\polarbear.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\wasp.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\wolf.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\ambusher.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\elites\elite.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\elites\goliath_broodmother.dm"
#include "code\modules\mob\living\simple_animal\hostile\mining_mobs\elites\herald.dm"

View File

@@ -19,7 +19,7 @@ GLOBAL_LIST_INIT(guardian_projectile_damage, list(
speak_emote = list("hisses")
gender = NEUTER
mob_biotypes = MOB_INORGANIC|MOB_SPIRIT
bubble_icon = "guardian"
bubble_icon = BUBBLE_GUARDIAN
response_help = "passes through"
response_disarm = "flails at"
response_harm = "punches"

View File

@@ -4,6 +4,7 @@
name = "Darkspawn"
id = "darkspawn"
limbs_id = "darkspawn"
bubble_icon = BUBBLE_DARKSPAWN
sexes = FALSE
nojumpsuit = TRUE
changesource_flags = MIRROR_BADMIN | MIRROR_MAGIC | WABBAJACK | ERT_SPAWN //never put this in the pride pool because they look super valid
@@ -46,7 +47,6 @@
/datum/species/darkspawn/spec_life(mob/living/carbon/human/H)
handle_upgrades(H)
H.bubble_icon = "darkspawn"
var/turf/T = H.loc
if(istype(T))
var/light_amount = T.get_lumcount()

View File

@@ -43,17 +43,20 @@
for(var/mob/M in listening)
if(M.client && M.client.prefs.chat_toggles & CHAT_TYPING_INDICATOR)
speech_bubble_recipients.Add(M.client)
var/bubble = "default"
if(isliving(src))
var/mob/living/L = src
bubble = L.bubble_icon
typing_overlay = image('yogstation/icons/mob/talk.dmi', src, "[bubble]_talking", FLY_LAYER)
typing_overlay.appearance_flags = APPEARANCE_UI
typing_overlay.invisibility = invisibility
typing_overlay.alpha = alpha
typing_overlay = get_bubble_icon(bubble_icon)
for(var/client/C in speech_bubble_recipients)
C.images += typing_overlay
/mob/proc/get_bubble_icon(bubble)
bubble = bubble_icon
SEND_SIGNAL(src, COMSIG_MOB_CREATE_TYPING_INDICATOR, args)
typing_overlay = image('yogstation/icons/mob/talk.dmi', src, "[bubble]_talking", FLY_LAYER)
if(a_intent == INTENT_HARM) // ANGRY!!!!
typing_overlay.add_overlay("angry")
typing_overlay.appearance_flags = APPEARANCE_UI
typing_overlay.invisibility = invisibility
typing_overlay.alpha = alpha
return typing_overlay
/mob/proc/remove_typing_indicator()
if(!typing_overlay)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB