fix(gtk): use automatically generated equals for ModState
This commit is contained in:
parent
75280b8897
commit
7797f8147f
@ -251,7 +251,7 @@ class ModsTab(window: InstanceSettingsWindow) : SettingsTab<Leaflet, InstanceSet
|
|||||||
val summary: String
|
val summary: String
|
||||||
val description: String
|
val description: String
|
||||||
|
|
||||||
class Installed(private val mod: Mod) : ModState {
|
data class Installed(private val mod: Mod) : ModState {
|
||||||
private val sources = mod.metadata.sources
|
private val sources = mod.metadata.sources
|
||||||
val updates: List<() -> Unit> = sources.mapNotNull { it.value.getOrNull() }.map { { mod.update(it) } }
|
val updates: List<() -> Unit> = sources.mapNotNull { it.value.getOrNull() }.map { { mod.update(it) } }
|
||||||
val outdated get() = updates.isEmpty()
|
val outdated get() = updates.isEmpty()
|
||||||
@ -261,7 +261,7 @@ class ModsTab(window: InstanceSettingsWindow) : SettingsTab<Leaflet, InstanceSet
|
|||||||
override val description: String by lazy { sources.bestDescription ?: mod.description.joinToString(separator = "\n") }
|
override val description: String by lazy { sources.bestDescription ?: mod.description.joinToString(separator = "\n") }
|
||||||
}
|
}
|
||||||
|
|
||||||
class Available(private val mod: ModSource, private val instance: Instance) : ModState {
|
data class Available(private val mod: ModSource, private val instance: Instance) : ModState {
|
||||||
fun install() {
|
fun install() {
|
||||||
//TODO thread and possibly show progress
|
//TODO thread and possibly show progress
|
||||||
ModManager.download(mod, instance.modsDir.resolve(mod.shortName + ModPath.EXT_IMOD), instance.mds)
|
ModManager.download(mod, instance.modsDir.resolve(mod.shortName + ModPath.EXT_IMOD), instance.mds)
|
||||||
|
Loading…
Reference in New Issue
Block a user