Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10900


Ignore:
Timestamp:
Nov 30, 2015, 4:38:28 PM (8 years ago)
Author:
meierman
Message:

Judihui it works

Location:
code/branches/hoverHS15
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hoverHS15/data/overlays/HoverHUD.oxo

    r10895 r10900  
    88  <OverlayGroup name = "spaceshiphoverhud" scale = "1, 1">
    99    <TimeHUD
    10      name       = "Timer"
     10     name       = "TimerHUD"
    1111     position  = "0.95, 0.02"
    1212     pickpoint = "0.0, 0.0"
     
    1818
    1919    <FlagHUD
     20     name      = "FlagHUD"
    2021     position  = "0.05, 0.02"
    2122     size      = "0.18, 0.05"
  • code/branches/hoverHS15/src/modules/hover/FlagHUD.cc

    r10895 r10900  
    5252
    5353    void FlagHUD::setFlagCount(int flagCount) {
     54        if(flagCount == 0){
     55            this->panel_->hide();
     56            return;
     57        }
    5458        this->panel_->setDimensions(
    5559            this->panel_->_getRelativeWidth() / ((float) flagCount_) * ((float) flagCount),
     
    6165    }
    6266
    63     /*void FlagHUD::tick(float dt)
     67    void FlagHUD::tick(float dt)
    6468    {
    6569        SUPER(FlagHUD, tick, dt);
    6670
    67         if (this->hoverGame)
    68         {
    69             setFlagCount(2);
    70         }
    71     }*/
     71            setFlagCount(this->hoverGame->getFlags());
     72       
     73    }
    7274
    7375    void FlagHUD::changedOwner()
  • code/branches/hoverHS15/src/modules/hover/FlagHUD.h

    r10895 r10900  
    3838namespace orxonox
    3939{
    40     class _OverlaysExport FlagHUD : public OrxonoxOverlay //, public Tickable
     40    class _OverlaysExport FlagHUD : public OrxonoxOverlay , public Tickable
    4141    {
    4242    public:
     
    4444        virtual ~FlagHUD();
    4545
    46         //virtual void tick(float dt);
     46        virtual void tick(float dt);
    4747        virtual void changedOwner();
    4848
  • code/branches/hoverHS15/src/modules/hover/Hover.cc

    r10895 r10900  
    116116        if(firstTick)
    117117        {
     118
    118119            std::fill( g_Maze, g_Maze + NumCells * NumCells, 0 );
    119120            g_PtX=0;
     
    143144            for ( int i = 0; i < 5; i++ )
    144145                flagVector.push_back(new HoverFlag(origin_->getContext(), rand()%10, rand()%10));
     146
     147            Flags_ = flagVector.size();
    145148           
    146149            //new HoverFlag(origin_->getContext()); //Rechts in Y Richtung
     
    154157            }
    155158        }
    156 
    157 
    158 
    159     }
    160 
    161    
     159        Flags_ = flagVector.size();
     160
     161
     162
     163    }
     164
     165     int Hover::getFlags()
     166    {
     167
     168        // Call start for the parent class.
     169        return Flags_;
     170    }   
    162171
    163172    void Hover::start()
  • code/branches/hoverHS15/src/modules/hover/Hover.h

    r10894 r10900  
    8888                       { this->origin_ = origin; }
    8989
    90 
     90            int getFlags();
    9191            WeakPtr<HoverOrigin> origin_;
    9292
     
    9595            int RandomInt();
    9696            int RandomInt4();
    97 
     97            int Flags_;
    9898
    9999            bool IsDirValid( eDirection Dir );
  • code/branches/hoverHS15/src/modules/hover/TimeHUD.cc

    r10895 r10900  
    4343        this->_running = false;
    4444        this->hoverGame = 0;
     45        setRunning(true);
    4546    }
    4647
     
    8283            this->setCaption(getTimeString(this->_time));
    8384        }
     85        if(this->hoverGame->getFlags() == 0)
     86            setRunning(false);
    8487       
    8588    }
Note: See TracChangeset for help on using the changeset viewer.