void AdvanceDifficultySelection(int32 offset) { if(!m_currentSelection) return; MapIndex* map = m_maps[m_currentlySelectedId]; int32 newIdx = m_currentlySelectedDiff + offset; newIdx = Math::Clamp(newIdx, 0, (int32)map->difficulties.size() - 1); SelectDifficulty(newIdx); }
void UI::StartUI() { DisplayTitleScreen(); int result = StartMenu(); //Means quit game if (result == 1) { return; } CAI = SelectDifficulty(); //CurrentGame = Game(); PlacePieces(CurrentGame.GetP1Board()); GameResult gr = PlayGame(); return; }
void m_OnMapSelected(MapIndex* map) { // Update compact mode selection views if(m_currentSelection) m_currentSelection->SwitchCompact(true); m_currentSelection = m_guiElements[map]; m_currentSelection->SwitchCompact(false); //if(map && map->id == m_currentlySelectedId) // return; // Clamp diff selection int32 selectDiff = m_currentlySelectedDiff; if(m_currentlySelectedDiff >= (int32)map->difficulties.size()) { selectDiff = (int32)map->difficulties.size() - 1; } SelectDifficulty(selectDiff); OnMapSelected.Call(map); }