mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Replace render nanomaps workflow with Holomap piggyback (#10976)
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
99882c7113
commit
55d2c85ea1
@@ -149,8 +149,8 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
|
||||
#define INIT_ORDER_DEFAULT 0
|
||||
#define INIT_ORDER_LIGHTING 0
|
||||
#define INIT_ORDER_AIR -1
|
||||
#define INIT_ORDER_ASSETS -3
|
||||
#define INIT_ORDER_HOLOMAPS -5
|
||||
#define INIT_ORDER_HOLOMAPS -3
|
||||
#define INIT_ORDER_ASSETS -5
|
||||
#define INIT_ORDER_NIGHTSHIFT -6
|
||||
#define INIT_ORDER_OVERLAY -7
|
||||
#define INIT_ORDER_XENOARCH -20
|
||||
|
||||
@@ -21,4 +21,30 @@ SUBSYSTEM_DEF(holomaps)
|
||||
/datum/controller/subsystem/holomaps/stat_entry(msg)
|
||||
if (!GLOB.Debug2)
|
||||
return // Only show up in stat panel if debugging is enabled.
|
||||
return ..() //CHOMPEdit
|
||||
. = ..()
|
||||
|
||||
/datum/controller/subsystem/holomaps/proc/dump_nanomap_icons()
|
||||
. = list()
|
||||
|
||||
for(var/z = 1 to world.maxz)
|
||||
var/icon/base = icon(HOLOMAP_ICON, "blank") // start at 480x480
|
||||
base.Scale(world.maxx, world.maxy) // scale down to perfectly fit the map size
|
||||
|
||||
var/icon/walls = icon(holoMiniMaps[z])
|
||||
var/icon/areas = extraMiniMaps["[HOLOMAP_EXTRA_STATIONMAPAREAS]_[z]"]
|
||||
|
||||
base.Blend(walls, ICON_OVERLAY)
|
||||
if(areas)
|
||||
base.Blend(areas, ICON_OVERLAY)
|
||||
|
||||
var/fname = "data/spritesheets/minimap_[z].png"
|
||||
|
||||
// Copy to a file
|
||||
fcopy(base, fname)
|
||||
|
||||
// Strip DMI metadata to prevent any ~issues~
|
||||
var/error = rustg_dmi_strip_metadata(fname)
|
||||
if(length(error))
|
||||
stack_trace("Failed to strip [fname]: [error]")
|
||||
|
||||
.["minimap_[z].png"] = fname
|
||||
|
||||
6
code/modules/asset_cache/assets/nanomap.dm
Normal file
6
code/modules/asset_cache/assets/nanomap.dm
Normal file
@@ -0,0 +1,6 @@
|
||||
/datum/asset/simple/holo_nanomap
|
||||
keep_local_name = TRUE
|
||||
|
||||
/datum/asset/simple/holo_nanomap/register()
|
||||
assets = SSholomaps.dump_nanomap_icons()
|
||||
. = ..()
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/datum/tgui_module/atmos_control/ui_assets(mob/user)
|
||||
. = ..()
|
||||
. += get_asset_datum(/datum/asset/simple/nanomaps)
|
||||
. += get_asset_datum(/datum/asset/simple/holo_nanomap)
|
||||
|
||||
/datum/tgui_module/atmos_control/tgui_interact(mob/user, datum/tgui/ui = null)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
tgui_id = "CrewMonitor"
|
||||
|
||||
/datum/tgui_module/crew_monitor/ui_assets(mob/user)
|
||||
. = ..()
|
||||
. += get_asset_datum(/datum/asset/simple/nanomaps)
|
||||
return list(
|
||||
get_asset_datum(/datum/asset/simple/holo_nanomap),
|
||||
)
|
||||
|
||||
/datum/tgui_module/crew_monitor/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
|
||||
@@ -280,7 +280,6 @@
|
||||
),
|
||||
//"refreshing" = refreshing,
|
||||
"refreshing" = FALSE,
|
||||
"map" = (using_map && using_map.path) ? using_map.path : "Unknown",
|
||||
"mapZLevel" = map_z_level,
|
||||
"window" = list(
|
||||
"key" = window_key,
|
||||
|
||||
@@ -180,9 +180,7 @@ export class NanoMap extends Component<Props, State> {
|
||||
const { dragging, offsetX, offsetY, zoom = 1 } = this.state;
|
||||
const { children } = this.props;
|
||||
|
||||
const mapUrl = resolveAsset(
|
||||
config.map + '_nanomap_z' + config.mapZLevel + '.png',
|
||||
);
|
||||
const mapUrl = resolveAsset('minimap_' + config.mapZLevel + '.png');
|
||||
// (x * zoom), x Needs to be double the turf- map size. (for virgo, 140x140)
|
||||
const mapSize = this.props.zoomScale * zoom + 'px';
|
||||
const newStyle: {} = {
|
||||
@@ -192,6 +190,7 @@ export class NanoMap extends Component<Props, State> {
|
||||
'margin-left': offsetX + 'px',
|
||||
overflow: 'hidden',
|
||||
position: 'relative',
|
||||
'image-rendering': 'pixelated',
|
||||
'background-image': 'url(' + mapUrl + ')',
|
||||
'background-size': 'cover',
|
||||
'background-repeat': 'no-repeat',
|
||||
|
||||
@@ -2160,6 +2160,7 @@
|
||||
#include "code\modules\asset_cache\assets\jquery.dm"
|
||||
#include "code\modules\asset_cache\assets\lobby.dm"
|
||||
#include "code\modules\asset_cache\assets\microwave.dm"
|
||||
#include "code\modules\asset_cache\assets\nanomap.dm"
|
||||
#include "code\modules\asset_cache\assets\ntos.dm"
|
||||
#include "code\modules\asset_cache\assets\permissions.dm"
|
||||
#include "code\modules\asset_cache\assets\preferences.dm"
|
||||
@@ -2168,7 +2169,6 @@
|
||||
#include "code\modules\asset_cache\assets\spritesheets\chat.dm"
|
||||
#include "code\modules\asset_cache\assets\spritesheets\chem_master.dm"
|
||||
#include "code\modules\asset_cache\assets\spritesheets\kitchen_recipes.dm"
|
||||
#include "code\modules\asset_cache\assets\spritesheets\nanomaps.dm"
|
||||
#include "code\modules\asset_cache\assets\spritesheets\pipes.dm"
|
||||
#include "code\modules\asset_cache\assets\spritesheets\robot_icons.dm"
|
||||
#include "code\modules\asset_cache\assets\spritesheets\stacks.dm"
|
||||
|
||||
Reference in New Issue
Block a user