Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 13, 2010, 11:55:23 PM (13 years ago)
Author:
dafrick
Message:

Merged releasetodo, containing a new way to describe and tag levels, back to trunk.

Location:
code/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/GUIManager.cc

    r7403 r7648  
    4343#include <CEGUIWindow.h>
    4444#include <CEGUIWindowManager.h>
     45#include <elements/CEGUIListbox.h>
     46#include <elements/CEGUIListboxItem.h>
    4547#include <ogreceguirenderer/OgreCEGUIRenderer.h>
    4648
     
    436438    }
    437439
     440    /**
     441    @brief
     442        Subscribe the input function to the input event for the input window.
     443        This is a helper to be used in lua, because subscribeScriptedEvent() doesn't work in lua.
     444    @param window
     445        The window for which the event is subscribed.
     446    @param event
     447        The type of event to which we subscribe.
     448    @param function
     449        The function that is called when the event occurs.
     450    */
    438451    void GUIManager::subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function)
    439452    {
    440453        window->subscribeScriptedEvent(event, function);
    441454    }
     455
     456    /**
     457    @brief
     458        Set the input tooltip text for the input ListboxItem.
     459    @param item
     460        The ListboxItem for which the tooltip should be set.
     461    @param tooltip
     462        The tooltip text that should be set.
     463    */
     464    void GUIManager::setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& tooltip)
     465    {
     466        item->setTooltipText(tooltip);
     467    }
     468
     469    /**
     470    @brief
     471        Set whether the tooltips for the input Listbox are enabled.
     472    @param listbox
     473        The Listbox for which to enable (or disable) tooltips.
     474    @param enabled
     475        Whether to enable or disabel the tooltips.
     476    */
     477    void GUIManager::setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled)
     478    {
     479        listbox->setItemTooltipsEnabled(enabled);
     480    }
     481
    442482}
  • code/trunk/src/libraries/core/GUIManager.h

    r7403 r7648  
    106106        // TODO: Temporary hack because the tolua exported CEGUI method does not seem to work
    107107        static void subscribeEventHelper(CEGUI::Window* window, const std::string& event, const std::string& function); //tolua_export
     108        static void setTooltipTextHelper(CEGUI::ListboxItem* item, const std::string& toooltip); //tolua_export
     109        static void setItemTooltipsEnabledHelper(CEGUI::Listbox* listbox, bool enabled); //tolua_export
    108110
    109111        static GUIManager& getInstance() { return Singleton<GUIManager>::getInstance(); } // tolua_export
  • code/trunk/src/libraries/core/Loader.cc

    r6422 r7648  
    8888    }
    8989
    90     bool Loader::load(const ClassTreeMask& mask)
     90    /**
     91    @brief
     92        Loads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
     93    @param mask
     94        A ClassTreeMask, which defines which types of classes are loaded and which aren't.
     95    @param verbose
     96        Whether the loader is verbose (prints its progress in a low output level) or not.
     97    @return
     98        Returns true if successful.
     99    */
     100    bool Loader::load(const ClassTreeMask& mask, bool verbose)
    91101    {
    92102        bool success = true;
    93103        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
    94             if (!Loader::load(it->first, it->second * mask))
     104            if (!Loader::load(it->first, it->second * mask, verbose))
    95105                success = false;
    96106
     
    109119    }
    110120
    111     bool Loader::reload(const ClassTreeMask& mask)
     121    /**
     122    @brief
     123        Reloads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
     124    @param mask
     125        A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
     126    @param verbose
     127        Whether the loader is verbose (prints its progress in a low output level) or not.
     128    @return
     129        Returns true if successful.
     130    */
     131    bool Loader::reload(const ClassTreeMask& mask, bool verbose)
    112132    {
    113133        Loader::unload(mask);
    114         return Loader::load(mask);
    115     }
    116 
    117     bool Loader::load(const XMLFile* file, const ClassTreeMask& mask)
     134        return Loader::load(mask, verbose);
     135    }
     136
     137    /**
     138    @brief
     139        Loads the input file, while conforming to the restrictions given by the input ClassTreeMask.
     140    @param file
     141        The file to be loaded.
     142    @param mask
     143        A ClassTreeMask, which defines which types of classes are loaded and which aren't.
     144    @param verbose
     145        Whether the loader is verbose (prints its progress in a low output level) or not.
     146    @return
     147        Returns true if successful.
     148    */
     149    bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool verbose)
    118150    {
    119151        if (!file)
     
    144176        try
    145177        {
    146             COUT(0) << "Start loading " << file->getFilename() << "..." << std::endl;
    147             COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
     178            if(verbose)
     179            {
     180                COUT(0) << "Start loading " << file->getFilename() << "..." << std::endl;
     181                COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
     182            }
     183            else
     184            {
     185                COUT(4) << "Start loading " << file->getFilename() << "..." << std::endl;
     186                COUT(4) << "Mask: " << Loader::currentMask_s << std::endl;
     187            }
    148188
    149189            ticpp::Document xmlfile(file->getFilename());
     
    165205            rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
    166206
    167             COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl;
     207            if(verbose)
     208                COUT(0) << "Finished loading " << file->getFilename() << '.' << std::endl;
     209            else
     210                COUT(4) << "Finished loading " << file->getFilename() << '.' << std::endl;
    168211
    169212            COUT(4) << "Namespace-tree:" << std::endl << rootNamespace->toString("  ") << std::endl;
     
    210253    }
    211254
    212     bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask)
     255    /**
     256    @brief
     257        Reloads the input file, while conforming to the restrictions given by the input ClassTreeMask.
     258    @param file
     259        The file to be reloaded.
     260    @param mask
     261        A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
     262    @param verbose
     263        Whether the loader is verbose (prints its progress in a low output level) or not.
     264    @return
     265        Returns true if successful.
     266    */
     267    bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool verbose)
    213268    {
    214269        Loader::unload(file, mask);
    215         return Loader::load(file, mask);
     270        return Loader::load(file, mask, verbose);
    216271    }
    217272
  • code/trunk/src/libraries/core/Loader.h

    r7401 r7648  
    5757            static void remove(const XMLFile* file);
    5858
    59             static bool load(const ClassTreeMask& mask = ClassTreeMask());
     59            static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
    6060            static void unload(const ClassTreeMask& mask = ClassTreeMask());
    61             static bool reload(const ClassTreeMask& mask = ClassTreeMask());
     61            static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
    6262
    63             static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
     63            static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
    6464            static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
    65             static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
     65            static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
    6666
    6767            static std::string replaceLuaTags(const std::string& text);
Note: See TracChangeset for help on using the changeset viewer.