Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds hana paperwork forms into the photocopier for City Fishers #2653

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions _maps/map_files/Event/city.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
"fM" = (
/obj/machinery/light,
/obj/structure/table/wood,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/turf/open/floor/facility/white,
/area/city/fixers)
"fP" = (
Expand Down Expand Up @@ -1019,12 +1024,28 @@
/turf/open/floor/plating/beach/sand,
/area/city)
"mV" = (
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/structure/table/wood,
/obj/item/toner/large{
pixel_x = 2;
pixel_y = -8
},
/obj/item/toner/large{
pixel_y = -4;
pixel_x = 1
},
/obj/item/toner/large,
/obj/item/toner/large{
pixel_y = 4;
pixel_x = -1
},
/obj/item/toner/large{
pixel_y = 8;
pixel_x = -2
},
/obj/item/toner/large{
pixel_y = 12;
pixel_x = -3
},
/turf/open/floor/facility/white,
/area/city/fixers)
"mW" = (
Expand Down
11 changes: 11 additions & 0 deletions _maps/map_files/Event/city_fixer.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,17 @@
"jP" = (
/obj/structure/table/wood,
/obj/item/modular_computer/laptop/preset/civilian,
/obj/item/toner/large{
pixel_y = 4;
pixel_x = 4
},
/obj/item/toner/large{
pixel_y = 8
},
/obj/item/toner/large{
pixel_y = 12;
pixel_x = -4
},
/turf/open/floor/facility/white,
/area/city/fixers)
"ka" = (
Expand Down
41 changes: 41 additions & 0 deletions code/modules/paperwork/photocopier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
var/color_mode = PHOTO_COLOR
/// Indicates whether the printer is currently busy copying or not.
var/busy = FALSE
/// Variable needed to determine the selected category of forms on Photocopier.js
var/category

/obj/machinery/photocopier/Initialize()
. = ..()
Expand All @@ -60,6 +62,18 @@
data["has_item"] = !copier_empty()
data["num_copies"] = num_copies

try
// var/list/blanks = json_decode(file2text("config/blanks.json")) LOBOTOMYCORPORATION EDIT OLD
var/list/blanks = (SSmaptype.maptype in SSmaptype.citymaps) ? json_decode(file2text("config/blanks_city.json")) : json_decode(file2text("config/blanks.json")) // LOBOTOMYCORPORATION EDIT NEW
if (blanks != null)
data["blanks"] = blanks
data["category"] = category
data["forms_exist"] = TRUE
else
data["forms_exist"] = FALSE
catch()
data["forms_exist"] = FALSE

if(photo_copy)
data["is_photo"] = TRUE
data["color_mode"] = color_mode
Expand Down Expand Up @@ -156,6 +170,27 @@
if("set_copies")
num_copies = clamp(text2num(params["num_copies"]), 1, MAX_COPIES_AT_ONCE)
return TRUE
// Changes the forms displayed on Photocopier.js when you switch categories
if("choose_category")
category = params["category"]
return TRUE
// Called when you press print blank
if("print_blank")
if(busy)
to_chat(usr, span_warning("[src] is currently busy copying something. Please wait until it is finished."))
return FALSE
if (toner_cartridge.charges - PAPER_TONER_USE < 0)
to_chat(usr, span_warning("There is not enough toner in [src] to print the form, please replace the cartridge."))
return FALSE
do_copy_loop(CALLBACK(src, PROC_REF(make_blank_print)), usr)
var/obj/item/paper/printblank = new /obj/item/paper (loc)
var/printname = params["name"]
var/list/printinfo
for(var/infoline as anything in params["info"])
printinfo += infoline
printblank.name = printname
printblank.info = printinfo
return printblank

/**
* Determines if the photocopier has enough toner to create `num_copies` amount of copies of the currently inserted item.
Expand Down Expand Up @@ -267,6 +302,12 @@
give_pixel_offset(copied_doc)
toner_cartridge.charges -= DOCUMENT_TONER_USE

/**
* The procedure is called when printing a blank to write off toner consumption.
*/
/obj/machinery/photocopier/proc/make_blank_print()
toner_cartridge.charges -= PAPER_TONER_USE

/**
* Handles the copying of an ass photo.
*
Expand Down
Loading
Loading