1
0
Fork 0

fixed install command call

This commit is contained in:
Kim, Jimin 2022-01-27 15:52:39 +09:00
parent 451a50b17f
commit cb77b67e8e

View file

@ -19,15 +19,16 @@
import type { InstallStatus } from "./types"
interface Args {
gamePath?: string
isLaunchOptionSet?: boolean
wasGameLaunched?: boolean
gamePath: string
isLaunchOptionSet: boolean
wasGameLaunched: boolean
}
//
// variables
//
let _gamePath = ""
let lastReturnStatus: InstallResult = undefined
let lastErrStaus: InstallErr = undefined
let didLastRunFail = false
@ -89,15 +90,24 @@
* entry point
*/
function install() {
_install({})
_install({
gamePath: _gamePath,
isLaunchOptionSet: false,
wasGameLaunched: false,
})
}
/**
* called when default game path was not found.
*/
function selectGamePathAndInstall() {
dialogOpen({ directory: true, multiple: false }).then((gamePath) => {
_install({ gamePath: gamePath as string })
dialogOpen({ directory: true, multiple: false }).then((value) => {
_gamePath = value as string
_install({
gamePath: _gamePath,
isLaunchOptionSet: false,
wasGameLaunched: false,
})
})
}
@ -105,14 +115,22 @@
* called after setting the steam launch option.
*/
function setSteamLaunchOptionAndInstall() {
_install({ isLaunchOptionSet: true })
_install({
gamePath: _gamePath,
isLaunchOptionSet: true,
wasGameLaunched: false,
})
}
/**
* called after launching the game once.
*/
function launchGameAndInstall() {
_install({ isLaunchOptionSet: true, wasGameLaunched: true })
_install({
gamePath: _gamePath,
isLaunchOptionSet: true,
wasGameLaunched: true,
})
}
//