better, but more dialog logic is needed
This commit is contained in:
@@ -85,12 +85,19 @@ impl EventHandler {
|
|||||||
// Check general bindings for dialog actions
|
// Check general bindings for dialog actions
|
||||||
if let Some(action) = config.get_general_action(key.code, key.modifiers) {
|
if let Some(action) = config.get_general_action(key.code, key.modifiers) {
|
||||||
match action {
|
match action {
|
||||||
"move_down" => {
|
"move_down" | "move_right" => {
|
||||||
app_state.next_dialog_button();
|
let current_index = app_state.ui.dialog.dialog_active_button_index;
|
||||||
|
let num_buttons = app_state.ui.dialog.dialog_buttons.len();
|
||||||
|
if num_buttons > 0 && current_index < num_buttons - 1 {
|
||||||
|
app_state.ui.dialog.dialog_active_button_index += 1;
|
||||||
|
}
|
||||||
return Ok(EventOutcome::Ok(String::new())); // Consume event
|
return Ok(EventOutcome::Ok(String::new())); // Consume event
|
||||||
}
|
}
|
||||||
"move_up" => {
|
"move_up" | "move_left" => {
|
||||||
app_state.previous_dialog_button();
|
let current_index = app_state.ui.dialog.dialog_active_button_index;
|
||||||
|
if current_index > 0 {
|
||||||
|
app_state.ui.dialog.dialog_active_button_index -= 1;
|
||||||
|
}
|
||||||
return Ok(EventOutcome::Ok(String::new())); // Consume event
|
return Ok(EventOutcome::Ok(String::new())); // Consume event
|
||||||
}
|
}
|
||||||
"select" => {
|
"select" => {
|
||||||
|
|||||||
Reference in New Issue
Block a user