Skip to content
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

Autoformatting #21

Closed
wants to merge 3 commits into from
Closed

Autoformatting #21

wants to merge 3 commits into from

Conversation

tsa96
Copy link
Member

@tsa96 tsa96 commented Aug 18, 2024

Did this a few weeks ago and forgot to PR. Adds Prettier autoformatting, as an npm script and a CI job.

Don't love making this an npm package, but devs won't necessarily need to run npm install for any of this if they have a Prettier extension for their editor and use it. But it's there if desired, and is needed for CI job anyway.

Comment on lines 6 to +90
PanoramaCastVoteNo: () => void;
PanoramaCastVoteYes: () => void;
RemoveStyle: (cls: string) => void;
RemoveStyleFromEachChild: (cls: string) => void;
ResetCarouselMouseWheelCounts: () => void;
ScrollPanelDown: () => void;
ScrollPanelLeft: () => void;
ScrollPanelRight: () => void;
ScrollPanelUp: () => void;
ScrollToBottom: () => void;
ScrollToTop: () => void;
SetCarouselSelectedChild: (panel: Panel) => void;
SetChildPanelsSelected: (selected: boolean) => void;
SetInputFocus: () => void;
SetPanelEnabled: (enabled: boolean) => void;
SetPanelSelected: (selected: boolean) => void;
SwitchStyle: (slot: string, cls: string) => void;
TogglePanelSelected: () => void;
ToggleStyle: (cls: string) => void;
TriggerStyle: (cls: string) => void;
UpdateFocusAndDirtyChildStyles: () => void;
}

interface GlobalEventNameMap {
'AsyncEvent': (delay: duration, eventToFire: string) => void,
'MainMenuResumeGame': () => void,
'MainMenuPauseGame': () => void,
'ShowPauseMenu': () => void,
'HidePauseMenu': () => void,
'ShowMainMenu': () => void,
'HideMainMenu': () => void,
'HudProcessInput': () => void,
'HudThink': () => void,
'ShowIntroMovie': () => void,
'HideIntroMovie': () => void,
'DemoPlaybackControl': (str: string, flt: float) => void,
'Drawer_ExtendAndNavigateToTab': (tabid: string) => void,
'Drawer_NavigateToTab': (tabid: string) => void,
'Drawer_UpdateLobbyButton': (imgsrc: string, playercount: unknown) => void,
'GameEventFired': (event: string) => void,
'HideContentPanel': () => void,
'LayoutReloaded': () => void,
'MainMenuTabHidden': (tabid: string) => void,
'MainMenuTabShown': (tabid: string) => void,
'PageDown': () => void,
'PageLeft': () => void,
'PageRight': () => void,
'PageUp': () => void,
'PanoramaGameTimeJumpEvent': (time: duration) => void,
'ReloadBackground': () => void,
'ScrollDown': () => void,
'ScrollLeft': () => void,
'ScrollRight': () => void,
'ScrollUp': () => void,
'SettingsNavigateToPanel': (category: string, panel: Panel) => void,
'ShowCenterPrintText': (message: string, priority: unknown) => void,
'ShowContentPanel': () => void,
'ShowVoteContextMenu': () => void,
'StaticHudMenu_EntrySelected': (panel: Panel) => void,
'UnloadLoadingScreenAndReinit': () => void,
'AchievementInfoLoaded': () => void,
'AchievementEarned': (player_index: number, achievement_index: number) => void,
AsyncEvent: (delay: duration, eventToFire: string) => void;
MainMenuResumeGame: () => void;
MainMenuPauseGame: () => void;
ShowPauseMenu: () => void;
HidePauseMenu: () => void;
ShowMainMenu: () => void;
HideMainMenu: () => void;
HudProcessInput: () => void;
HudThink: () => void;
ShowIntroMovie: () => void;
HideIntroMovie: () => void;
DemoPlaybackControl: (str: string, flt: float) => void;
Drawer_ExtendAndNavigateToTab: (tabid: string) => void;
Drawer_NavigateToTab: (tabid: string) => void;
Drawer_UpdateLobbyButton: (imgsrc: string, playercount: unknown) => void;
GameEventFired: (event: string) => void;
HideContentPanel: () => void;
LayoutReloaded: () => void;
MainMenuTabHidden: (tabid: string) => void;
MainMenuTabShown: (tabid: string) => void;
PageDown: () => void;
PageLeft: () => void;
PageRight: () => void;
PageUp: () => void;
PanoramaGameTimeJumpEvent: (time: duration) => void;
ReloadBackground: () => void;
ScrollDown: () => void;
ScrollLeft: () => void;
ScrollRight: () => void;
ScrollUp: () => void;
SettingsNavigateToPanel: (category: string, panel: Panel) => void;
ShowCenterPrintText: (message: string, priority: unknown) => void;
ShowContentPanel: () => void;
ShowVoteContextMenu: () => void;
StaticHudMenu_EntrySelected: (panel: Panel) => void;
UnloadLoadingScreenAndReinit: () => void;
AchievementInfoLoaded: () => void;
AchievementEarned: (player_index: number, achievement_index: number) => void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there anything we can do so it doesn't totally fuck up the formatting of this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, prettier will always get rid of indentation like this, personally I prefer it prettier's way, find it easier to read and edit, if you really can't stand it we wouldn't be able to use prettier (happy to discuss that).

Comment on lines 3 to 10
name: string; // Name of the achievement
index: number; // Index of the achievement (for use with the API)
achieved: boolean; // True if this has been achieved
available: boolean; // True if this is available
hide_until_achieved: boolean; // True if this is a "hidden" achievement. It should not be displayed in its full glory until achieved
name: string; // Name of the achievement
index: number; // Index of the achievement (for use with the API)
achieved: boolean; // True if this has been achieved
available: boolean; // True if this is available
hide_until_achieved: boolean; // True if this is a "hidden" achievement. It should not be displayed in its full glory until achieved
flags: number;
count: number; // Current count, if a stat is involved with this achievement. The achievement is granted when count >= goal
goal: number; // Stat goal for this achievement
count: number; // Current count, if a stat is involved with this achievement. The achievement is granted when count >= goal
goal: number; // Stat goal for this achievement
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a huge fan of what it's doing with the comments here (and elsewhere), they were somewhat easier to read as they were.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I can convert to single line /** */ comments.

@tsa96
Copy link
Member Author

tsa96 commented Aug 27, 2024

Closing as per internal discussion

@tsa96 tsa96 closed this Aug 27, 2024
@tsa96
Copy link
Member Author

tsa96 commented Aug 27, 2024

Will leave branch in case we change our mind in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants