Introducing noitatsxoB (#12073)
* okay * ok * ok * ok * ok * why am i doing this * WHY DID I DO THIS * mirror doesn't work * compile * shuttles should work * fix engine * fix engine * off by 1 * ok * adds proccall to write next map * haha post processing funny * fixes * Update code/modules/mapping/map_template.dm Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> * Update code/modules/mapping/map_template.dm Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> * Update code/modules/mapping/map_template.dm Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> * Update code/modules/mapping/map_template.dm Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -7,13 +7,21 @@ GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new)
|
||||
parent_type = /datum
|
||||
var/list/attributes
|
||||
var/target_path
|
||||
var/turn_angle
|
||||
var/swap_x
|
||||
var/swap_y
|
||||
var/swap_xy
|
||||
|
||||
/world/proc/preloader_setup(list/the_attributes, path)
|
||||
if(the_attributes.len)
|
||||
/world/proc/preloader_setup(list/the_attributes, path, turn_angle, swap_x, swap_y, swap_xy)
|
||||
if(length(the_attributes) || turn_angle)
|
||||
GLOB.use_preloader = TRUE
|
||||
var/datum/map_preloader/preloader_local = GLOB._preloader
|
||||
preloader_local.attributes = the_attributes
|
||||
preloader_local.target_path = path
|
||||
preloader_local.turn_angle = turn_angle
|
||||
preloader_local.swap_x = swap_x
|
||||
preloader_local.swap_y = swap_y
|
||||
preloader_local.swap_xy = swap_xy
|
||||
|
||||
/world/proc/preloader_load(atom/what)
|
||||
GLOB.use_preloader = FALSE
|
||||
@@ -29,6 +37,21 @@ GLOBAL_DATUM_INIT(_preloader, /datum/map_preloader, new)
|
||||
GLOB.dirty_vars += message
|
||||
#endif
|
||||
what.vars[attribute] = value
|
||||
// handle post processing, so things like directions on subtypes don't break.
|
||||
if(preloader_local.turn_angle) //safe way to check for if this is necessary
|
||||
what.dir = turn(what.dir, preloader_local.turn_angle)
|
||||
var/px = what.pixel_x
|
||||
var/py = what.pixel_y
|
||||
if(preloader_local.swap_y) //same order of operations as the load rotation, mirror and then x/y swapping.
|
||||
py = -py
|
||||
if(preloader_local.swap_x)
|
||||
px = -px
|
||||
if(preloader_local.swap_xy)
|
||||
var/opx = px
|
||||
px = py
|
||||
py = opx
|
||||
what.pixel_x = px
|
||||
what.pixel_y = py
|
||||
|
||||
/area/template_noop
|
||||
name = "Area Passthrough"
|
||||
|
||||
Reference in New Issue
Block a user