Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation3/src/orxonox/controllers/NewHumanController.cc @ 7075

Last change on this file since 7075 was 7075, checked in by landauf, 14 years ago

removed some tabs and adjusted formatting in some fps related files

  • Property svn:eol-style set to native
File size: 23.4 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Michael Wirth
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#include "NewHumanController.h"
30
31#include <cmath>
32#include <OgreRay.h>
33#include <OgreSceneQuery.h>
34#include <OgreCamera.h>
35#include <OgreSceneManager.h>
36#include <bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
37
38#include "core/CoreIncludes.h"
39#include "core/ConsoleCommand.h"
40#include "worldentities/ControllableEntity.h"
41#include "worldentities/pawns/Pawn.h"
42#include "infos/PlayerInfo.h"
43#include "overlays/OrxonoxOverlay.h"
44#include "graphics/Camera.h"
45#include "sound/SoundManager.h"
46#include "tools/BulletConversions.h"
47#include "Scene.h"
48
49namespace orxonox
50{
51    SetConsoleCommand(NewHumanController, changeMode, false).keybindMode(KeybindMode::OnPress);
52    SetConsoleCommand(NewHumanController, accelerate, false).keybindMode(KeybindMode::OnPress);
53    SetConsoleCommand(NewHumanController, decelerate, false).keybindMode(KeybindMode::OnPress);
54    SetConsoleCommand(NewHumanController, unfire,      true).keybindMode(KeybindMode::OnRelease);
55
56    CreateUnloadableFactory(NewHumanController);
57
58    NewHumanController* NewHumanController::localController_s = 0;
59
60    NewHumanController::NewHumanController(BaseObject* creator)
61        : HumanController(creator)
62        , crossHairOverlay_(NULL)
63        , centerOverlay_(NULL)
64        , damageOverlayTop_(NULL)
65        , damageOverlayRight_(NULL)
66        , damageOverlayBottom_(NULL)
67        , damageOverlayLeft_(NULL)
68        , damageOverlayTT_(0)
69        , arrowsOverlay1_(NULL)
70        , arrowsOverlay2_(NULL)
71        , arrowsOverlay3_(NULL)
72        , arrowsOverlay4_(NULL)
73    {
74        RegisterObject(NewHumanController);
75
76        overlaySize_ = 0.08f;
77        arrowsSize_ = 0.4f;
78
79        damageOverlayTime_ = 0.6f;
80
81        controlMode_ = 0;
82        acceleration_ = 0;
83        accelerating_ = false;
84        firemode_ = -1;
85
86        showArrows_ = true;
87        showOverlays_ = false;
88        showDamageOverlay_ = true;
89
90        //currentPitch_ = 1;
91        //currentYaw_ = 1;
92
93        if (GameMode::showsGraphics())
94        {
95            crossHairOverlay_ = new OrxonoxOverlay(this);
96            crossHairOverlay_->setBackgroundMaterial("Orxonox/Crosshair3");
97            crossHairOverlay_->setSize(Vector2(overlaySize_, overlaySize_));
98            crossHairOverlay_->hide();
99            //crossHairOverlay_->setAspectCorrection(true); not working
100
101            centerOverlay_ = new OrxonoxOverlay(this);
102            centerOverlay_->setBackgroundMaterial("Orxonox/CenterOverlay");
103            centerOverlay_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
104            centerOverlay_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f));
105            centerOverlay_->hide();
106
107            if (showDamageOverlay_)
108            {
109                damageOverlayTop_ = new OrxonoxOverlay(this);
110                damageOverlayTop_->setBackgroundMaterial("Orxonox/DamageOverlayTop");
111                damageOverlayTop_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
112                damageOverlayTop_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f));
113                damageOverlayTop_->hide();
114
115                damageOverlayRight_ = new OrxonoxOverlay(this);
116                damageOverlayRight_->setBackgroundMaterial("Orxonox/DamageOverlayRight");
117                damageOverlayRight_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
118                damageOverlayRight_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f));
119                damageOverlayRight_->hide();
120
121                damageOverlayBottom_ = new OrxonoxOverlay(this);
122                damageOverlayBottom_->setBackgroundMaterial("Orxonox/DamageOverlayBottom");
123                damageOverlayBottom_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
124                damageOverlayBottom_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f));
125                damageOverlayBottom_->hide();
126
127                damageOverlayLeft_ = new OrxonoxOverlay(this);
128                damageOverlayLeft_->setBackgroundMaterial("Orxonox/DamageOverlayLeft");
129                damageOverlayLeft_->setSize(Vector2(overlaySize_ * 2.5f, overlaySize_ * 2.5f));
130                damageOverlayLeft_->setPosition(Vector2(0.5f - overlaySize_*2.5f/2.0f, 0.5f - overlaySize_*2.5f/2.0f));
131                damageOverlayLeft_->hide();
132            }
133
134            if (showArrows_)
135            {
136                arrowsOverlay1_ = new OrxonoxOverlay(this);
137                arrowsOverlay1_->setBackgroundMaterial("Orxonox/DirectionArrows1");
138                arrowsOverlay1_->setSize(Vector2(0.02727f, 0.36f * arrowsSize_));
139                arrowsOverlay1_->setPickPoint(Vector2(0.5f, 0.5f));
140                arrowsOverlay1_->setPosition(Vector2(0.5f, 0.5f));
141                arrowsOverlay1_->hide();
142
143                arrowsOverlay2_ = new OrxonoxOverlay(this);
144                arrowsOverlay2_->setBackgroundMaterial("Orxonox/DirectionArrows2");
145                arrowsOverlay2_->setSize(Vector2(0.02727f, 0.59f * arrowsSize_));
146                arrowsOverlay2_->setPickPoint(Vector2(0.5f, 0.5f));
147                arrowsOverlay2_->setPosition(Vector2(0.5f, 0.5f));
148                arrowsOverlay2_->hide();
149
150                arrowsOverlay3_ = new OrxonoxOverlay(this);
151                arrowsOverlay3_->setBackgroundMaterial("Orxonox/DirectionArrows3");
152                arrowsOverlay3_->setSize(Vector2(0.02727f, 0.77f * arrowsSize_));
153                arrowsOverlay3_->setPickPoint(Vector2(0.5f, 0.5f));
154                arrowsOverlay3_->setPosition(Vector2(0.5f, 0.5f));
155                arrowsOverlay3_->hide();
156
157                arrowsOverlay4_ = new OrxonoxOverlay(this);
158                arrowsOverlay4_->setBackgroundMaterial("Orxonox/DirectionArrows4");
159                arrowsOverlay4_->setSize(Vector2(0.02727f, arrowsSize_));
160                arrowsOverlay4_->setPickPoint(Vector2(0.5f, 0.5f));
161                arrowsOverlay4_->setPosition(Vector2(0.5f, 0.5f));
162                arrowsOverlay4_->hide();
163            }
164        }
165
166        // HACK: Define which objects are targetable when considering the creator of an orxonox::Model
167        this->targetMask_.exclude(ClassByString("BaseObject"));
168        this->targetMask_.include(ClassByString("WorldEntity"));
169        this->targetMask_.exclude(ClassByString("Projectile"));
170
171        NewHumanController::localController_s = this;
172
173        controlPaused_ = false;
174
175        //HumanController::localController_s->getControllableEntity()->getCamera()->setDrag(true);
176    }
177
178    NewHumanController::~NewHumanController()
179    {
180        if (this->isInitialized())
181        {
182            if (this->crossHairOverlay_)
183                this->crossHairOverlay_->destroy();
184            if (this->centerOverlay_)
185                this->centerOverlay_->destroy();
186
187            if (this->arrowsOverlay1_)
188                this->arrowsOverlay1_->destroy();
189            if (this->arrowsOverlay2_)
190                this->arrowsOverlay2_->destroy();
191            if (this->arrowsOverlay3_)
192                this->arrowsOverlay3_->destroy();
193            if (this->arrowsOverlay4_)
194                this->arrowsOverlay4_->destroy();
195            if (this->damageOverlayTop_)
196                this->damageOverlayTop_->destroy();
197            if (this->damageOverlayLeft_)
198                this->damageOverlayLeft_->destroy();
199            if (this->damageOverlayRight_)
200                this->damageOverlayRight_->destroy();
201            if (this->damageOverlayBottom_)
202                this->damageOverlayBottom_->destroy();
203        }
204    }
205
206    void NewHumanController::tick(float dt)
207    {
208        if (GameMode::showsGraphics())
209        {
210
211            if (this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
212            {
213                this->updateTarget();
214
215                if (!controlPaused_ )
216                {
217                    if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
218                        this->showOverlays();
219                    else if (this->getControllableEntity() &&  this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
220                    {
221                        this->showOverlays();
222                        this->hideArrows();
223                    }
224
225                    this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5f-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5f-overlaySize_/2));
226
227                    if (this->controlMode_ == 0 || (this->controlMode_ == 1 && this->firemode_ == 1))
228                    {
229                        if (this->showOverlays_ && this->showArrows_)
230                            alignArrows();
231                    }
232                    else
233                        hideArrows();
234
235                    if (this->showDamageOverlay_ && (this->damageOverlayTT_ > 0 || this->damageOverlayTR_ > 0 || this->damageOverlayTB_ > 0 || this->damageOverlayTL_ > 0))
236                    {
237                        this->damageOverlayTT_ -= dt;
238                        this->damageOverlayTR_ -= dt;
239                        this->damageOverlayTB_ -= dt;
240                        this->damageOverlayTL_ -= dt;
241                        if (this->damageOverlayTT_ <= 0)
242                            this->damageOverlayTop_->hide();
243                        if (this->damageOverlayTR_ <= 0)
244                            this->damageOverlayRight_->hide();
245                        if (this->damageOverlayTB_ <= 0)
246                            this->damageOverlayBottom_->hide();
247                        if (this->damageOverlayTL_ <= 0)
248                            this->damageOverlayLeft_->hide();
249                    }
250                }
251            }
252            else
253                this->hideOverlays();
254
255            if (this->acceleration_ > 0)
256            {
257                if (this->accelerating_)
258                    HumanController::moveFrontBack(Vector2(1, 0));
259                else
260                    HumanController::moveFrontBack(Vector2(this->acceleration_, 0));
261                this->accelerating_ = false;
262                //HumanController::moveFrontBack(Vector2(clamp(this->acceleration_ + this->currentAcceleration_, 0.0f, 1.0f), 0));
263            }
264        }
265
266        // Reset pitch and yaw rates
267        // TODO: Reactivate this to fix the game pad problem with 0 input
268        //this->currentPitch_ = 0;
269        //this->currentYaw_ = 0;
270
271        HumanController::tick(dt);
272    }
273
274    void NewHumanController::doFire(unsigned int firemode)
275    {
276        if (!this->controllableEntity_)
277            return;
278
279        this->firemode_ = firemode;
280
281        if (firemode == 1 && this->controlMode_ == 1)
282        {
283            //unlocked steering, steer on right mouse click
284            HumanController::yaw(Vector2(this->currentYaw_, 0));
285            HumanController::pitch(Vector2(this->currentPitch_, 0));
286        }
287        else
288            HumanController::localController_s->getControllableEntity()->fire(firemode);
289
290    }
291
292    void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage)
293    {
294        if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook())
295        {
296            Vector3 posA;
297            if (originator)
298                posA = originator->getWorldPosition();
299            else
300                posA = multi_cast<Vector3>(contactpoint.getPositionWorldOnA());
301            //Vector3 posB = multi_cast<Vector3>(contactpoint.getPositionWorldOnB());
302            //posA and posB are almost identical
303
304            Vector3 relativeHit = this->getControllableEntity()->getWorldOrientation().UnitInverse() * (this->getControllableEntity()->getWorldPosition() - posA);
305
306            //back is z positive
307            //x is left positive
308            //y is down positive
309            relativeHit.normalise();
310
311            float threshold = 0.3f;
312            if (relativeHit.x > threshold) // Left
313            {
314                this->damageOverlayLeft_->show();
315                this->damageOverlayTL_ = this->damageOverlayTime_;
316                //this->damageOverlayLeft_->setBackgroundAlpha(0.3);
317            }
318            if (relativeHit.x < -threshold) //Right
319            {
320                this->damageOverlayRight_->show();
321                this->damageOverlayTR_ = this->damageOverlayTime_;
322                //this->damageOverlayRight_->setBackgroundAlpha(0.3);
323            }
324            if (relativeHit.y > threshold) //Top
325            {
326                this->damageOverlayBottom_->show();
327                this->damageOverlayTB_ = this->damageOverlayTime_;
328                //this->damageOverlayTop_->setBackgroundAlpha(0.3);
329            }
330            if (relativeHit.y < -threshold) //Bottom
331            {
332                this->damageOverlayTop_->show();
333                this->damageOverlayTT_ = this->damageOverlayTime_;
334                //this->damageOverlayBottom_->setBackgroundAlpha(0.3);
335            }
336        }
337    }
338
339    void NewHumanController::unfire()
340    {
341        if (NewHumanController::localController_s)
342            NewHumanController::localController_s->doUnfire();
343    }
344
345    void NewHumanController::doUnfire()
346    {
347        this->firemode_ = -1;
348        hideArrows();
349    }
350
351    void NewHumanController::updateTarget()
352    {
353        Ogre::RaySceneQuery * rsq = HumanController::localController_s->getControllableEntity()->getScene()->getSceneManager()->createRayQuery(Ogre::Ray());
354
355        Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getOgreCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5f, static_cast<float>(this->currentPitch_)/2*-1+.5f);
356
357        rsq->setRay(mouseRay);
358        rsq->setSortByDistance(true);
359
360        /*
361        Distance of objects:
362        ignore everything under 200 maybe even take 1000 as min distance to shoot at
363
364        shots are regularly traced and are entities!!!!!!!!! this is the biggest problem
365        they vanish only after a distance of 10'000
366        */
367
368
369        Ogre::RaySceneQueryResult& result = rsq->execute();
370        Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
371        WorldEntity* myWe = static_cast<WorldEntity*>(this->getControllableEntity());
372
373        Ogre::RaySceneQueryResult::iterator itr;
374        for (itr = result.begin(); itr != result.end(); ++itr)
375        {
376//             CCOUT(0) << "testing object as target" << endl;
377            if (itr->movable->isInScene() && itr->movable->getMovableType() == "Entity" /*&& itr->distance > 500*/)
378            {
379                // Try to cast the user pointer
380                WorldEntity* wePtr = dynamic_cast<WorldEntity*>(Ogre::any_cast<OrxonoxClass*>(itr->movable->getUserAny()));
381
382                // make sure we don't shoot ourselves
383                if( wePtr==myWe )
384                    continue;
385
386                if (wePtr)
387                {
388                    // go through all parents of object and look whether they are sightable or not
389                    bool isSightable = false;
390                    WorldEntity* parent = wePtr->getParent();
391                    while (parent)
392                    {
393                        if (this->targetMask_.isExcluded(parent->getIdentifier()) || parent==myWe)
394                        {
395                            parent = parent->getParent();
396                            continue;
397                        }
398                        else
399                        {
400                            isSightable = true;
401                            break;
402                        }
403                    }
404                    if (!isSightable)
405                        continue;
406                }
407
408                if (this->getControllableEntity() && this->getControllableEntity()->getTarget() != wePtr)
409                    this->getControllableEntity()->setTarget(wePtr);
410
411                if (pawn)
412                    pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance );
413
414                //itr->movable->getParentSceneNode()->showBoundingBox(true);
415                //return mouseRay.getOrigin() + mouseRay.getDirection() * itr->distance; //or itr->movable->getParentSceneNode()->_getDerivedPosition()
416                return;
417            }
418        }
419
420        if (pawn)
421            pawn->setAimPosition( mouseRay.getOrigin() + mouseRay.getDirection() * 1200 );
422
423        if( this->getControllableEntity() && this->getControllableEntity()->getTarget() != 0 )
424            this->getControllableEntity()->setTarget( 0 );
425
426        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getWorldOrientation() * Vector3::NEGATIVE_UNIT_Z * 2000);
427        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getCamera()->getOgreCamera()->getOrientation() * Vector3::NEGATIVE_UNIT_Z);
428    }
429
430    void NewHumanController::frontback(const Vector2& value)
431    {
432        this->accelerating_ = true;
433
434        //if (this->acceleration_ == 0)
435        HumanController::frontback(value);
436    }
437
438    void NewHumanController::yaw(const Vector2& value)
439    {
440        //SUPER(NewHumanController, yaw, value);
441        if (this->controlMode_ == 0 || (this->controllableEntity_ && this->controllableEntity_->isInMouseLook()))
442            HumanController::yaw(value);
443
444        if (this->getControllableEntity() && !this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
445            this->currentYaw_ = value.x;
446    }
447
448    void NewHumanController::pitch(const Vector2& value)
449    {
450        //SUPER(NewHumanController, pitch, value);
451        if (this->controlMode_ == 0 || (this->controllableEntity_ && this->controllableEntity_->isInMouseLook()))
452            HumanController::pitch(value);
453
454        if (this->getControllableEntity() && !this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
455            this->currentPitch_ = value.x;
456    }
457
458    void NewHumanController::changeMode()
459    {
460        if (NewHumanController::localController_s)
461        {
462            if (NewHumanController::localController_s->controlMode_ == 0)
463            {
464                NewHumanController::localController_s->controlMode_ = 1;
465                NewHumanController::localController_s->hideArrows();
466            }
467            else
468                NewHumanController::localController_s->controlMode_ = 0;
469        }
470    }
471
472    void NewHumanController::changedControllableEntity()
473    {
474        this->controlMode_ = 0;
475        this->currentYaw_ = 0;
476        this->currentPitch_ = 0;
477        if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
478        {
479            this->showOverlays_ = true;
480            if (!this->controlPaused_)
481            {
482                this->showOverlays();
483                this->alignArrows();
484            }
485        }
486        else
487        {
488            this->showOverlays_ = false;
489            this->hideOverlays();
490        }
491    }
492
493    void NewHumanController::accelerate()
494    {
495        if (NewHumanController::localController_s)
496            NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ + 0.2f, 0.00f, 1.0f);
497    }
498
499    void NewHumanController::decelerate()
500    {
501        if (NewHumanController::localController_s)
502            NewHumanController::localController_s->acceleration_ = clamp(NewHumanController::localController_s->acceleration_ - 0.1f, 0.0f, 1.0f);
503    }
504
505    void NewHumanController::doResumeControl()
506    {
507        this->controlPaused_ = false;
508        if (this->showOverlays_)
509            this->showOverlays();
510    }
511
512    void NewHumanController::doPauseControl()
513    {
514        this->controlPaused_ = true;
515        this->hideOverlays();
516    }
517
518    void NewHumanController::alignArrows()
519    {
520        if (showArrows_)
521        {
522            hideArrows();
523
524            float distance = sqrt(pow(static_cast<float>(this->currentYaw_)/2*-1,2) + pow(static_cast<float>(this->currentPitch_)/2*-1,2));
525
526            if (distance > 0.04f && distance <= 0.59f * arrowsSize_ / 2.0f )
527            {
528                this->arrowsOverlay1_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
529                this->arrowsOverlay1_->show();
530            }
531            else if (distance > 0.59f * arrowsSize_ / 2.0f && distance <= 0.77f * arrowsSize_ / 2.0f )
532            {
533                this->arrowsOverlay2_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
534                this->arrowsOverlay2_->show();
535            }
536            else if (distance > 0.77f * arrowsSize_ / 2.0f && distance <= arrowsSize_ / 2.0f)
537            {
538                this->arrowsOverlay3_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
539                this->arrowsOverlay3_->show();
540            }
541            else if (distance > arrowsSize_ / 2.0f)
542            {
543                this->arrowsOverlay4_->setRotation(Degree(-90 + -1.0f * atan2(static_cast<float>(this->currentPitch_)/2*-1, static_cast<float>(this->currentYaw_)/2*-1) / (2.0f * Ogre::Math::PI) * 360.0f));
544                this->arrowsOverlay4_->show();
545            }
546        }
547    }
548
549    void NewHumanController::showOverlays()
550    {
551        if (!GameMode::showsGraphics())
552            return;
553        this->crossHairOverlay_->show();
554        this->centerOverlay_->show();
555
556        if (showArrows_)
557        {
558            this->arrowsOverlay1_->show();
559            this->arrowsOverlay2_->show();
560            this->arrowsOverlay3_->show();
561            this->arrowsOverlay4_->show();
562        }
563    }
564
565    void NewHumanController::hideOverlays()
566    {
567        if (!GameMode::showsGraphics())
568            return;
569        this->crossHairOverlay_->hide();
570        this->centerOverlay_->hide();
571
572        if (showDamageOverlay_)
573        {
574            this->damageOverlayTop_->hide();
575            this->damageOverlayRight_->hide();
576            this->damageOverlayBottom_->hide();
577            this->damageOverlayLeft_->hide();
578        }
579
580        this->hideArrows();
581    }
582
583    void NewHumanController::hideArrows()
584    {
585        if(!GameMode::showsGraphics())
586            return;
587        if (showArrows_)
588        {
589            this->arrowsOverlay1_->hide();
590            this->arrowsOverlay2_->hide();
591            this->arrowsOverlay3_->hide();
592            this->arrowsOverlay4_->hide();
593        }
594    }
595
596
597
598
599
600}
Note: See TracBrowser for help on using the repository browser.