mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 19:31:17 +08:00
Update XSPUtils.kt
This commit is contained in:
@@ -20,8 +20,9 @@ object XSPUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun hasEnable(key: String, default: Boolean = false, crossinline block: () -> Unit) {
|
inline fun hasEnable(key: String, default: Boolean = false, noinline extraCondition: (() -> Boolean)? = null, crossinline block: () -> Unit) {
|
||||||
if (XSPUtils.getBoolean(key, default)) {
|
val conditionResult = if (extraCondition != null) extraCondition() else true
|
||||||
|
if (XSPUtils.getBoolean(key, default) && conditionResult) {
|
||||||
block()
|
block()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user