/* * Draws the buttons for one page to chose the act and one page for each act * can chose the levels per act * if savegame is not good enough it'll make the levels not loadable */ protected void drawLevelSelectionButtons() { text = " "; headline = " "; textFont = ((Spectrum)game).smallHeadlineFont; switch (Spectrum.currentAct) { case SpectrumEnums.Act.Prolog: headline = "Prolog"; level1 = buttonHandler.getLevel1Button(); level1.setRefLevel(SpectrumEnums.Levels.LevelP_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.LevelP_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); level2 = buttonHandler.getLevel2Button(); level2.setRefLevel(SpectrumEnums.Levels.LevelP_1); //lock levels that has not been reached yet if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.LevelP_1) { level2.setLocked(true); } else { level2.setLocked(false); } buttonHandler.Add(level2); level3 = buttonHandler.getLevel3Button(); level3.setRefLevel(SpectrumEnums.Levels.LevelP_2); //lock levels that has not been reached yet if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.LevelP_2) { level3.setLocked(true); } else { level3.setLocked(false); } buttonHandler.Add(level3); text = "1 2 3"; break; case SpectrumEnums.Act.Act1: headline = "Act I"; level1 = buttonHandler.getLevel1Button(); level1.setRefLevel(SpectrumEnums.Levels.Level1_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level1_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); level2 = buttonHandler.getLevel3Button(); level2.setRefLevel(SpectrumEnums.Levels.Level1_1); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level1_1) { level2.setLocked(true); } else { level2.setLocked(false); } buttonHandler.Add(level2); text = "1 2"; break; case SpectrumEnums.Act.Act2: headline = "Act II"; level1 = buttonHandler.getLevel1Button(); level1.setRefLevel(SpectrumEnums.Levels.Level2_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level2_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); level2 = buttonHandler.getLevel3Button(); level2.setRefLevel(SpectrumEnums.Levels.Level2_1); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level2_1) { level2.setLocked(true); } else { level2.setLocked(false); } buttonHandler.Add(level2); text = "1 2"; break; case SpectrumEnums.Act.Act3: headline = "Act III"; level1 = buttonHandler.getLevel1Button(); level1.setRefLevel(SpectrumEnums.Levels.Level3_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level3_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); level2 = buttonHandler.getLevel3Button(); level2.setRefLevel(SpectrumEnums.Levels.Level3_1); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level3_1) { level2.setLocked(true); } else { level2.setLocked(false); } buttonHandler.Add(level2); text = "1 2"; break; case SpectrumEnums.Act.Act4: headline = "Act IV"; level1 = buttonHandler.getLevel1Button(); level1.setRefLevel(SpectrumEnums.Levels.Level4_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level4_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); level2 = buttonHandler.getLevel3Button(); level2.setRefLevel(SpectrumEnums.Levels.Level4_1); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level4_1) { level2.setLocked(true); } else { level2.setLocked(false); } buttonHandler.Add(level2); text = "1 2"; break; case SpectrumEnums.Act.Act5: headline = "Act V"; level1 = buttonHandler.getLevel1Button(); level1.setRefLevel(SpectrumEnums.Levels.Level5_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level5_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); level2 = buttonHandler.getLevel3Button(); level2.setRefLevel(SpectrumEnums.Levels.Level5_1); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.Level5_1) { level2.setLocked(true); } else { level2.setLocked(false); } buttonHandler.Add(level2); text = "1 2"; break; case SpectrumEnums.Act.Epilog: headline = "Epilog"; level1 = buttonHandler.getLevel2Button(); level1.setRefLevel(SpectrumEnums.Levels.LevelE_0); if ((int)Spectrum.currentLevel < (int)SpectrumEnums.Levels.LevelE_0) { level1.setLocked(true); } else { level1.setLocked(false); } buttonHandler.Add(level1); text = " 1"; break; default: selectProlog = buttonHandler.getPrologButton(); selectAct1 = buttonHandler.getAct1Button(); selectAct2 = buttonHandler.getAct2Button(); selectAct3 = buttonHandler.getAct3Button(); selectAct4 = buttonHandler.getAct4Button(); selectAct5 = buttonHandler.getAct5Button(); selectEpilog = buttonHandler.getEpilogButton(); selectProlog.setRefAct(SpectrumEnums.Act.Prolog); selectAct1.setRefAct(SpectrumEnums.Act.Act1); selectAct2.setRefAct(SpectrumEnums.Act.Act2); selectAct3.setRefAct(SpectrumEnums.Act.Act3); selectAct4.setRefAct(SpectrumEnums.Act.Act4); selectAct5.setRefAct(SpectrumEnums.Act.Act5); selectEpilog.setRefAct(SpectrumEnums.Act.Epilog); buttonHandler.Add(selectProlog); buttonHandler.Add(selectAct1); buttonHandler.Add(selectAct2); buttonHandler.Add(selectAct3); buttonHandler.Add(selectAct4); buttonHandler.Add(selectAct5); buttonHandler.Add(selectEpilog); break; } }
/* * Sets the Buttons depending in popUp id */ public void setButtons() { switch (currentStyle) { case SpectrumEnums.popUpId.custom: closeButton = buttonHandler.getCloseButton(); buttonHandler.Add(closeButton); break; case SpectrumEnums.popUpId.win: retryButton = buttonHandler.getRetryButton(); continueButton = buttonHandler.getContinueButton(); continueButton.setRefLevel(screenManager.getNextLevel(Spectrum.lastPlayedLevel)); buttonHandler.Add(retryButton); buttonHandler.Add(continueButton); break; case SpectrumEnums.popUpId.lose: retryButton = buttonHandler.getRetryButton(); homeButton = buttonHandler.getHomeButton(); buttonHandler.Add(retryButton); buttonHandler.Add(homeButton); break; case SpectrumEnums.popUpId.mainMenu: drawMainMenu(); break; case SpectrumEnums.popUpId.settingsMenu: drawSettingsMenu(); break; case SpectrumEnums.popUpId.levelSelection: drawLevelSelection(); break; case SpectrumEnums.popUpId.musicSettings: drawMusicSettings(); break; case SpectrumEnums.popUpId.deleteSaveFile: drawDeleteSaveFile(); break; case SpectrumEnums.popUpId.gameAnalytics: drawGameAnalytics(); break; default: break; } buttonHandler.setParent(this); }