mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Increased cached_icon_states usage and tweaks to unit testing (#11445)
Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
403a7e0267
commit
14fed02701
@@ -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