Auto-commit after successful build: update app gameplay/UI, improve build setup
Changed files:\napp/build.gradle.kts app/src/main/java/solutions/tretter/githugandroid/GitHugApp.kt
This commit is contained in:
@@ -11,8 +11,8 @@ android {
|
||||
applicationId = "solutions.tretter.githugandroid"
|
||||
minSdk = 26
|
||||
targetSdk = 34
|
||||
versionCode = 69
|
||||
versionName = "0.1.68"
|
||||
versionCode = 70
|
||||
versionName = "0.1.69"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
@@ -40,7 +40,7 @@ fun GitHugApp() {
|
||||
val paneLayoutStore = remember(context) { PaneLayoutStore(context.applicationContext) }
|
||||
val gameProgressStore = remember(context) { GameProgressStore(context.applicationContext) }
|
||||
val persistedPaneLayout by paneLayoutStore.layoutFlow.collectAsState(initial = defaultPaneLayout())
|
||||
val persistedCompletedLevels by gameProgressStore.completedLevelsFlow.collectAsState(initial = emptySet())
|
||||
val persistedCompletedLevels by gameProgressStore.completedLevelsFlow.collectAsState(initial = null)
|
||||
val scope = rememberCoroutineScope()
|
||||
val screenScrollState = rememberScrollState()
|
||||
val screenHeightDp = configuration.screenHeightDp
|
||||
@@ -82,17 +82,18 @@ fun GitHugApp() {
|
||||
}
|
||||
|
||||
LaunchedEffect(persistedCompletedLevels) {
|
||||
completedLevels = persistedCompletedLevels
|
||||
val restoredCompletedLevels = persistedCompletedLevels ?: return@LaunchedEffect
|
||||
completedLevels = restoredCompletedLevels
|
||||
if (!hasRestoredProgress) {
|
||||
hasRestoredProgress = true
|
||||
val firstIncompleteIndex = levels.indexOfFirst { it.id !in persistedCompletedLevels }
|
||||
val firstIncompleteIndex = levels.indexOfFirst { it.id !in restoredCompletedLevels }
|
||||
val resumeIndex = firstIncompleteIndex.takeIf { it >= 0 } ?: levels.lastIndex
|
||||
currentLevelIndex = resumeIndex
|
||||
repo = runtime.prepareLevel(levels[resumeIndex])
|
||||
output = listOf(
|
||||
if (persistedCompletedLevels.size == levels.size) {
|
||||
if (restoredCompletedLevels.size == levels.size) {
|
||||
"🏁 All Githug levels completed."
|
||||
} else if (persistedCompletedLevels.isEmpty()) {
|
||||
} else if (restoredCompletedLevels.isEmpty()) {
|
||||
runtime.startupBanner()
|
||||
} else {
|
||||
"Resumed at level: ${levels[resumeIndex].title}"
|
||||
|
||||
Reference in New Issue
Block a user