Files
Paradise/tgui/README.md
+12
BurzahGitHubAylongwarriorstar-orionArthri/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>Toastical/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>AylongArthri/tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>Charlie Nolan
18573ef254 Tgui v6 (#29342)
* [TGUI v6 Project] Remove `context` (#29086)

* [TGUI v6 Project] Remove `context`

* I forgot I had to do that.

* [TGUI v6 Project] Move to React (#29090)

* It compiles

* Last Inferno uses

* all works now

* Fixes

* [TGUI v6] Changes files extensions for interfaces from .js to .jsx, Deprecates Inferno State Hooks (#29094)

* Initial Commit

* Apply suggestions from code review

trust me bro

Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>
Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>

* [TGUI v6] Replaces babel with swc, fixes realtive paths on a few files, new build (#29100)

* Initial commit

* Build

* webpack config and errors and rebuild

* export routingError, hopefully

* fix pda app routing

* pass current tab index to tab headers and content in nanobank

---------

Co-authored-by: warriorstar-orion <orion@snowfrost.garden>

* fix dna modifier bluescreen and library computer tabs (#29108)

* TGUI parity with TG

Need to fix a bunch of things...

* Implement TGUI payload chunking backend

https://github.com/tgstation/tgstation/pull/90295

* Filx chan bottom scroll. Again

* Fix TGchat focus

* Fix rounding

* Fix inputs

* Upgrade deps

* More fixes

* Fix chat lineHeight

* Fix NanoMap

* Update `tgui-core`

* fix autolathe

* fix airlock electronics

* fix intercom

* fix compost bin height

* Fix chat preferences

* Move to TSX without types :clueless:

* test tiny meet your new brother test tgui

* Fix RCD

* fix stackcraft

* fix up beakercontents

* Fix MODsuits

* fix seed extractor

* Merge branch 'tgui-v6' of github.com:ParadiseSS13/Paradise into tgui-v6

* fix holodeck

* fix cookbook pda app

* fix remaining useState args

* Fix DNAModifier

* Fix Sleeper

* Fix SupermatterMonitor

* Remove `vitest`

* Update dev-server

* Fix `IconStack`

* Correct margin

* bundles, please don't break

* prettier

* Revert "Remove `vitest`"

This reverts commit 0609006abb.

* Re-add tests

* Prettier

* fix maplint for test_tgui

* TGchat shine effect

* TGUI Rebuildo

* Fix broken tabs, search boxes, sortable tables, and others (#29450)

* Replace KitchenSink theme state with a React context

* Remove last usage of useLocalState

* Rebind unbound useState calls

* Build and update /tg/ui

* Reformat /tg/ui

* [ci skip]

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>

* Ports #29217 to tgui v6. Added tgui-setup to CI builds (#29787)

* Add tgui-setup to build scripts

* Fix CORS issue

* Build and update /tg/ui

Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>

* Add one missing word to comment

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix law manager

* Removes dangling references to `context` (#29793)

* Removes dangling references to `context`

* Build and update /tg/ui (#25)

Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix messenger and atmos scanner

* swap out line break in examinate

* fix powermonitor

* Bump tgui-core from 3.1.5/3.1.4 to 4.3.4 (#29799)

* Bump tgui-core

* Build and update /tg/ui (#28)

Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fixes additional examine text

* oopsie

* Small tgui v6 fixes (#29801)

* Remove flow

* Miscellaneous fixes

* Miscellaneous fixes

* Moved properties placed on the wrong element

* Migrate removed CSS attributes in JSX

* Build and update /tg/ui (#27)

Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix carbon examine

* fix robot examine

* fix lint

* improve SMES appearance

* fix camera console name order

* more newline fixes

* fix boolean modal cancel not working

* fix random disabled access in RCD

* point tgui to correct passthrough verb names

* Fix missing 0 option for ERTs. (#29819)

* fix newlines in damage flavor

* Revert all changes related to newlines in DM

* fix the actual thing that was wrong with newlines

* fix ERT manager deny input

* [tgui-v6] Makes Agent Card UI more aesthethic, fixes input fields, fixes minimum age slider (#29832)

* agent card fixes and tweaks

* tgui bundle

* Reformat /tg/ui (#33) (#29838)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* restore camera console list appearance

* fixed pai ui paths (#29867)

* /tg/ui fixes no. 3 (#29868)

* Remove IconStack styles that conflict with styles added in tgstation/tgui-core#203

* Fix minesweeper icon

* DNA Modifier fixes

* Fix alignment of icons in PDA games menu

* Expand chem dispenser

* Fix pAI interfaces

* Build and update /tg/ui

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Toastical <20125180+Toastical@users.noreply.github.com>

* teleporter fix, bundle changes, test

* /tg/ui fixes no.4 (#29877)

* Fix translucent buttons

* Remove stories already present in tgui-core

* Make voting choices not transparent

* Build and update /tg/ui

* Fix size of set ringtone in PDA messenger

* Fix crew monitor highlight colors

* Fix ReagentsEditor search. Small style fixes

* tgui-say radio prefix has special color again

* Expand chameleon mask a little

* Fix search in chameleon mask

* Make list input modal slightly taller

* [ci skip]

* Build /tg/ui

---------

Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>

---------

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Aylong <69762909+AyIong@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: Aylong <alexanderkitsa@gmail.com>
Co-authored-by: Arthri <41360489+Arthri@users.noreply.github.com>
Co-authored-by: Arthri <41360489+a@users.noreply.github.com>
Co-authored-by: /tg/ui Builder <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Charlie Nolan <funnyman3595@gmail.com>
Co-authored-by: Toastical <20125180+Toastical@users.noreply.github.com>
2025-07-27 23:23:20 +00:00

186 lines
7.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tgui
## Introduction
tgui is a robust user interface framework of /tg/station.
tgui is very different from most UIs you will encounter in BYOND programming.
It is heavily reliant on Javascript and web technologies as opposed to DM.
If you are familiar with NanoUI (a library which can be found on almost
every other SS13 codebase), tgui should be fairly easy to pick up.
## Learn tgui
People come to tgui from different backgrounds and with different
learning styles. Whether you prefer a more theoretical or a practical
approach, we hope youll find this section helpful.
### Practical Tutorial
If you are completely new to frontend and prefer to **learn by doing**,
start with our [practical tutorial](docs/tutorial-and-examples.md).
### Guides
This project uses React. Take your time to read the guide:
- [React guide](https://react.dev/learn)
If you were already familiar with an older, Ractive-based tgui, and want
to translate concepts between old and new tgui, read this
[interface conversion guide](docs/converting-old-tgui-interfaces.md).
## Pre-requisites
You will need these programs to start developing in tgui:
- [Node v22.11+](https://nodejs.org/en/download/)
- **LTS** release is recommended instead of latest
- **DO NOT install Chocolatey if Node installer asks you to!**
- [Yarn v4.8.1+](https://yarnpkg.com/getting-started/install)
- Yarn is normally installed with corepack.
- [Git Bash](https://git-scm.com/downloads)
or [MSys2](https://www.msys2.org/) (optional)
## Usage
**For Git Bash, MSys2, WSL, Linux or macOS users:**
Change your directory to `tgui`.
Run `bin/tgui --install-git-hooks` to install merge drivers which will
assist you in conflict resolution when rebasing your branches. Only has
to be done once.
Run `bin/tgui` with any of the options listed below.
**For Windows CMD or PowerShell users:**
If you haven't opened the console already, you can do that by holding
Shift and right clicking on the `tgui` folder, then pressing
either `Open command window here` or `Open PowerShell window here`.
Run `.\bin\tgui.bat` with any of the options listed below.
> If using PowerShell, you will receive errors if trying to run
> `.\bin\tgui.ps1`, because default Windows policy does not allow direct
> execution of PS1 scripts. Run `.\bin\tgui.bat` instead.
**Available commands:**
- `bin/tgui` - Build the project in production mode.
- `bin/tgui --dev` - Launch a development server.
- tgui development server provides you with incremental compilation,
hot module replacement and logging facilities in all running instances
of tgui. In short, this means that you will instantly see changes in the
game as you code it. Very useful, highly recommended.
- In order to use it, you should start the game server first, connect to it
and wait until the world has been properly loaded and you are no longer
in the lobby. Start tgui dev server, and once it has finished building,
press F5 on any tgui window. You'll know that it's hooked correctly if
you see a green bug icon in titlebar and data gets dumped to the console.
- `bin/tgui --dev --reload` - Reload byond cache once.
- `bin/tgui --dev --debug` - Run server with debug logging enabled.
- `bin/tgui --dev --no-hot` - Disable hot module replacement (helps when
doing development on IE8).
- `bin/tgui --lint` - Show problems with the code.
- `bin/tgui --fix` - Auto-fix problems with the code.
- `bin/tgui --test` - Run tests.
- `bin/tgui --analyze` - Run a bundle analyzer.
- `bin/tgui --clean` - Clean up project repo.
- `bin/tgui --tgui-polyfill` - Build polyfills. You need to run it when updating any of the static (numbered) polyfills.
- `bin/tgui [webpack options]` - Build the project with custom webpack
options.
**For everyone else:**
You can double-click these batch files to achieve the same thing:
- `bin\tgui.bat` - Build the project in production mode.
- `bin\tgui-dev-server.bat` - Launch a development server.
> Remember to always run a full build before submitting a PR. It creates
> a compressed javascript bundle which is then referenced from DM code.
> We prefer to keep it version controlled, so that people could build the
> game just by using Dream Maker.
## Troubleshooting
**Development server doesn't find my BYOND cache!**
This happens if your Documents folder in Windows has a custom location, for
example in `E:\Libraries\Documents`. Development server tries its best to find
this non-standard location (searches for a Windows Registry key), but it can
fail. You have to run the dev server with an additional environmental
variable, with a full path to BYOND cache.
```
BYOND_CACHE="E:/Libraries/Documents/BYOND/cache"
```
**Webpack errors out with some cryptic messages!**
> Example: `No template for dependency: PureExpressionDependency`
Webpack stores its cache on disk since tgui 4.3, and it is very sensitive
to build configuration. So if you update webpack, or share the same cache
directory between development and production build, it will start
hallucinating.
To fix this kind of problem, run `bin/tgui --clean` and try again.
## Developer Tools
When developing with `tgui-dev-server`, you will have access to certain
development only features.
**Debug Logs.**
When running server via `bin/tgui --dev --debug`, server will print debug
logs and time spent on rendering. Use this information to optimize your
code, and try to keep re-renders below 16ms.
**Kitchen Sink.**
Press `F12` to open the KitchenSink interface. This interface is a
playground to test various tgui components.
**Layout Debugger.**
Press `F11` to toggle the *layout debugger*. It will show outlines of
all tgui elements, which makes it easy to understand how everything comes
together, and can reveal certain layout bugs which are not normally visible.
## Project Structure
- `/packages` - Each folder here represents a self-contained Node module.
- `/packages/common` - Helper functions that are used throughout all packages.
- `/packages/tgui/index.ts` - Application entry point.
- `/packages/tgui/interfaces` - Actual in-game interfaces.
- `/packages/tgui/layouts` - Root level UI components, that affect the final
look and feel of the browser window. These hold various window elements, like
the titlebar and resize handlers, and control the UI theme.
- `/packages/tgui/routes.ts` - This is where tgui decides which interface to
pull and render.
- `/packages/tgui/styles/main.scss` - CSS entry point.
- `/packages/tgui/styles/functions.scss` - Useful SASS functions.
- `/packages/tgui/styles/atomic` - Atomic CSS classes. These are very simple,
tiny, reusable CSS classes which you can use and combine to change appearance
of your elements. Keep them small.
- `/packages/tgui/styles/interfaces` - Custom stylesheets for your interfaces.
Add stylesheets here if you really need a fine control over your UI styles.
- `/packages/tgui/styles/layouts` - Layout-related styles.
- `/packages/tgui/styles/themes` - Contains themes that you can use in tgui.
Each theme must be registered in `/packages/tgui/index.ts` file.
## Component Reference
See: [Component Reference](docs/component-reference.md).
## License
Source code is covered by /tg/station's parent license - **AGPL-3.0**
(see the main [README](../README.md)), unless otherwise indicated.
Some files are annotated with a copyright header, which explicitly states
the copyright holder and license of the file. Most of the core tgui
source code is available under the **MIT** license.
The Authors retain all copyright to their respective work here submitted.