mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Move skybox representation into procs and vars
This commit is contained in:
@@ -6,9 +6,38 @@
|
||||
var/known = 1 //shows up on nav computers automatically
|
||||
var/scannable //if set to TRUE will show up on ship sensors for detailed scans
|
||||
|
||||
var/skybox_icon //Icon file to use for skybox
|
||||
var/skybox_icon_state //Icon state to use for skybox
|
||||
var/skybox_pixel_x //Shift from lower left corner of skybox
|
||||
var/skybox_pixel_y //Shift from lower left corner of skybox
|
||||
var/cached_skybox_image //Cachey
|
||||
|
||||
//Overlay of how this object should look on other skyboxes
|
||||
/obj/effect/overmap/proc/get_skybox_representation()
|
||||
return
|
||||
if(!cached_skybox_image)
|
||||
build_skybox_representation()
|
||||
return cached_skybox_image
|
||||
|
||||
/obj/effect/overmap/proc/build_skybox_representation()
|
||||
if(!skybox_icon)
|
||||
return
|
||||
var/image/I = image(icon = skybox_icon, icon_state = skybox_icon_state)
|
||||
if(isnull(skybox_pixel_x))
|
||||
skybox_pixel_x = rand(200,600)
|
||||
if(isnull(skybox_pixel_y))
|
||||
skybox_pixel_y = rand(200,600)
|
||||
I.pixel_x = skybox_pixel_x
|
||||
I.pixel_y = skybox_pixel_y
|
||||
cached_skybox_image = I
|
||||
|
||||
/obj/effect/overmap/proc/expire_skybox_representation()
|
||||
cached_skybox_image = null
|
||||
|
||||
/obj/effect/overmap/proc/update_skybox_representation()
|
||||
expire_skybox_representation()
|
||||
build_skybox_representation()
|
||||
for(var/obj/effect/overmap/visitable/O in loc)
|
||||
SSskybox.rebuild_skyboxes(O.map_z)
|
||||
|
||||
/obj/effect/overmap/proc/get_scan_data(mob/user)
|
||||
return desc
|
||||
|
||||
Reference in New Issue
Block a user