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

Converts the NTSLScripting interface to .tsx, modifies the NTSL console to no longer save on pressing ENTER, adds in the signal technician wintercoat #3997

Merged
merged 2 commits into from
Oct 30, 2024
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
7 changes: 7 additions & 0 deletions monkestation/code/modules/NTSL/code/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ for example, adding in their job after their name

- monkestation\code\modules\jobs\job_types\signal_technician.dm
- monkestation\code\modules\clothing\under\jobs\engineering.dm
- monkestation\code\modules\clothing\suits\coats.dm
- monkestation\code\modules\clothing\spacesuits\plasmamen.dm

- monkestation\icons\obj\clothing\uniforms.dmi
- monkestation\icons\mob\clothing\uniform.dmi

- monkestation\icons\obj\clothing\suits.dmi
- monkestation\icons\mob\clothing\suit.dmi
- monkestation\icons\obj\clothing\hats.dmi
- monkestation\icons\mob\clothing\head.dmi

- monkestation\icons\obj\clothing\plasmaman.dmi
- monkestation\icons\mob\clothing\plasmaman.dmi
- monkestation\icons\obj\clothing\plasmaman_head.dmi
Expand Down
14 changes: 14 additions & 0 deletions monkestation/code/modules/clothing/suits/coats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@
worn_icon = 'monkestation/icons/mob/clothing/head.dmi'
icon_state = "winterhood_narsie"

/obj/item/clothing/suit/hooded/wintercoat/engineering/signal_tech
name = "engineering winter coat"
desc = "A surprisingly heavy yellow winter coat with reflective green stripes. It has a small antennae for its zipper tab, and the inside layer is covered with a radiation-resistant silver-nylon blend. Because heat insulation is clearly not a priority."
icon = 'monkestation/icons/obj/clothing/suits.dmi'
worn_icon = 'monkestation/icons/mob/clothing/suit.dmi'
icon_state = "coat_signal_tech"
hoodtype = /obj/item/clothing/head/hooded/winterhood/engineering/signal_tech

/obj/item/clothing/head/hooded/winterhood/engineering/signal_tech
desc = "A yellow winter coat hood. Definitely not enough to keep you warm near the telecommunications servers."
icon = 'monkestation/icons/obj/clothing/hats.dmi'
worn_icon = 'monkestation/icons/mob/clothing/head.dmi'
icon_state = "winterhood_signal_tech"

// End Of Winter Coat Varients

// Costumes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/obj/item/clothing/under/rank/engineering/signal_tech
name = "signal technician's jumpsuit"
desc = "It's an orange high visibility jumpsuit with green strips worn by signal technicians. Made from fire resistant materials."
desc = "It's an orange high visibility jumpsuit with green stripes worn by signal technicians. Made from fire resistant materials."
icon = 'monkestation/icons/obj/clothing/uniforms.dmi'
worn_icon = 'monkestation/icons/mob/clothing/uniform.dmi'
icon_state = "signal_tech"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
id_trim = /datum/id_trim/job/signal_technician

uniform = /obj/item/clothing/under/rank/engineering/signal_tech
suit = /obj/item/clothing/suit/hooded/wintercoat/engineering/signal_tech
belt = /obj/item/storage/belt/utility/full/engi
ears = /obj/item/radio/headset/headset_eng
gloves = /obj/item/clothing/gloves/color/black
Expand Down
Binary file modified monkestation/icons/mob/clothing/head.dmi
Binary file not shown.
Binary file modified monkestation/icons/mob/clothing/suit.dmi
Binary file not shown.
Binary file modified monkestation/icons/obj/clothing/hats.dmi
Binary file not shown.
Binary file modified monkestation/icons/obj/clothing/suits.dmi
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,86 @@ import {
Button,
Divider,
Input,
Tabs,
TextArea,
Section,
Stack,
Tabs,
TextArea,
} from '../components';
import { RADIO_CHANNELS } from '../constants';
import { Window } from '../layouts';

// NTSLTextArea component start
// This is literally just TextArea but without ENTER updating anything, for NTSL
import { KEY_ESCAPE, KEY_TAB } from 'common/keycodes';
import { toInputValue } from '../components/Input';

class NTSLTextArea extends TextArea {
constructor(props) {
super(props);
super(this.textareaRef);
super(this.state);
const { dontUseTabForIndent = false } = props;
this.handleKeyDown = (e) => {
const { editing } = this.state;
const { onInput, onKey } = this.props;
if (e.keyCode === KEY_ESCAPE) {
if (this.props.onEscape) {
this.props.onEscape(e);
}
this.setEditing(false);
if (this.props.selfClear) {
e.target.value = '';
} else {
e.target.value = toInputValue(this.props.value);
e.target.blur();
}
return;
}
if (!editing) {
this.setEditing(true);
}
// Custom key handler
if (onKey) {
onKey(e, e.target.value);
}
if (!dontUseTabForIndent) {
const keyCode = e.keyCode || e.which;
if (keyCode === KEY_TAB) {
e.preventDefault();
const { value, selectionStart, selectionEnd } = e.target;
e.target.value =
value.substring(0, selectionStart) +
'\t' +
value.substring(selectionEnd);
e.target.selectionEnd = selectionStart + 1;
if (onInput) {
onInput(e, e.target.value);
}
}
}
};
}
}

// NTSLTextArea component end

type Data = {
admin_view: Boolean;
emagged: Boolean;
stored_code: string;
user_name: string;
network: string;
compiler_output: string[];
access_log: string[];
server_data: Server_Data[];
};

type Server_Data = {
run_code: Boolean;
server: string;
server_name: string;
};

export const NTSLCoding = (props) => {
// Make sure we don't start larger than 50%/80% of screen width/height.
const winWidth = Math.min(900, window.screen.availWidth * 0.5);
Expand All @@ -34,12 +106,12 @@ export const NTSLCoding = (props) => {
};

const ScriptEditor = (props) => {
const { act, data } = useBackend();
const { act, data } = useBackend<Data>();
const { stored_code, user_name } = data;
return (
<Box width="100%" height="100%">
{user_name ? (
<TextArea
<NTSLTextArea
noborder
scrollbar
value={stored_code}
Expand All @@ -61,12 +133,12 @@ const ScriptEditor = (props) => {
};

const MainMenu = (props) => {
const { act, data } = useBackend();
const { act, data } = useBackend<Data>();
const { emagged, user_name, admin_view } = data;
const [tabIndex, setTabIndex] = useLocalState('tab-index', 1);
return (
<>
{admin_view === 1 ? (
{admin_view ? (
<Button
icon="power-off"
color="red"
Expand Down Expand Up @@ -126,7 +198,7 @@ const MainMenu = (props) => {
};

const CompilerOutput = (props) => {
const { act, data } = useBackend();
const { act, data } = useBackend<Data>();
const { compiler_output } = data;
return (
<>
Expand All @@ -151,7 +223,7 @@ const CompilerOutput = (props) => {
};

const ServerList = (props) => {
const { act, data } = useBackend();
const { act, data } = useBackend<Data>();
const { network, server_data } = data;
return (
<>
Expand Down Expand Up @@ -196,7 +268,7 @@ const ServerList = (props) => {
};

const LogViewer = (props) => {
const { act, data } = useBackend();
const { act, data } = useBackend<Data>();
const { access_log } = data;
// This is terrible but nothing else will work
return (
Expand Down
Loading