Skip to content

Commit

Permalink
feat: 1.19.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
DevScyu committed Dec 22, 2022
1 parent cfe4c79 commit cece07f
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 118 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Expand Up @@ -42,6 +42,7 @@ tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs = listOf(
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
)
}
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/com/wynntils/launchy/data/Config.kt
Expand Up @@ -19,6 +19,7 @@ data class Config(
val configs: Map<ModName, ConfigURL> = mapOf(),
val seenGroups: Set<GroupName> = setOf(),
val installedFabricVersion: String? = null,
val installedMinecraftVersion: String? = "1.18.2", // default to 1.18.2
val downloadUpdates: Boolean = true,
val handledImportOptions: Boolean = false,
val handledFirstLaunch: Boolean = false,
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/com/wynntils/launchy/logic/LaunchyState.kt
Expand Up @@ -51,6 +51,7 @@ class LaunchyState(
}

var installedFabricVersion by mutableStateOf(config.installedFabricVersion)
var installedMinecraftVersion by mutableStateOf(config.installedMinecraftVersion)

var notPresentDownloads by mutableStateOf(setOf<Mod>())
private set
Expand All @@ -59,7 +60,7 @@ class LaunchyState(
}

val upToDateMods by derivedStateOf {
enabledMods.filter { it in downloadURLs && downloadURLs[it] == it.url }
enabledMods.filter { it in downloadURLs && downloadURLs[it] == it.url && it !in notPresentDownloads }
}

val upToDateConfigs by derivedStateOf {
Expand Down Expand Up @@ -106,6 +107,7 @@ class LaunchyState(

var installingProfile by mutableStateOf(false)
val fabricUpToDate by derivedStateOf {
installedMinecraftVersion == versions.minecraftVersion &&
installedFabricVersion == versions.fabricVersion && FabricInstaller.isProfileInstalled(
Dirs.minecraft,
"Wynncraft"
Expand Down Expand Up @@ -186,6 +188,8 @@ class LaunchyState(
installingProfile = false
installedFabricVersion = "Installing..."
installedFabricVersion = versions.fabricVersion
installedMinecraftVersion = "Installing..."
installedMinecraftVersion = versions.minecraftVersion
}

suspend fun download(mod: Mod) {
Expand Down Expand Up @@ -259,6 +263,7 @@ class LaunchyState(
configs = downloadConfigURLs.mapKeys { it.key.name },
seenGroups = versions.groups.map { it.name }.toSet(),
installedFabricVersion = installedFabricVersion,
installedMinecraftVersion = installedMinecraftVersion,
handledImportOptions = handledImportOptions,
handledFirstLaunch = handledFirstLaunch,
).save()
Expand Down

0 comments on commit cece07f

Please sign in to comment.