diff --git a/code/__defines/minimap.dm b/code/__defines/minimap.dm index 74781d9b0bd..29f228dd9a0 100644 --- a/code/__defines/minimap.dm +++ b/code/__defines/minimap.dm @@ -3,9 +3,12 @@ // // Holomap colors -#define HOLOMAP_OBSTACLE "#FFFFFF" // Color of walls and barriers -#define HOLOMAP_PATH "#666666" // Color of floors -#define HOLOMAP_HOLOFIER "#79FF79" // Whole map is multiplied by this to give it a green holoish look +#define HOLOMAP_OBSTACLE "#FFFFFF" // Color of walls and barriers +#define HOLOMAP_PATH "#666666" // Color of floors +#define HOLOMAP_MINERAL_WALL "#704d31" // Color of minerals/rocks +#define HOLOMAP_MINERAL_FLOOR "#6d5a4a" // Color of minerals/rocks +#define HOLOMAP_TRANSPARENT "#00000000"// +#define HOLOMAP_HOLOFIER "#79FF79" // Whole map is multiplied by this to give it a green holoish look #define HOLOMAP_AREACOLOR_COMMAND "#386d80" #define HOLOMAP_AREACOLOR_SECURITY "#ae1212" diff --git a/code/controllers/subsystems/initialization/holomap.dm b/code/controllers/subsystems/initialization/holomap.dm index 9f6410116ef..897dcb58dfe 100644 --- a/code/controllers/subsystems/initialization/holomap.dm +++ b/code/controllers/subsystems/initialization/holomap.dm @@ -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) diff --git a/code/modules/overmap/ships/computers/shuttle.dm b/code/modules/overmap/ships/computers/shuttle.dm index 3b137c51854..c5aa86131eb 100644 --- a/code/modules/overmap/ships/computers/shuttle.dm +++ b/code/modules/overmap/ships/computers/shuttle.dm @@ -38,6 +38,9 @@ . += list( "destination_name" = shuttle.get_destination_name(), + "destination_map_image" = shuttle.next_location ? SSholomap.minimaps_scan_base64[shuttle.next_location.z] : null, + "destination_x" = shuttle.next_location?.x, + "destination_y" = shuttle.next_location?.y, "can_pick" = shuttle.moving_status == SHUTTLE_IDLE, "fuel_usage" = shuttle.fuel_consumption * 100, "remaining_fuel" = round(total_gas, 0.01) * 100, diff --git a/html/changelogs/DreamySkrell-minimap-scan.yml b/html/changelogs/DreamySkrell-minimap-scan.yml new file mode 100644 index 00000000000..67c3bed9a5e --- /dev/null +++ b/html/changelogs/DreamySkrell-minimap-scan.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: DreamySkrell + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Shuttle console program shows a scan of the area when selecting a navpoint." diff --git a/tgui/packages/tgui/interfaces/ShuttleControlConsoleMultiExplore.tsx b/tgui/packages/tgui/interfaces/ShuttleControlConsoleMultiExplore.tsx index e89e90c1187..0755ccf0122 100644 --- a/tgui/packages/tgui/interfaces/ShuttleControlConsoleMultiExplore.tsx +++ b/tgui/packages/tgui/interfaces/ShuttleControlConsoleMultiExplore.tsx @@ -13,6 +13,9 @@ export type ShuttleControlConsoleMultiExploreData = { can_force: boolean; can_pick: boolean; destination_name: string; + destination_map_image: any; // base64 icon + destination_x: number; + destination_y: number; fuel_usage: number; remaining_fuel: number; fuel_span: string; @@ -22,6 +25,13 @@ export const ShuttleControlConsoleMultiExplore = (props, context) => { const { act, data } = useBackend(context); + const map_size = 255; + const zoom_mod = 2.0; + const center_point_x = data.destination_x; + const center_point_y = data.destination_y; + + const rand = Math.random() * 1.0; + return ( @@ -87,6 +97,95 @@ export const ShuttleControlConsoleMultiExplore = (props, context) => { ) : null} + + {data.destination_map_image ? ( +
+ + + + + + + + {data.destination_x} + + + {data.destination_y} + + + +
+ ) : ( + '' + )}