POLARIS: Improve robot and typing overlays

This commit is contained in:
Arokha Sieyes
2018-03-17 19:49:03 -04:00
parent 2d83c044df
commit 2248c71b39
7 changed files with 32 additions and 61 deletions

View File

@@ -149,7 +149,7 @@ var/list/_client_preferences_by_type
/datum/client_preference/show_typing_indicator/toggled(var/mob/preference_mob, var/enabled) /datum/client_preference/show_typing_indicator/toggled(var/mob/preference_mob, var/enabled)
if(!enabled) if(!enabled)
preference_mob.set_typing_indicator(0) preference_mob.set_typing_indicator(FALSE)
/datum/client_preference/show_ooc /datum/client_preference/show_ooc
description ="OOC chat" description ="OOC chat"

View File

@@ -98,11 +98,11 @@
toggle_preference(pref_path) toggle_preference(pref_path)
src << "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] see the speech indicator." src << "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] have the speech indicator."
prefs.save_preferences() prefs.save_preferences()
feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! feedback_add_details("admin_verb","TTIND") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_ahelp_sound() /client/verb/toggle_ahelp_sound()
set name = "Toggle Admin Help Sound" set name = "Toggle Admin Help Sound"

View File

@@ -712,34 +712,29 @@
return 0 return 0
/mob/living/silicon/robot/updateicon() /mob/living/silicon/robot/updateicon()
overlays.Cut() cut_overlays()
if(stat == CONSCIOUS) if(stat == CONSCIOUS)
overlays += "eyes-[module_sprites[icontype]]" add_overlay("eyes-[module_sprites[icontype]]")
if(opened) if(opened)
var/panelprefix = custom_sprite ? "[src.ckey]-[src.name]" : "ov" var/panelprefix = custom_sprite ? "[src.ckey]-[src.name]" : "ov"
if(wiresexposed) if(wiresexposed)
overlays += "[panelprefix]-openpanel +w" add_overlay("[panelprefix]-openpanel +w")
else if(cell) else if(cell)
overlays += "[panelprefix]-openpanel +c" add_overlay("[panelprefix]-openpanel +c")
else else
overlays += "[panelprefix]-openpanel -c" add_overlay("[panelprefix]-openpanel -c")
if(has_active_type(/obj/item/borg/combat/shield)) if(has_active_type(/obj/item/borg/combat/shield))
var/obj/item/borg/combat/shield/shield = locate() in src var/obj/item/borg/combat/shield/shield = locate() in src
if(shield && shield.active) if(shield && shield.active)
overlays += "[module_sprites[icontype]]-shield" add_overlay("[module_sprites[icontype]]-shield")
if(modtype == "Combat") if(modtype == "Combat")
if(module_active && istype(module_active,/obj/item/borg/combat/mobility)) if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
icon_state = "[module_sprites[icontype]]-roll" icon_state = "[module_sprites[icontype]]-roll"
else else
icon_state = module_sprites[icontype] icon_state = module_sprites[icontype]
return
if(typing)
typing = FALSE
set_typing_indicator(1)
/mob/living/silicon/robot/proc/installed_modules() /mob/living/silicon/robot/proc/installed_modules()
if(weapon_lock) if(weapon_lock)

View File

@@ -220,9 +220,7 @@
var/get_rig_stats = 0 //Moved from computer.dm var/get_rig_stats = 0 //Moved from computer.dm
var/typing
var/hud_typing = 0 //Typing indicator stuff.
var/typing //Simple mobs use this variable.
var/obj/effect/decal/typing_indicator var/obj/effect/decal/typing_indicator
var/low_priority = FALSE //Skip processing life() if there's just no players on this Z-level var/low_priority = FALSE //Skip processing life() if there's just no players on this Z-level

View File

@@ -11,7 +11,7 @@
set name = "Say" set name = "Say"
set category = "IC" set category = "IC"
set_typing_indicator(0) set_typing_indicator(FALSE)
usr.say(message) usr.say(message)
/mob/verb/me_verb(message as text) /mob/verb/me_verb(message as text)
@@ -24,7 +24,7 @@
message = sanitize(message) message = sanitize(message)
set_typing_indicator(0) set_typing_indicator(FALSE)
if(use_me) if(use_me)
usr.emote("me",usr.emote_type,message) usr.emote("me",usr.emote_type,message)
else else

View File

@@ -1,5 +1,9 @@
/mob/proc/set_typing_indicator(var/state) //Leaving this here for mobs. /mob/proc/set_typing_indicator(var/state) //Leaving this here for mobs.
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator))
cut_overlay(typing_indicator, TRUE)
return
if(!typing_indicator) if(!typing_indicator)
typing_indicator = new typing_indicator = new
//typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - Looks better on the right with job icons. //typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - Looks better on the right with job icons.
@@ -7,37 +11,26 @@
typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons typing_indicator.icon = 'icons/mob/talk_vr.dmi' //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons
typing_indicator.icon_state = "[speech_bubble_appearance()]_typing" typing_indicator.icon_state = "[speech_bubble_appearance()]_typing"
if(client && !stat) if(state && !typing)
typing_indicator.invisibility = invisibility add_overlay(typing_indicator, TRUE)
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator)) typing = TRUE
add_overlay(typing_indicator) else if(typing)
else cut_overlay(typing_indicator, TRUE)
if(state) typing = FALSE
if(!typing)
add_overlay(typing_indicator) if(shadow) //Multi-Z above-me shadows
typing = 1 shadow.set_typing_indicator(state)
else
if(typing) return state
cut_overlay(typing_indicator)
typing = 0
return state
/mob/verb/say_wrapper() /mob/verb/say_wrapper()
set name = ".Say" set name = ".Say"
set hidden = 1 set hidden = 1
if(!ishuman(src)) //If they're a mob, use the old code. set_typing_indicator(TRUE)
set_typing_indicator(1)
else if(is_preference_enabled(/datum/client_preference/show_typing_indicator))
hud_typing = 1
var/message = input("","say (text)") as text var/message = input("","say (text)") as text
set_typing_indicator(FALSE)
if(!ishuman(src)) //If they're a mob, use the old code.
set_typing_indicator(0)
else if(is_preference_enabled(/datum/client_preference/show_typing_indicator))
hud_typing = 0
if(message) if(message)
say_verb(message) say_verb(message)
@@ -45,17 +38,9 @@
set name = ".Me" set name = ".Me"
set hidden = 1 set hidden = 1
if(!ishuman(src)) //If they're a mob, use the old code. set_typing_indicator(TRUE)
set_typing_indicator(1)
else if(is_preference_enabled(/datum/client_preference/show_typing_indicator))
hud_typing = 1
var/message = input("","me (text)") as text var/message = input("","me (text)") as text
set_typing_indicator(FALSE)
if(is_preference_enabled(/datum/client_preference/show_typing_indicator))
hud_typing = 0
else if(!ishuman(src)) //If they're a mob, use the old code.
set_typing_indicator(0)
if(message) if(message)
me_verb(message) me_verb(message)

View File

@@ -118,13 +118,6 @@
if(shadow) if(shadow)
shadow.visible_message(message, self_message, blind_message) shadow.visible_message(message, self_message, blind_message)
// We should show the typing indicator so people above us can tell we're about to talk.
/mob/set_typing_indicator(var/state)
var/old_typing = src.typing
. = ..()
if(shadow && old_typing != src.typing)
shadow.set_typing_indicator(state) // Okay the real proc changed something! That means we should handle things too
/mob/zshadow/set_typing_indicator(var/state) /mob/zshadow/set_typing_indicator(var/state)
if(!typing_indicator) if(!typing_indicator)
typing_indicator = new typing_indicator = new