mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 07:48:55 +00:00
push
This commit is contained in:
@@ -82,6 +82,7 @@
|
||||
|
||||
/// Returns the mob this is being displayed to, if any
|
||||
/atom/movable/screen/proc/get_mob()
|
||||
RETURN_TYPE(/mob)
|
||||
return hud?.mymob
|
||||
|
||||
/atom/movable/screen/proc/on_hud_delete(datum/source)
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
name = "storage"
|
||||
var/insertion_click = FALSE
|
||||
|
||||
/atom/movable/screen/storage/Initialize(mapload, new_master)
|
||||
/atom/movable/screen/storage/Initialize(mapload, datum/hud/hud, new_master)
|
||||
. = ..()
|
||||
master = new_master
|
||||
|
||||
/atom/movable/screen/storage/Click(location, control, params)
|
||||
if(!insertion_click)
|
||||
return ..()
|
||||
if(hud?.mymob && (hud.mymob != usr))
|
||||
if(get_mob() != usr)
|
||||
return
|
||||
// just redirect clicks
|
||||
if(master)
|
||||
@@ -55,7 +55,7 @@
|
||||
plane = VOLUMETRIC_STORAGE_BOX_PLANE
|
||||
var/obj/item/our_item
|
||||
|
||||
/atom/movable/screen/storage/volumetric_box/Initialize(mapload, new_master, obj/item/our_item)
|
||||
/atom/movable/screen/storage/volumetric_box/Initialize(mapload, datum/hud/hud, new_master, obj/item/our_item)
|
||||
src.our_item = our_item
|
||||
RegisterSignal(our_item, COMSIG_ITEM_MOUSE_ENTER, PROC_REF(on_item_mouse_enter))
|
||||
RegisterSignal(our_item, COMSIG_ITEM_MOUSE_EXIT, PROC_REF(on_item_mouse_exit))
|
||||
@@ -97,9 +97,9 @@
|
||||
var/atom/movable/screen/storage/item_holder/holder
|
||||
var/pixel_size
|
||||
|
||||
/atom/movable/screen/storage/volumetric_box/center/Initialize(mapload, new_master, our_item)
|
||||
left = new(null, src, our_item)
|
||||
right = new(null, src, our_item)
|
||||
/atom/movable/screen/storage/volumetric_box/center/Initialize(mapload, datum/hud/hud, new_master, our_item)
|
||||
left = new(null, hud, src, our_item)
|
||||
right = new(null, hud, src, our_item)
|
||||
return ..()
|
||||
|
||||
/atom/movable/screen/storage/volumetric_box/center/Destroy()
|
||||
@@ -116,7 +116,7 @@
|
||||
/**
|
||||
* Sets the size of this box screen object and regenerates its left/right borders. This includes the actual border's size!
|
||||
*/
|
||||
/atom/movable/screen/storage/volumetric_box/center/proc/set_pixel_size(pixels)
|
||||
/atom/movable/screen/storage/volumetric_box/center/proc/set_pixel_size(pixels, datum/hud/hud)
|
||||
if(pixel_size == pixels)
|
||||
return
|
||||
pixel_size = pixels
|
||||
@@ -128,7 +128,7 @@
|
||||
if(our_item)
|
||||
if(holder)
|
||||
qdel(holder)
|
||||
holder = new(null, src, our_item)
|
||||
holder = new(null, hud, src, our_item)
|
||||
holder.transform = matrix(1 / multiplier, 0, 0, 0, 1, 0)
|
||||
holder.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
holder.appearance_flags &= ~RESET_TRANSFORM
|
||||
@@ -155,7 +155,7 @@
|
||||
layer = VOLUMETRIC_STORAGE_BOX_LAYER
|
||||
plane = VOLUMETRIC_STORAGE_BOX_PLANE
|
||||
|
||||
/atom/movable/screen/storage/volumetric_edge/Initialize(mapload, master, our_item)
|
||||
/atom/movable/screen/storage/volumetric_edge/Initialize(mapload, datum/hud/hud, master, our_item)
|
||||
src.master = master
|
||||
return ..()
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
var/obj/item/our_item
|
||||
vis_flags = NONE
|
||||
|
||||
/atom/movable/screen/storage/item_holder/Initialize(mapload, new_master, obj/item/I)
|
||||
/atom/movable/screen/storage/item_holder/Initialize(mapload, datum/hud/hud, new_master, obj/item/I)
|
||||
. = ..()
|
||||
our_item = I
|
||||
vis_contents += I
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
var/rows = clamp(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
|
||||
|
||||
// First, boxes.
|
||||
ui_boxes = get_ui_boxes()
|
||||
ui_boxes = get_ui_boxes(user.hud_used)
|
||||
ui_boxes.screen_loc = "[screen_start_x]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x+columns-1]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
|
||||
. += ui_boxes
|
||||
// Then, closer.
|
||||
ui_close = get_ui_close()
|
||||
ui_close = get_ui_close(user.hud_used)
|
||||
ui_close.screen_loc = "[screen_start_x + columns]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y]"
|
||||
. += ui_close
|
||||
// Then orient the actual items.
|
||||
@@ -62,7 +62,7 @@
|
||||
for(var/obj/O in accessible_items())
|
||||
if(QDELETED(O))
|
||||
continue
|
||||
var/atom/movable/screen/storage/item_holder/D = new(null, src, O)
|
||||
var/atom/movable/screen/storage/item_holder/D = new(null, user.hud_used, src, O)
|
||||
// SNOWFLAKE: make O opaque too, pending storage rewrite
|
||||
O.mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
D.mouse_opacity = MOUSE_OPACITY_OPAQUE //This is here so storage items that spawn with contents correctly have the "click around item to equip"
|
||||
@@ -139,7 +139,7 @@
|
||||
for(var/i in percentage_by_item)
|
||||
I = i
|
||||
var/percent = percentage_by_item[I]
|
||||
var/atom/movable/screen/storage/volumetric_box/center/B = new /atom/movable/screen/storage/volumetric_box/center(null, src, I)
|
||||
var/atom/movable/screen/storage/volumetric_box/center/B = new /atom/movable/screen/storage/volumetric_box/center(null, user.hud_used, src, I)
|
||||
// SNOWFLAKE: force it to icon until we unfuck storage/click passing
|
||||
I.mouse_opacity = MOUSE_OPACITY_ICON
|
||||
var/pixels_to_use = overrun? MINIMUM_PIXELS_PER_ITEM : max(using_horizontal_pixels * percent, MINIMUM_PIXELS_PER_ITEM)
|
||||
@@ -168,15 +168,15 @@
|
||||
current_pixel = VOLUMETRIC_STORAGE_EDGE_PADDING
|
||||
|
||||
// Then, continuous section.
|
||||
ui_continuous = get_ui_continuous()
|
||||
ui_continuous = get_ui_continuous(user.hud_used)
|
||||
ui_continuous.screen_loc = "[screen_start_x]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x+maxcolumns-1]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
|
||||
. += ui_continuous
|
||||
// Then, left.
|
||||
ui_left = get_ui_left()
|
||||
ui_left = get_ui_left(user.hud_used)
|
||||
ui_left.screen_loc = "[screen_start_x]:[screen_pixel_x - 2],[screen_start_y]:[screen_pixel_y] to [screen_start_x]:[screen_pixel_x - 2],[screen_start_y+rows-1]:[screen_pixel_y]"
|
||||
. += ui_left
|
||||
// Then, closer, which is also our right element.
|
||||
ui_close = get_ui_close()
|
||||
ui_close = get_ui_close(user.hud_used)
|
||||
ui_close.screen_loc = "[screen_start_x + maxcolumns]:[screen_pixel_x],[screen_start_y]:[screen_pixel_y] to [screen_start_x + maxcolumns]:[screen_pixel_x],[screen_start_y+rows-1]:[screen_pixel_y]"
|
||||
. += ui_close
|
||||
|
||||
@@ -258,23 +258,23 @@
|
||||
/**
|
||||
* Gets our ui_boxes, making it if it doesn't exist.
|
||||
*/
|
||||
/datum/component/storage/proc/get_ui_boxes()
|
||||
return new /atom/movable/screen/storage/boxes(null, src)
|
||||
/datum/component/storage/proc/get_ui_boxes(datum/hud/hud)
|
||||
return new /atom/movable/screen/storage/boxes(null, hud, src)
|
||||
|
||||
/**
|
||||
* Gets our ui_left, making it if it doesn't exist.
|
||||
*/
|
||||
/datum/component/storage/proc/get_ui_left()
|
||||
return new /atom/movable/screen/storage/left(null, src)
|
||||
/datum/component/storage/proc/get_ui_left(datum/hud/hud)
|
||||
return new /atom/movable/screen/storage/left(null, hud, src)
|
||||
|
||||
/**
|
||||
* Gets our ui_close, making it if it doesn't exist.
|
||||
*/
|
||||
/datum/component/storage/proc/get_ui_close()
|
||||
return new /atom/movable/screen/storage/close(null, src)
|
||||
/datum/component/storage/proc/get_ui_close(datum/hud/hud)
|
||||
return new /atom/movable/screen/storage/close(null, hud, src)
|
||||
|
||||
/**
|
||||
* Gets our ui_continuous, making it if it doesn't exist.
|
||||
*/
|
||||
/datum/component/storage/proc/get_ui_continuous()
|
||||
return new /atom/movable/screen/storage/continuous(null, src)
|
||||
/datum/component/storage/proc/get_ui_continuous(datum/hud/hud)
|
||||
return new /atom/movable/screen/storage/continuous(null, hud, src)
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
/datum/numbered_display/New(obj/item/sample, _number = 1, datum/component/storage/parent)
|
||||
if(!istype(sample))
|
||||
qdel(src)
|
||||
sample_object = new /atom/movable/screen/storage/item_holder(null, parent, sample)
|
||||
sample_object = new /atom/movable/screen/storage/item_holder(null, null, parent, sample)
|
||||
number = _number
|
||||
|
||||
Reference in New Issue
Block a user