From 7ad09602b5e800de02c92eae9f479e880d7a3fa4 Mon Sep 17 00:00:00 2001 From: nevimer Date: Sat, 22 Feb 2025 20:01:09 -0500 Subject: [PATCH] fixes and allows tgui to work --- code/modules/client/preferences/README.md | 2 +- tgui/docs/writing-tests.md | 2 +- .../tgui/interfaces/AmmoWorkbench.jsx | 2 +- .../tgui/interfaces/AntagInfoAssaultops.tsx | 8 +- .../tgui/interfaces/AntagInfoBloodsucker.tsx | 4 +- .../tgui/interfaces/AntagInfoClock.tsx | 3 +- .../tgui/interfaces/AntagInfoGhoul.tsx | 3 +- .../tgui/interfaces/AntagInfoOpfor.tsx | 3 +- .../tgui/interfaces/AntagInfoRules.tsx | 3 +- .../tgui/interfaces/ArmamentStation.jsx | 5 +- .../interfaces/BluespaceArtillerySkyrat.tsx | 10 +- tgui/packages/tgui/interfaces/BorerChem.jsx | 10 +- .../tgui/interfaces/BorerEvolution.tsx | 3 +- .../tgui/interfaces/CargoImportConsole.jsx | 9 +- .../tgui/interfaces/CharacterPreview.tsx | 2 +- tgui/packages/tgui/interfaces/ChemPress.jsx | 5 +- .../tgui/interfaces/ClockworkResearch.tsx | 12 +- .../tgui/interfaces/ClockworkSlab.jsx | 15 +- .../tgui/interfaces/ColorPickerModal.tsx | 16 +-- .../tgui/interfaces/CommandReportConsole.jsx | 5 +- .../tgui/interfaces/CrewConsoleBubbers.tsx | 6 +- .../tgui/interfaces/CrewConsoleSkyrat.jsx | 2 +- .../CrewConsoleSkyratBlueshield.jsx | 2 +- .../tgui/interfaces/CryopodConsole.jsx | 9 +- .../tgui/interfaces/DelamProcedure.tsx | 3 +- tgui/packages/tgui/interfaces/EventPanel.jsx | 10 +- .../packages/tgui/interfaces/ExaminePanel.jsx | 2 +- .../tgui/interfaces/FishingBubbers.tsx | 14 +- .../tgui/interfaces/FoodPreferences.tsx | 2 +- .../packages/tgui/interfaces/GlassBlowing.tsx | 10 +- .../tgui/interfaces/InteractionMenu.tsx | 5 +- tgui/packages/tgui/interfaces/KindredBook.tsx | 3 +- .../tgui/interfaces/MaturityPrompt.tsx | 6 +- .../tgui/interfaces/MicrofusionGunControl.jsx | 8 +- .../tgui/interfaces/MilkingMachine.jsx | 3 +- tgui/packages/tgui/interfaces/Minesweeper.jsx | 3 +- tgui/packages/tgui/interfaces/NifPanel.jsx | 23 ++- tgui/packages/tgui/interfaces/NifSoulPoem.jsx | 5 +- .../tgui/interfaces/NtosNifsoftCatalog.jsx | 5 +- .../tgui/interfaces/OpposingForcePanel.jsx | 8 +- .../bubber/character_voice.tsx | 3 +- tgui/packages/tgui/interfaces/RBMK2.tsx | 8 +- .../tgui/interfaces/RecordManifest.jsx | 4 +- .../tgui/interfaces/ServerControlPanel.jsx | 3 +- tgui/packages/tgui/interfaces/Signalvib.jsx | 9 +- .../tgui/interfaces/SiliconJobManager.jsx | 3 +- tgui/packages/tgui/interfaces/Soulcatcher.jsx | 5 +- .../tgui/interfaces/SoulcatcherUser.jsx | 5 +- .../packages/tgui/interfaces/StoryManager.tsx | 5 +- .../tgui/interfaces/SyndContractor.jsx | 25 ++-- tgui/packages/tgui/interfaces/TimeClock.jsx | 3 +- .../VorePanel/AppearanceDisplay.tsx | 2 +- .../tgui/interfaces/VorePanel/BellyUI.tsx | 4 +- .../interfaces/ZubbersCharacterDirectory.jsx | 6 +- .../tgui/interfaces/common/Interactive.tsx | 136 ++++++++++++++++++ .../tgui/interfaces/common/Pointer.tsx | 2 +- .../tgui/styles/themes/clockwork.scss | 12 +- 57 files changed, 339 insertions(+), 147 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/common/Interactive.tsx diff --git a/code/modules/client/preferences/README.md b/code/modules/client/preferences/README.md index 674f234d48e..a653039f1b8 100644 --- a/code/modules/client/preferences/README.md +++ b/code/modules/client/preferences/README.md @@ -419,7 +419,7 @@ In the `.ts` file you created earlier, you must now give the information of your ```ts import { Antagonist, Category } from "../base"; -import { multiline } from "common/string"; +import { multiline } from "tgui-core/string"; const Changeling: Antagonist = { key: "changeling", // This must be the same as your filename diff --git a/tgui/docs/writing-tests.md b/tgui/docs/writing-tests.md index 633e73bcd1a..dc6299d53d9 100644 --- a/tgui/docs/writing-tests.md +++ b/tgui/docs/writing-tests.md @@ -12,7 +12,7 @@ test('something', () => { Refer to [README](../README.md) to learn how to run tests. -There is an example test in `packages/common/react.spec.ts`. +There is an example test in `packages/tgui-core/react.spec.ts`. You can read more about Jest here: https://jestjs.io/docs/en/getting-started diff --git a/tgui/packages/tgui/interfaces/AmmoWorkbench.jsx b/tgui/packages/tgui/interfaces/AmmoWorkbench.jsx index b815cc212da..3f21e12880a 100644 --- a/tgui/packages/tgui/interfaces/AmmoWorkbench.jsx +++ b/tgui/packages/tgui/interfaces/AmmoWorkbench.jsx @@ -1,5 +1,5 @@ // THIS IS A SKYRAT UI FILE -import { toTitleCase } from 'common/string'; +import { toTitleCase } from 'tgui-core/string'; import { useState } from 'react'; import { useBackend, useSharedState } from '../backend'; diff --git a/tgui/packages/tgui/interfaces/AntagInfoAssaultops.tsx b/tgui/packages/tgui/interfaces/AntagInfoAssaultops.tsx index 9cd4a1f5edc..cebc1c05064 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoAssaultops.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoAssaultops.tsx @@ -1,8 +1,5 @@ // THIS IS A SKYRAT UI FILE -import { BooleanLike } from 'common/react'; import { useState } from 'react'; - -import { useBackend } from '../backend'; import { Box, Button, @@ -12,7 +9,10 @@ import { Section, Stack, Tabs, -} from '../components'; +} from 'tgui-core/components'; +import { BooleanLike } from 'tgui-core/react'; + +import { useBackend } from '../backend'; import { Window } from '../layouts'; import { Rules } from './AntagInfoRules'; diff --git a/tgui/packages/tgui/interfaces/AntagInfoBloodsucker.tsx b/tgui/packages/tgui/interfaces/AntagInfoBloodsucker.tsx index 13985de99ba..cd02e1322a5 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoBloodsucker.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoBloodsucker.tsx @@ -1,9 +1,9 @@ -import { BooleanLike } from 'common/react'; import { useState } from 'react'; +import { Box, Button, Image, Section, Stack, Tabs } from 'tgui-core/components'; +import { BooleanLike } from 'tgui-core/react'; import { resolveAsset } from '../assets'; import { useBackend } from '../backend'; -import { Box, Button, Image, Section, Stack, Tabs } from 'tgui-core/components'; import { Window } from '../layouts'; import { Objective } from './common/Objectives'; import { PowerDetails } from './PowerInfo'; diff --git a/tgui/packages/tgui/interfaces/AntagInfoClock.tsx b/tgui/packages/tgui/interfaces/AntagInfoClock.tsx index 78911f8462c..757cb999fab 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoClock.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoClock.tsx @@ -1,6 +1,7 @@ // THIS IS A SKYRAT UI FILE +import { Icon, Section, Stack } from 'tgui-core/components'; + import { useBackend } from '../backend'; -import { Icon, Section, Stack } from '../components'; import { Window } from '../layouts'; import { Rules } from './AntagInfoRules'; diff --git a/tgui/packages/tgui/interfaces/AntagInfoGhoul.tsx b/tgui/packages/tgui/interfaces/AntagInfoGhoul.tsx index b403dc98fca..b653d9ef101 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoGhoul.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoGhoul.tsx @@ -1,5 +1,6 @@ +import { Section, Stack } from 'tgui-core/components'; + import { useBackend } from '../backend'; -import { Section, Stack } from '../components'; import { Window } from '../layouts'; import { GhoulProps } from './AntagInfoBloodsucker'; import { ObjectivePrintout } from './common/Objectives'; diff --git a/tgui/packages/tgui/interfaces/AntagInfoOpfor.tsx b/tgui/packages/tgui/interfaces/AntagInfoOpfor.tsx index cd344af8619..9343fb6a9fe 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoOpfor.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoOpfor.tsx @@ -1,6 +1,7 @@ // THIS IS A SKYRAT UI FILE +import { Button, Section, Stack } from 'tgui-core/components'; + import { useBackend } from '../backend'; -import { Button, Section, Stack } from '../components'; import { Window } from '../layouts'; export const AntagInfoOpfor = (props) => { diff --git a/tgui/packages/tgui/interfaces/AntagInfoRules.tsx b/tgui/packages/tgui/interfaces/AntagInfoRules.tsx index b1a3a919add..ca7ba2d0509 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoRules.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoRules.tsx @@ -1,6 +1,7 @@ // THIS IS A SKYRAT UI FILE +import { Stack } from 'tgui-core/components'; + import { useBackend } from '../backend'; -import { Stack } from '../components'; import { Objective } from './common/Objectives'; type Info = { diff --git a/tgui/packages/tgui/interfaces/ArmamentStation.jsx b/tgui/packages/tgui/interfaces/ArmamentStation.jsx index c223cd4eb5c..9d066779543 100644 --- a/tgui/packages/tgui/interfaces/ArmamentStation.jsx +++ b/tgui/packages/tgui/interfaces/ArmamentStation.jsx @@ -1,5 +1,4 @@ // THIS IS A SKYRAT UI FILE -import { useBackend, useLocalState } from '../backend'; import { Box, Button, @@ -8,7 +7,9 @@ import { NoticeBox, Section, Stack, -} from '../components'; +} from 'tgui-core/components'; + +import { useBackend, useLocalState } from '../backend'; import { Window } from '../layouts'; export const ArmamentStation = (props) => { diff --git a/tgui/packages/tgui/interfaces/BluespaceArtillerySkyrat.tsx b/tgui/packages/tgui/interfaces/BluespaceArtillerySkyrat.tsx index fd29ca62d21..7d9e24d3fa1 100644 --- a/tgui/packages/tgui/interfaces/BluespaceArtillerySkyrat.tsx +++ b/tgui/packages/tgui/interfaces/BluespaceArtillerySkyrat.tsx @@ -1,7 +1,4 @@ // THIS IS A SKYRAT UI FILE -import { BooleanLike } from 'common/react'; - -import { useBackend } from '../backend'; import { Box, Button, @@ -9,8 +6,11 @@ import { NoticeBox, Section, Slider, -} from '../components'; -import { formatPower } from '../format'; +} from 'tgui-core/components'; +import { formatPower } from 'tgui-core/format'; +import { BooleanLike } from 'tgui-core/react'; + +import { useBackend } from '../backend'; import { Window } from '../layouts'; type Data = { diff --git a/tgui/packages/tgui/interfaces/BorerChem.jsx b/tgui/packages/tgui/interfaces/BorerChem.jsx index 42b7841abe1..2b268e32775 100644 --- a/tgui/packages/tgui/interfaces/BorerChem.jsx +++ b/tgui/packages/tgui/interfaces/BorerChem.jsx @@ -1,8 +1,14 @@ // THIS IS A SKYRAT UI FILE -import { toFixed } from 'common/math'; +import { + Box, + Button, + LabeledList, + ProgressBar, + Section, +} from 'tgui-core/components'; +import { toFixed } from 'tgui-core/math'; import { useBackend } from '../backend'; -import { Box, Button, LabeledList, ProgressBar, Section } from '../components'; import { Window } from '../layouts'; export const BorerChem = (props) => { diff --git a/tgui/packages/tgui/interfaces/BorerEvolution.tsx b/tgui/packages/tgui/interfaces/BorerEvolution.tsx index a906cb24ee8..15696772a66 100644 --- a/tgui/packages/tgui/interfaces/BorerEvolution.tsx +++ b/tgui/packages/tgui/interfaces/BorerEvolution.tsx @@ -1,6 +1,7 @@ // THIS IS A SKYRAT UI FILE +import { BlockQuote, Button, Section, Stack } from 'tgui-core/components'; + import { useBackend } from '../backend'; -import { BlockQuote, Button, Section, Stack } from '../components'; import { Window } from '../layouts'; const borerColor = { diff --git a/tgui/packages/tgui/interfaces/CargoImportConsole.jsx b/tgui/packages/tgui/interfaces/CargoImportConsole.jsx index 2854aee9828..6f6a3eb557c 100644 --- a/tgui/packages/tgui/interfaces/CargoImportConsole.jsx +++ b/tgui/packages/tgui/interfaces/CargoImportConsole.jsx @@ -1,8 +1,15 @@ // THIS IS A SKYRAT UI FILE import { useState } from 'react'; +import { + Box, + Button, + Divider, + Image, + Section, + Stack, +} from 'tgui-core/components'; import { useBackend } from '../backend'; -import { Box, Button, Divider, Image, Section, Stack } from '../components'; import { Window } from '../layouts'; export const CargoImportConsole = (props) => { diff --git a/tgui/packages/tgui/interfaces/CharacterPreview.tsx b/tgui/packages/tgui/interfaces/CharacterPreview.tsx index c6935409fb4..bd3fe7c4853 100644 --- a/tgui/packages/tgui/interfaces/CharacterPreview.tsx +++ b/tgui/packages/tgui/interfaces/CharacterPreview.tsx @@ -1,4 +1,4 @@ -import { ByondUi } from '../components'; +import { ByondUi } from 'tgui-core/components'; export const CharacterPreview = (props: { height: string; id: string }) => { return ( diff --git a/tgui/packages/tgui/interfaces/ChemPress.jsx b/tgui/packages/tgui/interfaces/ChemPress.jsx index b91406db3ec..217646a0ffc 100644 --- a/tgui/packages/tgui/interfaces/ChemPress.jsx +++ b/tgui/packages/tgui/interfaces/ChemPress.jsx @@ -1,5 +1,4 @@ // THIS IS A SKYRAT UI FILE -import { useBackend } from '../backend'; import { Box, Button, @@ -7,7 +6,9 @@ import { LabeledList, NumberInput, Section, -} from '../components'; +} from 'tgui-core/components'; + +import { useBackend } from '../backend'; import { Window } from '../layouts'; export const ChemPress = (props) => { diff --git a/tgui/packages/tgui/interfaces/ClockworkResearch.tsx b/tgui/packages/tgui/interfaces/ClockworkResearch.tsx index 215e0343077..a831fb28f2b 100644 --- a/tgui/packages/tgui/interfaces/ClockworkResearch.tsx +++ b/tgui/packages/tgui/interfaces/ClockworkResearch.tsx @@ -1,7 +1,15 @@ // THIS IS A SKYRAT UI FILE -import { BooleanLike, classes } from '../../common/react'; +import { + Box, + Button, + Divider, + Flex, + Section, + Stack, +} from 'tgui-core/components'; +import { BooleanLike, classes } from 'tgui-core/react'; + import { useBackend } from '../backend'; -import { Box, Button, Divider, Flex, Section, Stack } from '../components'; import { Window } from '../layouts'; type Data = { diff --git a/tgui/packages/tgui/interfaces/ClockworkSlab.jsx b/tgui/packages/tgui/interfaces/ClockworkSlab.jsx index 7acb39b8713..7cb3244e7ca 100644 --- a/tgui/packages/tgui/interfaces/ClockworkSlab.jsx +++ b/tgui/packages/tgui/interfaces/ClockworkSlab.jsx @@ -1,7 +1,5 @@ // THIS IS A SKYRAT UI FILE import { Fragment } from 'react'; - -import { useBackend, useLocalState } from '../backend'; import { Box, Button, @@ -12,8 +10,9 @@ import { Section, Stack, Table, -} from '../components'; -import { TableRow } from '../components/Table'; +} from 'tgui-core/components'; + +import { useBackend, useLocalState } from '../backend'; import { Window } from '../layouts'; const brassColor = '#DFC69C'; @@ -221,7 +220,7 @@ const ClockworkSpellList = (props) => { {scriptures.map((script) => script.type === selectedTab ? ( - + {script.name}