Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 11, 2010, 5:06:23 PM (14 years ago)
Author:
jo
Message:

Hud works. There's at least on bug to repair.

Location:
code/branches/lastmanstanding/src/orxonox/gametypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.cc

    r7636 r7640  
    6464                    this->spawnPlayer(it->first);
    6565                }
    66                 else if (0>=playerLives_[it->first])
    67                 {
    68                     if (it->first->getClientID()== CLIENTID_UNKNOWN)
    69                         continue;
    70                     const std::string& message2 = "You have lost all " +multi_cast<std::string>(lives)+ " lives." ;
    71                     this->gtinfo_->sendFadingMessage(message2,it->first->getClientID());
    72                 }
    7366            }
    7467    }
     
    115108            Host::Broadcast(message);
    116109        }
     110
    117111        return true;
    118112    }
     
    173167        this->playerDelayTime_[player]=respawnDelay;
    174168        this->inGame_[player]=true;
    175         //Update: EachPlayer's "Players in Game"-HUD
    176         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    177         {
    178             if (it->first->getClientID() == CLIENTID_UNKNOWN)
    179                 continue;
    180             const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
    181             this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    182         }
    183169    }
    184170
     
    192178            this->playerDelayTime_.erase (player);
    193179            this->inGame_.erase (player);
    194             //Update: EachPlayer's "Players in Game"-HUD
    195             for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    196             {
    197                 if (it->first->getClientID() == CLIENTID_UNKNOWN)
    198                     continue;
    199                 const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
    200                 this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    201             }
    202180        }
    203181
     
    211189        this->timeToAct_[player]=timeRemaining+3.0f+respawnDelay;//reset timer
    212190        this->playerDelayTime_[player]=respawnDelay;
    213         //Update: Individual Players "lifes"-HUD
    214         std::map<PlayerInfo*, Player>::iterator it2 = this->players_.find(player);
    215         if (it2 != this->players_.end())
    216         {
    217             if (it2->first->getClientID()== CLIENTID_UNKNOWN)
     191       
     192        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
     193        if (it != this->players_.end())
     194        {
     195            if (it->first->getClientID()== CLIENTID_UNKNOWN)
    218196                return;
    219             const std::string& message = "Your Lives: " +multi_cast<std::string>(playerLives_[player]);
    220             this->gtinfo_->sendFadingMessage(message,it2->first->getClientID());
    221             const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
    222             this->gtinfo_->sendStaticMessage(message1,it2->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    223         }
    224     }
    225 
    226     void LastManStanding::playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn)
    227     {
    228         //Update: EachPlayer's "Players in Game"-HUD
    229         for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    230         {
    231             if (it->first->getClientID() == CLIENTID_UNKNOWN)
    232                 continue;
    233             const std::string& message1 = "Remaining Players: "+ multi_cast<std::string>(playersAlive);
    234             this->gtinfo_->sendStaticMessage(message1,it->first->getClientID(),ColourValue(1.0f, 1.0f, 0.5f));
    235         }
     197            const std::string& message = ""; // resets Camper-Warning-message
     198            this->gtinfo_->sendFadingMessage(message,it->first->getClientID());
     199        } 
    236200    }
    237201
  • code/branches/lastmanstanding/src/orxonox/gametypes/LastManStanding.h

    r7636 r7640  
    7575            int playerGetLives(PlayerInfo* player); //!< getFunction for the map "playerLives_".
    7676            int getNumPlayersAlive() const; //!< Returns the number of players that are still alive.
    77             virtual void playerEntered(PlayerInfo* player); //!< Initializes values. Manages the gametype's HUD. #Players alive via StaticMessage.
    78             virtual bool playerLeft(PlayerInfo* player); //!< Manages the gametype's HUD. #Players alive via StaticMessage.
    79             virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Manages the gametype's HUD. player's lives via FadingMessage.
    80             virtual void playerStopsControllingPawn(PlayerInfo* player, Pawn* pawn);  //!< Manages the gametype's HUD. #Players alive via StaticMessage.
     77            virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
     78            virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
     79            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Resets punishment time and respawn delay.
    8180
    8281            void punishPlayer(PlayerInfo* player); //!< Function in order to kill a player. Punishment for hiding longer than "timeRemaining".
Note: See TracChangeset for help on using the changeset viewer.