-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Reverts reversion: tgui will 516 or else (#2775)
* Reverts reversion: tgui will 516 or else (#82527) ## About The Pull Request Context: #82522 Apparently you cant just stuff the byond helper functions into an external js file, but if you do, byond won't even let you know its a problem until the servers crash and you have to run `bin/clean` just to unbork your entire repo This reimplements the changes from #82473 without: - moving the byond helper functions externally - causing a tooltip render issue in panel ## Why It's Good For The Game 516 prep (again this time) * Reverts reversion: tgui will 516 or else --------- Co-authored-by: NovaBot <[email protected]> Co-authored-by: Jeremiah <[email protected]> Co-authored-by: Iajret <[email protected]>
- Loading branch information
1 parent
7f93b6e
commit 68bf272
Showing
10 changed files
with
57 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import './styles/main.scss'; | ||
|
||
import { createRenderer } from 'tgui/renderer'; | ||
import { createRoot, Root } from 'react-dom/client'; | ||
|
||
import { TguiSay } from './TguiSay'; | ||
|
||
const renderApp = createRenderer(() => { | ||
return <TguiSay />; | ||
}); | ||
let reactRoot: Root | null = null; | ||
|
||
const setupApp = () => { | ||
// Delay setup | ||
if (document.readyState === 'loading') { | ||
document.addEventListener('DOMContentLoaded', setupApp); | ||
return; | ||
document.onreadystatechange = function () { | ||
if (document.readyState !== 'complete') return; | ||
|
||
if (!reactRoot) { | ||
const root = document.getElementById('react-root'); | ||
reactRoot = createRoot(root!); | ||
} | ||
|
||
renderApp(); | ||
reactRoot.render(<TguiSay />); | ||
}; | ||
|
||
setupApp(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters