Almost finished with new launcher

This commit is contained in:
2025-10-31 09:33:41 -07:00
parent 3b5bd13b1c
commit df951d90c6
64 changed files with 994 additions and 1424 deletions

View File

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

View File

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

7
src/app/types/Game.ts Normal file
View File

@@ -0,0 +1,7 @@
export interface Game {
id: number
name: string
official: boolean
verified: boolean
cutOff: number | null
}

View File

@@ -0,0 +1,10 @@
export interface GameVersion {
id: string
versionName: string
releaseDate: number
downloadUrls: string[]
platforms: string[]
executables: string[]
game: number
place: number
}

View File

@@ -1,18 +0,0 @@
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

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

View File

@@ -0,0 +1,7 @@
import { Game } from "./Game"
import { GameVersion } from "./GameVersion"
export interface ServerVersionsResponse {
versions: GameVersion[]
games: Game[]
}

View File

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

View File

@@ -1,8 +1,7 @@
export class SettingsType {
constructor (
public checkForNewVersionOnLoad: boolean = true,
constructor(
public allowNotifications: boolean = true,
public useWineOnUnixWhenNeeded: boolean = false,
public wineOnUnixCommand: string = 'wine %path%'
) {}
) { }
}

View File

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

View File

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