MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / ProcessEvent

Method ProcessEvent

PanzerChasm/menu.cpp:143–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143MenuBase* 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

Callers 1

ProcessEventsMethod · 0.80

Calls 12

KeyCanBeUsedForControlFunction · 0.85
NewGameMethod · 0.80
StartServerMethod · 0.80
SetSettingMethod · 0.80
SaveGameMethod · 0.80
LoadGameMethod · 0.80
GetIntMethod · 0.80
GetBoolMethod · 0.80
QuitMethod · 0.80
SaveAvailableMethod · 0.80
ConnectToServerMethod · 0.45
VidRestartMethod · 0.45

Tested by

no test coverage detected