Merge pull request #3266 from VOREStation/aro-overlays2

Refactor typing overlay and robot overlays
This commit is contained in:
Leshana
2018-03-17 20:13:33 -04:00
committed by GitHub
9 changed files with 39 additions and 68 deletions
@@ -149,7 +149,7 @@ var/list/_client_preferences_by_type
/datum/client_preference/show_typing_indicator/toggled(var/mob/preference_mob, var/enabled)
if(!enabled)
preference_mob.set_typing_indicator(0)
preference_mob.set_typing_indicator(FALSE)
/datum/client_preference/show_ooc
description ="OOC chat"
@@ -98,11 +98,11 @@
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()
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()
set name = "Toggle Admin Help Sound"
+6 -11
View File
@@ -712,34 +712,29 @@
return 0
/mob/living/silicon/robot/updateicon()
overlays.Cut()
cut_overlays()
if(stat == CONSCIOUS)
overlays += "eyes-[module_sprites[icontype]]"
add_overlay("eyes-[module_sprites[icontype]]")
if(opened)
var/panelprefix = custom_sprite ? "[src.ckey]-[src.name]" : "ov"
if(wiresexposed)
overlays += "[panelprefix]-openpanel +w"
add_overlay("[panelprefix]-openpanel +w")
else if(cell)
overlays += "[panelprefix]-openpanel +c"
add_overlay("[panelprefix]-openpanel +c")
else
overlays += "[panelprefix]-openpanel -c"
add_overlay("[panelprefix]-openpanel -c")
if(has_active_type(/obj/item/borg/combat/shield))
var/obj/item/borg/combat/shield/shield = locate() in src
if(shield && shield.active)
overlays += "[module_sprites[icontype]]-shield"
add_overlay("[module_sprites[icontype]]-shield")
if(modtype == "Combat")
if(module_active && istype(module_active,/obj/item/borg/combat/mobility))
icon_state = "[module_sprites[icontype]]-roll"
else
icon_state = module_sprites[icontype]
return
if(typing)
typing = FALSE
set_typing_indicator(1)
/mob/living/silicon/robot/proc/installed_modules()
if(weapon_lock)
@@ -45,21 +45,21 @@
..()
if(dogborg == TRUE && stat == CONSCIOUS)
if(sleeper_g == TRUE)
overlays += "[module_sprites[icontype]]-sleeper_g"
add_overlay("[module_sprites[icontype]]-sleeper_g")
if(sleeper_r == TRUE)
overlays += "[module_sprites[icontype]]-sleeper_r"
add_overlay("[module_sprites[icontype]]-sleeper_r")
if(istype(module_active,/obj/item/weapon/gun/energy/laser/mounted))
overlays += "laser"
add_overlay("laser")
if(istype(module_active,/obj/item/weapon/gun/energy/taser/mounted/cyborg))
overlays += "taser"
add_overlay("taser")
if(resting)
overlays.Cut() // Hide that gut for it has no ground sprite yo.
cut_overlays() // Hide that gut for it has no ground sprite yo.
icon_state = "[module_sprites[icontype]]-rest"
else
icon_state = "[module_sprites[icontype]]"
if(dogborg == TRUE && stat == DEAD)
icon_state = "[module_sprites[icontype]]-wreck"
overlays += "wreck-overlay"
add_overlay("wreck-overlay")
/mob/living/silicon/robot/Move(a, b, flag)
+1 -3
View File
@@ -220,9 +220,7 @@
var/get_rig_stats = 0 //Moved from computer.dm
var/hud_typing = 0 //Typing indicator stuff.
var/typing //Simple mobs use this variable.
var/typing
var/obj/effect/decal/typing_indicator
var/low_priority = FALSE //Skip processing life() if there's just no players on this Z-level
+2 -2
View File
@@ -11,7 +11,7 @@
set name = "Say"
set category = "IC"
set_typing_indicator(0)
set_typing_indicator(FALSE)
usr.say(message)
/mob/verb/me_verb(message as text)
@@ -24,7 +24,7 @@
message = sanitize(message)
set_typing_indicator(0)
set_typing_indicator(FALSE)
if(use_me)
usr.emote("me",usr.emote_type,message)
else
+1 -1
View File
@@ -15,7 +15,7 @@
if(!message)
return
set_typing_indicator(0)
set_typing_indicator(FALSE)
if(use_me)
usr.emote_vr("me",4,message)
else
+20 -35
View File
@@ -1,5 +1,9 @@
/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)
typing_indicator = new
//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_state = "[speech_bubble_appearance()]_typing"
if(client && !stat)
typing_indicator.invisibility = invisibility
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator))
add_overlay(typing_indicator)
else
if(state)
if(!typing)
add_overlay(typing_indicator)
typing = 1
else
if(typing)
cut_overlay(typing_indicator)
typing = 0
return state
if(state && !typing)
add_overlay(typing_indicator, TRUE)
typing = TRUE
else if(typing)
cut_overlay(typing_indicator, TRUE)
typing = FALSE
if(shadow) //Multi-Z above-me shadows
shadow.set_typing_indicator(state)
return state
/mob/verb/say_wrapper()
set name = ".Say"
set hidden = 1
if(!ishuman(src)) //If they're a mob, use the old code.
set_typing_indicator(1)
else if(is_preference_enabled(/datum/client_preference/show_typing_indicator))
hud_typing = 1
set_typing_indicator(TRUE)
var/message = input("","say (text)") as text
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
set_typing_indicator(FALSE)
if(message)
say_verb(message)
@@ -45,17 +38,9 @@
set name = ".Me"
set hidden = 1
if(!ishuman(src)) //If they're a mob, use the old code.
set_typing_indicator(1)
else if(is_preference_enabled(/datum/client_preference/show_typing_indicator))
hud_typing = 1
set_typing_indicator(TRUE)
var/message = input("","me (text)") as text
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)
set_typing_indicator(FALSE)
if(message)
me_verb(message)
-7
View File
@@ -118,13 +118,6 @@
if(shadow)
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)
if(!typing_indicator)
typing_indicator = new