mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 01:57:01 +00:00
Language icons
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
#define NO_STUTTER 1
|
||||
#define TONGUELESS_SPEECH 2
|
||||
#define LANGUAGE_HIDE_ICON_IF_UNDERSTOOD 4
|
||||
#define LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD 8
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
if(flags & CLEAN_ON_MOVE)
|
||||
clean_on_move()
|
||||
|
||||
|
||||
var/datum/proximity_monitor/proximity_monitor = src.proximity_monitor
|
||||
if(proximity_monitor)
|
||||
proximity_monitor.HandleMove()
|
||||
@@ -628,4 +628,4 @@
|
||||
/atom/movable/proc/ConveyorMove(movedir)
|
||||
set waitfor = FALSE
|
||||
if(!anchored && has_gravity())
|
||||
step(src, movedir)
|
||||
step(src, movedir)
|
||||
|
||||
@@ -59,7 +59,12 @@ GLOBAL_LIST_INIT(freqtospan, list(
|
||||
//Message
|
||||
var/messagepart = " <span class='message'>[lang_treat(speaker, message_language, raw_message, spans, message_mode)]</span></span>"
|
||||
|
||||
return "[spanpart1][spanpart2][freqpart][compose_track_href(speaker, namepart)][namepart][compose_job(speaker, message_language, raw_message, radio_freq)][endspanpart][messagepart]"
|
||||
var/languageicon = ""
|
||||
var/datum/language/D = get_language_instance(message_language)
|
||||
if(D.display_icon(src))
|
||||
languageicon = D.get_icon()
|
||||
|
||||
return "[spanpart1][spanpart2][freqpart][compose_track_href(speaker, namepart)][namepart][compose_job(speaker, message_language, raw_message, radio_freq)][endspanpart][languageicon][messagepart]"
|
||||
|
||||
/atom/movable/proc/compose_track_href(atom/movable/speaker, message_langs, raw_message, radio_freq)
|
||||
return ""
|
||||
@@ -93,7 +98,7 @@ GLOBAL_LIST_INIT(freqtospan, list(
|
||||
return speaker.say_quote(raw_message, spans, message_mode)
|
||||
else if(language)
|
||||
var/atom/movable/AM = speaker.GetSource()
|
||||
var/datum/language/D = new language
|
||||
var/datum/language/D = get_language_instance(language)
|
||||
raw_message = D.scramble(raw_message)
|
||||
if(AM)
|
||||
return AM.say_quote(raw_message, spans, message_mode)
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
speech_verb = "says"
|
||||
whisper_verb = "whispers"
|
||||
key = "0"
|
||||
flags = TONGUELESS_SPEECH
|
||||
flags = TONGUELESS_SPEECH | LANGUAGE_HIDE_ICON_IF_UNDERSTOOD
|
||||
default_priority = 100
|
||||
|
||||
icon = 'icons/obj/cardboard_cutout.dmi'
|
||||
icon_state = "cutout_greytide"
|
||||
|
||||
//Syllable Lists
|
||||
/*
|
||||
This list really long, mainly because I can't make up my mind about which mandarin syllables should be removed,
|
||||
|
||||
@@ -12,3 +12,6 @@
|
||||
space_chance = 0
|
||||
sentence_chance = 0
|
||||
default_priority = 20
|
||||
|
||||
icon = 'icons/mob/drone.dmi'
|
||||
icon_state = "drone_repair"
|
||||
|
||||
@@ -21,6 +21,22 @@
|
||||
var/static/list/scramble_cache = list()
|
||||
var/default_priority = 0 // the language that an atom knows with the highest "default_priority" is selected by default.
|
||||
|
||||
var/icon
|
||||
var/icon_state
|
||||
|
||||
/datum/language/proc/display_icon(atom/movable/hearer)
|
||||
if(isobserver(hearer))
|
||||
return TRUE
|
||||
var/understands = hearer.has_language(src.type)
|
||||
if(flags & LANGUAGE_HIDE_ICON_IF_UNDERSTOOD && understands)
|
||||
return FALSE
|
||||
if(flags & LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD && !understands)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/language/proc/get_icon()
|
||||
return "<img class=icon src=\ref[icon] iconstate='[icon_state]'>"
|
||||
|
||||
/datum/language/proc/get_random_name(gender, name_count=2, syllable_count=4, syllable_divisor=2)
|
||||
if(!syllables || !syllables.len)
|
||||
if(gender==FEMALE)
|
||||
@@ -93,3 +109,13 @@
|
||||
return speech_verb
|
||||
|
||||
#undef SCRAMBLE_CACHE_LEN
|
||||
|
||||
/proc/get_language_instance(langtype)
|
||||
if(!ispath(langtype, /datum/language))
|
||||
return
|
||||
|
||||
if(!GLOB.language_datums[langtype])
|
||||
var/datum/language/langdatum = new langtype
|
||||
GLOB.language_datums[langtype] = langdatum
|
||||
|
||||
. = GLOB.language_datums[langtype]
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
space_chance = 10
|
||||
default_priority = 90
|
||||
|
||||
icon = 'icons/mob/robots.dmi'
|
||||
icon_state = "robot_old"
|
||||
|
||||
/datum/language/machine/get_random_name()
|
||||
if(prob(70))
|
||||
return "[pick(GLOB.posibrain_names)]-[rand(100, 999)]"
|
||||
|
||||
@@ -9,3 +9,6 @@
|
||||
space_chance = 100
|
||||
syllables = list("oop", "aak", "chee", "eek")
|
||||
default_priority = 80
|
||||
|
||||
icon = 'icons/obj/hydroponics/harvest.dmi'
|
||||
icon_state = "banana"
|
||||
|
||||
@@ -8,5 +8,8 @@
|
||||
default_priority = 10
|
||||
spans = list(SPAN_ROBOT, "brass")
|
||||
|
||||
icon = 'icons/obj/clockwork_objects.dmi'
|
||||
icon_state = "wall_gear"
|
||||
|
||||
/datum/language/ratvar/scramble(var/input)
|
||||
. = text2ratvar(input)
|
||||
|
||||
@@ -8,3 +8,6 @@
|
||||
key = "k"
|
||||
syllables = list("qr","qrr","xuq","qil","quum","xuqm","vol","xrim","zaoo","qu-uu","qix","qoo","zix","*","!")
|
||||
default_priority = 70
|
||||
|
||||
icon = 'icons/mob/slimes.dmi'
|
||||
icon_state = "grey adult slime"
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
space_chance = 100
|
||||
sentence_chance = 0
|
||||
default_priority = 60
|
||||
|
||||
icon = 'icons/mob/swarmer.dmi'
|
||||
icon_state = "swarmer"
|
||||
|
||||
// since various flats and sharps are the same,
|
||||
// all non-accidental notes are doubled in the list
|
||||
/* The list with unicode symbols for the accents.
|
||||
|
||||
@@ -8,3 +8,6 @@
|
||||
key = "4"
|
||||
syllables = list("sss","sSs","SSS")
|
||||
default_priority = 50
|
||||
|
||||
icon = 'icons/mob/alien.dmi'
|
||||
icon_state = "alienq"
|
||||
|
||||
Reference in New Issue
Block a user