mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-25 00:51:55 +00:00
## About The Pull Request - Tablets now refresh their page when changing programs, this means the UI will no longer close and reopen itself several times (or even have several UIs open if shit broke hard enough). - Removed tablet's attack self because interact already does everything it had to do. - Header programs now close when minimized (as there's no button to close them in the main menu. - Removed a lot of program UI stuff, it's now handled by the PC itself, such as header data and ui host. - Cut off asset sending from TGUI into it's own proc so I can re-send assets when changing programs - Added an ejection button for machine computers - Fixed ID not ejecting into the user's hand when using 'Eject ID' - Fixes a minor runtime when opening the MODsuit application without a MODsuit already connected. ## Why It's Good For The Game Fixes some bugs that I found with tablets UIS now won't be flickering as bad in front of them, or have inconsistent placement (like when you move your main menu UI, go to Messenger, then it's back to the center of the screen). Video of it in action https://user-images.githubusercontent.com/53777086/221301417-78321149-0c10-475e-bd29-79f5a4ba0597.mp4 ## Changelog 🆑 fix: Being in an application now properly uses the tablet's battery. fix: Messenger and Themify apps now close when minimized, so don't count towards the running app limit. fix: Tablet UIs will now no longer spam open/close the UI when changing applications fix: Using the Eject ID button on tablets now ejects into your hand. fix: Computers now have an Eject ID button refactor: Cut down a lot of copy paste in tablet & program code, now it's mostly done by the tablet. /🆑
64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
/datum/computer_file/program/maintenance/camera
|
|
filename = "camera_app"
|
|
filedesc = "Camera"
|
|
program_icon_state = "camera"
|
|
category = PROGRAM_CATEGORY_MISC
|
|
extended_desc = "This program allows the taking of pictures."
|
|
size = 4
|
|
usage_flags = PROGRAM_TABLET
|
|
tgui_id = "NtosCamera"
|
|
program_icon = "camera"
|
|
|
|
/// Camera built-into the tablet.
|
|
var/obj/item/camera/internal_camera
|
|
/// Latest picture taken by the app.
|
|
var/datum/picture/internal_picture
|
|
/// How many pictures were taken already, used for the camera's TGUI photo display
|
|
var/picture_number = 1
|
|
|
|
/datum/computer_file/program/maintenance/camera/on_install()
|
|
. = ..()
|
|
internal_camera = new(computer)
|
|
internal_camera.print_picture_on_snap = FALSE
|
|
|
|
/datum/computer_file/program/maintenance/camera/Destroy()
|
|
if(internal_camera)
|
|
QDEL_NULL(internal_camera)
|
|
if(internal_picture)
|
|
QDEL_NULL(internal_picture)
|
|
return ..()
|
|
|
|
/datum/computer_file/program/maintenance/camera/tap(atom/tapped_atom, mob/living/user, params)
|
|
. = ..()
|
|
if(internal_picture)
|
|
QDEL_NULL(internal_picture)
|
|
var/turf/our_turf = get_turf(tapped_atom)
|
|
internal_picture = internal_camera.captureimage(our_turf, user, internal_camera.picture_size_x + 1, internal_camera.picture_size_y + 1)
|
|
picture_number++
|
|
computer.save_photo(internal_picture.picture_image)
|
|
|
|
/datum/computer_file/program/maintenance/camera/ui_data(mob/user)
|
|
var/list/data = list()
|
|
|
|
if(!isnull(internal_picture))
|
|
user << browse_rsc(internal_picture.picture_image, "tmp_photo[picture_number].png")
|
|
data["photo"] = "tmp_photo[picture_number].png"
|
|
|
|
data["paper_left"] = computer.stored_paper
|
|
|
|
return data
|
|
|
|
/datum/computer_file/program/maintenance/camera/ui_act(action, params, datum/tgui/ui)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
var/mob/living/user = usr
|
|
switch(action)
|
|
if("print_photo")
|
|
if(computer.stored_paper <= 0)
|
|
to_chat(usr, span_notice("Hardware error: Printer out of paper."))
|
|
return
|
|
internal_camera.printpicture(user, internal_picture)
|
|
computer.stored_paper--
|
|
computer.visible_message(span_notice("\The [computer] prints out a paper."))
|