mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 19:15:11 +01:00
Increased cached_icon_states usage and tweaks to unit testing (#18246)
* initial * Fix cosmetic test change
This commit is contained in:
@@ -440,7 +440,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
|
||||
/datum/asset/spritesheet/proc/queuedInsert(sprite_name, icon/I, icon_state="", dir=SOUTH, frame=1, moving=FALSE)
|
||||
I = icon(I, icon_state=icon_state, dir=dir, frame=frame, moving=moving)
|
||||
if(!I || !length(icon_states(I))) // that direction or state doesn't exist
|
||||
if(!I || !length(cached_icon_states(I))) // that direction or state doesn't exist
|
||||
return
|
||||
var/size_id = "[I.Width()]x[I.Height()]"
|
||||
var/size = sizes[size_id]
|
||||
@@ -476,7 +476,7 @@ GLOBAL_LIST_EMPTY(asset_datums)
|
||||
if(!directions)
|
||||
directions = list(SOUTH)
|
||||
|
||||
for(var/icon_state_name in icon_states(I))
|
||||
for(var/icon_state_name in cached_icon_states(I))
|
||||
for(var/direction in directions)
|
||||
var/prefix2 = (directions.len > 1) ? "[dir2text(direction)]-" : ""
|
||||
Insert("[prefix][prefix2][icon_state_name]", I, icon_state=icon_state_name, dir=direction)
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
var/obj/machinery/computer/C = item
|
||||
var/screen = initial(C.icon_screen)
|
||||
var/keyboard = initial(C.icon_keyboard)
|
||||
var/all_states = icon_states(icon_file)
|
||||
var/all_states = cached_icon_states(icon_file)
|
||||
if (screen && (screen in all_states))
|
||||
transform.blend_icon(uni_icon(icon_file, screen), ICON_OVERLAY)
|
||||
if (keyboard && (keyboard in all_states))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
var/datum/universal_icon/I
|
||||
|
||||
var/icon_states_list = icon_states(icon_file)
|
||||
var/icon_states_list = cached_icon_states(icon_file)
|
||||
if(icon_state in icon_states_list)
|
||||
I = uni_icon(icon_file, icon_state, SOUTH)
|
||||
var/c = initial(item.color)
|
||||
|
||||
Reference in New Issue
Block a user