diff --git a/code/game/machinery/computer/timeclock_vr.dm b/code/game/machinery/computer/timeclock_vr.dm new file mode 100644 index 00000000000..9a23dfb6d94 --- /dev/null +++ b/code/game/machinery/computer/timeclock_vr.dm @@ -0,0 +1,127 @@ +///////////////////////////////////////////// +//Time Clock Terminal//////////////////////// +///////////////////////////////////////////// + +// +// Timeclock terminal machine itself +// +/obj/machinery/computer/timeclock + name = "timeclock terminal" + icon = 'icons/obj/machines/timeclock_vr.dmi' + icon_state = "timeclock" + icon_keyboard = null + light_color = "#0099ff" + light_power_on = 0.5 + layer = ABOVE_WINDOW_LAYER + density = FALSE + circuit = /obj/item/weapon/circuitboard/timeclock + + var/obj/item/weapon/card/id/card // Inserted Id card + +/obj/machinery/computer/timeclock/Destroy() + if(card) + card.forceMove(get_turf(src)) + card = null + . = ..() + +/obj/machinery/computer/timeclock/update_icon() + if(inoperable()) + icon_state = "[initial(icon_state)]_off" + else if(card) + icon_state = "[initial(icon_state)]_card" + else + icon_state = "[initial(icon_state)]" + +/obj/machinery/computer/timeclock/power_change() + var/old_stat = stat + . = ..() + if(old_stat != stat) + update_icon() + if(stat & NOPOWER) + set_light(0) + else + set_light(light_range_on, light_power_on) + +/obj/machinery/computer/timeclock/attackby(obj/I, mob/user) + if(istype(I, /obj/item/weapon/card/id)) + if(!card && user.unEquip(I)) + I.forceMove(src) + card = I + nanomanager.update_uis(src) + update_icon() + else if(card) + to_chat(user, "There is already ID card inside.") + return + . = ..() + +/obj/machinery/computer/timeclock/attack_hand(var/mob/user as mob) + if(..()) + return + user.set_machine(src) + ui_interact(user) + +/obj/machinery/computer/timeclock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) + user.set_machine(src) + + var/list/data = list() + // Okay, data for showing the user's OWN PTO stuff + if(user.client) + data["department_hours"] = SANITIZE_LIST(user.client.department_hours) + data["user_name"] = "[user]" + + // Data about the card that we put into it. + if(card) + data["card"] = "[card]" + data["assignment"] = card.assignment + var/datum/job/job = job_master.GetJob(card.rank) + if (job) + data["job_datum"] = list( + "title" = job.title, + "department" = job.department, + "selection_color" = job.selection_color, + "economic_modifier" = job.economic_modifier, + "head_position" = job.head_position, + "timeoff_factor" = job.timeoff_factor + ) + // TODO - Once job changing is implemented, we will want to list jobs to change into. + // if(job && job.timeoff_factor < 0) // Currently are Off Duty, so gotta lookup what on-duty jobs are open + // data["job_choices"] = getOpenOnDutyJobs(user, job.department) + + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if (!ui) + ui = new(user, src, ui_key, "timeclock_vr.tmpl", capitalize(src.name), 500, 520) + ui.set_initial_data(data) + ui.open() + +/obj/machinery/computer/timeclock/Topic(href, href_list) + if(..()) + return 1 + usr.set_machine(src) + src.add_fingerprint(usr) + + if (href_list["id"]) + if (card) + usr.put_in_hands(card) + card = null + else + var/obj/item/I = usr.get_active_hand() + if (istype(I, /obj/item/weapon/card/id) && usr.unEquip(I)) + I.forceMove(src) + card = I + update_icon() + return 1 // Return 1 to update UI + +// +// Frame type for construction +// +/datum/frame/frame_types/timeclock_terminal + name = "Timeclock Terminal" + frame_class = FRAME_CLASS_DISPLAY + frame_size = 2 + frame_style = FRAME_STYLE_WALL + x_offset = 30 + y_offset = 30 + icon_override = 'icons/obj/machines/timeclock_vr.dmi' + +/datum/frame/frame_types/timeclock_terminal/get_icon_state(var/state) + return "timeclock_b[state]" diff --git a/code/game/objects/items/weapons/circuitboards/circuitboards_vr.dm b/code/game/objects/items/weapons/circuitboards/circuitboards_vr.dm index b88ba62452f..fd2601c695d 100644 --- a/code/game/objects/items/weapons/circuitboards/circuitboards_vr.dm +++ b/code/game/objects/items/weapons/circuitboards/circuitboards_vr.dm @@ -45,4 +45,11 @@ origin_tech = list(TECH_PHORON = 3, TECH_DATA = 2, TECH_MAGNET = 2) req_components = list( /obj/item/weapon/stock_parts/matter_bin/adv = 1, - /obj/item/weapon/stock_parts/scanning_module = 5) \ No newline at end of file + /obj/item/weapon/stock_parts/scanning_module = 5) + +// Board for the timeclock terminal in timeclock_vr.dm +/obj/item/weapon/circuitboard/timeclock + name = T_BOARD("timeclock") + build_path = /obj/machinery/computer/timeclock + board_type = new /datum/frame/frame_types/timeclock_terminal + matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50) diff --git a/icons/obj/machines/timeclock_vr.dmi b/icons/obj/machines/timeclock_vr.dmi new file mode 100644 index 00000000000..e2b3cd9c30f Binary files /dev/null and b/icons/obj/machines/timeclock_vr.dmi differ diff --git a/nano/templates/timeclock_vr.tmpl b/nano/templates/timeclock_vr.tmpl new file mode 100644 index 00000000000..0ca409a1d2a --- /dev/null +++ b/nano/templates/timeclock_vr.tmpl @@ -0,0 +1,83 @@ + + + +
+

Time Off Balance for {{:config.user.name}}

+ {{props data.department_hours}} +
+
{{:key}}
+
{{:helper.fixed(value)}} {{:helper.fixed(value) == 1.0 ? 'hour' : 'hours'}}
+
+ {{empty}} +
No Hours Accrued
+ {{/props}} +
+ +

Employment Information

+
+
+
Employee ID:
+ {{:helper.link(data.card ? data.card : 'Insert ID', 'person', {'id' : 1})}} +
+ {{if data.job_datum }} +
+
Rank:
+
+ {{:data.job_datum.title}} +
+
+
+
Department:
+
{{:data.job_datum.department}}
+
+
+
Pay Scale:
+
{{:data.job_datum.economic_modifier}}
+
+
+
PTO Eligibility:
+ {{if data.job_datum.timeoff_factor > 0 }} +
+ Earns PTO +
+ {{else data.job_datum.timeoff_factor < 0}} +
+ Requires PTO +
+ {{else}} +
+ Neutral +
+ {{/if}} +
+ {{/if}} +
+ +{{if data.allow_change_job && data.job_datum && data.job_datum.timeoff_factor != 0 }} +

Employment Actions

+
+
+ {{if data.job_datum.head_position }} + + NT policy does not permit head positions to go off duty mid-shift. + {{else (data.job_datum.timeoff_factor > 0) }} + {{if helper.round(data.department_hours[data.job_datum.department]) > 0 }} + {{:helper.link('Go Off Duty', 'alert', {'switch-to-offduty': 1})}} + {{else}} + + Insufficent Time Off Accrued + {{/if}} + {{else (data.job_datum.timeoff_factor < 0) }} + {{for data.job_choices }} +
{{:value}}
+
{{:helper.link("Issue Guest Pass", 'suitcase', {'guest-pass' : value})}}
+ {{empty}} +
No Open Positions - See Head of Personnel
+ {{/for}} + {{/if}} +
+
+{{/if}} diff --git a/vorestation.dme b/vorestation.dme index 8502a5e34a0..d22fa593ec0 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -735,6 +735,7 @@ #include "code\game\machinery\computer\station_alert.dm" #include "code\game\machinery\computer\supply.dm" #include "code\game\machinery\computer\syndicate_specops_shuttle.dm" +#include "code\game\machinery\computer\timeclock_vr.dm" #include "code\game\machinery\computer\~computer_vr.dm" #include "code\game\machinery\computer3\bios.dm" #include "code\game\machinery\computer3\buildandrepair.dm"