mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 07:20:09 +01:00
Update SSOverlays (ported from Baystation) (#19051)
Our SSOverlays system is outdated, and is likely the cause of many of the issues seen in #18895. It has also been linked to a massive server performance decrease. This brings an updated system from Baystation, hopefully with speed increases. Should be testmerged, ideally with #18895. --------- Co-authored-by: Cody Brittain <cbrittain10@live.com>
This commit is contained in:
co-authored by
Cody Brittain
parent
405a05b819
commit
9983fca311
@@ -246,7 +246,7 @@
|
||||
return shards
|
||||
|
||||
/obj/structure/table/update_icon()
|
||||
cut_overlays()
|
||||
ClearOverlays()
|
||||
icon_state = "blank"
|
||||
var/image/I
|
||||
if(flipped != 1)
|
||||
@@ -264,11 +264,11 @@
|
||||
I = image(icon, "[material.icon_base]_[connections[i]]", dir = 1<<(i-1))
|
||||
if(material.icon_colour)
|
||||
I.color = material.icon_colour
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
else // Table frame
|
||||
for(var/i = 1 to 4)
|
||||
I = image(icon, "[connections[i]]", dir = 1<<(i-1))
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
if(reinforced) // Reinforcements.
|
||||
for(var/i = 1 to 4)
|
||||
@@ -278,12 +278,12 @@
|
||||
I = image('icons/obj/structure/tables/table_reinf.dmi', "[reinforced.reinf_icon]_[connections[i]]", dir = 1<<(i-1)) // else use the generic recolorable one
|
||||
if(reinforced.icon_colour && ("reinf_[reinforced.name]" == "[reinforced.reinf_icon]"))
|
||||
I.color = reinforced.icon_colour
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
if(carpeted)
|
||||
for(var/i = 1 to 4)
|
||||
I = image(icon, "carpet_[connections[i]]", dir = 1<<(i-1))
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
else // Flipped table
|
||||
var/type = 0
|
||||
@@ -314,7 +314,7 @@
|
||||
I = image(icon, "[material.icon_base]_flip[type]")
|
||||
if(material.icon_colour)
|
||||
I.color = material.icon_colour
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
if(material.display_name)
|
||||
if(material.display_name == "comfy")
|
||||
name = "fancy table"
|
||||
@@ -323,7 +323,7 @@
|
||||
else
|
||||
I = image(icon, "flip[type]")
|
||||
name = "table frame"
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
if(reinforced)
|
||||
if("reinf_[reinforced.name]_flip[type]" in icon_states('icons/obj/structure/tables/table_reinf.dmi')) // if it's got an existing purpose-made reinforced icon, and it isn't already a generic one, use it
|
||||
@@ -332,10 +332,10 @@
|
||||
I = image('icons/obj/structure/tables/table_reinf.dmi', "[reinforced.reinf_icon]_flip[type]") // else use the generic recolorable one
|
||||
if(reinforced.icon_colour && ("reinf_[reinforced.name]" == "[reinforced.reinf_icon]"))
|
||||
I.color = reinforced.icon_colour
|
||||
add_overlay(I)
|
||||
AddOverlays(I)
|
||||
|
||||
if(carpeted)
|
||||
add_overlay("carpet_flip[type]")
|
||||
AddOverlays("carpet_flip[type]")
|
||||
|
||||
// set propagate if you're updating a table that should update tables around it too, for example if it's a new table or something important has changed (like material).
|
||||
/obj/structure/table/proc/update_connections(propagate=0)
|
||||
|
||||
Reference in New Issue
Block a user