diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2023-10-21 22:56:53 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-21 13:56:53 +0200 |
commit | 526365859a27d54b7ea5c07c08b301650c15ea0e (patch) | |
tree | ddf772f564d85caf3dbe73c66c032affdf69281f /src/main/java/at/hannibal2/skyhanni/events | |
parent | a98927303854058ad2d7a0d8bb88265c54139614 (diff) | |
download | skyhanni-526365859a27d54b7ea5c07c08b301650c15ea0e.tar.gz skyhanni-526365859a27d54b7ea5c07c08b301650c15ea0e.tar.bz2 skyhanni-526365859a27d54b7ea5c07c08b301650c15ea0e.zip |
Backend: Serialise all constants and add repo error messages and status (#605)
Backend: Serialise all constants and add repo error messages and status #605
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/events')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt index e0eb01b9b..3b2b426fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt @@ -1,16 +1,16 @@ package at.hannibal2.skyhanni.events import at.hannibal2.skyhanni.data.repo.RepoError +import at.hannibal2.skyhanni.data.repo.RepoManager import at.hannibal2.skyhanni.data.repo.RepoUtils import com.google.gson.Gson -import com.google.gson.JsonObject import java.io.File import java.lang.reflect.Type class RepositoryReloadEvent(val repoLocation: File, val gson: Gson) : LorenzEvent() { - fun getConstant(constant: String) = getConstant<JsonObject>(constant) inline fun <reified T : Any> getConstant(constant: String, type: Type? = null): T = try { + RepoManager.setlastConstant(constant) if (!repoLocation.exists()) throw RepoError("Repo folder does not exist!") RepoUtils.getConstant(repoLocation, constant, gson, T::class.java, type) } catch (e: Exception) { |