diff --git a/code/game/area/Space_Station_13_areas.dm b/code/game/area/Space_Station_13_areas.dm index b724b3acd..188fb4456 100644 --- a/code/game/area/Space_Station_13_areas.dm +++ b/code/game/area/Space_Station_13_areas.dm @@ -103,7 +103,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/maintenance ambientsounds = MAINTENANCE valid_territory = FALSE - + minimap_color = "#454545" //Departments @@ -255,6 +255,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station //Hallway +/area/hallway + minimap_color = "#aaaaaa" + +/area/hallway/primary + name = "Primary Hallway" + /area/hallway/primary/aft name = "Aft Primary Hallway" icon_state = "hallA" @@ -302,6 +308,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/hallway/secondary/exit name = "Escape Shuttle Hallway" icon_state = "escape" + minimap_color = "#baa0a0" /area/hallway/secondary/exit/departure_lounge name = "Departure Lounge" @@ -310,6 +317,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station /area/hallway/secondary/entry name = "Arrival Shuttle Hallway" icon_state = "entry" + minimap_color = "#a0a0ba" /area/hallway/secondary/service name = "Service Hallway" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 1a61d189e..4b8eb7ccb 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -73,6 +73,10 @@ /// Color on minimaps, if it's null (which is default) it makes one at random. var/minimap_color + var/minimap_color2 // if this isn't null, then this will show as a checkerboard pattern mixed in with the above. works even if the above is null (for better or worse) + + var/minimap_show_walls = TRUE + /*Adding a wizard area teleport list because motherfucking lag -- Urist*/ /*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ GLOBAL_LIST_EMPTY(teleportlocs) diff --git a/code/game/area/areas/ruins/_ruins.dm b/code/game/area/areas/ruins/_ruins.dm index b97c3f0ef..165432f40 100644 --- a/code/game/area/areas/ruins/_ruins.dm +++ b/code/game/area/areas/ruins/_ruins.dm @@ -7,7 +7,9 @@ hidden = TRUE dynamic_lighting = DYNAMIC_LIGHTING_FORCED ambientsounds = RUINS - + minimap_color = "#775940" + minimap_color2 = "#6b5d48" + minimap_show_walls = FALSE /area/ruin/unpowered always_unpowered = FALSE diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index fdad7fc97..4fd7e4ff6 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -6,6 +6,8 @@ var/obj_flags = CAN_BE_HIT var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT. + var/minimap_override_color // allows this obj to set its own color on the minimap + var/damtype = BRUTE var/force = 0 diff --git a/code/modules/mapping/minimaps.dm b/code/modules/mapping/minimaps.dm index 7a62e9ab4..a327d4e78 100644 --- a/code/modules/mapping/minimaps.dm +++ b/code/modules/mapping/minimaps.dm @@ -4,7 +4,7 @@ // The map icons var/icon/map_icon var/icon/meta_icon - + var/list/color_area_names = list() var/minx @@ -33,7 +33,7 @@ meta_icon = new('html/blank.png') map_icon.Scale(x2 - x1 + 1, y2 - y1 + 1) // arrays start at 1 meta_icon.Scale(x2 - x1 + 1, y2 - y1 + 1) - + var/list/area_to_color = list() for(var/turf/T in block(locate(x1, y1, z_level), locate(x2, y2, z_level))) var/area/A = T.loc @@ -44,24 +44,46 @@ crop_x2 = max(crop_x2, T.x) crop_y1 = min(crop_y1, T.y) crop_y2 = max(crop_y2, T.y) - + var/meta_color = area_to_color[A] if(!meta_color) - meta_color = rgb(rand(0, 255), rand(0, 255), rand(0, 255)) // technically conflicts could happen but it's like very unlikely and it's not that big of a deal if one happens + var/meta_x = LAZYLEN(area_to_color) + 1 + var/meta_y = (((meta_x + 1) - ((meta_x + 1) % 255)) / 255) + var/meta_z = (((meta_y + 1) - ((meta_y + 1) % 255)) / 255) + meta_color = rgb(meta_x % 255, meta_y % 255, meta_z % 255) //This supports exactly 16,581,374 areas with no conflicts whatsoever before it just gives up area_to_color[A] = meta_color color_area_names[meta_color] = A.name meta_icon.DrawBox(meta_color, img_x, img_y) - if(istype(T, /turf/closed/wall)) + if(A.minimap_show_walls && istype(T, /turf/closed/wall)) map_icon.DrawBox("#000000", img_x, img_y) else if(!istype(A, /area/space)) - var/color = A.minimap_color || "#FF00FF" - if(locate(/obj/machinery/power/solar) in T) - color = "#02026a" + var/color = (A.minimap_color2 ? (((img_x + img_y) % 2) ? A.minimap_color2 : A.minimap_color ) : A.minimap_color) || "#FF00FF" + if(A.minimap_show_walls) + var/overridden + for(var/obj/structure/O in T) + if(O.minimap_override_color) + color = O.minimap_override_color + overridden = TRUE + break + else if(O.density && O.anchored) + color = BlendRGB(color, "#000000", 0.5) + overridden = TRUE + break + + //In an ideal world, we'd be able to get away with just doing for(var/obj/O in T) up there, and calling it a day. However. HOWEVER! + //Doing that causes the code to also loop through items. and that uh. Kinda bloats minimap gen time. A LOT. We're talking straight-up doubling the time it takes to gen. + //So instead we take our ctrl+c. We copy the above code. And we ctrl+v. It's awful. We hate it. But it works. It's faster. Funny mapgen go vroom + if(!overridden) + for(var/obj/machinery/O in T) + if(O.minimap_override_color) + color = O.minimap_override_color + break + else if(O.density && O.anchored) + color = BlendRGB(color, "#000000", 0.25) + break - if((locate(/obj/effect/spawner/structure/window) in T) || (locate(/obj/structure/grille) in T)) - color = BlendRGB(color, "#000000", 0.5) map_icon.DrawBox(color, img_x, img_y) map_icon.Crop(crop_x1, crop_y1, crop_x2, crop_y2) @@ -100,20 +122,44 @@ var/list/datas = list() var/list/info = list() - - for(var/i in 1 to length(minimaps))// OLD: for(var/i in 1 to length(minimaps)) + var/buttonfield = "" + var/totalmaps = length(minimaps) + for(var/i in 1 to totalmaps)// OLD: for(var/i in 1 to length(minimaps)) var/datum/minimap/M = minimaps[i] M.send(user) info += {" -