Bleeding edgy refresh (#303)
* not code stuff * other things * global vars, defines, helpers * onclick hud stuff, orphans, world.dm * controllers and datums * game folder * everything not client/mobs in modules * client folder * stage 1 mob stuff * simple animal things * silicons * carbon things * ayylmaos and monkeys * hyoomahn * icons n shit * sprite fixes * compile fixes * some fixes I cherrypicked. * qdel fixes * forgot brain refractors
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var/datum/subsystem/minimap/SSminimap
|
||||
var/datum/controller/subsystem/minimap/SSminimap
|
||||
|
||||
/datum/subsystem/minimap
|
||||
/datum/controller/subsystem/minimap
|
||||
name = "Minimap"
|
||||
init_order = -2
|
||||
flags = SS_NO_FIRE
|
||||
@@ -9,11 +9,11 @@ var/datum/subsystem/minimap/SSminimap
|
||||
|
||||
var/list/z_levels = list(ZLEVEL_STATION)
|
||||
|
||||
/datum/subsystem/minimap/New()
|
||||
/datum/controller/subsystem/minimap/New()
|
||||
NEW_SS_GLOBAL(SSminimap)
|
||||
|
||||
/datum/subsystem/minimap/Initialize(timeofday)
|
||||
var/hash = md5(file2text("_maps/[MAP_PATH]/[MAP_FILE]"))
|
||||
/datum/controller/subsystem/minimap/Initialize(timeofday)
|
||||
var/hash = md5(SSmapping.config.GetFullMapPath())
|
||||
if(config.generate_minimaps)
|
||||
if(hash == trim(file2text(hash_path())))
|
||||
for(var/z in z_levels) //We have these files cached, let's register them
|
||||
@@ -25,48 +25,48 @@ var/datum/subsystem/minimap/SSminimap
|
||||
fdel(hash_path())
|
||||
text2file(hash, hash_path())
|
||||
else
|
||||
world << "<span class='boldannounce'>Minimap generation disabled. Loading from cache...</span>"
|
||||
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())))
|
||||
world << "<span class='boldannounce'>Loaded cached minimap is outdated. There may be minor discrepancies in layout.</span>" //Disclaimer against players saying map is wrong.
|
||||
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))
|
||||
world << "<span class='boldannounce'>Failed to load backup minimap file. Aborting.</span>" //We couldn't find something. Bail to prevent issues with null files
|
||||
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.
|
||||
world << "<span class='boldannounce'>No cached minimaps detected. Backup files loaded.</span>"
|
||||
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)))
|
||||
..()
|
||||
|
||||
/datum/subsystem/minimap/proc/check_files(backup) // If the backup argument is true, looks in the icons folder. If false looks in the data folder.
|
||||
/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 [MAP_NAME] on zlevel [z].")
|
||||
log_world("Failed to find backup file for map [SSmapping.config.map_name] on zlevel [z].")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/subsystem/minimap/proc/hash_path(backup)
|
||||
/datum/controller/subsystem/minimap/proc/hash_path(backup)
|
||||
if(backup)
|
||||
return "icons/minimaps/[MAP_NAME].md5"
|
||||
return "icons/minimaps/[SSmapping.config.map_name].md5"
|
||||
else
|
||||
return "data/minimaps/[MAP_NAME].md5"
|
||||
return "data/minimaps/[SSmapping.config.map_name].md5"
|
||||
|
||||
/datum/subsystem/minimap/proc/map_path(z,backup)
|
||||
/datum/controller/subsystem/minimap/proc/map_path(z,backup)
|
||||
if(backup)
|
||||
return "icons/minimaps/[MAP_NAME]_[z].png"
|
||||
return "icons/minimaps/[SSmapping.config.map_name]_[z].png"
|
||||
else
|
||||
return "data/minimaps/[MAP_NAME]_[z].png"
|
||||
return "data/minimaps/[SSmapping.config.map_name]_[z].png"
|
||||
|
||||
/datum/subsystem/minimap/proc/send(client/client)
|
||||
/datum/controller/subsystem/minimap/proc/send(client/client)
|
||||
for(var/z in z_levels)
|
||||
send_asset(client, "minimap_[z].png")
|
||||
|
||||
/datum/subsystem/minimap/proc/generate(z = 1, x1 = 1, y1 = 1, x2 = world.maxx, y2 = world.maxy)
|
||||
/datum/controller/subsystem/minimap/proc/generate(z = 1, 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.
|
||||
@@ -81,7 +81,7 @@ var/datum/subsystem/minimap/SSminimap
|
||||
final.Insert(minimap, "", SOUTH, 1, 0)
|
||||
fcopy(final, map_path(z))
|
||||
|
||||
/datum/subsystem/minimap/proc/generate_tile(turf/tile, icon/minimap)
|
||||
/datum/controller/subsystem/minimap/proc/generate_tile(turf/tile, icon/minimap)
|
||||
var/icon/tile_icon
|
||||
var/obj/obj
|
||||
var/list/obj_icons
|
||||
|
||||
Reference in New Issue
Block a user