From c2fc8575321ca96f28d198a030eab90d473aa3a6 Mon Sep 17 00:00:00 2001 From: SapphicOverload <93578146+SapphicOverload@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:12:59 -0400 Subject: [PATCH] Makes the traffic control console less terrible to use (#22478) * AHAHAHAHAHAHAHAHAHAHAHAHAHA * VESTIGIAL CODE THAT MUST BE DESTROYED * E * FIXES STUFF * Update NtslEditor.js * USELESS VARIABLE THAT DOES NOTHING BUT THE LINTER WANTS IT * IS THIS WHAT IT WANTS * MADE THE SCROLLING NOT TERRIBLY CODED * YES * NOT USED * Update traffic_control.dm * SCROLL BAR --- interface/skin.dmf | 96 ---- tgui/packages/tgui/interfaces/NtslEditor.js | 204 ++++++++ yogstation.dme | 1 - .../telecomms/computers/traffic_control.dm | 446 ++++++------------ .../code/modules/scripting/client_verbs.dm | 241 ---------- 5 files changed, 356 insertions(+), 632 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/NtslEditor.js delete mode 100644 yogstation/code/modules/scripting/client_verbs.dm diff --git a/interface/skin.dmf b/interface/skin.dmf index 4c495931755c..5adb7643d5f3 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -359,99 +359,3 @@ window "statwindow" background-color = none is-visible = false saved-params = "" - -window "Telecomms IDE" - elem "Telecomms IDE" - type = MAIN - pos = 281,0 - size = 569x582 - anchor1 = none - anchor2 = none - text-color = #eeeeee - background-color = #222222 - is-visible = false - saved-params = "pos;size;is-minimized;is-maximized" - title = "TCS IDE" - statusbar = false - on-close = "exittcs" - elem "button5" - type = BUTTON - pos = 209,464 - size = 70x20 - anchor1 = 37,80 - anchor2 = 49,83 - text-color = #eeeeee - background-color = #555555 - saved-params = "is-checked" - text = "Clear Memory" - command = "tcsclearmem" - elem "button4" - type = BUTTON - pos = 157,464 - size = 52x20 - anchor1 = 28,80 - anchor2 = 37,83 - text-color = #eeeeee - background-color = #555555 - saved-params = "is-checked" - text = "Revert" - command = "tcsrevert" - elem "button3" - type = BUTTON - pos = 105,464 - size = 52x20 - anchor1 = 18,80 - anchor2 = 28,83 - text-color = #eeeeee - background-color = #555555 - saved-params = "is-checked" - text = "Execute" - command = "tcsrun" - elem "tcserror" - type = OUTPUT - pos = 0,488 - size = 566x94 - anchor1 = 0,84 - anchor2 = 99,100 - font-family = "sans-serif" - font-size = 9 - text-color = #eeeeee - background-color = #333334 - saved-params = "max-lines" - elem "button2" - type = BUTTON - pos = 53,464 - size = 52x20 - anchor1 = 9,80 - anchor2 = 18,83 - text-color = #eeeeee - background-color = #555555 - saved-params = "is-checked" - text = "Compile" - command = "tcscompile" - elem "button1" - type = BUTTON - pos = 0,464 - size = 53x20 - anchor1 = 0,80 - anchor2 = 9,83 - text-color = #eeeeee - background-color = #555555 - saved-params = "is-checked" - text = "Save" - command = "tcssave" - elem "tcscode" - type = INPUT - pos = 0,0 - size = 569x464 - anchor1 = 0,0 - anchor2 = 100,80 - font-family = "Courier" - font-size = 10 - text-color = #eeeeee - background-color = #333334 - saved-params = "" - command = "cancel" - multi-line = true - no-command = true - diff --git a/tgui/packages/tgui/interfaces/NtslEditor.js b/tgui/packages/tgui/interfaces/NtslEditor.js new file mode 100644 index 000000000000..c4847a61a418 --- /dev/null +++ b/tgui/packages/tgui/interfaces/NtslEditor.js @@ -0,0 +1,204 @@ +import { useBackend, useLocalState } from '../backend'; +import { Box, Button, Divider, Input, Tabs, TextArea, Section, Stack } from '../components'; +import { Window } from '../layouts'; + + +export const NtslEditor = (props, context) => { + // Make sure we don't start larger than 50%/80% of screen width/height. + const winWidth = Math.min(900, window.screen.availWidth * 0.5); + const winHeight = Math.min(600, window.screen.availHeight * 0.8); + + return ( + + + + + + + + + + + + + ); +}; + +const ScriptEditor = (props, context) => { + const { act, data } = useBackend(context); + const { stored_code, user_name } = data; + return ( + + {user_name ? +