Move to NextJS + other changes

This commit is contained in:
2025-08-25 01:00:52 -07:00
parent e8e9e4d312
commit 342f8101fe
44 changed files with 3265 additions and 1305 deletions

View File

@@ -0,0 +1,10 @@
import { LauncherVersion } from './LauncherVersion'
export class DownloadProgress {
constructor (
public version: LauncherVersion,
public progress: number,
public failed: boolean,
public queued: boolean
) {}
}

View File

@@ -0,0 +1,12 @@
import { LauncherVersion } from './LauncherVersion'
export class DownloadedVersion {
constructor (
public version: LauncherVersion,
public installDate: number = Date.now()
) {}
static import (data: LauncherVersion) {
return new DownloadedVersion(data)
}
}

View File

@@ -0,0 +1,18 @@
import { DownloadedVersion } from './DownloadedVersion'
import { DownloadProgress } from './DownloadProgress'
import { LauncherVersion } from './LauncherVersion'
import { NormalConfig } from './NormalConfig'
import { VersionsConfig } from './VersionsConfig'
export type InstallsProps = {
downloadProgress: DownloadProgress[]
showPopup: boolean
setShowPopup: (v: boolean) => void
setPopupMode: (v: null | number) => void
setFadeOut: (v: boolean) => void
setSelectedVersionList: (v: LauncherVersion[]) => void
setVersionList: (v: null | LauncherVersion[]) => void
downloadedVersionsConfig: VersionsConfig | null
normalConfig: NormalConfig | null
setManagingVersion: (v: DownloadedVersion | null) => void
}

View File

@@ -0,0 +1,8 @@
export interface LauncherVersion {
version: string
displayName: string
platforms: string[]
downloadUrls: string[]
executables: string[]
id: number
}

View File

@@ -0,0 +1,9 @@
export interface LeaderboardEntry {
username: string
userid: bigint
value: bigint
icon: number
overlay: number
birdColor: number[]
overlayColor: number[]
}

View File

@@ -0,0 +1,21 @@
import { SettingsType } from './SettingsType'
type NormalConfigData = {
version: string
settings?: Partial<SettingsType>
}
export class NormalConfig {
constructor (
public version: string,
public settings: SettingsType = new SettingsType()
) {}
static import (data: NormalConfigData) {
const cfg = new NormalConfig(data.version)
if (data.settings) {
cfg.settings = { ...cfg.settings, ...data.settings }
}
return cfg
}
}

View File

@@ -0,0 +1,6 @@
export type SettingProps = {
label: string
value: boolean
onChange: (val: boolean) => void
className?: string
}

View File

@@ -0,0 +1,5 @@
import { NormalConfig } from './NormalConfig'
export type SettingsProps = {
normalConfig: NormalConfig | null
}

View File

@@ -0,0 +1,8 @@
export class SettingsType {
constructor (
public checkForNewVersionOnLoad: boolean = true,
public allowNotifications: boolean = true,
public useWineOnUnixWhenNeeded: boolean = false,
public useWindowsRoundedCorners: boolean = false
) {}
}

View File

@@ -0,0 +1,8 @@
import { DownloadProgress } from './DownloadProgress'
export type SidebarProps = {
setShowPopup: (v: boolean) => void
setPopupMode: (v: null | number) => void
setFadeOut: (v: boolean) => void
downloadProgress: DownloadProgress[]
}

View File

@@ -0,0 +1,16 @@
import { DownloadedVersion } from './DownloadedVersion'
type VersionsConfigData = {
version: string
list: DownloadedVersion[]
}
export class VersionsConfig {
constructor (public version: string, public list: DownloadedVersion[] = []) {}
static import (data: VersionsConfigData) {
const cfg = new VersionsConfig(data.version)
cfg.list = [...data.list]
return cfg
}
}