mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 13:05:47 +00:00
feat(stores): editable launch options for EA store games (#2444)
This commit is contained in:
1 parent
9a76e75ee9
commit
6349a171b5
5 files changed
+41
-2
No files matched your search
@@ -103,6 +103,23 @@ class AddedGamesStoreScanTest {
|
||||
assertTrue(listing.contains("\"store\":\"${Store.EPIC.id}\""))
|
||||
}
|
||||
|
||||
@Test fun anEaGamesSavedLaunchOptionsReachTheListingAndOtherStoresIgnoreThem() {
|
||||
val ea = install(Store.EA, "Origin.OFR.1", "Burnout Paradise", "bin/Game.exe", launcher = true)
|
||||
val gog = install(Store.GOG, "42", "Plain Gog", "Game.exe")
|
||||
AddedGames.scan(app)
|
||||
AddedGameEdits.setLaunchOptions(app, ea.path, "-dx11")
|
||||
AddedGameEdits.setLaunchOptions(app, gog.path, "-ignored")
|
||||
val games = AddedGames.scan(app)
|
||||
assertEquals("-dx11", games.single { it.folder.absolutePath == ea.absolutePath }.launchOptions)
|
||||
assertEquals("", games.single { it.folder.absolutePath == gog.absolutePath }.launchOptions)
|
||||
assertTrue(AddedGames.writeListing(app, games).readText().contains("\"launch\":\"-dx11\""))
|
||||
}
|
||||
|
||||
@Test fun anEaGameWithoutSavedLaunchOptionsHasNone() {
|
||||
val ea = install(Store.EA, "Origin.OFR.2", "Other EA", "bin/Game.exe", launcher = true)
|
||||
assertEquals("", AddedGames.scan(app).single { it.folder.absolutePath == ea.absolutePath }.launchOptions)
|
||||
}
|
||||
|
||||
// GOG runs a task from its declared working directory; the install root when it declares none.
|
||||
@Test fun aTaskWorkingDirectoryBecomesTheShortcutsStartIn() {
|
||||
val folder = install(Store.GOG, "1207658924", "Witcher Game", "System/witcher.exe", workdir = "System")
|
||||
|
||||
@@ -302,7 +302,7 @@ class EaTest {
|
||||
val text = StoreLaunch.launcherText(StoreGameSidecar(Store.EA, "Origin.OFR.1", "Game", exe = "bin/Game.exe", args = listOf("-dx12")))
|
||||
assertTrue(text.contains("for /f \"usebackq tokens=1,* delims==\" %%a in (\"%~dp0.droiddeck-ea-env\") do set \"%%a=%%b\""))
|
||||
assertTrue(text.contains("del \"%~dp0.droiddeck-ea-env\""))
|
||||
assertTrue(text.contains("start \"\" \"${StoreLaunch.EA_ORIGIN}\"\r\n\"%~dp0bin\\Game.exe\" -dx12\r\n"))
|
||||
assertTrue(text.contains("start \"\" \"${StoreLaunch.EA_ORIGIN}\"\r\n\"%~dp0bin\\Game.exe\" -dx12 %*\r\n"))
|
||||
assertTrue(text.trimEnd().endsWith("taskkill /f /im Origin.exe >nul 2>&1"))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user