Logo Search packages:      
Sourcecode: teg version File versions  Download package

TEG_STATUS set_sensitive_tb ( void   ) 

'prende' y 'apaga' los botones segun el estado del game

Definition at line 611 of file interface.c.

References PLAYER_STATUS_ATAQUE, PLAYER_STATUS_CONNECTED, PLAYER_STATUS_DESCONECTADO, PLAYER_STATUS_FICHAS, PLAYER_STATUS_FICHAS2, PLAYER_STATUS_FICHASC, PLAYER_STATUS_HABILITADO, PLAYER_STATUS_REAGRUPE, PLAYER_STATUS_START, PLAYER_STATUS_TARJETA, and PLAYER_STATUS_TROPAS.

{
      PLAYER_STATUS e = ESTADO_GET();

      /* CONNECT & START */
      if( e == PLAYER_STATUS_DESCONECTADO ) {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_CONNECT].widget,TRUE);
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_DISCONNECT].widget,FALSE);
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_START].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.connect_button, TRUE);
            gtk_widget_set_sensitive (SensiData.start_button, FALSE);

      } else if( e == PLAYER_STATUS_HABILITADO ) {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_CONNECT].widget,FALSE);
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_DISCONNECT].widget,TRUE);
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_START].widget,TRUE);
            gtk_widget_set_sensitive (SensiData.connect_button, FALSE);
            gtk_widget_set_sensitive (SensiData.start_button, TRUE);

      } else {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_CONNECT].widget,FALSE);
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_DISCONNECT].widget,TRUE);
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_START].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.connect_button, FALSE);
            gtk_widget_set_sensitive (SensiData.start_button, FALSE);
      }

      if( g_game.with_ggz ) {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_CONNECT].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.connect_button, FALSE);
      } 
      if( g_game.observer ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_START].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.start_button, FALSE);
      }

      /* STATUS */
      if( e == PLAYER_STATUS_DESCONECTADO ) {
            gtk_widget_set_sensitive( view_menu_uiinfo[ON_STATUS].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.status_button, FALSE);
      } else {
            gtk_widget_set_sensitive( view_menu_uiinfo[ON_STATUS].widget,TRUE);
            gtk_widget_set_sensitive (SensiData.status_button, TRUE);
      }

      /* ATAQUE */
      if( e == PLAYER_STATUS_ATAQUE ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_ATTACK_RE].widget,TRUE);
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_ATTACK_RESET].widget,TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_ATTACK_RE].widget,FALSE);
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_ATTACK_RESET].widget,FALSE);
      }

      /* ENVIAR FICHAS */
      if( e==PLAYER_STATUS_FICHAS || e==PLAYER_STATUS_FICHAS2 || e==PLAYER_STATUS_FICHASC ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_FICHAS].widget,TRUE);
            gtk_widget_set_sensitive (SensiData.enviarfichas_button, TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_FICHAS].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.enviarfichas_button, FALSE);
      }

      /* REAGRUPE */
      if( e==PLAYER_STATUS_ATAQUE || e==PLAYER_STATUS_TROPAS ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_REGROUP].widget,TRUE);
            gtk_widget_set_sensitive (SensiData.reagrupe_button, TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_REGROUP].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.reagrupe_button, FALSE);
      }

      /* GET CARD */
      if( e==PLAYER_STATUS_ATAQUE || e==PLAYER_STATUS_TROPAS || e==PLAYER_STATUS_REAGRUPE ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_GETCARD].widget,TRUE);
            gtk_widget_set_sensitive (SensiData.getcard_button, TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_GETCARD].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.getcard_button, FALSE);
      }

      /* END TURN */
      if( e==PLAYER_STATUS_ATAQUE || e==PLAYER_STATUS_TROPAS || e==PLAYER_STATUS_REAGRUPE || e==PLAYER_STATUS_TARJETA) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_ENDTURN].widget,TRUE);
            gtk_widget_set_sensitive (SensiData.endturn_button, TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_ENDTURN].widget,FALSE);
            gtk_widget_set_sensitive (SensiData.endturn_button, FALSE);
      }

      /* UPDATE MAP */
      if( e >= PLAYER_STATUS_START || (g_game.observer && e >= PLAYER_STATUS_CONNECTED) ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_UPDATEMAP].widget,TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_UPDATEMAP].widget,FALSE);
      }

      /* VIEW CARDS, MISSION */
      if( e >= PLAYER_STATUS_START ) {
            gtk_widget_set_sensitive( view_menu_uiinfo[ON_MISSION].widget,TRUE);
            gtk_widget_set_sensitive( view_menu_uiinfo[ON_CARDS].widget,TRUE);
      } else {
            gtk_widget_set_sensitive( view_menu_uiinfo[ON_MISSION].widget,FALSE);
            gtk_widget_set_sensitive( view_menu_uiinfo[ON_CARDS].widget,FALSE);
      }

      /* LAUNCH ROBOT */
      if( e >= PLAYER_STATUS_CONNECTED && e < PLAYER_STATUS_START ) {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_LAUNCHROBOT].widget,TRUE);
      } else {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_LAUNCHROBOT].widget,FALSE);
      }

      /* SURRENDER */
      if( e>=PLAYER_STATUS_START ) {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_SURRENDER].widget,TRUE);
      } else {
            gtk_widget_set_sensitive( actions_menu_uiinfo[ON_SURRENDER].widget,FALSE);
      }

      /* SCORES */
      if( e >= PLAYER_STATUS_CONNECTED ) {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_SCORES].widget,TRUE);
      } else {
            gtk_widget_set_sensitive( game_menu_uiinfo[ON_SCORES].widget,FALSE);
      }


      return TEG_STATUS_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index