The bag of holding (and I guess backpack) balancing pass no one asked for (#11864)

* Ok

* whew

* ok

* fix

* ehh

* fix

* buff disks

* Update _compile_options.dm

* Update tgstation.dme
This commit is contained in:
kevinz000
2020-05-14 18:44:56 -07:00
committed by GitHub
parent af0d1da409
commit 10944d1b52
13 changed files with 145 additions and 51 deletions
+5 -1
View File
@@ -353,8 +353,12 @@
/datum/component/storage/proc/_remove_and_refresh(datum/source, atom/movable/thing)
_removal_reset(thing)
if(LAZYACCESS(ui_item_blocks, thing))
qdel(ui_item_blocks[thing])
var/obj/screen/storage/volumetric_box/center/C = ui_item_blocks[thing]
for(var/i in can_see_contents()) //runtimes result if mobs can access post deletion.
var/mob/M = i
M.client?.screen -= C.on_screen_objects()
ui_item_blocks -= thing
qdel(C)
refresh_mob_views()
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the new_location target, if that is null it's being deleted
+7 -3
View File
@@ -92,6 +92,8 @@
var/list/volume_by_item = list()
var/list/percentage_by_item = list()
for(var/obj/item/I in contents)
if(QDELETED(I))
continue
volume = I.get_w_volume()
used += volume
volume_by_item[I] = volume
@@ -123,6 +125,7 @@
var/obj/item/I
// start at this pixel from screen_start_x.
var/current_pixel = VOLUMETRIC_STORAGE_EDGE_PADDING
var/first = TRUE
var/row = 1
LAZYINITLIST(ui_item_blocks)
@@ -140,10 +143,10 @@
addrow = TRUE
// now that we have pixels_to_use, place our thing and add it to the returned list.
B.screen_loc = I.screen_loc = "[screen_start_x]:[round(current_pixel + (pixels_to_use * 0.5) + VOLUMETRIC_STORAGE_ITEM_PADDING, 1)],[screen_start_y+row-1]:[screen_pixel_y]"
B.screen_loc = I.screen_loc = "[screen_start_x]:[round(current_pixel + (pixels_to_use * 0.5) + (first? 0 : VOLUMETRIC_STORAGE_ITEM_PADDING), 1)],[screen_start_y+row-1]:[screen_pixel_y]"
// add the used pixels to pixel after we place the object
current_pixel += pixels_to_use + VOLUMETRIC_STORAGE_ITEM_PADDING
current_pixel += pixels_to_use + (first? 0 : VOLUMETRIC_STORAGE_ITEM_PADDING)
first = FALSE //apply padding to everything after this
// set various things
B.set_pixel_size(pixels_to_use)
@@ -163,6 +166,7 @@
// go up a row if needed
if(addrow)
row++
first = TRUE //first in the row, don't apply between-item padding.
current_pixel = VOLUMETRIC_STORAGE_EDGE_PADDING
// Then, continuous section.