forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
R&D Monitoring console TGUI + Can see RD consoles (tgstation#72987)
## About The Pull Request I wrote this while constantly rushing lol This PR does many things, the largest is that the R&D Monitoring console (the RD's one) is now TGUI It also changes how researching loggings work, bringing the RD console and NtosRD app on par with eachother The type of person is also logged differently, instead of ``Cyborg: [name]`` and ``User: [name]``, humans do not have a prefix and cyborgs will say ``CYBORG [name]``. ``research_logs`` also works differently now to make it easier to reference each needed data from the list. Lastly, I added the ability to see R&D consoles from the console, and the ability to remotely un/lock them down. This currently is pretty useless as it can't control the tablet app variant, and anyone with Science access can just unlock it, however with some minor future changes I think this can be turned into a good way for the RD to get control of their department. Video demonstration, mostly (I made a few edits after this): https://user-images.githubusercontent.com/53777086/215005387-817106f4-5237-4f2e-b0ac-da28e6a17f9c.mp4 ## Why It's Good For The Game This console is overhyped by the game, being hidden behind an RD-locked Command-colored door, in the same room as one of the most damaging theft objectives, yet it is one of the most useless and forgotten consoles in R&D if you don't count everything outside of researching, experiments and robotics. This adds a nice TGUI menu while making it a little more worthwhile to use. ## Changelog :cl: balance: The R&D monitoring console now shows R&D consoles and their locations. refactor: The R&D monitoring console now has a nice TGUI menu. /:cl:
- Loading branch information
1 parent
92db9f2
commit 4fcedc9
Showing
7 changed files
with
263 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/obj/machinery/computer/rdservercontrol | ||
name = "R&D Server Controller" | ||
desc = "Manages access to research databases and consoles." | ||
icon_screen = "rdcomp" | ||
icon_keyboard = "rd_key" | ||
circuit = /obj/item/circuitboard/computer/rdservercontrol | ||
req_access = list(ACCESS_RD) | ||
|
||
///Connected techweb node the server is connected to. | ||
var/datum/techweb/stored_research | ||
|
||
/obj/machinery/computer/rdservercontrol/Initialize(mapload, obj/item/circuitboard/C) | ||
. = ..() | ||
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research) | ||
stored_research = SSresearch.science_tech | ||
|
||
/obj/machinery/computer/rdservercontrol/multitool_act(mob/living/user, obj/item/multitool/tool) | ||
if(!QDELETED(tool.buffer) && istype(tool.buffer, /datum/techweb)) | ||
stored_research = tool.buffer | ||
balloon_alert(user, "techweb connected") | ||
return TRUE | ||
|
||
/obj/machinery/computer/rdservercontrol/emag_act(mob/user) | ||
if(obj_flags & EMAGGED) | ||
return | ||
obj_flags |= EMAGGED | ||
playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) | ||
balloon_alert(user, "console emagged") | ||
|
||
/obj/machinery/computer/rdservercontrol/ui_interact(mob/user, datum/tgui/ui) | ||
. = ..() | ||
ui = SStgui.try_update_ui(user, src, ui) | ||
if(!ui) | ||
ui = new(user, src, "ServerControl", name) | ||
ui.open() | ||
|
||
/obj/machinery/computer/rdservercontrol/ui_data(mob/user) | ||
var/list/data = list() | ||
|
||
data["server_connected"] = !!stored_research | ||
|
||
if(stored_research) | ||
data["logs"] += stored_research.research_logs | ||
|
||
for(var/obj/machinery/rnd/server/server as anything in stored_research.techweb_servers) | ||
data["servers"] += list(list( | ||
"server_name" = server, | ||
"server_details" = server.get_status_text(), | ||
"server_disabled" = server.research_disabled, | ||
"server_ref" = REF(server), | ||
)) | ||
|
||
for(var/obj/machinery/computer/rdconsole/console as anything in stored_research.consoles_accessing) | ||
data["consoles"] += list(list( | ||
"console_name" = console, | ||
"console_location" = get_area(console), | ||
"console_locked" = console.locked, | ||
"console_ref" = REF(console), | ||
)) | ||
|
||
return data | ||
|
||
/obj/machinery/computer/rdservercontrol/ui_act(action, params) | ||
. = ..() | ||
if(.) | ||
return TRUE | ||
if(!allowed(usr) && !(obj_flags & EMAGGED)) | ||
balloon_alert(usr, "access denied!") | ||
playsound(src, 'sound/machines/click.ogg', 20, TRUE) | ||
return TRUE | ||
|
||
switch(action) | ||
if("lockdown_server") | ||
var/obj/machinery/rnd/server/server_selected = locate(params["selected_server"]) in stored_research.techweb_servers | ||
if(!server_selected) | ||
return FALSE | ||
server_selected.toggle_disable(usr) | ||
return TRUE | ||
if("lock_console") | ||
var/obj/machinery/computer/rdconsole/console_selected = locate(params["selected_console"]) in stored_research.consoles_accessing | ||
if(!console_selected) | ||
return FALSE | ||
console_selected.locked = !console_selected.locked | ||
return TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.