Exemplo n.º 1
0
 @Override
 protected void onAssetsLoaded(View view) {
   screen.addActor(view);
   addButtonListenersRecursively(view);
   if (view.getName().compareTo(MenuScreen.MAIN_MENU_VIEW) == 0) {
     view.setVisible(true);
     if (getMultiplayer() != null) {
       screen.enableMultiplayer(true);
       multiplayerController.onMainMenuAssetsLoaded();
     } else screen.enableMultiplayer(false);
   } else if (view.getName().compareTo(MenuScreen.USER_VIEW) == 0) {
     view.setVisible(true);
     initNickNameTextFieldListeners(view);
     getStatisticsController().addObserver((UserView) view);
   } else if (view.getName().compareTo(MenuScreen.NEW_GAME_VIEW) == 0) {
     screen.setRoomConfigFromUI(roomConfig);
   } else if (view.getName().compareTo(MenuScreen.COINS_VIEW) == 0) {
     getStatisticsController().addObserver((CoinsView) view);
   } else if (view.getName().compareTo(MenuScreen.STATISTICS_VIEW) == 0) {
     getStatisticsController().addObserver((StatisticsView) view);
   } else if (view.getName().compareTo(MenuScreen.SETTINGS_VIEW) == 0) {
     ((SettingsView) view)
         .initialiseLanguageButtons(getAssets().getLocalization().getLanguageKeys());
     ((SettingsView) view).setEventListener(this);
     ((SettingsView) view).updateView(getSettings().getSettingsModel());
   }
 }
Exemplo n.º 2
0
 private boolean getAndValidateRoomConfig() {
   screen.setRoomConfigFromUI(roomConfig);
   if (!getStatisticsController().hasEnoughtCoins(roomConfig.bet)) {
     showDialogue("Not enough coins", "You can either buy, or play for a smaller bet", false);
     goTo(MenuScreen.COINS_VIEW, -1, -1);
     return false;
   }
   return true;
 }