Beispiel #1
0
GameState Menu::KeyboardInputProcess()
{
	if(IPMan::GetIPMan()->GetKeyDown(KeyType::BACKWARD))
	{
		//Because the height of the fonts is 100
		r->top += 100;
		r->bottom += 100;
		if(r->top > 200 + TICKER_TOP_OFFSET)
			{
				r->top = TICKER_TOP_OFFSET;
				r->bottom = guiMan->_guiElements["SINGLEPLAYER"]->GetRect()->y + TICKER_HEIGHT; 
			}
		GUITexture* tex = (GUITexture*)(guiMan->_guiElements["Texture"]);
		tex->SetRect(r);	
		menuOptions = changeOptions(menuOptions, 1);
	}
	else 
		if(IPMan::GetIPMan()->GetKeyDown(KeyType::FORWARD))
	{
		//Because the height of the fonts is 100
		r->top -= 100;
		r->bottom -= 100;
		float x = guiMan->_guiElements["SINGLEPLAYER"]->GetRect()->y	+ TICKER_TOP_OFFSET;
		if(r->top < x)
			{
				r->top = guiMan->_guiElements["EXIT"]->GetRect()->y+ TICKER_TOP_OFFSET;
				r->bottom = guiMan->_guiElements["EXIT"]->GetRect()->y+TICKER_HEIGHT;
			}
		GUITexture* tex = (GUITexture*)(guiMan->_guiElements["Texture"]);
		tex->SetRect(r);	
		menuOptions = changeOptions(menuOptions, -1);
	}

	
		if(IPMan::GetIPMan()->GetKey(VK_RETURN))
			{
				switch(menuOptions)
				{
				case MENU_OPTIONS::SINGLEPLAYER: return GameState::Playing;
					break;
				case MENU_OPTIONS::MULTIPLAYER: return GameState::GameLobby;
					break;
				case MENU_OPTIONS::SETTINGS: return GameState::Settings;
					break;
				case MENU_OPTIONS::EXIT: 
					exit(1);
					return GameState::Lost;
					break;
				default: return GameState::MenuState;
					break;
				}
			}
		return GameState::MenuState;
}
//Funkcja obs³uguj¹ca przyciski w trybie edycji opcji
void optionsManager(int8_t przyciskLewo, int8_t przyciskPrawo, int8_t przyciskWyboru)
{
	if(optionChoose == 0)
	{
		if(przyciskLewo == 0)
		{
			changeOptions(-1);
			drawLCD_OptionsMode();
			_delay_ms(200);
		}
		else if(przyciskPrawo == 0)
		{
			changeOptions(1);
			drawLCD_OptionsMode();
			_delay_ms(200);
		}
		else if(przyciskWyboru == 0)
		{
			optionChoose = 1;
			editMode();
			_delay_ms(200);
		}
	}
	else if(optionChoose == 1)
	{
		if(przyciskLewo == 0)
		{
			changeOptionsValue(-1);
			drawLCD_OptionsMode();
			editMode();
			_delay_ms(200);
		}
		else if(przyciskPrawo == 0)
		{
			changeOptionsValue(1);
			drawLCD_OptionsMode();
			editMode();
			_delay_ms(200);
		}
		else if(przyciskWyboru == 0)
		{
			optionChoose = 0;
			elapsedTime = 0;
			editMode();
			_delay_ms(200);
		}
	}
}
Beispiel #3
0
QWidget *SimpleMessageStyle::createWidget(const IMessageStyleOptions &AOptions, QWidget *AParent)
{
	StyleViewer *view = new StyleViewer(AParent);
	view->setNetworkAccessManager(FNetworkAccessManager);
	changeOptions(view,AOptions,true);
	return view;
}
void Simulation::run() {
	int userChoice;
	while (userChoice = menu.displayMenu(MAIN_MENU)) {
		switch (userChoice) {
		case 1: // Run with current options
			loadSimulation();
			runSimulation();
		case 2: // View current options
			displayCurrentOptions();
			break;
		case 3: // Change current options
			changeOptions();
			break;
		case 4: // Randomize Options
			randomizeOptions();	
			break;
		default:
			return;
		}	
	}
}