* Converts A && A.B into A?.B (#54342)
Implements the ?. operator, replacing code like A && A.B with A?.B
BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.
* Converts all A && A.B into A?.B
Co-authored-by: ZeWaka <zewakagamer@gmail.com>
* Enforce preserving parent proc return values across ui_act call stacks (#53964)
All ui_act procs should call parent by default. All procs should preserve the value of the parent proc when it's TRUTHY and pass it down the call stack. No UI should be interactible when its flags or state indicate it should not be, except when explicity overriden by child procs intentionally disregarding parent return values to achieve a specific goal.
* Enforce preserving parent proc return values across ui_act call stacks
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* Fix runtime with NTOS apps and improve code involved (#53779)
There exists a specific state where ui.open() can be called yet the
result would be a null window and such behaviour would be intentional.
The following CRASH in ui.send_asset() would thus be misleading,
because send_asset() was called after open().
This PR adds more information to the CRASH about when the failure state
can occur, makes open() return a value based on whether it actually
opened a new pooled window or not, and makes sure modular computer apps
don't send_assets unless a new pooled window was created.
* Fix runtime with ntos apps and improves code involved in the runtime
Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
* Fix runtime when NPC tries to interact with tgui (#53776)
Monki tries to open a door with a wire panel open, it tries to open a tgui for him, and uh oh, there is no client on user.
* Fix runtime when NPC tries to interact with tgui
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
* Process procs now properly utilize deltatime when implementing rates, timers and probabilities (#52981)
* Process procs now properly use deltatime when implementing rates, timers and probabilities
* Review fixes
* Geiger counters cleanup
Made hardsuit geiger code more similar to geiger counter code
Geiger counters are more responsive now
* Moved SS*_DT defines to subsystems.dm
* Rebase fix
* Redefined the SS*_DT defines to use the subsystem wait vars
* Implemented suggested changes by @AnturK
* Commented /datum/proc/process about the deltatime stuff
* Send delta_time as a process parameter instead of the defines
Also DTfied acid_processing
* Dtfied new acid component
* Process procs now properly utilize deltatime when implementing rates, timers and probabilities
Co-authored-by: Donkie <daniel.cf.hultgren@gmail.com>
* tgchat (#52426)
Replaces goonchat with a tgui based chat panel
Fixes#52898Fixes#52663
It is as fast as goonchat was (if not faster in certain circumstances), and is very extensible. It has all the necessary code for sorting messages into categories, which means that one of the next features will be multiple tab support.
Additional features that you will get with tgchat right now:
Massively faster server-side performance compared to goonchat, especially if batching multiple messages to one client.
Message persistence across rounds and reconnects. (All messages are stored client-side in IndexedDB)
More robust scroll tracking. If you scroll up, it will not change the scroll position on new messages like goonchat did.
Multiple message combining. (Currently set to combine up to 5 messages over last 5 seconds).
If using the highlighting feature, it highlights the whole message as well as the matching word.
"Now playing" widget, with preview of the song title, a knob for adjusting the volume and a stop button.
Architecture is as following:
```
to_chat() -+
|
SSchat
(queue, batching)
|
window.send_message()
|
v
+-------------+
| tgui-panel |
|+-----------+|
|| tgchat ||
|+-----------+|
+-------------+
```
Subsystem is basically goonchat, but without all the garbage that slows the servers down (string concatenation, double urlencoding, sanitizing, etc). Now, instead of all that, it's being slowed down by json_encode in /datum/tgui_window/proc/send_message, which IMO is completely worth it, and allows sending various templates and widgets to tgchat.
/datum/tgui_window abstracts the whole window away from you, establishes a nice message-passing interface between DM and JS, with two message queues on each side, automatically loads js/css assets for you, basically does everything. You as a developer only have to worry about sending/receiving messages and write javascript.
tgui-panel is a slimmed down version of tgui, and functions as a container for various widgets, and tgchat is one of them. It of course can be expanded with more stuff.
It's also a separate entry point and a JS bundle, so it's not bloating the main tgui bundle, and is currently sitting at about 230kB.
* tgchat
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
* [Ready] CDN browser assets! (#52681)
Rewrites the asset_cache system to handle sending assets to a CDN via a webroot.
see https://github.com/MrStonedOne/tgstation/blob/asset-cdn/code/modules/asset_cache/readme.md
Fixed a lot of bugs with assets, removed some dead code.
Changes:
Moved asset cache code to transport datums, the currently loaded one is located at SSassets.transport, asset cache calls made before the config is loaded use the simple browse_rsc transport.
Added subsystem call for when the config loads or reloads.
Added a webroot CDN asset transport. assets are saved to a file in a format based on the file's hash (currently md5).
Assets that don't use get_asset_url or get_url_mappings (such as browser assets referred to by static html files like changelog.html or static css files) can be saved to browse_rsc even when in cdn asset mode by setting legacy to TRUE on the datum returned by register_assets
Added a system for saving assets on a cdn in a hash based namespace (folder), assets within the same namespace will always be able to refer to each other by relative names. (used to allow cdn'ing font awesome without having to make something that regenerates it's css files.).
The simple/namespaced asset cache datum helper will handle generating a namespace composed of the combined md5 of everything in the same datum, as well as registering them properly.
Moved external resource from a snowflake loaded file to a config entry, added it to resources.txt
To ensure the system breaks in local testing in any situation that wouldn't work in cdn mode, the simple transport will mutate the filenames of non-legacy and non-namespaced assets and return this with get_asset_url.
Simple transport's passive send of all roundstart assets to all clients is now a config that defaults to off. this is to break race conditions during local testings from devs accidentally relying on this instead of using send() properly.
cl
refactor: Interface assets (js/css/images) can now be managed using an external webserver instead of byond's one at a time file transfer queue.
admin: Adds admin verb toggle-cdn that allows admins to disable the external webserver asset transport and revert to the old system. Useful if the webserver backing this goes down (thanks cloudflare).
config: New config file, resources.txt, (must be loaded by an $include statement from the main config)
server: The external_rsc_urls.txt config has been moved to the main config system.
/cl
Porting notes:
Interface webpages must refer to their assets (css/js/image/etc) by a generated url, or the asset must register itself as a legacy asset. The system is designed to break in localtest (on simple/legacy mode) in most situations that would break in cdn mode.
Requires latest tgui.
The webserver must set the proper CORS headers for font files or font awesome (and other fonts) won't load.
/tg/'s webserver config: https://gist.github.com/MrStonedOne/523388b2f161af832292d98a8aad0eae
* [Ready] CDN browser assets!
Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
* Adds an atmos debugging tool and excited group visualizer (#52395)
* Adds an atmos debugging tool and excited group visualizer
* rebuild moment
* yarn install -> yarn run build
* Sigh
* Fixed UI, did not test, needs a rebuild.
* Proper flexing
* Adds varied colors, improved ui courtusy of stylemistake:
* Fixes a runtime, updates tgui
* added superconductors, cleaned up some shitcode, removed a clashing color
* Woop
* Speed
* rebuild
* Adds a tick count
* begone auto-update
* color defines
* rebuild moment
* color improvements, fixes updating
* adds another preprocesser define to handle showing max shares in the ui
* test of application system?
* patches up some display issues, allows for smooth flowing from one group to another
* overlay-ified
* client testing
* dmi moment
* plane master
* it fucking works
* size change
* passthrough
* rebuild moment
* adresses review concerns, toggles active turf vis on when testing
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
* Adds an atmos debugging tool and excited group visualizer
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
update_static_data now passes user to push_data().
I'm pretty sure no UIs currently use user in ui_static_data for... Anything. So that's why no one noticed this before. Well, better to pass it than not.
* MIT license headers
* various tweaks
- Tweak jsdoc headers a bit
- Use an old-school format with SPDX-License-Identifier for SCSS
- Add headers to tgui dmcode
* Simplify the license section
* Rebuild tgui, small tweaks
Co-authored-by: ZeWaka <zewakagamer@gmail.com>
About The Pull Request
All relevant source code now contains copyright headers, that explicitly assert copyright and license for every file.
This has been done to prepare TGUI for wider adoption. Goon station devs are interested in using TGUI, and hopefully this will result in a nice collaboration and improvements to both codebases.
The following files were relicensed under MIT:
code/controllers/subsystem/tgui.dm
code/modules/tgui/*.dm
tgui/**/*.js
tgui/**/*.scss
The following files were kept untouched:
tgui/packages/tgui/interfaces/**/*.js
tgui/packages/tgui/styles/interfaces/**/*.scss
Project is still basically AGPL-3.0 under /tg/station's parent license (with added MIT texts), but allows importing MIT code into MIT-compatible codebases.
* ByondUi, Cam Console
* Remove todos
* Rebuild tgui
* Poltergeist fix
* Clean up imports in CameraConsole
* More cleanup
* Rebuild tgui
* Address reviews, optimize camera code
* CRASH instead of stack_trace
Co-Authored-By: Rohesie <rohesie@gmail.com>
* Micro manage that code to death
* Prefer to perform the operations first on Destroy()
Co-Authored-By: Rohesie <rohesie@gmail.com>
* Typecast in get_bbox_of_atoms, skip ismob() check
Co-authored-by: Rohesie <rohesie@gmail.com>
* Improve tgui fatal error reporting
* Keyboard passthrough in tgui
* New Rapid Pipe Dispenser interface
* Update README with new components
* Release held keys when browser window loses focus
* Power Monitor Interface, NtOS theme and core components
* Yet another CSS rework
* Fix Table, Chart stubs for IE8
* NtOS Main interface
* Supermatter Monitor interface
* Tweak NT color, color + sort gas bars
* Remove clockwork tgui theme
* Perform early tgui initialization
* Fix IE8 compatibility
- No frills mode was not working on IE8
- Conditional comments do not work in embedded webview
* Rethink console stubs, more proc inlining
* some microoptimizations
* Constraint window position
* Rebuild tgui
* tgui-next: Low level stuff
- More robust cache reloader, support WSL pathing
- Add a way to only reload the cache once without launching a full dev server
Throw a warning when using lowecase onclick on Button
Improve logging, add loader to inline svgs
- Logger can now handle circular references;
- Logger will not truncate long objects.
Typo, rebase, rebuild
Support --debug flag on dev server, improve logging
Lots of cosmetic and other changes
- Add support for Babel macros
- Implement a "multiline" macro for creating long multiline strings
- Rename interfaces to better match the component naming convention
- LabeledList.Divider size is 2 by default
- Sort routes by name
- Remove package-lock.json files on --clean
- Catch weird JSON parsing errors for better debuggability
Ignore sourcemaps
Clarify what that multiline function is
Try this travis fix
Bump NodeJS version to 12.x
Add a stub to make multiline usable as a template tag
- Just in case we will need to remove macros and have it still working.
Document debug flag in README
Fix LabeledList.Divider, reduce expensive SCSS calls
Separate dev and production builds so that they never overwrite each other
Run linter as a part of the production build
Rebuild tgui
Add react eslint plugin, massive jsx cleanup
* Mint janitor
* Optimization of tgui initialization path
- Call browse with titlebar and resize flags disabled
* Fix backend reducer
* Rebuild, fix linter errors
* static data backend
old tgui compatibility
no more state inlining
better comment
general > data
data > static_data
reference implementation
frontend implementation?
working version
functional manual updating
fix buy privately not triggering ui updates
manual update
rebuild conflict resolution
* Do not read inlined state, adjust object merging priority
* Initial tgui-next commit
* Improve dev server, slight changes to layout.
* Add more components, fix dragging, finalize scrubber list
* Complete an air alarm interface.
* Multiple improvements based on feedback
- LabeledList now has a "buttons" prop, where you can put buttons.
- Improved Box and Flex components
- Whole UI is now dimmable if non-interactive
- Basic documentation of components (Box and Flex so far).
- Icon and Box now accept a "color" prop.
- Routing improved in "Layout" component, you can now specify whether an interface is scrollable.
* Less harsh dimming
* Redux, Toasts
- Fixed inconsistent backend updates with Redux.
- Added Toasts which are currently unused, but are functional.
* acclimator + ai airlock ui
* Add a progress bar component, implement resizing
* Fix a zero in title bar
* Add a linter to keep shit tidy, fix danger level mapping, add some more docs
* better ai door interact ui
* final ai airlock interface
* Fix issues with code, enforce hard 120 line length cap, automerge binaries
* Implement hot module reloading
* Fix progress bar, add color support
* Fix ProgressBar baseline alignment issues
* Remove unwanted padding on the bottom of the LabeledList.
* Component improvements
- Fix baseline issues with Button and ProgressBar components
- Box how inherits props from Box
- Atomic colors and Button colors are now auto-generated, all range of colors supported
* Chem Dispenser UI, animated numbers, more style fixes
* Add an IE8 polyfill
* Intermediate state of fixing IE8
* Lots of shimming and general misery
* Fully working old TGUI chainloader for IE8, more pipeline improvements
* Support title-less Sections
* Delete Yarn, use Lerna for workspace management
* Improve maths and animated numbers
* Fix loss of focus for scrollable content, activate buttons with keyboard
* Attempt to bust the cache, grab focus on keyboard presses too
* Fix hot module replacement by manually pulling replaced modules.
* backend logging
un-nuke line endings
changes without insane line endings
* helper procs + href support
* slight optimization
* compiles
* Redux, Hotkeys, Kitchen Sink (for UI testing), Tabs component
* Push logs to backend, small kitchen sink changes, tab fixes
* Update component reference in README
* Small fixes
* Next bunch of IE8 fixes, PureComponent optimization for Inferno
* Delete old tgui html
* Log the event of loading the old tgui
* Enable tgui logging on server by default
* Final solution
* Extract routes into a separate file, fix ChemDispenser bug
- Chem dispenser was needlessly disabling transfer amount buttons
* Disable baseline alignment for vertical tabs
* Fix tabs and box units
- Tab content was not taking full page width
- Box can now accepts strings as units, which will be treated as raw style values.
* Fix tgui on Terry
* Fix sending all logs with an "error" flag
* Some macro UI component changes and improvements
- Refer to README.md diff to see what's new
* Tooltip component
* Add support for themes, nanotrasen logo is back
* Clockwork theme hotfix
* Slight adjustment to logo positioning
* Actually proper solution for logo positioning
* Fix color maps
* tgui-next thermomachine interface
* tgui-next canister interface
* Add icon_class_name proc to asset cache
* Lots of stuff backported from actioninja's repo
* Cleanup oopsies
* Cargo UI adjustments
* Nuke lodash
* Minor fixes and cleanup
- Remove local Inferno package in favor of upstream Inferno
- Fix "initial" prop on AnimatedNumber
- Force fancy=0 for IE8
- Click-through dimmer
* Add a bat file for dummies
* podlauncher interface fix
* Update README, assert code dominance
* Clarify usage of event handlers in Inferno
* Document LabeledList.Divider
* Fukken grammar
* fixes cellular emporium readapt button not working
* fixes incorrect action on button in atmos control interface
* remove unneeded data from airlock electronics ui
* Set +x mode on bin/tgui
* Fix filename cases
- They were untracked by git on windows
* Ignore package lock, make batch more robust
- package-lock.json is very random and unreliable as fuck. Yarn was better.
* Build tgui-next in travis
* bruh
- fixes tgui error reporting
* logging cleanup + always log
* removes duplicated tgui asset definition.
* Puts fa in separate asset
* Makes it work.
* Not needed anymore
* Removes brands css and font
* we're not using logos anywhere right
* duh
* Fixes the chat settings width while i'm at it.
* TGUI build
Pills are now two spreadsheets instead of individual icons.
This reduces assets sent by about 19-20.
Furthermore tgui has been extended with a new proc ui_base_html which
allows a user to customise the html sent as the base for a tgui window.
This allows someone to provide custom spritesheet css as links in a
specific tgui window without having to add it to the global html.
Aiming to implement the framework oranges has detailed in https://tgstation13.org/phpBB/viewtopic.php?f=10&t=19102
Moves canmove to a bitflag in a new variable called mobility_flags, that will allow finer grain control of what someone can do codewise, for example, letting them move but not stand up, or stand up but not move.
Adds Immobilize()d status effect that freezes movement but does not prevent anything else.
Adds Paralyze()d which is oldstun "You can't do anything at all and knock down).
Stun() will now prevent any item/UI usage and movement (which is similar to before).
Knockdown() will now only knockdown without preventing item usage/movement.
People knocked down will be able to crawl at softcrit-speeds
Refactors some /mob variables and procs to /mob/living.
update_canmove() refactored to update_mobility() and will handle mobility_flags instead of the removed canmove
cl
rscadd: Crawling is now possible if you are down but not stunned. Obviously, you will be slower.
/cl
Refactors are done. I'd rather get this merged faster than try to fine tune stuff like slips. The most obvious gameplay effect this pr has will be crawling, and I believe I made tiny tweaks but I can't find it Anything I missed or weird behavior should be reported.
MrDoomBringer
admin: Admins can now spawn things in ICly (as well as do a bunch of other cool new stuff) using the Config/Launch Supplypod verb!
code: also supplypods have been refactored
Quick changes list:
html_interface gone
unused card interface gone
minimap gone from crew console(subsystem not disabled in case something else wants to use it)
ui_host() now takes user parameter
Some assets moved around.
Fixes#22124
* Consolidates datum var location
* Move ui_screen to /datum/tgui
* Move focusers to datum.dm. Move fingerprintslast to /atom
* Remove focusers list, makes mobs check if their focus is QDELETED in Life()
* Consolidate use_tag and var_edited into datum_flags
* Revert garbage comment
* Thought I already removed this
* Remove the var_edited preservation
* Removes focus QDELETED handling