Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2009, 5:16:29 PM (16 years ago)
Author:
bknecht
Message:

You don't need no —level or -l anymore now. You may choose your favorite level from the main menu ;-)

Location:
code/trunk/src/orxonox/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/gui/GUIManager.cc

    r2963 r3008  
    5555#include "ToluaBindCore.h"
    5656#include "ToluaBindOrxonox.h"
     57#include "core/Loader.h"
    5758
    5859extern "C" {
     
    238239            COUT(2) << "CEGUI Error: \"" << ex.getMessage() << "\" while executing code \"" << str << "\"" << std::endl;
    239240        }
     241    }
     242
     243    /**
     244
     245    */
     246    void GUIManager::getLevelList()
     247    {
     248        lua_State* L = this->scriptModule_->getLuaState();
     249        lua_newtable(L);
     250
     251        std::vector<std::string> list = Loader::getLevelList();
     252
     253        int j = 1;
     254        for (std::vector<std::string>::iterator i = list.begin(); i != list.end(); i++)
     255        {
     256            lua_pushnumber(L,j);
     257            lua_pushstring(L,i->c_str());
     258            lua_settable(L,-3);
     259            j++;
     260        }
     261        lua_setglobal(L, "levellist");
    240262    }
    241263
  • code/trunk/src/orxonox/gui/GUIManager.h

    r2962 r3008  
    9797        static GUIManager* getInstancePtr() { return singletonRef_s; }
    9898
     99        void getLevelList(); //tolua_export
     100
    99101    private:
    100102        GUIManager(const GUIManager& instance);                 //!< private constructor (this is a singleton class)
Note: See TracChangeset for help on using the changeset viewer.