Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTS #4

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
203097e
TTS initialize port
PhantornRU Nov 2, 2024
a40a655
world_topic initialize port
PhantornRU Nov 2, 2024
a323884
world topic
PhantornRU Nov 2, 2024
c1150a6
change to paradise tts
PhantornRU Nov 2, 2024
e0045a1
spans, surgery, vv
PhantornRU Nov 2, 2024
fb0a3ca
off megaphone and announcer
PhantornRU Nov 2, 2024
2d1ad73
SHELLEO
PhantornRU Nov 2, 2024
dd954cf
defines clear
PhantornRU Nov 6, 2024
17d5098
pref clear
PhantornRU Nov 6, 2024
9cc518e
Config Get (without config)
PhantornRU Nov 6, 2024
127bf41
port rust_utils
PhantornRU Nov 9, 2024
66bcec8
redefines, rerust + sounds channels
PhantornRU Nov 9, 2024
313f6a9
off donator level
PhantornRU Nov 9, 2024
766cd56
dna remove
PhantornRU Nov 9, 2024
0e4863f
громкость ТТС
PhantornRU Nov 9, 2024
cc6ab65
subsystem fix - volume prefs TTS code
PhantornRU Nov 9, 2024
9ad8711
remove responce team member tts
PhantornRU Nov 9, 2024
c7a6c5b
remove UpdateAppearance(list/UI)
PhantornRU Nov 9, 2024
c7074c4
config entry string
PhantornRU Nov 10, 2024
6e3164d
Copy To
PhantornRU Nov 10, 2024
61df1b1
ui, sound, pref saves
PhantornRU Nov 10, 2024
7c717e6
preference - remove active character
PhantornRU Nov 10, 2024
0208f85
flag enabled to SStts220
PhantornRU Nov 10, 2024
2c6cb34
replace combine message to treat_tts_message
PhantornRU Nov 10, 2024
132eb3c
TGUI interface add
PhantornRU Nov 10, 2024
52bbcc3
TGUI Fix by Aylongo
PhantornRU Nov 11, 2024
393a961
vv change tts topic
PhantornRU Nov 11, 2024
c95aef2
rust_g move
PhantornRU Nov 11, 2024
f298ab4
Aylong0 .tsx TGUI interface fix
PhantornRU Nov 17, 2024
1edfa15
rust update?
PhantornRU Nov 17, 2024
c11d4ad
librust_utils.dll
PhantornRU Nov 17, 2024
c92330d
request silero http test rework
PhantornRU Nov 24, 2024
b128dfc
ttsServer
PhantornRU Nov 24, 2024
7ad6103
SStts220 SS_INIT_SUCCESS
PhantornRU Nov 24, 2024
93fbb11
volume preferences upstream
PhantornRU Dec 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
spans, surgery, vv
  • Loading branch information
PhantornRU committed Dec 28, 2024
commit e0045a1369f0b65fd5a8afb6d6f312365e3aa322
169 changes: 169 additions & 0 deletions modular/_defines220/code/defines/spans.dm
Original file line number Diff line number Diff line change
@@ -1 +1,170 @@
#define span_maptext(str) ("<span class='maptext'>" + str + "</span>")

// From TG / BandaStation
// From 'goon\browserassets\css\browserOutput.css'
#define span_darkmblue(str) ("<span class='darkmblue'>" + str + "</span>")
#define span_prefix(str) ("<span class='prefix'>" + str + "</span>")
#define span_ooc(str) ("<span class='ooc'>" + str + "</span>")
#define span_looc(str) ("<span class='looc'>" + str + "</span>")
#define span_adminobserverooc(str) ("<span class='adminobserverooc'>" + str + "</span>")
#define span_adminooc(str) ("<span class='adminooc'>" + str + "</span>")
#define span_adminobserver(str) ("<span class='adminobserver'>" + str + "</span>")
#define span_admin(str) ("<span class='admin'>" + str + "</span>")
#define span_adminsay(str) ("<span class='adminsay'>" + str + "</span>")
#define span_mentorhelp(str) ("<span class='mentorhelp'>" + str + "</span>")
#define span_adminhelp(str) ("<span class='adminhelp'>" + str + "</span>")
#define span_playerreply(str) ("<span class='playerreply'>" + str + "</span>")
#define span_pmsend(str) ("<span class='pmsend'>" + str + "</span>")
#define span_debug(str) ("<span class='debug'>" + str + "</span>")
#define span_name(str) ("<span class='name'>" + str + "</span>")
#define span_say(str) ("<span class='say'>" + str + "</span>")
#define span_yell(str) ("<span class='yell'>" + str + "</span>")
#define span_siliconsay(str) ("<span class='siliconsay'>" + str + "</span>")
#define span_deadsay(str) ("<span class='deadsay'>" + str + "</span>")
#define span_radio(str) ("<span class='radio'>" + str + "</span>")
#define span_deptradio(str) ("<span class='deptradio'>" + str + "</span>")
#define span_comradio(str) ("<span class='comradio'>" + str + "</span>")
#define span_syndradio(str) ("<span class='syndradio'>" + str + "</span>")
#define span_dsquadradio(str) ("<span class='dsquadradio'>" + str + "</span>")
#define span_resteamradio(str) ("<span class='resteamradio'>" + str + "</span>")
#define span_airadio(str) ("<span class='airadio'>" + str + "</span>")
#define span_centradio(str) ("<span class='centradio'>" + str + "</span>")
#define span_secradio(str) ("<span class='secradio'>" + str + "</span>")
#define span_engradio(str) ("<span class='engradio'>" + str + "</span>")
#define span_medradio(str) ("<span class='medradio'>" + str + "</span>")
#define span_sciradio(str) ("<span class='sciradio'>" + str + "</span>")
#define span_supradio(str) ("<span class='supradio'>" + str + "</span>")
#define span_srvradio(str) ("<span class='srvradio'>" + str + "</span>")
#define span_proradio(str) ("<span class='proradio'>" + str + "</span>")
#define span_admin_channel(str) ("<span class='admin_channel'>" + str + "</span>")
#define span_all_admin_ping(str) ("<span class='all_admin_ping'>" + str + "</span>")
#define span_mentor_channel(str) ("<span class='mentor_channel'>" + str + "</span>")
#define span_mentor_channel_admin(str) ("<span class='mentor_channel_admin'>" + str + "</span>")
#define span_djradio(str) ("<span class='djradio'>" + str + "</span>")
#define span_binaryradio(str) ("<span class='binaryradio'>" + str + "</span>")
#define span_mommiradio(str) ("<span class='mommiradio'>" + str + "</span>")
#define span_alert(str) ("<span class='alert'>" + str + "</span>")
#define span_ghostalert(str) ("<span class='ghostalert'>" + str + "</span>")
#define span_emote(str) ("<span class='emote'>" + str + "</span>")
#define span_selecteddna(str) ("<span class='selecteddna'>" + str + "</span>")

#define span_attack(str) ("<span class='attack'>" + str + "</span>")
#define span_moderate(str) ("<span class='moderate'>" + str + "</span>")
#define span_disarm(str) ("<span class='disarm'>" + str + "</span>")
#define span_passive(str) ("<span class='passive'>" + str + "</span>")

#define span_warning(str) ("<span class='warning'>" + str + "</span>")
#define span_boldwarning(str) ("<span class='boldwarning'>" + str + "</span>")
#define span_danger(str) ("<span class='danger'>" + str + "</span>")
#define span_userdanger(str) ("<span class='userdanger'>" + str + "</span>")
#define span_biggerdanger(str) ("<span class='biggerdanger'>" + str + "</span>")

#define span_info(str) ("<span class='info'>" + str + "</span>")
#define span_notice(str) ("<span class='notice'>" + str + "</span>")
#define span_boldnotice(str) ("<span class='boldnotice'>" + str + "</span>")
#define span_suicide(str) ("<span class='suicide'>" + str + "</span>")
#define span_green(str) ("<span class='green'>" + str + "</span>")
#define span_pr_announce(str) ("<span class='pr_announce'>" + str + "</span>")
#define span_boldannounce(str) ("<span class='boldannounce'>" + str + "</span>")
#define span_greenannounce(str) ("<span class='greenannounce'>" + str + "</span>")

#define span_alien(str) ("<span class='alien'>" + str + "</span>")
#define span_noticealien(str) ("<span class='noticealien'>" + str + "</span>")
#define span_alertalien(str) ("<span class='alertalien'>" + str + "</span>")
#define span_terrorspider(str) ("<span class='terrorspider'>" + str + "</span>")
#define span_dantalion(str) ("<span class='dantalion'>" + str + "</span>")

#define span_sinister(str) ("<span class='sinister'>" + str + "</span>")
#define span_blob(str) ("<span class='blob'>" + str + "</span>")
#define span_confirm(str) ("<span class='confirm'>" + str + "</span>")
#define span_rose(str) ("<span class='rose'>" + str + "</span>")
#define span_sans(str) ("<span class='sans'>" + str + "</span>")
#define span_wingdings(str) ("<span class='wingdings'>" + str + "</span>")
#define span_robot(str) ("<span class='robot'>" + str + "</span>")
#define span_ancient(str) ("<span class='ancient'>" + str + "</span>")
#define span_newscaster(str) ("<span class='newscaster'>" + str + "</span>")
#define span_mod(str) ("<span class='mod'>" + str + "</span>")
#define span_modooc(str) ("<span class='modooc'>" + str + "</span>")
#define span_adminmod(str) ("<span class='adminmod'>" + str + "</span>")
#define span_tajaran(str) ("<span class='tajaran'>" + str + "</span>")
#define span_skrell(str) ("<span class='skrell'>" + str + "</span>")
#define span_solcom(str) ("<span class='solcom'>" + str + "</span>")
#define span_com_srus(str) ("<span class='com_srus'>" + str + "</span>")
#define span_zombie(str) ("<span class='zombie'>" + str + "</span>")
#define span_soghun(str) ("<span class='soghun'>" + str + "</span>")
#define span_changeling(str) ("<span class='changeling'>" + str + "</span>")
#define span_vox(str) ("<span class='vox'>" + str + "</span>")
#define span_diona(str) ("<span class='diona'>" + str + "</span>")
#define span_trinary(str) ("<span class='trinary'>" + str + "</span>")
#define span_kidan(str) ("<span class='kidan'>" + str + "</span>")
#define span_slime(str) ("<span class='slime'>" + str + "</span>")
#define span_drask(str) ("<span class='drask'>" + str + "</span>")
#define span_moth(str) ("<span class='moth'>" + str + "</span>")
#define span_clown(str) ("<span class='clown'>" + str + "</span>")
#define span_vulpkanin(str) ("<span class='vulpkanin'>" + str + "</span>")
#define span_abductor(str) ("<span class='abductor'>" + str + "</span>")
#define span_mind_control(str) ("<span class='mind_control'>" + str + "</span>")
#define span_rough(str) ("<span class='rough'>" + str + "</span>")
#define span_say_quote(str) ("<span class='say_quote'>" + str + "</span>")
#define span_cult(str) ("<span class='cult'>" + str + "</span>")
#define span_cultspeech(str) ("<span class='cultspeech'>" + str + "</span>")
#define span_cultitalic(str) ("<span class='cultitalic'>" + str + "</span>")
#define span_cultlarge(str) ("<span class='cultlarge'>" + str + "</span>")
#define span_narsie(str) ("<span class='narsie'>" + str + "</span>")
#define span_narsiesmall(str) ("<span class='narsiesmall'>" + str + "</span>")
#define span_interface(str) ("<span class='interface'>" + str + "</span>")
#define span_big(str) ("<span class='big'>" + str + "</span>")
#define span_reallybig(str) ("<span class='reallybig'>" + str + "</span>")
#define span_greentext(str) ("<span class='greentext'>" + str + "</span>")
#define span_redtext(str) ("<span class='redtext'>" + str + "</span>")
#define span_bold(str) ("<span class='bold'>" + str + "</span>")
#define span_his_grace(str) ("<span class='his_grace'>" + str + "</span>")
#define span_center(str) ("<span class='center'>" + str + "</span>")
#define span_red(str) ("<span class='red'>" + str + "</span>")
#define span_purple(str) ("<span class='purple'>" + str + "</span>")
#define span_skeleton(str) ("<span class='skeleton'>" + str + "</span>")
#define span_gutter(str) ("<span class='gutter'>" + str + "</span>")
#define span_orange(str) ("<span class='orange'>" + str + "</span>")
#define span_orangei(str) ("<span class='orangei'>" + str + "</span>")
#define span_orangeb(str) ("<span class='orangeb'>" + str + "</span>")
#define span_resonate(str) ("<span class='resonate'>" + str + "</span>")

#define span_revennotice(str) ("<span class='revennotice'>" + str + "</span>")
#define span_revenboldnotice(str) ("<span class='revenboldnotice'>" + str + "</span>")
#define span_revenbignotice(str) ("<span class='revenbignotice'>" + str + "</span>")
#define span_revenminor(str) ("<span class='revenminor'>" + str + "</span>")
#define span_revenwarning(str) ("<span class='revenwarning'>" + str + "</span>")
#define span_revendanger(str) ("<span class='revendanger'>" + str + "</span>")

#define span_specialnoticebold(str) ("<span class='specialnoticebold'>" + str + "</span>")

#define span_specialnotice(str) ("<span class='specialnotice'>" + str + "</span>")

#define span_good(str) ("<span class='good'>" + str + "</span>")
#define span_average(str) ("<span class='average'>" + str + "</span>")
#define span_bad(str) ("<span class='bad'>" + str + "</span>")
#define span_italics(str) ("<span class='italics'>" + str + "</span>")
#define span_talkinto(str) ("<span class='talkinto'>" + str + "</span>")
#define span_whisper(str) ("<span class='whisper'>" + str + "</span>")
#define span_recruit(str) ("<span class='recruit'>" + str + "</span>")

#define span_memo(str) ("<span class='memo'>" + str + "</span>")
#define span_memoedit(str) ("<span class='memoedit'>" + str + "</span>")
#define span_connectionClosed(str) ("<span class='connectionClosed'>" + str + "</span>")
#define span_fatalError(str) ("<span class='fatalError'>" + str + "</span>")

#define span_rebooting(str) ("<span class='rebooting'>" + str + "</span>")

#define span_colossus(str) ("<span class='colossus'>" + str + "</span>")
#define span_hierophant(str) ("<span class='hierophant'>" + str + "</span>")
#define span_hierophant_warning(str) ("<span class='hierophant_warning '>" + str + "</span>")

#define span_emoji(str) ("<span class='emoji'>" + str + "</span>")

#define span_adminticket(str) ("<span class='adminticket'>" + str + "</span>")

#define span_adminticketalt(str) ("<span class='adminticketalt'>" + str + "</span>")

#define span_announcement(str) ("<span class='announcement'>" + str + "</span>")

#define span_bolditalics(str) ("<span class='bolditalics'>" + str + "</span>")
2 changes: 2 additions & 0 deletions modular/_defines220/code/defines/text_to_speech.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#define VV_HK_SELECT_TTS_VOICE "select_tts_voice"

#define VV_HK_MODIFY_TRAITS "changetts"

#define TTS_TRAIT_PITCH_WHISPER (1<<1)
#define TTS_TRAIT_RATE_FASTER (1<<2)
#define TTS_TRAIT_RATE_MEDIUM (1<<3)
Expand Down
1 change: 0 additions & 1 deletion modular/text_to_speech/_tts.dme
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "code/tts_surgery.dm"
#include "code/tts_megaphone.dm"
#include "code/tts_vv.dm"
#include "code/obj/hologram.dm"

#include "code/base_seeds/mobs/_base.dm"
#include "code/base_seeds/mobs/alien.dm"
Expand Down
16 changes: 11 additions & 5 deletions modular/text_to_speech/code/hear.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/*
Тут нету комбинировки, но потенциально нужно будет использовать
/mob/combine_message(list/message_pieces, verb, mob/speaker, always_stars)
. = ..()
return replace_characters(., list("+"))
*/

/mob/hear_say(list/message_pieces, verb, italics, mob/speaker, sound/speech_sound, sound_vol, sound_frequency, use_voice)
. = ..()
Expand All @@ -12,15 +15,18 @@
. = ..()
if(hard_to_hear || !speaker)
return
speaker.cast_tts(src, message_pieces, src, FALSE, SOUND_EFFECT_RADIO, postSFX = 'modular_ss220/text_to_speech/code/sound/radio_chatter.ogg')

/mob/hear_holopad_talk(list/message_pieces, verb, mob/speaker, obj/effect/overlay/holo_pad_hologram/H)
. = ..()
speaker.cast_tts(src, message_pieces, H, TRUE, SOUND_EFFECT_RADIO)
speaker.cast_tts(src, message_pieces, src, FALSE, SOUND_EFFECT_RADIO, postSFX = 'modular/text_to_speech/code/sound/radio_chatter.ogg')

/*
/atom/atom_say(message)
. = ..()
if(!message)
return
for(var/mob/M in get_mobs_in_view(7, src))
cast_tts(M, message)

По идее нам не нужно, тот же телефон и прочие структуры используют
/obj/item/phone/proc/handle_hear(message, datum/language/L, mob/speaking)
что внутри уже использует hear_radio
TODO: нужно в целом проверить нормально ли "слышится" ТТС по телефону.
*/
5 changes: 0 additions & 5 deletions modular/text_to_speech/code/obj/hologram.dm

This file was deleted.

59 changes: 16 additions & 43 deletions modular/text_to_speech/code/tts_surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,42 @@
// Surgery for organics
/datum/surgery/vocal_cords_surgery
name = "Vocal Cords Tuning Surgery"
invasiveness = list(SURGERY_DEPTH_DEEP)
required_surgery_skill = SKILL_SURGERY_TRAINED
pain_reduction_required = PAIN_REDUCTION_MEDIUM
steps = list(
/datum/surgery_step/generic/cut_open,
/datum/surgery_step/generic/retract_skin,
/datum/surgery_step/incision,
/datum/surgery_step/clamp_bleeders_step,
/datum/surgery_step/retract_skin,
/datum/surgery_step/tune_vocal_cords,
/datum/surgery_step/generic/cauterize
/datum/surgery_step/cauterize
)
possible_locs = list(BODY_ZONE_PRECISE_MOUTH)
possible_locs = list("mouth")


/datum/surgery/vocal_cords_surgery/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(!H.check_has_mouth())
return FALSE
return TRUE
return TRUE
// if(ishuman(target))
// return TRUE
// return FALSE

/datum/surgery_step/tune_vocal_cords
name = "tune vocal cords"
allowed_tools = list(/obj/item/scalpel = 100, /obj/item/kitchen/knife = 50, /obj/item/wirecutters = 35)
time = 6 SECONDS
var/target_vocal = "vocal cords"

/datum/surgery_step/tune_vocal_cords/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/tune_vocal_cords/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, tool_type, datum/surgery/surgery)
user.visible_message("[user] begins to tune [target]'s vocals.", span_notice("You begin to tune [target]'s vocals..."))
..()

/datum/surgery_step/tune_vocal_cords/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/tune_vocal_cords/success(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, tool_type, datum/surgery/surgery)
target.change_tts_seed(user, FALSE, TRUE)
user.visible_message("[user] tunes [target]'s vocals completely!", span_notice("You tune [target]'s vocals completely."))
return TRUE

/datum/surgery_step/tune_vocal_cords/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/organ/external/head/head = target.get_organ(target_zone)
/datum/surgery_step/tune_vocal_cords/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, tool_type, datum/surgery/surgery)
user.visible_message(span_warning("[user]'s hand slips, tearing [target_vocal] in [target]'s throat with [tool]!"), \
span_warning("Your hand slips, tearing [target_vocal] in [target]'s throat with [tool]!"))
target.AddComponent(/datum/component/tts_component, SStts220.get_random_seed(target))
target.apply_damage(10, BRUTE, head, sharp = TRUE)
target.apply_damage(15, BRUTE, target_zone)
return FALSE

// Surgery for IPC
/datum/surgery/vocal_cords_surgery/ipc
name = "Microphone Setup Operation"
steps = list(
/datum/surgery_step/robotics/external/unscrew_hatch,
/datum/surgery_step/robotics/external/open_hatch,
/datum/surgery_step/tune_vocal_cords/ipc,
/datum/surgery_step/robotics/external/close_hatch
)
requires_organic_bodypart = FALSE

/datum/surgery/vocal_cords_surgery/ipc/can_start(mob/user, mob/living/carbon/target)
if(!ishuman(target))
return FALSE

var/mob/living/carbon/human/H = target
var/obj/item/organ/external/head/affected = H.get_organ(user.zone_selected)
if(!affected)
return FALSE
if(!affected.is_robotic())
return FALSE
return TRUE

/datum/surgery_step/tune_vocal_cords/ipc
name = "microphone setup"
allowed_tools = list(/obj/item/multitool = 100, /obj/item/screwdriver = 55, /obj/item/scalpel = 25, /obj/item/kitchen/knife = 20)
target_vocal = "microphone"
6 changes: 3 additions & 3 deletions modular/text_to_speech/code/tts_vv.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/client/view_var_Topic(href, href_list, hsrc)
. = ..()
if(href_list["changetts"])
if(href_list[VV_HK_MODIFY_TRAITS])
if(!check_rights(R_VAREDIT))
return
var/atom/A = locateUID(href_list["changetts"])
var/atom/A = locate(href_list[VV_HK_MODIFY_TRAITS])
A.change_tts_seed(src.mob, TRUE, TRUE)

/atom/vv_get_dropdown()
. = ..()
.["Change TTS"] = "?_src_=vars;changetts=[UID()]"
VV_DROPDOWN_OPTION(VV_HK_MODIFY_TRAITS, "Change TTS")