Almost finished with new launcher
This commit is contained in:
@@ -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
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
@@ -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
7
src/app/types/Game.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface Game {
|
||||
id: number
|
||||
name: string
|
||||
official: boolean
|
||||
verified: boolean
|
||||
cutOff: number | null
|
||||
}
|
||||
10
src/app/types/GameVersion.ts
Normal file
10
src/app/types/GameVersion.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface GameVersion {
|
||||
id: string
|
||||
versionName: string
|
||||
releaseDate: number
|
||||
downloadUrls: string[]
|
||||
platforms: string[]
|
||||
executables: string[]
|
||||
game: number
|
||||
place: number
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
export interface LauncherVersion {
|
||||
version: string
|
||||
displayName: string
|
||||
platforms: string[]
|
||||
downloadUrls: string[]
|
||||
executables: string[]
|
||||
id: number
|
||||
}
|
||||
7
src/app/types/ServerVersionsResponse.ts
Normal file
7
src/app/types/ServerVersionsResponse.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Game } from "./Game"
|
||||
import { GameVersion } from "./GameVersion"
|
||||
|
||||
export interface ServerVersionsResponse {
|
||||
versions: GameVersion[]
|
||||
games: Game[]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import { NormalConfig } from './NormalConfig'
|
||||
|
||||
export type SettingsProps = {
|
||||
normalConfig: NormalConfig | null
|
||||
}
|
||||
@@ -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%'
|
||||
) {}
|
||||
) { }
|
||||
}
|
||||
|
||||
@@ -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[]
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user