From fd8abe70563529a79870ed2283f53d10cbe9710e Mon Sep 17 00:00:00 2001 From: Kyep Date: Fri, 18 Sep 2020 05:52:59 -0700 Subject: [PATCH] Replaces firealarm interface --- code/game/machinery/firealarm.dm | 76 +---- nano/templates/card_prog.tmpl | 309 ----------------- nano/templates/comm_program.tmpl | 129 -------- nano/templates/firealarm.tmpl | 69 ---- nano/templates/identification_computer.tmpl | 347 -------------------- 5 files changed, 13 insertions(+), 917 deletions(-) delete mode 100644 nano/templates/card_prog.tmpl delete mode 100644 nano/templates/comm_program.tmpl delete mode 100644 nano/templates/firealarm.tmpl delete mode 100644 nano/templates/identification_computer.tmpl diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 911f85be753..6144d1c3883 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -30,7 +30,6 @@ FIRE ALARM light_range = 7 light_color = "#ff3232" - var/last_process = 0 var/wiresexposed = 0 var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone var/enabled = FALSE @@ -85,7 +84,8 @@ FIRE ALARM return attack_hand(user) /obj/machinery/firealarm/attack_ghost(mob/user) - ui_interact(user) + if(user.can_admin_interact()) + toggle_alarm(user) /obj/machinery/firealarm/emp_act(severity) if(prob(50/severity)) @@ -218,21 +218,6 @@ FIRE ALARM else set_light(l_power = 0) -/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed - if(stat & (NOPOWER|BROKEN)) - return - - if(timing) - if(time > 0) - time = time - ((world.timeofday - last_process)/10) - else - alarm() - time = 0 - timing = 0 - STOP_PROCESSING(SSobj, src) - updateDialog() - last_process = world.timeofday - /obj/machinery/firealarm/power_change() if(powered(ENVIRON)) stat &= ~NOPOWER @@ -249,56 +234,21 @@ FIRE ALARM if(user.incapacitated()) return 1 - ui_interact(user) + toggle_alarm(user) -/obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state) - ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "firealarm.tmpl", name, 400, 400, state = state) - ui.open() - ui.set_auto_update(1) - -/obj/machinery/firealarm/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state) - var/data[0] +/obj/machinery/firealarm/proc/toggle_alarm(mob/user) var/area/A = get_area(src) - data["fire"] = A.fire - data["timing"] = timing + if(istype(A)) + add_fingerprint(user) + if(A.fire) + reset() + else + alarm() - data["sec_level"] = get_security_level() - - var/second = round(time % 60) - var/minute = round(time / 60) - - data["time_left"] = "[minute ? "[minute]:" : ""][add_zero(num2text(second), 2)]" - return data - -/obj/machinery/firealarm/Topic(href, href_list) - if(..()) - return 1 - - if(buildstage != 2) - return 1 - - add_fingerprint(usr) - - if(href_list["reset"]) - reset() - else if(href_list["alarm"]) - alarm() - else if(href_list["time"]) - var/oldTiming = timing - timing = text2num(href_list["time"]) - last_process = world.timeofday - if(oldTiming != timing) - if(timing) - START_PROCESSING(SSobj, src) - else - STOP_PROCESSING(SSobj, src) - else if(href_list["tp"]) - var/tp = text2num(href_list["tp"]) - time += tp - time = min(max(round(time), 0), 120) +/obj/machinery/firealarm/examine(mob/user) + . = ..() + . += "It shows the alert level as: [capitalize(get_security_level())]." /obj/machinery/firealarm/proc/reset() if(!working || !report_fire_alarms) diff --git a/nano/templates/card_prog.tmpl b/nano/templates/card_prog.tmpl deleted file mode 100644 index 7054f8bf4c2..00000000000 --- a/nano/templates/card_prog.tmpl +++ /dev/null @@ -1,309 +0,0 @@ -{{if data.printing}} -
The computer is currently busy.
-
-
Printing...
-
-

- Thank you for your patience! -

-{{else}} - {{:helper.link('Access Modification', 'home', {'action' : 'PRG_mode', 'mode_target' : 0}, !data.mode ? 'disabled' : null)}} - {{:helper.link('Job Management', 'gear', {'action' : 'PRG_mode', 'mode_target' : 1}, data.mode == 1 ? 'disabled' : null)}} - {{:helper.link('Crew Manifest', 'folder-open', {'action' : 'PRG_mode', 'mode_target' : 2}, data.mode == 2 ? 'disabled' : null)}} - {{:helper.link('Print', 'print', {'action' : 'PRG_print'}, data.printer && (data.mode == 2 || data.has_modify && !data.mode) ? null : 'disabled')}} - {{:helper.link('Records', 'file', {'action' : 'PRG_mode', 'mode_target' : 3}, (data.mode == 3) ? 'disabled' : null)}} - - {{if data.mode == 1}} -
-

Job Management

-
-
-
- Authorized Identity: -
-
- {{:helper.link(data.scan_name, 'eject', {'action' : 'PRG_scan'})}} -
-
- Cooldown: -
-
- {{if data.cooldown_mins > 0 || data.cooldown_mins == 0 && data.cooldown_secs > 0}} - Next change in: {{:data.cooldown_mins}}:{{:data.cooldown_secs}} - {{else}} - Ready - {{/if}} -
-
-
-
- {{for data.job_slots}} -
- {{:value.title}}: {{:value.current_positions}}/{{:value.total_positions}} - {{:helper.link('-', null, {'action' : 'PRG_make_job_unavailable', 'job' : value.title}, value.can_close == 1 && data.authenticated ? null : 'disabled')}} - {{:helper.link('+', null, {'action' : 'PRG_make_job_available', 'job' : value.title}, value.can_open == 1 && data.authenticated ? null : 'disabled')}} - {{:helper.link('Pri', null, {'action' : 'PRG_prioritize_job', 'job' : value.title}, value.can_prioritize > 0 && data.authenticated ? null : 'disabled')}} {{if value.can_prioritize == 2}}Priority Job {{/if}} -
- {{/for}} -
- {{else data.mode == 2}} -
-

Crew Manifest

-
-
- {{:data.manifest}} -
- {{else data.mode == 3}} -
-

Records

-
-
-
- Authorized Identity: -
-
- {{:helper.link(data.scan_name, 'eject', {'action' : 'PRG_scan'})}} -
-
-
- {{if data.authenticated}} - {{:data.id_change_html}} - {{if data.centcom_access}} - {{:helper.link('Delete Records By: ' + data.scan_owner, null, {'action' : 'PRG_wipe_my_logs'}, null, 'linkDanger')}} - {{/if}} - {{if !data.target_dept}} - {{:helper.link('Delete ALL Records', null, {'action' : 'PRG_wipe_all_logs'}, null, 'linkDanger')}} - {{/if}} - {{else}} - Please insert an authorized ID into the terminal to proceed.
- {{/if}} -
- {{else}} -
-

Access Modification

-
- - {{if !data.authenticated}} - Please insert the IDs into the terminal to proceed.
- {{/if}} - -
-
- Target Identity: -
-
- {{:helper.link(data.target_name, 'eject', {'action' : 'PRG_modify'})}} -
-
-
-
- Authorized Identity: -
-
- {{:helper.link(data.scan_name, 'eject', {'action' : 'PRG_scan'})}} -
-
-
- - {{if data.authenticated}} - - - {{if data.has_modify}} -
-

Details

-
- -
-
-
- - - Registered Name: -
-
- - -
-
-
- -
-
-
- - - Account Number: -
-
- - -
-
-
- -
-
- Terminations: -
-
- {{if data.target_rank == "Terminated"}} - {{:data.target_owner}} has already been terminated! - {{else}} - {{:helper.link('Terminate ' + data.target_owner, 'gear', {'action' : 'PRG_terminate'}, data.target_rank == "Terminated" ? 'disabled' : null, data.target_rank == "Terminated" ? 'disabled' : 'linkDanger')}} - {{/if}} -
-
- -
-

Assignment

-
- -
- - {{:data.target_rank}} - -
-
- -
- - {{if data.centcom_access}} -
-

Central Command

-
-
- {{for data.all_centcom_access}} - {{:helper.link(value.desc, '', {'action' : 'PRG_access', 'access_target' : value.ref, 'allowed' : value.allowed}, null, value.allowed ? 'selected' : null)}} - {{/for}} -
-
Card Skin
- {{for data.all_centcom_skins}} - {{:helper.link(value.display_name, '', {'action' : 'PRG_skin', 'skin_target' : value.skin}, null,(data.current_skin == value.skin) ? 'selected' : null )}} - {{/for}} -
-
- {{else}} -
-

{{:data.station_name}}

-
-
- {{for data.regions}} -
-
{{:value.name}}
- {{for value.accesses :accessValue:accessKey}} -
- {{:helper.link(accessValue.desc, '', {'action' : 'PRG_access', 'access_target' : accessValue.ref, 'allowed' : accessValue.allowed}, null, accessValue.allowed ? 'selected' : null)}} -
- {{/for}} -
- {{/for}} -
-
Card Skin
- {{for data.card_skins}} - {{:helper.link(value.display_name, '', {'action' : 'PRG_skin', 'skin_target' : value.skin}, null,(data.current_skin == value.skin) ? 'selected' : null )}} - {{/for}} -
-
- {{/if}} - {{/if}} - {{/if}} - {{/if}} -{{/if}} diff --git a/nano/templates/comm_program.tmpl b/nano/templates/comm_program.tmpl deleted file mode 100644 index b1c64c6f4e3..00000000000 --- a/nano/templates/comm_program.tmpl +++ /dev/null @@ -1,129 +0,0 @@ -{{if !data.authenticated}} -
Please swipe your ID card. {{:helper.link('Log In', 'unlock', {'PRG_login' : 1}, null, 'fixed')}}
-{{else}} - {{if !data.is_ai}} -
Please remember to {{:helper.link('Log Out', 'lock', {'PRG_logout' : 1}, null, 'fixed')}}
- {{/if}} - {{if data.lastCallLoc}} -
Most recent shuttle call/recall traced to: {{:data.lastCallLoc}}
- {{else}} -
Unable to trace most recent shuttle call/recall signal.
- {{/if}} -
-

Emergency Shuttle:

- {{if data.shuttle.eta}} -
ETA:
-
- {{>data.shuttle.eta}} -
- {{/if}} -
Options:
-
- {{if data.shuttle.callStatus == 1 && !data.is_ai}} - {{:helper.link('Cancel Shuttle', 'arrow-left', {'PRG_operation' : 'cancelshuttle'})}} - {{else data.shuttle.callStatus == 2}} - {{:helper.link('Call Shuttle', 'arrow-circle-down', {'PRG_operation' : 'callshuttle'})}} - {{/if}} -
-
- - {{if data.screen==1}} - -

Menu

-
- {{if data.authenticated==2}} -
- {{:helper.link('Make an Announcement', 'info', {'PRG_operation' : 'announce'})}} -
-
- {{if data.emagged}} - {{:helper.link('Message [UNKNOWN]', 'envelope', {'PRG_operation' : 'MessageSyndicate'})}} - {{else}} - {{:helper.link('Message CentComm', 'envelope', {'PRG_operation' : 'MessageCentcomm'})}} - {{/if}} -
-
- {{:helper.link('Request Nuclear Authentication Codes', 'exclamation-triangle', {'PRG_operation' : 'nukerequest'})}} -
- {{/if}} -
- {{:helper.link('Change Alert Level', 'signal', {'PRG_operation' : 'changeseclevel'})}} -
-
- {{:helper.link('Change Status Displays', 'info', {'PRG_operation' : 'status'})}} -
-
- {{:helper.link('Message List', 'comment', {'PRG_operation' : 'messagelist'})}} -
-
- {{:helper.link('Restart Nano-Mob Hunter GO! Server', 'power-off', {'PRG_operation' : 'RestartNanoMob'})}} -
-
- {{else data.screen==2}} - -

Status Displays

- {{:helper.link('Back', 'home', {'PRG_operation' : 'main'})}} -

Presets

- {{for data.stat_display.presets}} -
-
{{:helper.link(value.label, 'info', {'PRG_operation' : 'setstat', 'statdisp' : value.name}, name == data.stat_display.type ? 'selected' : null)}}
-
- {{/for}} -

Alerts

- {{for data.stat_display.alerts}} -
-
{{:helper.link(value.label, 'exclamation-triangle', {'PRG_operation' : 'setstat', 'statdisp' : 'alert', 'alert' : value.alert}, value.alert == data.stat_display.type ? 'selected' : null)}}
-
- {{/for}} -

Messages

-
- {{if data.stat_display.type}} -
-
{{:helper.link('Line 1:', 'gear', {'PRG_operation':'setmsg1'})}}
-
{{>data.stat_display.line_1}}
-
-
-
{{:helper.link('Line 2:', 'gear', {'PRG_operation':'setmsg2'})}}
-
{{>data.stat_display.line_2}}
-
- {{/if}} -
- {{else data.screen==3}} - -

Messages

- {{if data.current_message}} - {{:helper.link('Messages', 'home', {'PRG_operation' : 'messagelist'})}} -

{{:data.current_message_title}}

-
- {{:data.current_message}} -
- {{else}} - {{:helper.link('Back', 'home', {'PRG_operation' : 'main'})}} - {{for data.messages}} -
- {{:value.title}}
- {{:helper.link('Open', 'envelope-o', {'PRG_operation' : 'messagelist', 'msgid' : value.id})}} - {{:helper.link('Delete', 'close', {'PRG_operation' : 'delmessage', 'msgid' : value.id})}} -
- {{/for}} - {{/if}} - {{else data.screen==4}} - -

Security Level

- {{:helper.link('Back', 'home', {'PRG_operation' : 'main'})}} -
-
-
Security Level:
-
{{>data.str_security_level}}
-
-
-
Presets:
-
- {{for data.levels}} - {{:helper.link(value.name, 'comment', {'PRG_operation' : 'newalertlevel', 'level' : value.id}, value.id == data.security_level ? 'selected' : null)}} - {{/for}} -
-
-
- {{/if}} -{{/if}} \ No newline at end of file diff --git a/nano/templates/firealarm.tmpl b/nano/templates/firealarm.tmpl deleted file mode 100644 index 5ddaa2977f4..00000000000 --- a/nano/templates/firealarm.tmpl +++ /dev/null @@ -1,69 +0,0 @@ - -
-
- Fire Alarm -
-
- {{:helper.link('Activated', 'lightbulb-o', {'alarm' : 1}, data.fire ? 'selected' : '')}} - {{:helper.link('Deactivated', 'lightbulb-o', {'reset' : 1}, data.fire ? '' : 'selected')}} -
-
- -
-
- Security Level -
-
- {{if data.sec_level == "green"}} - Green - {{else data.sec_level == "blue"}} - Blue - {{else data.sec_level == "red"}} - Red - {{else data.sec_level == "gamma"}} - Gamma - {{else data.sec_level == "epsilon"}} - Contracts terminated. - {{else data.sec_level == "delta"}} - Nuclear device primed. - {{else}} - ERR: Unable to ascertain security level. Please see an authorized NT fire alarm technician. - {{/if}} -
-
- -
-
- Timer System -
-
- {{:helper.link('Initiate', 'play', {'time': 1}, data.timing ? 'selected' : '')}} - {{:helper.link('Stop', 'pause', {'time': 0}, data.timing ? '' : 'selected')}} -
-
- -
-
- Time Modifiers -
-
- {{:helper.link('30', 'minus', {'tp': -30})}} - {{:helper.link('1', 'minus', {'tp': -1 })}} - {{:helper.link('1', 'plus', {'tp': +1 })}} - {{:helper.link('30', 'plus', {'tp': +30})}} -
-
- -{{if data.timing}} -
-
- Time Left -
-
- {{:data.time_left}} -
-
-{{/if}} \ No newline at end of file diff --git a/nano/templates/identification_computer.tmpl b/nano/templates/identification_computer.tmpl deleted file mode 100644 index 606af520168..00000000000 --- a/nano/templates/identification_computer.tmpl +++ /dev/null @@ -1,347 +0,0 @@ -{{if data.printing}} -
The computer is currently busy.
-
-
Printing...
-
-

- Thank you for your patience! -

-{{else}} - {{:helper.link('Access Modification', 'home', {'choice' : 'mode', 'mode_target' : 0}, !data.mode ? 'disabled' : null)}} - {{if !data.target_dept}}{{:helper.link('Job Management', 'gear', {'choice' : 'mode', 'mode_target' : 1}, data.mode == 1 ? 'disabled' : null)}}{{/if}} - {{:helper.link('Crew Manifest', 'folder-open', {'choice' : 'mode', 'mode_target' : 2}, data.mode == 2 ? 'disabled' : null)}} - {{if !data.target_dept}}{{:helper.link('Print', 'print', {'choice' : 'print'}, (data.mode == 2 || data.has_modify && !data.mode) ? null : 'disabled')}}{{/if}} - {{:helper.link('Records', 'file', {'choice' : 'mode', 'mode_target' : 3}, (data.mode == 3) ? 'disabled' : null)}} - - {{if data.mode == 1 && !data.target_dept}} -
-

Job Management

-
-
-
- Authorized Identity: -
-
- {{:helper.link(data.scan_name, 'eject', {'choice' : 'scan'})}} -
-
- Cooldown: -
-
- {{if data.cooldown_mins > 0 || data.cooldown_mins == 0 && data.cooldown_secs > 0}} - Next change in: {{:data.cooldown_mins}}:{{:data.cooldown_secs}} - {{else}} - Ready - {{/if}} -
-
-
-
- {{for data.job_slots}} -
- {{:value.title}}: {{:value.current_positions}}/{{:value.total_positions}} - {{:helper.link('-', null, {'choice' : 'make_job_unavailable', 'job' : value.title}, value.can_close == 1 && data.authenticated ? null : 'disabled')}} - {{:helper.link('+', null, {'choice' : 'make_job_available', 'job' : value.title}, value.can_open == 1 && data.authenticated ? null : 'disabled')}} - {{:helper.link('Pri', null, {'choice' : 'prioritize_job', 'job' : value.title}, value.can_prioritize > 0 && data.authenticated ? null : 'disabled')}} {{if value.can_prioritize == 2}}Priority Job {{/if}} -
- {{/for}} -
- {{else data.mode == 2}} -
-

Crew Manifest

-
-
- {{:data.manifest}} -
- {{else data.mode == 3}} -
-

Records

-
-
-
- Authorized Identity: -
-
- {{:helper.link(data.scan_name, 'eject', {'choice' : 'scan'})}} -
-
-
- {{if data.authenticated}} - {{:data.id_change_html}} - {{if data.centcom_access}} - {{:helper.link('Delete Records By: ' + data.scan_owner, null, {'choice' : 'wipe_my_logs'}, null, 'linkDanger')}} - {{/if}} - {{if !data.target_dept}} - {{:helper.link('Delete ALL Records', null, {'choice' : 'wipe_all_logs'}, null, 'linkDanger')}} - {{/if}} - {{else}} - Please insert an authorized ID into the terminal to proceed.
- {{/if}} -
- {{else}} -
-

Access Modification

-
- - {{if !data.authenticated}} - Please insert the IDs into the terminal to proceed.
- {{/if}} - -
-
- Target Identity: -
-
- {{:helper.link(data.target_name, 'eject', {'choice' : 'modify'})}} -
-
-
-
- Authorized Identity: -
-
- {{:helper.link(data.scan_name, 'eject', {'choice' : 'scan'})}} -
-
-
- - {{if data.authenticated}} - - - {{if data.has_modify}} - {{if !data.target_dept}} -
-

Details

-
- -
-
-
- - - Registered Name: -
-
- - -
-
-
- -
-
-
- - - Account Number: -
-
- - -
-
-
- {{/if}} - {{if data.target_rank != "Terminated"}} -
-
- Demotions: -
-
- {{if data.target_rank == "Demoted"}} - {{:data.target_owner}} has already been demoted! - {{else}} - {{:helper.link('Demote ' + data.target_owner, 'gear', {'choice' : 'demote'}, (data.target_rank == "Civilian" || data.target_rank == "Unassigned") ? 'disabled' : null, (data.target_rank == "Civilian" || data.target_rank == "Unassigned") ? 'disabled' : 'linkDanger')}} - {{/if}} -
-
- {{/if}} - {{if !data.target_dept}} -
-
- Terminations: -
-
- {{if data.target_rank == "Terminated"}} - {{:data.target_owner}} has already been terminated! - {{else}} - {{:helper.link('Terminate ' + data.target_owner, 'gear', {'choice' : 'terminate'}, data.target_rank == "Terminated" ? 'disabled' : null, data.target_rank == "Terminated" ? 'disabled' : 'linkDanger')}} - {{/if}} -
-
- -
-

Assignment

-
- - {{else}} - -
-

Assignment for {{:data.target_owner}}

-
- - {{/if}} - -
- - {{:data.target_rank}} - -
-
- -
- - {{if data.centcom_access}} -
-

Central Command

-
-
- {{for data.all_centcom_access}} - {{:helper.link(value.desc, '', {'choice' : 'access', 'access_target' : value.ref, 'allowed' : value.allowed}, null, value.allowed ? 'selected' : null)}} - {{/for}} -
-
Card Skin
- {{for data.all_centcom_skins}} - {{:helper.link(value.display_name, '', {'choice' : 'skin', 'skin_target' : value.skin}, null,(data.current_skin == value.skin) ? 'selected' : null )}} - {{/for}} -
-
- {{else}} - {{if !data.target_dept}} -
-

{{:data.station_name}}

-
-
- {{for data.regions}} -
-
{{:value.name}}
- {{for value.accesses :accessValue:accessKey}} -
- {{:helper.link(accessValue.desc, '', {'choice' : 'access', 'access_target' : accessValue.ref, 'allowed' : accessValue.allowed}, null, accessValue.allowed ? 'selected' : null)}} -
- {{/for}} -
- {{/for}} -
-
Card Skin
- {{for data.card_skins}} - {{:helper.link(value.display_name, '', {'choice' : 'skin', 'skin_target' : value.skin}, null,(data.current_skin == value.skin) ? 'selected' : null )}} - {{/for}} -
-
- {{/if}} - {{/if}} - {{/if}} - {{/if}} - {{/if}} -{{/if}}