Shuttle console shows scan of area around navpoint (#17829)

* map program, holomap init order

* huh

* programz

* program defines

* hmm.......

* a

* map 😩

* sane code, zoom

* holo_minimaps -> minimaps

* o

* remove station holomap stuff

* changelog, shitcode, mapping

* c

* o

* minus

* generate_all_minimaps()

* holomap init order

* tests rerun please

* tests rerun please

* aurora station_map removal

* shuttle control minimap

* feTurbulence baseFrequency random

* filters, idk

* 1

* c

* cc

* x y

* remove regeneration of minimaps

---------

Co-authored-by: DreamySkrell <>
This commit is contained in:
DreamySkrell
2024-01-06 12:36:10 +00:00
committed by GitHub
co-authored by DreamySkrell <>
parent 185b4eda58
commit 7e1c4075f9
5 changed files with 195 additions and 3 deletions
@@ -18,6 +18,9 @@ SUBSYSTEM_DEF(holomap)
/// Same as `minimaps_base64`, but the map is colored with `holomap_color` of the `/area/`
var/list/minimaps_area_colored_base64 = list()
/// Same as `minimaps_base64`, but does not discriminate between walls and paths.
var/list/minimaps_scan_base64 = list()
/datum/controller/subsystem/holomap/Initialize()
generate_all_minimaps()
LOG_DEBUG("SSholomap: [minimaps.len] maps.")
@@ -27,10 +30,12 @@ SUBSYSTEM_DEF(holomap)
minimaps.len = world.maxz
minimaps_base64.len = world.maxz
minimaps_area_colored_base64.len = world.maxz
minimaps_scan_base64.len = world.maxz
for (var/z in 1 to world.maxz)
generate_minimap(z)
generate_minimap_area_colored(z)
generate_minimap_scan(z)
/datum/controller/subsystem/holomap/proc/generate_minimap(zlevel = 1)
// Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime
@@ -101,3 +106,44 @@ SUBSYSTEM_DEF(holomap)
big_map.Blend(map_base, ICON_OVERLAY)
big_map.Blend(canvas, ICON_OVERLAY)
minimaps_area_colored_base64[zlevel] = icon2base64(big_map)
/datum/controller/subsystem/holomap/proc/generate_minimap_scan(zlevel = 1)
// Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime
var/icon/canvas = icon('icons/255x255.dmi', "blank")
if(world.maxx > canvas.Width())
CRASH("Minimap for z=[zlevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]")
if(world.maxy > canvas.Height())
CRASH("Minimap for z=[zlevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]")
var/list/mineral_wall_tcache = typecacheof(list(
/turf/simulated/mineral,
/turf/unsimulated/mineral,
))
var/list/mineral_floor_tcache = typecacheof(list(
/turf/unsimulated/floor/asteroid,
/turf/simulated/mineral,
/turf/simulated/floor/exoplanet,
))
var/list/hull_tcache = typecacheof(list(
/turf/simulated/wall,
/turf/simulated/floor,
/turf/unsimulated/wall,
/turf/unsimulated/floor,
))
var/turf/T
var/Ttype
for (var/thing in Z_ALL_TURFS(zlevel))
T = thing
Ttype = T.type
if (mineral_wall_tcache[Ttype])
canvas.DrawBox(HOLOMAP_MINERAL_WALL, T.x, T.y)
else if (mineral_floor_tcache[Ttype])
canvas.DrawBox(HOLOMAP_MINERAL_FLOOR, T.x, T.y)
else if(hull_tcache[Ttype])
canvas.DrawBox(HOLOMAP_OBSTACLE, T.x, T.y)
CHECK_TICK
minimaps_scan_base64[zlevel] = icon2base64(canvas)