mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 07:28:53 +01:00
chat assets
This commit is contained in:
@@ -343,16 +343,17 @@
|
||||
//The icon var could be local in the proc, but it's a waste of resources
|
||||
// to always create it and then throw it out.
|
||||
/var/icon/text_tag_icons = 'icons/chattags.dmi'
|
||||
/var/list/text_tag_cache = list()
|
||||
GLOBAL_LIST_EMPTY(text_tag_cache)
|
||||
|
||||
/proc/create_text_tag(var/tagname, var/tagdesc = tagname, var/client/C = null)
|
||||
if(!(C && C.prefs?.read_preference(/datum/preference/toggle/chat_tags)))
|
||||
return tagdesc
|
||||
if(!text_tag_cache[tagname])
|
||||
var/icon/tag = icon(text_tag_icons, tagname)
|
||||
text_tag_cache[tagname] = tag
|
||||
if(!GLOB.text_tag_cache[tagname])
|
||||
var/datum/asset/spritesheet/chatassets = get_asset_datum(/datum/asset/spritesheet/chat)
|
||||
GLOB.text_tag_cache[tagname] = chatassets.icon_tag(tagname)
|
||||
if(!C.tgui_panel.is_ready() || C.tgui_panel.oldchat)
|
||||
return "<IMG src='\ref[text_tag_icons]' class='text_tag' iconstate='[tagname]'" + (tagdesc ? " alt='[tagdesc]'" : "") + ">"
|
||||
return icon2html(text_tag_cache[tagname], C, extra_classes = "text_tag")
|
||||
return GLOB.text_tag_cache[tagname]
|
||||
|
||||
/proc/create_text_tag_old(var/tagname, var/tagdesc = tagname, var/client/C = null)
|
||||
if(!(C && C.prefs?.read_preference(/datum/preference/toggle/chat_tags)))
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/datum/configuration/load()
|
||||
. = ..()
|
||||
SSassets.OnConfigLoad()
|
||||
|
||||
SUBSYSTEM_DEF(assets)
|
||||
name = "Assets"
|
||||
init_order = INIT_ORDER_ASSETS
|
||||
@@ -27,6 +23,7 @@ SUBSYSTEM_DEF(assets)
|
||||
|
||||
|
||||
/datum/controller/subsystem/assets/Initialize()
|
||||
OnConfigLoad()
|
||||
|
||||
for(var/type in typesof(/datum/asset))
|
||||
var/datum/asset/A = type
|
||||
|
||||
@@ -2,5 +2,4 @@
|
||||
name = "chat"
|
||||
|
||||
/datum/asset/spritesheet/chat/create_spritesheets()
|
||||
//honk
|
||||
//This function has to be overridden otherwise it will generate runtimes
|
||||
InsertAll("", text_tag_icons) //Chomp - OOC, LOOC ect icons
|
||||
|
||||
Reference in New Issue
Block a user