Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7640


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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lastmanstanding/data/levels/gametype_dynamicmatch.oxw

    r7163 r7640  
    6868<?lua
    6969max = 20
    70 for i = 1, max, 1
     70for i = 0, max, 1
    7171do
    7272    y = math.sin(i/max*6)*4000
    7373    z = math.cos(i/max*6)*5000
    74     x = i*100
     74    x = 0
    7575    ?>
    7676<?lua
  • code/branches/lastmanstanding/data/overlays/lastmanstandinghud.oxo

    r7637 r7640  
    22  <OverlayGroup name="DynamicmatcHUD" scale = "1, 1">
    33   
    4  <GametypeStaticMessage
     4 <!--GametypeStaticMessage
    55   name     = "staticmessage"
    66   position = "0.5, 0.01"
     
    1010   colour   = "1.0, 1.0, 0.5, 1.0"
    1111   align    = "center"
    12   />
     12  /-->
    1313
    1414<GametypeFadingMessage
    1515     name     = "fadingmessage"
    16      position = "0.5, 0.05"
     16     position = "0.5, 0.01"
    1717     font     = "VeraMono"
    1818     textsize = 0.04
    1919     colour   = "1.0, 1.0, 0.5, 1.0"
    2020     align    = "center"
    21     />
    22     <LastManStandingInfos
    23      position  = "0.63, 0.05"
    24      pickpoint = "0.0, 0.0"
    25      font      = "ShareTechMono"
    26      textsize  = 0.04
    27      colour    = "0.8, 0.8, 1.0, 1.0"
    28      align     = "right"
    29 
    30      showlives     = true
    31      showplayers     = false
    3221    />
    3322
     
    4231    />
    4332
     33    <LastManStandingInfos
     34     position  = "0.15, 0.02"
     35     pickpoint = "0.0, 0.0"
     36     font      = "ShareTechMono"
     37     textsize  = 0.04
     38     colour    = "1.0, 1.0, 1.0, 1.0"
     39     align     = "left"
     40
     41     showlives     = true
     42     showplayers     = false
     43    />
     44
    4445    <OverlayText
    4546     position  = "0.02, 0.055"
     
    5051     align     = "left"
    5152     caption   = "Players: "
     53    />
     54
     55    <LastManStandingInfos
     56     position  = "0.15, 0.055"
     57     pickpoint = "0.0, 0.0"
     58     font      = "ShareTechMono"
     59     textsize  = 0.04
     60     colour    = "1.0, 1.0, 1.0, 1.0"
     61     align     = "left"
     62
     63     showlives     = false
     64     showplayers     = true
    5265    />
    5366
  • 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.