Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (15 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/questsystem/AddQuestHint.cc

    r5781 r6417  
    7171
    7272        XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode);
    73        
     73
    7474        COUT(3) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl;
    7575    }
     
    9090            return false;
    9191        }
    92        
     92
    9393        this->hintId_ = id;
    9494        return true;
  • code/trunk/src/modules/questsystem/AddReward.cc

    r5781 r6417  
    6767
    6868        XMLPortObject(AddReward, Rewardable, "", addRewardable, getRewardables, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New AddReward, with " << this->rewards_.size() << " Rewardables created." << std::endl;
    7171    }
     
    104104    {
    105105        COUT(3) << "AddReward on player: " << player << " ." << std::endl;
    106        
     106
    107107        bool check = true;
    108108        for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward )
     
    110110            check = check && (*reward)->reward(player);
    111111        }
    112        
     112
    113113        COUT(3) << "Rewardable successfully added to player." << player << " ." << std::endl;
    114114
  • code/trunk/src/modules/questsystem/ChangeQuestStatus.cc

    r5781 r6417  
    8383            return false;
    8484        }
    85        
     85
    8686        this->questId_ = id;
    8787        return true;
  • code/trunk/src/modules/questsystem/CompleteQuest.cc

    r5781 r6417  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    6767    {
    6868        SUPER(CompleteQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    7171    }
  • code/trunk/src/modules/questsystem/FailQuest.cc

    r5781 r6417  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    6767    {
    6868        SUPER(FailQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        COUT(3) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    7171    }
     
    103103            return false;
    104104        }
    105        
     105
    106106        COUT(3) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl;
    107107        return true;
  • code/trunk/src/modules/questsystem/GlobalQuest.cc

    r5781 r6417  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    5959
    6060    }
    61    
     61
    6262    /**
    6363    @brief
     
    6767    {
    6868        SUPER(GlobalQuest, XMLPort, xmlelement, mode);
    69        
     69
    7070        XMLPortObject(GlobalQuest, QuestEffect, "reward-effects", addRewardEffect, getRewardEffects, xmlelement, mode);
    7171
    7272        COUT(3) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
    7373    }
    74    
     74
    7575    /**
    7676    @brief
     
    8989            return false;
    9090        }
    91        
     91
    9292        Quest::fail(player);
    93    
     93
    9494    //! Iterate through all players possessing this Quest.
    9595    for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     
    118118            return false;
    119119        }
    120        
     120
    121121        //! Iterate through all players possessing the Quest.
    122122        for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)
     
    124124            QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
    125125        }
    126    
     126
    127127        Quest::complete(player);
    128    
     128
    129129        QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
    130130        return true;
     
    230230            this->players_.insert(player); //!< Add the player to the set.
    231231        }
    232        
     232
    233233        this->status_ = status; //!< Set the status, which is global, remember...?
    234234        return true;
    235235    }
    236    
     236
    237237    /**
    238238    @brief
     
    256256        return true;
    257257    }
    258    
     258
    259259    /**
    260260    @brief
  • code/trunk/src/modules/questsystem/LocalQuest.cc

    r5781 r6417  
    8787            return false;
    8888        }
    89        
     89
    9090        Quest::fail(player);
    91        
     91
    9292        QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
    9393        return true;
     
    110110            return false;
    111111        }
    112        
     112
    113113        Quest::complete(player);
    114        
     114
    115115        QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
    116116        return true;
     
    188188            return it->second;
    189189        }
    190        
     190
    191191        return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
    192192    }
     
    209209            return false;
    210210        }
    211        
     211
    212212        this->playerStatus_[player] = status;
    213213        return true;
  • code/trunk/src/modules/questsystem/Quest.cc

    r5781 r6417  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    204204    {
    205205        int i = index;
    206        
     206
    207207        //! Iterate through all subquests.
    208208        for (std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)
     
    214214            i--;
    215215        }
    216        
     216
    217217        return NULL; //!< If the index is greater than the number of elements in the list.
    218218    }
     
    229229    {
    230230        int i = index;
    231        
     231
    232232        //! Iterate through all QuestHints.
    233233        for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
     
    253253    {
    254254        int i = index;
    255        
     255
    256256        //! Iterate through all fail QuestEffects.
    257257        for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
     
    277277    {
    278278        int i = index;
    279        
     279
    280280        //! Iterate through all complete QuestEffects.
    281281        for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
     
    350350        return this->getStatus(player) == QuestStatus::Completed;
    351351    }
    352    
     352
    353353    /**
    354354    @brief
     
    363363        QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
    364364        this->setStatus(player, QuestStatus::Failed);
    365        
     365
    366366        COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
    367        
     367
    368368        this->getDescription()->sendFailQuestNotification();
    369369        return true;
    370370    }
    371    
     371
    372372    /**
    373373    @brief
     
    382382        QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
    383383        this->setStatus(player, QuestStatus::Completed);
    384        
     384
    385385        COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
    386        
     386
    387387        this->getDescription()->sendCompleteQuestNotification();
    388388        return true;
     
    404404            return false;
    405405        }
    406        
     406
    407407        COUT(4) << "Quest {" << this->getId() << "} is started for player: " << player << " ." <<std::endl;
    408        
     408
    409409        QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
    410        
     410
    411411        this->setStatus(player, QuestStatus::Active);
    412        
     412
    413413        this->getDescription()->sendAddQuestNotification();
    414414        return true;
    415415    }
    416    
     416
    417417    /**
    418418    @brief
     
    430430            return false;
    431431        }
    432        
     432
    433433        this->listeners_.push_back(listener);
    434434        return true;
  • code/trunk/src/modules/questsystem/QuestDescription.cc

    r5781 r6417  
    5050    {
    5151        RegisterObject(QuestDescription);
    52        
    53         this->title_ = "";
    54         this->description_ = "";
    5552    }
    5653
     
    7976        COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
    8077    }
    81    
     78
    8279    /**
    8380    @brief
     
    9491    bool QuestDescription::notificationHelper(const std::string & item, const std::string & status) const
    9592    {
    96         std::string message = "";
     93        std::string message;
    9794        if(item == "hint")
    9895        {
    99             message = "You received a hint: '" + this->title_ + "'";
     96            message = "You received a hint: '" + this->title_ + '\'';
    10097        }
    10198        else if(item == "quest")
     
    103100            if(status == "start")
    104101            {
    105                 message = "You received a new quest: '" + this->title_ + "'";
     102                message = "You received a new quest: '" + this->title_ + '\'';
    106103            }
    107104            else if(status == "fail")
    108105            {
    109                 message = "You failed the quest: '" + this->title_ + "'";
     106                message = "You failed the quest: '" + this->title_ + '\'';
    110107            }
    111108            else if(status == "complete")
    112109            {
    113                 message = "You successfully completed the quest: '" + this->title_ + "'";
     110                message = "You successfully completed the quest: '" + this->title_ + '\'';
    114111            }
    115112            else
     
    124121            return false;
    125122        }
    126        
     123
    127124        QuestNotification* notification = new QuestNotification(message);
    128125        notification->send();
  • code/trunk/src/modules/questsystem/QuestEffect.cc

    r5781 r6417  
    6969    {
    7070        bool check = true;
    71        
     71
    7272        COUT(4) << "Invoking QuestEffects on player: " << player << " ."  << std::endl;
    7373
  • code/trunk/src/modules/questsystem/QuestGUI.cc

    r5929 r6417  
    7777        }
    7878        this->windows_.clear();
    79        
     79
    8080        if(this->root_ != NULL)
    8181            this->root_->destroy();
     
    104104
    105105        this->clear(); //!< Clear the GUI.
    106        
     106
    107107        int depth = 0;
    108108        int index = 0;
     
    116116        for(std::map<std::string, Quest*>::iterator it = quests.begin(); it != quests.end(); it++)
    117117        {
    118             Quest* quest = (*it).second;
     118            Quest* quest = it->second;
    119119            if(quest->getParentQuest() == NULL && !quest->isInactive(this->player_)) //!< If the Quest isn't inactive and a root Quest (meaning it has no parent.), create a Node.
    120120            {
     
    136136        for(std::map<CEGUI::Window*, QuestGUINode*>::iterator it = this->nodes_.begin(); it != this->nodes_.end(); it++)
    137137        {
    138             QuestGUINode* node = (*it).second;
     138            QuestGUINode* node = it->second;
    139139            if(node == NULL)
    140140            {
     
    209209        for(std::map<PlayerInfo*, QuestGUI*>::iterator it = QuestManager::getInstance().questGUIs_.begin(); it != QuestManager::getInstance().questGUIs_.end(); it++)
    210210        {
    211             QuestGUI* gui = (*it).second;
     211            QuestGUI* gui = it->second;
    212212            std::map<CEGUI::Window*, QuestGUINode*>::iterator node = gui->nodes_.find(window);
    213213            if(node != gui->nodes_.end()) return node->second;
     
    235235
    236236        this->nodes_.insert(std::pair<CEGUI::Window*, QuestGUINode*>(node->getWindow(),node)); //!< Insert the node and its window in the nodes_ map.
    237        
     237
    238238        index++;
    239239
     
    268268        index = tempIndex; //!< Reset the index to the original level.
    269269
    270         return index;       
     270        return index;
    271271    }
    272272
  • code/trunk/src/modules/questsystem/QuestGUI.h

    r5781 r6417  
    5656
    5757        public:
    58        
     58
    5959            QuestGUI(PlayerInfo* player);
    6060            virtual ~QuestGUI();
     
    8686            inline PlayerInfo* getPlayer(void)
    8787                { return this->player_; }
    88    
     88
    8989        private:
    90            
     90
    9191            int createNode(QuestGUINode* parent, QuestItem* item, int depth, int index); //!< Recursive method to create Nodes for all Quests an Hints the given Quest is a parent to.
    9292
  • code/trunk/src/modules/questsystem/QuestGUINode.cc

    r5781 r6417  
    7171    QuestGUINode::QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index)
    7272    {
    73         this->initialize();   
     73        this->initialize();
    7474
    7575        this->gui_ = gui;
     
    119119    void QuestGUINode::toggleVisibility(void)
    120120    {
    121        
     121
    122122    }
    123123
     
    134134        if(this->window_ != NULL)
    135135        {
    136             buffer = (std::string)(this->window_->getName().c_str());
     136            buffer = this->window_->getName().c_str();
    137137        }
    138138        else
    139139        {
    140             buffer = "";
     140            buffer.erase();
    141141        }
    142142    }
     
    154154
    155155        if(this->details_ == NULL) //!< If the details window was not already created.
    156         { 
     156        {
    157157            std::ostringstream stream;
    158158
     
    187187                CEGUI::Window* statusWindow = this->gui_->getWindowManager()->createWindow("TaharezLook/StaticText", stream.str());
    188188                window->addChildWindow(statusWindow);
    189                 std::string status = "";
     189                std::string status;
    190190                if(quest->isActive(this->gui_->getPlayer()))
    191191                {
     
    209209                offset += height;
    210210            }
    211            
     211
    212212            //! Create title pane for the description.
    213213            stream.str("");
     
    282282    {
    283283        COUT(3) << "Open QuestItem..." << std::endl;
    284        
     284
    285285        //CEGUI::Window* window = this->gui_->getRootWindow();
    286286        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
     
    297297    */
    298298    bool QuestGUINode::closeDetails(const CEGUI::EventArgs& e)
    299     {       
     299    {
    300300        //CEGUI::Window* window = this->gui_->getRootWindow();
    301301        CEGUI::Window* window = this->gui_->getWindowManager()->getWindow("orxonox/QuestGUI/Background");
     
    344344        //! Set the height to the window.
    345345        window->setHeight(CEGUI::UDim(0, height));
    346        
     346
    347347        //Debug
    348348        const CEGUI::Rect newArea = getStaticTextArea(window);
     
    368368    {
    369369        Quest* quest = dynamic_cast<Quest*>(this->item_);
    370        
     370
    371371        this->window_ = this->gui_->getWindow();
    372372        std::ostringstream stream;
     
    377377        }
    378378        stream << this->index_;
    379        
     379
    380380        this->window_->rename(stream.str());
    381381        this->window_->setText(this->item_->getDescription()->getTitle());
  • code/trunk/src/modules/questsystem/QuestGUINode.h

    r5781 r6417  
    4444
    4545        public:
    46    
     46
    4747            QuestGUINode(void);
    4848            QuestGUINode(QuestGUI* gui, QuestGUINode* parent, QuestItem* item, int depth, int index);
    4949            virtual ~QuestGUINode(void);
    50    
     50
    5151            void toggleVisibility(void);
    5252
     
    5454            /**
    5555            @brief Retreive the window of this node.
    56             @return The CEGUI Window of this node. 
     56            @return The CEGUI Window of this node.
    5757            */
    5858            inline CEGUI::Window* getWindow(void)
  • code/trunk/src/modules/questsystem/QuestHint.cc

    r5781 r6417  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    7171
    7272        QuestManager::getInstance().registerHint(this); //!< Registers the QuestHint with the QuestManager.
    73        
     73
    7474        COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
    7575    }
     
    100100            return it->second;
    101101        }
    102        
     102
    103103        return QuestStatus::Inactive;
    104104    }
     
    119119            {
    120120                this->playerStatus_[player] = QuestHintStatus::Active;
    121                
     121
    122122                this->getDescription()->sendAddHintNotification();
    123123                return true;
     
    129129            }
    130130        }
    131        
     131
    132132        COUT(2) << "A hint of a non-active quest was trying to get activated." << std::endl;
    133133        return false;
  • code/trunk/src/modules/questsystem/QuestItem.cc

    r5781 r6417  
    2626 *
    2727 */
    28  
     28
    2929/**
    3030    @file
     
    4747    {
    4848        RegisterObject(QuestItem);
    49 
    50         this->id_ = "";
    5149    }
    5250
     
    8684            return;
    8785        }
    88        
     86
    8987        this->id_ = id;
    9088    }
  • code/trunk/src/modules/questsystem/QuestListener.cc

    r5781 r6417  
    5050    {
    5151        RegisterObject(QuestListener);
    52        
     52
    5353        this->mode_ = QuestListenerMode::All;
    5454        this->quest_ = NULL;
    5555    }
    56    
     56
    5757    /**
    5858    @brief
     
    6262    {
    6363    }
    64    
     64
    6565    /**
    6666    @brief
     
    7575
    7676        this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners.
    77        
     77
    7878        COUT(3) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl;
    7979    }
    80    
     80
    8181    /**
    8282    @brief
     
    9898        }
    9999    }
    100    
     100
    101101    /**
    102102    @brief
     
    110110    {
    111111        this->quest_ = QuestManager::getInstance().findQuest(id); //!< Find the Quest corresponding to the given questId.
    112        
     112
    113113        if(this->quest_ == NULL) //!< If there is no such Quest.
    114114        {
     
    116116            return false;
    117117        }
    118        
     118
    119119        return true;
    120120    }
    121    
     121
    122122    /**
    123123    @brief
     
    152152        return false;
    153153        }
    154        
     154
    155155        return true;
    156156    }
    157    
     157
    158158    /**
    159159    @brief
     
    183183        {
    184184            COUT(1) << "An unforseen, never to happen, Error has occurred. This is impossible!" << std::endl;
    185         return "";
     185            return "";
    186186        }
    187187    }
     
    193193        Returns the questId of the Quest the QuestListener reacts to.
    194194    */
    195     const std::string & QuestListener::getQuestId(void)   
     195    const std::string & QuestListener::getQuestId(void)
    196196    {
    197197        return this->quest_->getId();
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r5929 r6417  
    5555    DeclareToluaInterface(Questsystem);
    5656
    57     //! Pointer to the current (and single) instance of this class.
    58     /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL;
    5957    ManageScopedSingleton(QuestManager, ScopeID::Root, false);
    6058
     
    7876        for(std::map<PlayerInfo*, QuestGUI*>::iterator it = this->questGUIs_.begin(); it != this->questGUIs_.end(); it++)
    7977        {
    80             (*it).second->destroy();
     78            it->second->destroy();
    8179        }
    8280        this->questGUIs_.clear();
  • code/trunk/src/modules/questsystem/QuestManager.h

    r5929 r6417  
    7272            static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
    7373
    74             //! Retreive the main window for the GUI. 
     74            //! Retreive the main window for the GUI.
    7575            CEGUI::Window* getQuestGUI(const std::string & guiName); // tolua_export
    7676
  • code/trunk/src/modules/questsystem/QuestNotification.cc

    r5781 r6417  
    3232namespace orxonox {
    3333
    34     const std::string QuestNotification::SENDER = "questsystem";
     34    const std::string QuestNotification::SENDER("questsystem");
    3535
    3636    QuestNotification::QuestNotification(BaseObject* creator) : Notification(creator)
     
    3838        this->initialize();
    3939    }
    40    
     40
    4141    QuestNotification::QuestNotification(const std::string & message) : Notification(message)
    4242    {
    4343        this->initialize();
    4444    }
    45    
     45
    4646    QuestNotification::~QuestNotification()
    4747    {
    48        
     48
    4949    }
    5050
  • code/trunk/src/modules/questsystem/notifications/Notification.cc

    r5781 r6417  
    4949        this->initialize();
    5050    }
    51    
     51
    5252    /**
    5353    @brief
     
    6060        this->message_ = message;
    6161    }
    62    
     62
    6363    /**
    6464    @brief
     
    6868    {
    6969    }
    70    
     70
    7171    /**
    7272    @brief
     
    7575    void Notification::initialize(void)
    7676    {
    77         this->message_ = "";
     77        this->message_.clear();
    7878        this->sender_ = NotificationManager::NONE;
    7979        this->sent_ = false;
    8080    }
    81    
     81
    8282    /**
    8383    @brief
     
    9090        return this->send(NotificationManager::NONE);
    9191    }
    92    
     92
    9393    /**
    9494    @brief
     
    106106            return false;
    107107        this->sent_ = true;
    108        
     108
    109109        COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
    110        
     110
    111111        return true;
    112112    }
    113    
     113
    114114    /**
    115115    @brief
  • code/trunk/src/modules/questsystem/notifications/NotificationManager.cc

    r5929 r6417  
    4444{
    4545
    46     const std::string NotificationManager::ALL = "all";
    47     const std::string NotificationManager::NONE = "none";
     46    const std::string NotificationManager::ALL("all");
     47    const std::string NotificationManager::NONE("none");
    4848
    49     NotificationManager* NotificationManager::singletonPtr_s = NULL;
    5049    ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
    5150
  • code/trunk/src/modules/questsystem/notifications/NotificationQueue.cc

    r5929 r6417  
    4646    CreateFactory(NotificationQueue);
    4747
    48     const std::string NotificationQueue::DEFAULT_FONT = "VeraMono";
    49     const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0);
    50     const float NotificationQueue::DEFAULT_FONT_SIZE  = 0.025f;
     48    const std::string NotificationQueue::DEFAULT_FONT("VeraMono");
     49    const Vector2 NotificationQueue::DEFAULT_POSITION(0.0,0.0);
     50    const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025f;
    5151
    5252    /**
     
    271271            if(!first)
    272272            {
    273                 *string += ",";
     273                *string += ',';
    274274            }
    275275            else
     
    300300        while( index < targets.size() ) //!< Go through the string, character by character until the end is reached.
    301301        {
    302             pTemp = new std::string("");
     302            pTemp = new std::string();
    303303            while(index < targets.size() && targets[index] != ',' && targets[index] != ' ')
    304304            {
     
    399399        std::ostringstream stream;
    400400        stream << reinterpret_cast<unsigned long>(notification);
    401         std::string addressString = stream.str() ;
     401        const std::string& addressString = stream.str();
    402402        container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
    403403
Note: See TracChangeset for help on using the changeset viewer.