Auto-commit after successful build: update app gameplay/UI, improve build setup
Changed files:\napp/build.gradle.kts app/src/main/java/com/kawomi/githugandroid/GameModels.kt app/src/main/java/com/kawomi/githugandroid/GitHugApp.kt
This commit is contained in:
@@ -211,6 +211,10 @@ fun GitHugApp() {
|
||||
}
|
||||
}
|
||||
|
||||
fun showCommandHelp() {
|
||||
output = output + GitSandboxEngine.commandReferenceLines()
|
||||
}
|
||||
|
||||
Scaffold { padding ->
|
||||
Surface(
|
||||
modifier = Modifier
|
||||
@@ -265,6 +269,7 @@ fun GitHugApp() {
|
||||
},
|
||||
onRun = { runCommand() },
|
||||
onTab = { tabComplete() },
|
||||
onHelp = { showCommandHelp() },
|
||||
onCursorLeft = { moveCursor(-1) },
|
||||
onCursorRight = { moveCursor(1) },
|
||||
onHistoryUp = { historyUp() },
|
||||
@@ -383,6 +388,7 @@ private fun TerminalPanel(
|
||||
onValueChange: (TextFieldValue) -> Unit,
|
||||
onRun: () -> Unit,
|
||||
onTab: () -> Unit,
|
||||
onHelp: () -> Unit,
|
||||
onCursorLeft: () -> Unit,
|
||||
onCursorRight: () -> Unit,
|
||||
onHistoryUp: () -> Unit,
|
||||
@@ -419,6 +425,7 @@ private fun TerminalPanel(
|
||||
}
|
||||
SpecialKeyBar(
|
||||
onTab = onTab,
|
||||
onHelp = onHelp,
|
||||
onCursorLeft = onCursorLeft,
|
||||
onCursorRight = onCursorRight,
|
||||
onHistoryUp = onHistoryUp,
|
||||
@@ -464,6 +471,7 @@ private fun TerminalPanel(
|
||||
@Composable
|
||||
private fun SpecialKeyBar(
|
||||
onTab: () -> Unit,
|
||||
onHelp: () -> Unit,
|
||||
onCursorLeft: () -> Unit,
|
||||
onCursorRight: () -> Unit,
|
||||
onHistoryUp: () -> Unit,
|
||||
@@ -471,13 +479,14 @@ private fun SpecialKeyBar(
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
||||
) {
|
||||
TerminalKeyButton(label = "TAB", onClick = onTab, modifier = Modifier.width(68.dp))
|
||||
TerminalKeyButton(label = "←", onClick = onCursorLeft, modifier = Modifier.width(48.dp))
|
||||
TerminalKeyButton(label = "→", onClick = onCursorRight, modifier = Modifier.width(48.dp))
|
||||
TerminalKeyButton(label = "↑", onClick = onHistoryUp, modifier = Modifier.width(48.dp))
|
||||
TerminalKeyButton(label = "↓", onClick = onHistoryDown, modifier = Modifier.width(48.dp))
|
||||
TerminalKeyButton(label = "↹", onClick = onTab, modifier = Modifier.width(56.dp), fontFamily = FontFamily.Default)
|
||||
TerminalKeyButton(label = "?", onClick = onHelp, modifier = Modifier.width(40.dp), fontFamily = FontFamily.Default)
|
||||
TerminalKeyButton(label = "←", onClick = onCursorLeft, modifier = Modifier.width(40.dp))
|
||||
TerminalKeyButton(label = "→", onClick = onCursorRight, modifier = Modifier.width(40.dp))
|
||||
TerminalKeyButton(label = "↑", onClick = onHistoryUp, modifier = Modifier.width(40.dp))
|
||||
TerminalKeyButton(label = "↓", onClick = onHistoryDown, modifier = Modifier.width(40.dp))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,6 +495,7 @@ private fun TerminalKeyButton(
|
||||
label: String,
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
fontFamily: FontFamily = FontFamily.Monospace,
|
||||
) {
|
||||
Button(
|
||||
onClick = onClick,
|
||||
@@ -498,7 +508,7 @@ private fun TerminalKeyButton(
|
||||
) {
|
||||
Text(
|
||||
text = label,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = fontFamily,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 13.sp
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user