Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codex-rs/core/src/config/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ pub enum MiniGameKind {
SubwaySurfer,
Snake,
FlappyBird,
Pacman,
}

/// Collection of settings that are specific to the TUI.
Expand Down
1 change: 1 addition & 0 deletions codex-rs/tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3150,6 +3150,7 @@ impl App {
codex_core::config::types::MiniGameKind::SubwaySurfer => "subway_surfer",
codex_core::config::types::MiniGameKind::Snake => "snake",
codex_core::config::types::MiniGameKind::FlappyBird => "flappy_bird",
codex_core::config::types::MiniGameKind::Pacman => "pacman",
};
let edit = ConfigEdit::SetPath {
segments: vec!["tui".to_string(), "mini_game".to_string()],
Expand Down
10 changes: 10 additions & 0 deletions codex-rs/tui/src/chatwidget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5674,6 +5674,16 @@ impl ChatWidget {
dismiss_on_select: true,
..Default::default()
},
SelectionItem {
name: "Pacman".to_string(),
description: Some("Munch pellets and dodge ghosts through the maze".to_string()),
is_current: current == MiniGameKind::Pacman,
actions: vec![Box::new(|tx| {
tx.send(AppEvent::UpdateMiniGameKind(MiniGameKind::Pacman));
})],
dismiss_on_select: true,
..Default::default()
},
SelectionItem {
name: "Quit Games".to_string(),
description: Some("Close the game and return to the input bar".to_string()),
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/tui/src/games/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub(crate) mod connect4;
pub(crate) mod flappy_bird;
pub(crate) mod pacman;
pub(crate) mod snake;
pub(crate) mod subway_surfer;
pub(crate) mod tetris;
Expand Down Expand Up @@ -60,6 +61,7 @@ impl GameOverlay {
}
MiniGameKind::Snake => Box::new(snake::SnakeGame::new(frame_requester)),
MiniGameKind::FlappyBird => Box::new(flappy_bird::FlappyBirdGame::new(frame_requester)),
MiniGameKind::Pacman => Box::new(pacman::PacmanGame::new(frame_requester)),
};
Self {
game,
Expand Down
Loading