mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Remove SSminimap (#39459)
Return of #37112. @Carbonhell from Hippie reported an SSminimap crash on 512.1440 due to accidentally leaving the config on. Nothing uses this subsystem, its maps look terrible, and it still after all this time is prone to crashes. If someone actually wants to start using these maps again they can just add the SS back in when they do that.
This commit is contained in:
committed by
yogstation13-bot
parent
8a64b61437
commit
4242b43d55
@@ -71,7 +71,6 @@
|
||||
#define INIT_ORDER_TIMER 1
|
||||
#define INIT_ORDER_DEFAULT 0
|
||||
#define INIT_ORDER_AIR -1
|
||||
#define INIT_ORDER_MINIMAP -3
|
||||
#define INIT_ORDER_ASSETS -4
|
||||
#define INIT_ORDER_ICON_SMOOTHING -5
|
||||
#define INIT_ORDER_OVERLAY -6
|
||||
|
||||
@@ -326,8 +326,6 @@
|
||||
|
||||
/datum/config_entry/flag/allow_map_voting
|
||||
|
||||
/datum/config_entry/flag/generate_minimaps
|
||||
|
||||
/datum/config_entry/number/client_warn_version
|
||||
config_entry_value = null
|
||||
min_val = 500
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
SUBSYSTEM_DEF(minimap)
|
||||
name = "Minimap"
|
||||
init_order = INIT_ORDER_MINIMAP
|
||||
flags = SS_NO_FIRE
|
||||
var/const/MINIMAP_SIZE = 2048
|
||||
var/const/TILE_SIZE = 8
|
||||
|
||||
var/list/z_levels
|
||||
|
||||
/datum/controller/subsystem/minimap/Initialize(timeofday)
|
||||
z_levels = SSmapping.levels_by_trait(ZTRAIT_STATION)
|
||||
var/list/hashlist = list()
|
||||
for (var/file in SSmapping.config.GetFullMapPaths())
|
||||
hashlist += md5(file2text(file))
|
||||
var/hash = hashlist.Join("\n")
|
||||
if(CONFIG_GET(flag/generate_minimaps))
|
||||
if(hash == trim(file2text(hash_path())))
|
||||
for(var/z in z_levels) //We have these files cached, let's register them
|
||||
register_asset("minimap_[z].png", fcopy_rsc(map_path(z)))
|
||||
return ..()
|
||||
for(var/z in z_levels)
|
||||
generate(z)
|
||||
register_asset("minimap_[z].png", fcopy_rsc(map_path(z)))
|
||||
fdel(hash_path())
|
||||
text2file(hash, hash_path())
|
||||
else
|
||||
to_chat(world, "<span class='boldannounce'>Minimap generation disabled. Loading from cache...</span>")
|
||||
var/fileloc = 0
|
||||
if(check_files(0)) //Let's first check if we have maps cached in the data folder. NOTE: This will override the backup files even if this map is older.
|
||||
if(hash != trim(file2text(hash_path())))
|
||||
to_chat(world, "<span class='boldannounce'>Loaded cached minimap is outdated. There may be minor discrepancies in layout.</span>" )
|
||||
fileloc = 0
|
||||
else
|
||||
if(!check_files(1))
|
||||
to_chat(world, "<span class='boldannounce'>Failed to load backup minimap file. Aborting.</span>" )
|
||||
return
|
||||
fileloc = 1 //No map image cached with the current map, and we have a backup. Let's fall back to it.
|
||||
to_chat(world, "<span class='boldannounce'>No cached minimaps detected. Backup files loaded.</span>")
|
||||
for(var/z in z_levels)
|
||||
register_asset("minimap_[z].png", fcopy_rsc(map_path(z,fileloc)))
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/minimap/proc/check_files(backup) // If the backup argument is true, looks in the icons folder. If false looks in the data folder.
|
||||
for(var/z in z_levels)
|
||||
if(!fexists(file(map_path(z,backup)))) //Let's make sure we have a file for this map
|
||||
if(backup)
|
||||
log_world("Failed to find backup file for map [SSmapping.config.map_name] on zlevel [z].")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/controller/subsystem/minimap/proc/hash_path(backup)
|
||||
if(backup)
|
||||
return "icons/minimaps/[SSmapping.config.map_name].md5"
|
||||
else
|
||||
return "data/minimaps/[SSmapping.config.map_name].md5"
|
||||
|
||||
/datum/controller/subsystem/minimap/proc/map_path(z,backup)
|
||||
if(backup)
|
||||
return "icons/minimaps/[SSmapping.config.map_name]_[z].png"
|
||||
else
|
||||
return "data/minimaps/[SSmapping.config.map_name]_[z].png"
|
||||
|
||||
/datum/controller/subsystem/minimap/proc/send(client/client)
|
||||
for(var/z in z_levels)
|
||||
send_asset(client, "minimap_[z].png")
|
||||
|
||||
/datum/controller/subsystem/minimap/proc/generate(z, x1 = 1, y1 = 1, x2 = world.maxx, y2 = world.maxy)
|
||||
// Load the background.
|
||||
var/icon/minimap = new /icon('icons/minimap.dmi')
|
||||
// Scale it up to our target size.
|
||||
minimap.Scale(MINIMAP_SIZE, MINIMAP_SIZE)
|
||||
|
||||
// Loop over turfs and generate icons.
|
||||
for(var/T in block(locate(x1, y1, z), locate(x2, y2, z)))
|
||||
generate_tile(T, minimap)
|
||||
|
||||
// Create a new icon and insert the generated minimap, so that BYOND doesn't generate different directions.
|
||||
var/icon/final = new /icon()
|
||||
final.Insert(minimap, "", SOUTH, 1, 0)
|
||||
fcopy(final, map_path(z))
|
||||
|
||||
/datum/controller/subsystem/minimap/proc/generate_tile(turf/tile, icon/minimap)
|
||||
var/icon/tile_icon
|
||||
var/obj/obj
|
||||
var/list/obj_icons
|
||||
// Don't use icons for space, just add objects in space if they exist.
|
||||
if(isspaceturf(tile))
|
||||
obj = locate(/obj/structure/lattice/catwalk) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/smooth_structures/catwalk.dmi', "catwalk", SOUTH)
|
||||
obj = locate(/obj/structure/lattice) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/smooth_structures/lattice.dmi', "lattice", SOUTH)
|
||||
obj = locate(/obj/structure/grille) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/structures.dmi', "grille", SOUTH)
|
||||
obj = locate(/obj/structure/transit_tube) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/atmospherics/pipes/transit_tube.dmi', obj.icon_state, obj.dir)
|
||||
else
|
||||
tile_icon = new /icon(tile.icon, tile.icon_state, tile.dir)
|
||||
obj_icons = list()
|
||||
|
||||
obj = locate(/obj/structure) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon(obj.icon, obj.icon_state, obj.dir, 1, 0)
|
||||
obj = locate(/obj/machinery) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon(obj.icon, obj.icon_state, obj.dir, 1, 0)
|
||||
obj = locate(/obj/structure/window) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon('icons/obj/smooth_structures/window.dmi', "window", SOUTH)
|
||||
obj = locate(/obj/structure/table) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon('icons/obj/smooth_structures/table.dmi', "table", SOUTH)
|
||||
for(var/I in obj_icons)
|
||||
var/icon/obj_icon = I
|
||||
tile_icon.Blend(obj_icon, ICON_OVERLAY)
|
||||
|
||||
if(tile_icon)
|
||||
// Scale the icon.
|
||||
tile_icon.Scale(TILE_SIZE, TILE_SIZE)
|
||||
// Add the tile to the minimap.
|
||||
minimap.Blend(tile_icon, ICON_OVERLAY, ((tile.x - 1) * TILE_SIZE), ((tile.y - 1) * TILE_SIZE))
|
||||
@@ -373,10 +373,6 @@ AUTOADMIN_RANK Game Master
|
||||
## Uncomment to automatically give that admin rank to all players
|
||||
#AUTOADMIN
|
||||
|
||||
## GENERATE_MINIMAPS
|
||||
## Generating minimaps(For crew monitor) is slow and bogs down testing, so its disabled by default and must be enabled by uncommenting this config if you are running a production server.
|
||||
#GENERATE_MINIMAPS
|
||||
|
||||
## CLIENT VERSION CONTROL
|
||||
## This allows you to configure the minimum required client version, as well as a warning version, and message for both.
|
||||
## These trigger for any version below (non-inclusive) the given version, so 510 triggers on 509 or lower.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 917 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 492 KiB |
@@ -229,7 +229,6 @@
|
||||
#include "code\controllers\subsystem\machines.dm"
|
||||
#include "code\controllers\subsystem\mapping.dm"
|
||||
#include "code\controllers\subsystem\medals.dm"
|
||||
#include "code\controllers\subsystem\minimap.dm"
|
||||
#include "code\controllers\subsystem\mobs.dm"
|
||||
#include "code\controllers\subsystem\moods.dm"
|
||||
#include "code\controllers\subsystem\nightshift.dm"
|
||||
|
||||
@@ -11,7 +11,7 @@ fi
|
||||
|
||||
mkdir -p \
|
||||
$1/_maps \
|
||||
$1/icons/minimaps \
|
||||
$1/icons \
|
||||
$1/sound/chatter \
|
||||
$1/sound/voice/complionator \
|
||||
$1/sound/instruments \
|
||||
@@ -25,7 +25,6 @@ fi
|
||||
cp yogstation.dmb yogstation.rsc $1/
|
||||
cp -r _maps/* $1/_maps/
|
||||
cp icons/default_title.dmi $1/icons/
|
||||
cp -r icons/minimaps/* $1/icons/minimaps/
|
||||
cp -r sound/chatter/* $1/sound/chatter/
|
||||
cp -r sound/voice/complionator/* $1/sound/voice/complionator/
|
||||
cp -r sound/instruments/* $1/sound/instruments/
|
||||
|
||||
Reference in New Issue
Block a user