mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-20 03:30:01 +01:00
## About The Pull Request Revival of #72881 A new alt click window with a tarkov-y loading spinner. Replaces the object item window in stat panel. ## Videos <details> <summary>vids</summary> toggleable grouping:  now lists the floor as first obj:  in action:  </details> ## features: - search by name - 515 image generator is much faster than alt click menu - opening a gargantuan amount of items shouldnt freeze your screen - groups similar items together in stacks by default, toggleable - shows tile as first item - <kbd>Shift</kbd> and <kbd>Ctrl</kbd> compatible with LMB 🖱️ - RMB points points at items (sry i could not get MMB working) - key <kbd>Esc</kbd> to exit the window. For devs: - A new image generation tech. - An error refetch mechanic to the Image component - It does not "smart track" the items being added to the pile, just reopen or refresh. This was a design decision. ## Why It's Good For The Game Honestly I just dislike the stat panel Fixes #53824 Fixes  ## Changelog 🆑 add: Added a loot window for alt-clicking tiles. del: Removed the item browser from the stat panel. /🆑 --------- Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: AnturK <AnturK@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
35 lines
1.7 KiB
Plaintext
35 lines
1.7 KiB
Plaintext
/datum/unit_test/lootpanel
|
|
abstract_type = /datum/unit_test/lootpanel
|
|
|
|
/datum/unit_test/lootpanel/contents/Run()
|
|
var/datum/client_interface/mock_client = new()
|
|
var/datum/lootpanel/panel = new(mock_client)
|
|
var/mob/living/carbon/human/labrat = allocate(/mob/living/carbon/human/consistent)
|
|
mock_client.mob = labrat
|
|
var/turf/one_over = locate(run_loc_floor_bottom_left.x + 1, run_loc_floor_bottom_left.y, run_loc_floor_bottom_left.z)
|
|
var/obj/item/storage/toolbox/box = allocate(/obj/item/storage/toolbox, one_over)
|
|
|
|
panel.open(one_over)
|
|
TEST_ASSERT_EQUAL(length(panel.contents), 2, "Contents should populate on open")
|
|
TEST_ASSERT_EQUAL(length(panel.to_image), 2, "to_image should've populated (unit testing)")
|
|
TEST_ASSERT_EQUAL(panel.contents[1].item, one_over, "First item should be the source turf")
|
|
|
|
var/datum/search_object/searchable = panel.contents[2]
|
|
TEST_ASSERT_EQUAL(searchable.item, box, "Second item should be the box")
|
|
|
|
qdel(box)
|
|
TEST_ASSERT_EQUAL(length(panel.contents), 1, "Contents should update on searchobj deleted")
|
|
TEST_ASSERT_EQUAL(length(panel.to_image), 1, "to_image should update on searchobj deleted")
|
|
|
|
var/obj/item/storage/toolbox/new_box = allocate(/obj/item/storage/toolbox, one_over)
|
|
TEST_ASSERT_EQUAL(length(panel.contents), 1, "Contents shouldn't update, we're dumb")
|
|
TEST_ASSERT_EQUAL(length(panel.to_image), 1, "to_image shouldn't update, we're dumb")
|
|
|
|
panel.populate_contents() // this also calls reset_contents bc length(contents)
|
|
TEST_ASSERT_EQUAL(length(panel.contents), 2, "Contents should repopulate with the new toolbox")
|
|
|
|
panel.populate_contents()
|
|
TEST_ASSERT_EQUAL(length(panel.contents), 2, "Panel shouldnt dupe searchables if reopened")
|
|
|
|
mock_client.mob = null
|