Skip to content

Commit

Permalink
style: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tsa96 committed Aug 18, 2024
1 parent 1eb0228 commit dc18757
Show file tree
Hide file tree
Showing 6 changed files with 461 additions and 294 deletions.
34 changes: 20 additions & 14 deletions momentum/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,39 @@ interface MapData {
name: string;
thumbnail: {
urlLarge: string;
}
};
mainTrack: {
difficulty: number;
numZones: number;
isLinear: boolean;
}
credits: { type: string, user: { alias: string } }[];
};
credits: { type: string; user: { alias: string } }[];
}

declare type TimerEvent = TimerEventEnum[keyof TimerEventEnum];
declare interface TimerEventEnum {
Started: 0,
Finished: 1,
Stopped: 2,
Failed: 3,
Started: 0;
Finished: 1;
Stopped: 2;
Failed: 3;
}

declare type TimerState = TimerStateEnum[keyof TimerStateEnum];
declare interface TimerStateEnum {
NotRunning: 0,
Running: 1,
Practice: 2,
NotRunning: 0;
Running: 1;
Practice: 2;
}

declare interface GlobalEventNameMap {
'OnMomentumTimerStateChange': (ent: unknown, type: TimerEvent) => void,
'OnMomentumZoneChange': (enter: unknown, linear: unknown, curZone: unknown, curTrack: unknown, timerState: TimerState) => void,
'OnSaveStateUpdate': (count: number, current: unknown, usingMenu: boolean) => void,
'OnMomentumReplayStopped': () => void,
OnMomentumTimerStateChange: (ent: unknown, type: TimerEvent) => void;
OnMomentumZoneChange: (
enter: unknown,
linear: unknown,
curZone: unknown,
curTrack: unknown,
timerState: TimerState
) => void;
OnSaveStateUpdate: (count: number, current: unknown, usingMenu: boolean) => void;
OnMomentumReplayStopped: () => void;
}
16 changes: 7 additions & 9 deletions p2ce/achievements.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

interface Achievement {
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
}

declare namespace AchievementsAPI {

/**
* Returns true if cheats were turned on at any point during this session
*/
Expand Down
84 changes: 42 additions & 42 deletions p2ce/weapons.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,67 +11,67 @@
*/

declare interface GlobalEventNameMap {
'WeaponStateChange': (mode: WeaponStateMode, index: int32) => void,
'WeaponSelect': (action: WeaponSelectAction) => void,
WeaponStateChange: (mode: WeaponStateMode, index: int32) => void;
WeaponSelect: (action: WeaponSelectAction) => void;
}

/** @group enum */
declare enum WeaponStateMode {
SWITCH = 0,
PICKUP = 1,
DROP = 2,
SWITCH = 0,
PICKUP = 1,
DROP = 2
}

/** @group enum */
declare enum WeaponSelectAction {
NEXT = 0,
PREV = 1,
SHOW = 2,
HIDE = 3,
HIDE = 3
}

interface Weapon {
name: string;
classname: string;
viewmodel: string;
playermodel: string;
name: string;
classname: string;
viewmodel: string;
playermodel: string;

slot: number;
position: number;
slot: number;
position: number;

type: 'melee' | 'gun';
type: 'melee' | 'gun';

primary: {
usesPrimary: boolean; // True when this weapon uses primary ammo
usesClips: boolean; // True when this weapon uses clips
clipSize: number; // The clip size of the weapon
clipAmmo: number; // The ammo in the current clip
ammoType: string; // The name of the ammo, or an empty string if no name given
maxAmmo: number; // The max amount of primary ammo
ammo: number; // The amount of ammo remaining
};
primary: {
usesPrimary: boolean; // True when this weapon uses primary ammo
usesClips: boolean; // True when this weapon uses clips
clipSize: number; // The clip size of the weapon
clipAmmo: number; // The ammo in the current clip
ammoType: string; // The name of the ammo, or an empty string if no name given
maxAmmo: number; // The max amount of primary ammo
ammo: number; // The amount of ammo remaining
};

secondary: {
usesSecondary: boolean; // True when this weapon uses secondary ammo
usesClips: boolean; // True when this weapon uses clips
clipSize: number; // The clip size of the weapon
clipAmmo: number; // The ammo in the current clip
ammoType: string; // The name of the ammo, or an empty string if no name given
maxAmmo: number; // The max amount of secondary ammo
ammo: number; // The amount of ammo remaining
};
secondary: {
usesSecondary: boolean; // True when this weapon uses secondary ammo
usesClips: boolean; // True when this weapon uses clips
clipSize: number; // The clip size of the weapon
clipAmmo: number; // The ammo in the current clip
ammoType: string; // The name of the ammo, or an empty string if no name given
maxAmmo: number; // The max amount of secondary ammo
ammo: number; // The amount of ammo remaining
};
}

declare namespace WeaponsAPI {
function GetWeaponCount(): uint32;
function GetWeapons(): (Weapon | null)[];
function GetActiveWeapon(): uint32;
function HasWeaponClass(classname: string): boolean;
function HasWeapon(id: uint32): boolean;
function GetWeaponInfo(id: uint32): Weapon | null;
function GetActiveWeaponInfo(): Weapon | null;
function CanSwitchToWeapon(id: uint32): boolean;
function SwitchToWeapon(id: uint32): boolean;
function GetWeaponIndexFromClass(classname: string): uint32;
function DropWeapon(id: uint32, throwVecX: number, throwVecY: number, throwVecZ: number): boolean;
function GetWeaponCount(): uint32;
function GetWeapons(): (Weapon | null)[];
function GetActiveWeapon(): uint32;
function HasWeaponClass(classname: string): boolean;
function HasWeapon(id: uint32): boolean;
function GetWeaponInfo(id: uint32): Weapon | null;
function GetActiveWeaponInfo(): Weapon | null;
function CanSwitchToWeapon(id: uint32): boolean;
function SwitchToWeapon(id: uint32): boolean;
function GetWeaponIndexFromClass(classname: string): uint32;
function DropWeapon(id: uint32, throwVecX: number, throwVecY: number, throwVecZ: number): boolean;
}
162 changes: 81 additions & 81 deletions shared/events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,88 @@
*/

interface PanelEventNameMap {
'AddStyle': (cls: string) => void,
'AddStyleToEachChild': (cls: string) => void,
'CarouselAutoScroll': (autoscroll_id: number) => void,
'CarouselChildrenChanged': (panel: Panel) => void,
'CarouselNavIncrementSelectedIndex':(inc: number) => void,
'CarouselNavSetSelectedIndex': (index: number) => void,
'DragStart': (source: unknown, info: DragEventInfo) => void,
'DropInputFocus': () => void,
'IfHasClassEvent': (cls: string, eventToFire: string) => void,
'IfHoverOtherEvent': (otherPanelID: string, eventToFire: string) => void,
'IfNotHasClassEvent': (cls: string, eventToFire: string) => void,
'IfNotHoverOtherEvent': (otherPanelID: string, eventToFire: string) => void,
'ImageFailedLoad': () => void,
'MovePanelDown': (repeatCount: int32) => void,
'MovePanelLeft': (repeatCount: int32) => void,
'MovePanelRight': (repeatCount: int32) => void,
'MovePanelUp': (repeatCount: int32) => void,
'PagePanelDown': () => void,
'PagePanelLeft': () => void,
'PagePanelRight': () => void,
'PagePanelUp': () => void,
'PanelLoaded': () => void,
'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,
AddStyle: (cls: string) => void;
AddStyleToEachChild: (cls: string) => void;
CarouselAutoScroll: (autoscroll_id: number) => void;
CarouselChildrenChanged: (panel: Panel) => void;
CarouselNavIncrementSelectedIndex: (inc: number) => void;
CarouselNavSetSelectedIndex: (index: number) => void;
DragStart: (source: unknown, info: DragEventInfo) => void;
DropInputFocus: () => void;
IfHasClassEvent: (cls: string, eventToFire: string) => void;
IfHoverOtherEvent: (otherPanelID: string, eventToFire: string) => void;
IfNotHasClassEvent: (cls: string, eventToFire: string) => void;
IfNotHoverOtherEvent: (otherPanelID: string, eventToFire: string) => void;
ImageFailedLoad: () => void;
MovePanelDown: (repeatCount: int32) => void;
MovePanelLeft: (repeatCount: int32) => void;
MovePanelRight: (repeatCount: int32) => void;
MovePanelUp: (repeatCount: int32) => void;
PagePanelDown: () => void;
PagePanelLeft: () => void;
PagePanelRight: () => void;
PagePanelUp: () => void;
PanelLoaded: () => void;
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;
}
Loading

0 comments on commit dc18757

Please sign in to comment.