Ejemplo n.º 1
0
void Game::ProcessEvents() {
    //Zmienna bool wspolna z klasa App
    if ( *m_is_done ) return;

    //W zaleznosci od stanu aplikacji, inne klasy przejmuja sterowanie
    if ( *m_game_state==GS::Play ) ControlGame();
    else if ( *m_game_state==GS::MainMenu
              || *m_game_state==GS::About  ) ControlMenu();
    else if ( *m_game_state==GS::SelectLevel ) NewGame();
}
Ejemplo n.º 2
0
BString AmControlChangeInfoView::MenuStringForControl(uint32 control) const
{
	if (control > 127) return BString("?");
	BMenu*		menu = ControlMenu();
	if (!menu) return BString( am_control_name(control) );

	BMenuItem*	item;
	for (int32 index = 0; (item = menu->ItemAt( index )); index++) {
		if (index == (int32)control) return BString( item->Label() );
	}
	return BString( am_control_name(control) );
}
Ejemplo n.º 3
0
void AmControlChangeInfoView::SetConfiguration(const BMessage* config)
{
	int32	tmp;
	if (config->FindInt32(STR_CONTROL_CHANGE, &tmp) == B_OK) {
		mCc = (uchar)tmp;
		BMenu*	menu = ControlMenu();
		if (menu) {
			BMenuItem*	item;
			for (int32 index = 0; (item = menu->ItemAt( index )); index++) {
				if (index == mCc) item->SetMarked(false);
				else item->SetMarked(true);
			}
		}
	}
}