mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 12:05:59 +01:00
37df0a0cbe
## About The Pull Request Makes the lootpanel act like you'd expect it to. ## Why It's Good For The Game You should not need to manually refresh the loot panel. You should not be able to monitor a turf on the other side of the station. ## Changelog 🆑 fix: The lootpanel will now properly close with distance from the target like most other tguis. qol: The lootpanel will now automatically refresh when new items enter it. Removed the manual refresh button. /🆑 Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
/// Helper to open the panel
|
|
/datum/lootpanel/proc/open(turf/tile)
|
|
if (tile != source_turf)
|
|
if (source_turf)
|
|
UnregisterSignal(source_turf, COMSIG_ATOM_ENTERED)
|
|
RegisterSignal(tile, COMSIG_ATOM_ENTERED, PROC_REF(on_source_turf_entered))
|
|
|
|
source_turf = tile
|
|
|
|
#if !defined(OPENDREAM) && !defined(UNIT_TESTS)
|
|
if(!notified)
|
|
var/build = owner.byond_build
|
|
var/version = owner.byond_version
|
|
if(build < 515 || (build == 515 && version < 1635))
|
|
to_chat(owner.mob, boxed_message(span_info("\
|
|
<span class='bolddanger'>Your version of Byond doesn't support fast image loading.</span>\n\
|
|
Detected: [version].[build]\n\
|
|
Required version for this feature: <b>515.1635</b> or later.\n\
|
|
Visit <a href=\"https://secure.byond.com/download\">BYOND's website</a> to get the latest version of BYOND.\n\
|
|
")))
|
|
|
|
notified = TRUE
|
|
#endif
|
|
|
|
populate_contents()
|
|
ui_interact(owner.mob)
|
|
|
|
|
|
/**
|
|
* Called by SSlooting whenever this datum is added to its backlog.
|
|
* Iterates over to_image list to create icons, then removes them.
|
|
* Returns boolean - whether this proc has finished the queue or not.
|
|
*/
|
|
/datum/lootpanel/proc/process_images()
|
|
for(var/datum/search_object/index as anything in to_image)
|
|
to_image -= index
|
|
|
|
if(QDELETED(index) || index.icon)
|
|
continue
|
|
|
|
index.generate_icon(owner)
|
|
|
|
if(TICK_CHECK)
|
|
break
|
|
|
|
var/datum/tgui/window = SStgui.get_open_ui(owner.mob, src)
|
|
if(isnull(window))
|
|
reset_contents()
|
|
return TRUE
|
|
|
|
window.send_update()
|
|
|
|
return !length(to_image)
|