diff --git a/app/src/main/java/today/notfeelingit/lcdpet/MainActivity.kt b/app/src/main/java/today/notfeelingit/lcdpet/MainActivity.kt index bd4f1c5..b8914da 100644 --- a/app/src/main/java/today/notfeelingit/lcdpet/MainActivity.kt +++ b/app/src/main/java/today/notfeelingit/lcdpet/MainActivity.kt @@ -671,6 +671,7 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { var testWantMenuOpen by remember { mutableStateOf(false) } var testBondMenuOpen by remember { mutableStateOf(false) } var downtimeMode by remember { mutableStateOf(DowntimeMode.None) } + var petMeTimeActive by remember { mutableStateOf(false) } var sleepWakeConfirm by remember { mutableStateOf(false) } var selectedTvChannel by remember { mutableStateOf(TvChannel.Weather) } @@ -4548,6 +4549,26 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { } ) + LCDSubButton( + text = "TEST ME TIME", + enabled = !isSleeping && + !isBathing && + !isTalking && + !isFindingNewPet && + !isTradingInPet && + framePropAnimation.isEmpty(), + lcdDark = lcdDark, + lcdFaded = lcdFaded, + onClick = { + petMeTimeActive = true + downtimeMode = DowntimeMode.None + careMenuOpen = false + socializeMenuOpen = false + testWantMenuOpen = false + statsMenuOpen = false + } + ) + LCDSubButton( text = "TEST TOUCH GRASS", enabled = !isSleeping && @@ -4871,7 +4892,9 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { verticalArrangement = Arrangement.Center ) { val downtimeActive = - !isSleeping && downtimeMode != DowntimeMode.None + !isSleeping && + !petMeTimeActive && + downtimeMode != DowntimeMode.None val downtimeTitle = if (isSleeping) { @@ -4907,7 +4930,10 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { ) ) - if (!isSleeping && downtimeMode == DowntimeMode.TouchGrass) { + if (!isSleeping && + !petMeTimeActive && + downtimeMode == DowntimeMode.TouchGrass + ) { TouchGrassActivityScreen( lcdDark = petFrameForeground, onGrassTap = {}, @@ -4918,7 +4944,10 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { "Pet is taking time alone." } ) - } else if (!isSleeping && downtimeMode == DowntimeMode.WatchTv) { + } else if (!isSleeping && + !petMeTimeActive && + downtimeMode == DowntimeMode.WatchTv + ) { WatchTvActivityScreen( lcdDark = petFrameForeground, selectedChannel = selectedTvChannel, @@ -5550,7 +5579,8 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { verticalArrangement = Arrangement.spacedBy(actionSpacing) ) { val actionInProgress = - (testingMode && downtimeMode != DowntimeMode.None) || + petMeTimeActive || + (testingMode && downtimeMode != DowntimeMode.None) || isTradingInPet || isFindingNewPet || isSleeping || @@ -5587,6 +5617,121 @@ fun Greeting(name: String, modifier: Modifier = Modifier) { "RecoverWeak" ) + if (petMeTimeActive && !isSleeping) { + androidx.compose.ui.window.Popup( + alignment = Alignment.TopCenter, + properties = androidx.compose.ui.window.PopupProperties( + focusable = true + ) + ) { + Box( + modifier = Modifier + .width(configuration.screenWidthDp.dp) + .height(configuration.screenHeightDp.dp) + .background(petHomeBackground) + .border(2.dp, petFrameForeground) + .padding(screenPadding) + ) { + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text( + text = "$displayPetName wants some time alone.", + fontWeight = FontWeight.Bold, + color = petFrameForeground, + textAlign = TextAlign.Center, + modifier = Modifier.fillMaxWidth() + ) + + Spacer(modifier = Modifier.height(12.dp)) + + LCDSubMenuFrame(lcdDark = petFrameForeground) { + LCDSubButton( + text = "TOUCH GRASS", + modifier = Modifier.weight(1f), + fillWidthFraction = 1f, + enabled = true, + lcdDark = petFrameForeground, + lcdFaded = lcdFaded, + onClick = { + downtimeMode = DowntimeMode.TouchGrass + } + ) + + LCDSubButton( + text = "WATCH TV", + modifier = Modifier.weight(1f), + fillWidthFraction = 1f, + enabled = true, + lcdDark = petFrameForeground, + lcdFaded = lcdFaded, + onClick = { + downtimeMode = DowntimeMode.WatchTv + } + ) + } + + Spacer(modifier = Modifier.height(12.dp)) + + Box( + modifier = Modifier + .weight(1f) + .fillMaxWidth(), + contentAlignment = Alignment.Center + ) { + when (downtimeMode) { + DowntimeMode.TouchGrass -> { + TouchGrassActivityScreen( + lcdDark = petFrameForeground, + onGrassTap = {}, + statusText = "$displayPetName wants some time alone." + ) + } + + DowntimeMode.WatchTv -> { + WatchTvActivityScreen( + lcdDark = petFrameForeground, + selectedChannel = selectedTvChannel, + weatherLabel = weather, + onChannelSelected = { + selectedTvChannel = it + }, + statusText = "$displayPetName wants some time alone." + ) + } + + DowntimeMode.None -> { + Text( + text = petArt, + fontSize = 24.sp, + lineHeight = 24.sp, + fontFamily = FontFamily.Monospace, + textAlign = TextAlign.Center, + color = petFrameForeground + ) + } + } + } + + Spacer(modifier = Modifier.height(12.dp)) + + LCDMenuButton( + text = "EXIT", + enabled = true, + lcdDark = petFrameForeground, + lcdFaded = lcdFaded, + onClick = { + downtimeMode = DowntimeMode.None + (context as? android.app.Activity) + ?.moveTaskToBack(true) + } + ) + } + } + } + } + if (isSleeping) { androidx.compose.ui.window.Popup( alignment = Alignment.TopCenter,