[ready]Makes bIcon better

This commit is contained in:
CitadelStationBot
2017-08-13 17:41:12 -05:00
parent 6d72705ff5
commit bd35823012
68 changed files with 644 additions and 180 deletions
+45
View File
@@ -138,6 +138,13 @@ You can set verify to TRUE if you want send() to sleep until the client has the
/proc/register_asset(var/asset_name, var/asset)
SSassets.cache[asset_name] = asset
//Generated names do not include file extention.
//Used mainly for code that deals with assets in a generic way
//The same asset will always lead to the same asset name
/proc/generate_asset_name(var/file)
return "asset.[md5(fcopy_rsc(file))]"
//These datums are used to populate the asset cache, the proc "register()" does this.
//all of our asset datums, used for referring to these later
@@ -170,6 +177,33 @@ GLOBAL_LIST_EMPTY(asset_datums)
send_asset_list(client,assets,verify)
//Generates assets based on iconstates of a single icon
/datum/asset/simple/icon_states
var/icon
var/direction = SOUTH
var/frame = 1
var/movement_states = FALSE
var/prefix = "default" //asset_name = "[prefix].[icon_state_name].png"
var/generic_icon_names = FALSE //generate icon filenames using generate_asset_name() instead the above format
verify = FALSE
/datum/asset/simple/icon_states/register()
for(var/icon_state_name in icon_states(icon))
var/asset = icon(icon, icon_state_name, direction, frame, movement_states)
if (!asset)
continue
asset = fcopy_rsc(asset) //dedupe
var/asset_name = sanitize_filename("[prefix].[icon_state_name].png")
if (generic_icon_names)
asset_name = "[generate_asset_name(asset)].png"
assets[asset_name] = asset
..()
//DEFINITIONS FOR ASSET DATUMS START HERE.
/datum/asset/simple/tgui
@@ -306,3 +340,14 @@ GLOBAL_LIST_EMPTY(asset_datums)
for(var/path in typesof(/datum/html_interface))
var/datum/html_interface/hi = new path()
hi.registerResources()
//this exists purely to avoid meta by pre-loading all language icons.
/datum/asset/language/register()
for(var/path in typesof(/datum/language))
set waitfor = FALSE
var/datum/language/L = new path ()
L.get_icon()
/datum/asset/simple/icon_states/emojis
icon = 'icons/emoji.dmi'
generic_icon_names = TRUE