mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 07:28:53 +01:00
TGUI Say (#16160)
* TGUI Say * Add icon_ref_map.json to make tgui-dev-server stop screaming * Update tgui.bundle.js * bundle recompile --------- Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Heroman <alesha3000@list.ru>
This commit is contained in:
co-authored by
Heroman3003
Heroman
parent
bd1d79aebf
commit
7a7920f29e
@@ -1,4 +1,4 @@
|
||||
/proc/generate_speech_bubble(var/bubble_loc, var/speech_state, var/set_layer = FLOAT_LAYER)
|
||||
/proc/generate_speech_bubble(bubble_loc, speech_state, set_layer = FLOAT_LAYER)
|
||||
var/image/I = image('icons/mob/talk_vr.dmi', bubble_loc, speech_state, set_layer) //VOREStation Edit - talk_vr.dmi instead of talk.dmi for right-side icons
|
||||
I.appearance_flags |= (RESET_COLOR|PIXEL_SCALE) //VOREStation Edit
|
||||
/* //VOREStation Removal Start
|
||||
@@ -11,77 +11,69 @@
|
||||
*/ //VOREStation Removal Start
|
||||
return I
|
||||
|
||||
/mob/proc/init_typing_indicator(var/set_state = "typing")
|
||||
if(typing_indicator)
|
||||
qdel(typing_indicator)
|
||||
typing_indicator = null
|
||||
typing_indicator = new
|
||||
typing_indicator.appearance = generate_speech_bubble(null, set_state)
|
||||
typing_indicator.appearance_flags |= (RESET_COLOR|PIXEL_SCALE) //VOREStation Edit
|
||||
/mob/verb/say_wrapper()
|
||||
set name = "Say verb"
|
||||
set category = "IC"
|
||||
|
||||
/mob/proc/set_typing_indicator(var/state) //Leaving this here for mobs.
|
||||
|
||||
if(!is_preference_enabled(/datum/client_preference/show_typing_indicator))
|
||||
if(typing_indicator)
|
||||
cut_overlay(typing_indicator, TRUE)
|
||||
if(is_preference_enabled(/datum/client_preference/tgui_say))
|
||||
winset(src, null, "command=[client.tgui_say_create_open_command(SAY_CHANNEL)]")
|
||||
return
|
||||
|
||||
var/cur_bubble_appearance = custom_speech_bubble
|
||||
if(!cur_bubble_appearance || cur_bubble_appearance == "default")
|
||||
cur_bubble_appearance = speech_bubble_appearance()
|
||||
if(!typing_indicator || cur_typing_indicator != cur_bubble_appearance)
|
||||
init_typing_indicator("[cur_bubble_appearance]_typing")
|
||||
|
||||
if(state && !typing)
|
||||
add_overlay(typing_indicator, TRUE)
|
||||
typing = TRUE
|
||||
typing_indicator_active = typing_indicator
|
||||
else if(typing)
|
||||
cut_overlay(typing_indicator_active, TRUE)
|
||||
typing = FALSE
|
||||
if(typing_indicator_active != typing_indicator)
|
||||
qdel(typing_indicator_active)
|
||||
typing_indicator_active = null
|
||||
|
||||
return state
|
||||
|
||||
/mob/verb/say_wrapper()
|
||||
set name = ".Say"
|
||||
set hidden = 1
|
||||
|
||||
set_typing_indicator(TRUE)
|
||||
client?.start_thinking()
|
||||
client?.start_typing()
|
||||
var/message = tgui_input_text(usr, "Type your message:", "Say")
|
||||
set_typing_indicator(FALSE)
|
||||
client?.stop_thinking()
|
||||
|
||||
if(message)
|
||||
say_verb(message)
|
||||
|
||||
/mob/verb/me_wrapper()
|
||||
set name = ".Me"
|
||||
set hidden = 1
|
||||
set name = "Me verb"
|
||||
set category = "IC"
|
||||
|
||||
set_typing_indicator(TRUE)
|
||||
if(is_preference_enabled(/datum/client_preference/tgui_say))
|
||||
winset(src, null, "command=[client.tgui_say_create_open_command(ME_CHANNEL)]")
|
||||
return
|
||||
|
||||
client?.start_thinking()
|
||||
client?.start_typing()
|
||||
var/message = tgui_input_text(usr, "Type your message:", "Emote", multiline = TRUE)
|
||||
set_typing_indicator(FALSE)
|
||||
client?.stop_thinking()
|
||||
|
||||
if(message)
|
||||
me_verb(message)
|
||||
|
||||
// No typing indicators here, but this is the file where the wrappers are, so...
|
||||
/mob/verb/whisper_wrapper()
|
||||
set name = ".Whisper"
|
||||
set hidden = 1
|
||||
set name = "Whisper verb"
|
||||
set category = "IC"
|
||||
|
||||
if(is_preference_enabled(/datum/client_preference/tgui_say))
|
||||
winset(src, null, "command=[client.tgui_say_create_open_command(WHIS_CHANNEL)]")
|
||||
return
|
||||
|
||||
if(is_preference_enabled(/datum/client_preference/show_typing_indicator_subtle))
|
||||
client?.start_thinking()
|
||||
client?.start_typing()
|
||||
var/message = tgui_input_text(usr, "Type your message:", "Whisper")
|
||||
client?.stop_thinking()
|
||||
|
||||
if(message)
|
||||
whisper(message)
|
||||
|
||||
/mob/verb/subtle_wrapper()
|
||||
set name = ".Subtle"
|
||||
set hidden = 1
|
||||
set name = "Subtle verb"
|
||||
set category = "IC"
|
||||
set desc = "Emote to nearby people (and your pred/prey)"
|
||||
|
||||
if(is_preference_enabled(/datum/client_preference/tgui_say))
|
||||
winset(src, null, "command=[client.tgui_say_create_open_command(SUBTLE_CHANNEL)]")
|
||||
return
|
||||
|
||||
if(is_preference_enabled(/datum/client_preference/show_typing_indicator_subtle))
|
||||
client?.start_thinking()
|
||||
client?.start_typing()
|
||||
var/message = tgui_input_text(usr, "Type your message:", "Subtle", multiline = TRUE)
|
||||
client?.stop_thinking()
|
||||
|
||||
if(message)
|
||||
me_verb_subtle(message)
|
||||
|
||||
Reference in New Issue
Block a user