-
Notifications
You must be signed in to change notification settings - Fork 23
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
Port to TypeScript + 0.10.0 Gamemode Changes #146
Port to TypeScript + 0.10.0 Gamemode Changes #146
Conversation
Will resolve conflicts with Peen's stuff once #145 is in (and I've finally slept) |
b7705e0
to
cdb9f89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own work since this is such a chore for everyone else to do, plus afaik I'm the only Pano person who works with TypeScript frequently.
Others reviewing is by-all-means appreciated, probably just need one other though this is such a slog to review.
I've tested pretty well ingame so far, going to do a second pass of ingame testing today as well.
import { PanelHandler } from 'util/module-helpers'; | ||
import { tupleToRgbaString } from 'util/colors'; | ||
import { SpeedometerColorType, SpeedometerType } from 'common/speedometer'; | ||
import { TimerState_OLD } from 'common/timer'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move to new timer today
cdb9f89
to
7cbf1e9
Compare
Still need to get all the new timer stuff hooked up. Panzer's timer changes don't work on this branch (aren't in TypeScript with new data structures), currently my stuff is just overwriting his recent commit. I'll join them together properly soon, want to remove the old APIs in the process. Will also merge with Peen's new zoning stuff, just don't have energy tonight. |
Not doing for ages, don't any reason to keep the stubbed stuff around.
Not pinning dev dependencies. It's not a big deal, and we're not in prod.
Top-level await yaaaay
"class-methods-use-this" is just annoying, not much benefit to static methods in JS, and doesn't work well with our PanelHandler system
Idk, eslint updated and their config changed. Fun!
This causing people headaches, and not super beneficial.
Kiiiiind of works with debugger! And assume we'll want this once SCell's thing is in.
3e71311
to
c0408b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split out the map selector stuff but the rest is good 👍
c0408b7
to
b7e169b
Compare
Release tonight will be pretty janky anyway so no need to rush this in, we can just cut release off this branch without merging. |
60b1477
to
8615f32
Compare
scripts/hud/synchronizer.ts
Outdated
] | ||
}); | ||
|
||
$.RegisterForUnhandledEvent('OnSynchroModeChanged', (cvarValue) => this.setDisplayMode(cvarValue)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question about registering events for game mode with the panel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah same response, if config is always loaded on map init we can pull all events into the famcy thing, will do that.
There absolutely no code changes here, just moves, to keep files linked in Git and so review is easier.
Don't like having a dedicated script for something simple as this, better in <script> tag.
I know this feels a bit framework-y but with modules it's really needed, otherwise exposing stuff to XML takes a lot of boilerplate.
Generators waow!!
Chungus commit but not that much to break up. Tried to not refactor too much but I tweaked some things as I went. Couple of general comments: - Suffixing every class with "Handler" is very verbose but omitting it will be a namespace collision for JS-defined panels like LevelIndicator, so figured I'd keep consistent and suffix everything. - static is no longer required everywhere because of @PanelHandler instantiating classes it's applied to. Maybe a bit too magical, but I like not having static on absolutely everything. - We should avoid .bind(this) with event handlers, it's easy to introduce type errors when using it, since it provides no type-safety between the event handler function signature and the function it's applied to. Arrow functions do the same thing, and make the arguments explicit.
This stuff is all interconnected so figured I'd split them out from main ts port commit Refactored a bit of gamemode handling logic as well, needed a C++ fix to get config loading working with new modes, that's in review on red.
Show/HideContentPanel weren't doing anything. ReloadBackground is ambigious. Guhh!!!
Not doing much styling in this PR, just couldn't resist improving these slightly.
This thing just confuses people, had multiple people ask why it doesn't work. Doesn't look very good in its current state, may as well just hide for now.
Toop was having issues with default line endings in vscode, this should set right defaults
2f49092
to
010d70c
Compare
Okay I've addressed everything, good to merge once @PeenScreeker approves |
} | ||
|
||
export function sumOfSquares(vec: vec2 | vec3): number { | ||
return 'z' in vec ? vec.x ** 2 + vec.y ** 2 + vec.z ** 2 : vec.x ** 2 + vec.y ** 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I wasn't super clear about this:
return 'z' in vec ? sumOfSquares3D(vec) : sumOfSquares2D(vec);
Working on Pano seriously for the first time in ages doing gamemode changes and was very unhappy with the quality of the TypeScript integration, mainly the namespacing issues caused by not being able to use imports. I eventually snapped and adding module loading support in C++, then found I was now liking the TypeScript integration so much I ended up porting everything across.
There were enough bugs, random unused events/APIs and other issues I encountered along the way that it was definitely justified. Would've preferred doing after 0.10.0 but hey, it meant we can get the shared types/enums from the website repo hooked up whilst doing all the updated timer, comparisons etc.
Momentum-specific types have been split out to this repo as discussed. I've almost upgraded all our deps, had to mess around with eslint in the process.
The one thing I haven't quite finished yet is the map selector. New modes are hooked up but I want to get zone downloading working by Saturday, maybe even do the submission maps tab if I have time. Everything else is good for review, if people reach the wip map selector stuff fast then I'll split that work out into a separate PR, but I expect it'll take at least a week for this work + all my other stuff to get reviewed.
Needs StrataSource/pano-typed#22 on the shared types repo, then on red, my module loading PR and gamemode enum PR.
Checks
feat: Add foo
,chore: Update bar
, etc...fixup
ed into my original commits.