mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 11:05:50 +01:00
Convert robot icons to iconforge, update iconforge to not break on them (#16793)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/datum/asset/spritesheet/chat
|
||||
/datum/asset/spritesheet_batched/chat
|
||||
name = "chat"
|
||||
|
||||
/datum/asset/spritesheet/chat/create_spritesheets()
|
||||
InsertAll("", text_tag_icons) // OOC, LOOC ect icons
|
||||
/datum/asset/spritesheet_batched/chat/create_spritesheets()
|
||||
insert_all_icons("", text_tag_icons, prefix_with_dirs = FALSE) // OOC, LOOC ect icons
|
||||
|
||||
@@ -1,36 +1,52 @@
|
||||
/datum/asset/spritesheet/robot_icons
|
||||
/datum/asset/spritesheet_batched/robot_icons
|
||||
name = "robot_icons"
|
||||
|
||||
/datum/asset/spritesheet/robot_icons/create_spritesheets()
|
||||
/datum/asset/spritesheet_batched/robot_icons/create_spritesheets()
|
||||
for(var/datum/robot_sprite/S as anything in typesof(/datum/robot_sprite))
|
||||
if(!S.name || !S.sprite_icon_state) // snowflake out those customs... they suck
|
||||
continue
|
||||
var/icon/I_N = icon(S.sprite_icon, S.sprite_icon_state, NORTH)
|
||||
var/icon/I_S = icon(S.sprite_icon, S.sprite_icon_state, SOUTH)
|
||||
var/icon/I_W = icon(S.sprite_icon, S.sprite_icon_state, WEST)
|
||||
var/icon/I_E = icon(S.sprite_icon, S.sprite_icon_state, EAST)
|
||||
|
||||
var/datum/universal_icon/I_N = uni_icon(S.sprite_icon, S.sprite_icon_state, NORTH)
|
||||
var/datum/universal_icon/I_S = uni_icon(S.sprite_icon, S.sprite_icon_state, SOUTH)
|
||||
var/datum/universal_icon/I_W = uni_icon(S.sprite_icon, S.sprite_icon_state, WEST)
|
||||
var/datum/universal_icon/I_E = uni_icon(S.sprite_icon, S.sprite_icon_state, EAST)
|
||||
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_NE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", NORTH)
|
||||
var/datum/universal_icon/I_NE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", NORTH)
|
||||
if(I_NE)
|
||||
I_N.Blend(I_NE, ICON_OVERLAY)
|
||||
I_N.blend_icon(I_NE, ICON_OVERLAY)
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_SE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", SOUTH)
|
||||
var/datum/universal_icon/I_SE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", SOUTH)
|
||||
if(I_SE)
|
||||
I_S.Blend(I_SE, ICON_OVERLAY)
|
||||
I_S.blend_icon(I_SE, ICON_OVERLAY)
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_WE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", WEST)
|
||||
var/datum/universal_icon/I_WE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", WEST)
|
||||
if(I_WE)
|
||||
I_W.Blend(I_WE, ICON_OVERLAY)
|
||||
I_W.blend_icon(I_WE, ICON_OVERLAY)
|
||||
if(S.has_eye_sprites)
|
||||
var/icon/I_EE = icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", EAST)
|
||||
var/datum/universal_icon/I_EE = uni_icon(S.sprite_icon, "[S.sprite_icon_state]-eyes", EAST)
|
||||
if(I_EE)
|
||||
I_E.Blend(I_EE, ICON_OVERLAY)
|
||||
I_E.blend_icon(I_EE, ICON_OVERLAY)
|
||||
|
||||
var/imgid = sanitize_css_class_name("[S.type]")
|
||||
I_N.Scale(120, 120)
|
||||
I_S.Scale(120, 120)
|
||||
I_W.Scale(120, 120)
|
||||
I_E.Scale(120, 120)
|
||||
Insert(imgid + "N", I_N)
|
||||
Insert(imgid + "S", I_S)
|
||||
Insert(imgid + "W", I_W)
|
||||
Insert(imgid + "E", I_E)
|
||||
if(S.icon_x > S.icon_y)
|
||||
var/buffer = (S.icon_x - S.icon_y) / 2
|
||||
I_N.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
I_S.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
I_W.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
I_E.crop(0, -buffer, S.icon_x, S.icon_y + buffer)
|
||||
else if (S.icon_x < S.icon_y)
|
||||
var/buffer = (S.icon_y - S.icon_x) / 2
|
||||
I_N.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_S.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_W.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_E.crop(-buffer, 0, S.icon_x + buffer, S.icon_y)
|
||||
I_N.scale(120, 120)
|
||||
I_S.scale(120, 120)
|
||||
I_W.scale(120, 120)
|
||||
I_E.scale(120, 120)
|
||||
|
||||
insert_icon(imgid + "N", I_N)
|
||||
insert_icon(imgid + "S", I_S)
|
||||
insert_icon(imgid + "W", I_W)
|
||||
insert_icon(imgid + "E", I_E)
|
||||
|
||||
@@ -180,6 +180,10 @@
|
||||
// Remove the cache, since it's invalid if we get to this point.
|
||||
fdel("[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/spritesheet_cache.[name].json")
|
||||
|
||||
if(!fexists(ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY))
|
||||
rustg_file_write("stub", "[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/stub.txt")
|
||||
fdel("[ASSET_CROSS_ROUND_SMART_CACHE_DIRECTORY]/stub.txt")
|
||||
|
||||
var/do_cache = CONFIG_GET(flag/smart_cache_assets) || force_cache
|
||||
var/data_out
|
||||
if(yield || !isnull(job_id))
|
||||
|
||||
Reference in New Issue
Block a user