mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #2055 from CHOMPStationBot/upstream-merge-10446
[MIRROR] Improve hull corner color finding slightly
This commit is contained in:
@@ -326,31 +326,43 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
update_look()
|
update_look()
|
||||||
|
|
||||||
|
/obj/structure/hull_corner/proc/get_dirs_to_test()
|
||||||
|
return list(dir, turn(dir,90))
|
||||||
|
|
||||||
/obj/structure/hull_corner/proc/update_look()
|
/obj/structure/hull_corner/proc/update_look()
|
||||||
cut_overlays()
|
var/turf/simulated/wall/T
|
||||||
|
for(var/direction in get_dirs_to_test())
|
||||||
|
T = get_step(src, direction)
|
||||||
|
if(!istype(T))
|
||||||
|
continue
|
||||||
|
|
||||||
|
name = T.name
|
||||||
|
desc = T.desc
|
||||||
|
|
||||||
|
var/datum/material/B = T.material
|
||||||
|
var/datum/material/R = T.reinf_material
|
||||||
|
|
||||||
|
if(B?.icon_colour)
|
||||||
|
color = B.icon_colour
|
||||||
|
if(R?.icon_colour)
|
||||||
|
var/image/I = image(icon, icon_state+"_reinf", dir=dir)
|
||||||
|
I.color = R.icon_colour
|
||||||
|
add_overlay(I)
|
||||||
|
break
|
||||||
|
|
||||||
var/turf/simulated/wall/T = get_step(src, dir)
|
if(!T)
|
||||||
if(!istype(T))
|
warning("Hull corner at [x],[y] not placed adjacent to a hull it can find.")
|
||||||
log_error("[src] at [x],[y] not placed facing a hull")
|
|
||||||
return
|
|
||||||
|
|
||||||
name = T.name
|
|
||||||
desc = T.desc
|
|
||||||
|
|
||||||
var/datum/material/B = T.material
|
|
||||||
var/datum/material/R = T.reinf_material
|
|
||||||
|
|
||||||
if(B?.icon_colour)
|
|
||||||
color = B.icon_colour
|
|
||||||
if(R?.icon_colour)
|
|
||||||
var/image/I = image(icon, icon_state+"_reinf", dir=dir)
|
|
||||||
I.color = R.icon_colour
|
|
||||||
add_overlay(I)
|
|
||||||
|
|
||||||
/obj/structure/hull_corner/long_vert
|
/obj/structure/hull_corner/long_vert
|
||||||
icon = 'icons/turf/wall_masks32x64.dmi'
|
icon = 'icons/turf/wall_masks32x64.dmi'
|
||||||
bound_height = 64
|
bound_height = 64
|
||||||
|
|
||||||
|
/obj/structure/hull_corner/long_vert/get_dirs_to_test()
|
||||||
|
return list(dir, turn(dir,90), turn(dir,-90))
|
||||||
|
|
||||||
/obj/structure/hull_corner/long_horiz
|
/obj/structure/hull_corner/long_horiz
|
||||||
icon = 'icons/turf/wall_masks64x32.dmi'
|
icon = 'icons/turf/wall_masks64x32.dmi'
|
||||||
bound_width = 64
|
bound_width = 64
|
||||||
|
|
||||||
|
/obj/structure/hull_corner/long_horiz/get_dirs_to_test()
|
||||||
|
return list(dir, turn(dir,90), turn(dir,-90))
|
||||||
|
|||||||
Reference in New Issue
Block a user