| 141 | } |
| 142 | |
| 143 | MenuBase* NewGameMenu::ProcessEvent( const SystemEvent& event ) |
| 144 | { |
| 145 | if( event.type == SystemEvent::Type::Key && |
| 146 | event.event.key.pressed ) |
| 147 | { |
| 148 | if( event.event.key.key_code == KeyCode::Up ) |
| 149 | { |
| 150 | PlayMenuSound( Sound::SoundId::MenuChange ); |
| 151 | current_row_= ( current_row_ - 1 + 3 ) % 3; |
| 152 | } |
| 153 | |
| 154 | if( event.event.key.key_code == KeyCode::Down ) |
| 155 | { |
| 156 | PlayMenuSound( Sound::SoundId::MenuChange ); |
| 157 | current_row_= ( current_row_ + 1 + 3 ) % 3; |
| 158 | } |
| 159 | |
| 160 | if( event.event.key.key_code == KeyCode::Enter ) |
| 161 | { |
| 162 | PlayMenuSound( Sound::SoundId::MenuSelect ); |
| 163 | |
| 164 | DifficultyType difficulty= Difficulty::Easy; |
| 165 | if( current_row_ == 1u ) |
| 166 | difficulty= Difficulty::Normal; |
| 167 | if( current_row_ == 2u ) |
| 168 | difficulty= Difficulty::Hard; |
| 169 | |
| 170 | host_commands_.NewGame( difficulty ); |
| 171 | |
| 172 | return nullptr; |
| 173 | } |
| 174 | } |
| 175 | return this; |
| 176 | } |
| 177 | |
| 178 | // NetworkConnectMenu |
| 179 |
no test coverage detected