Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2009, 12:43:12 PM (14 years ago)
Author:
rgrieder
Message:

Added LuaFunctor that can execute arbitrary lua code.
Also added LuaState::createLuaFunctor(std::string) and implemented that for the keybindings menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/input/KeyBinderManager.h

    r6280 r6281  
    3434#include <map>
    3535#include <string>
     36#include <boost/shared_ptr.hpp>
     37#include <CEGUIForwardRefs.h>
     38
    3639#include "util/Singleton.h"
    3740#include "core/OrxonoxClass.h"
    38 
    39 #include <CEGUIForwardRefs.h>
    4041
    4142namespace orxonox //tolua_export
     
    99100        inline void tkeybind(const std::string& command)
    100101            { this->keybindInternal(command, true); }
     102        inline void registerKeybindCallback(Functor* function) { this->callbackFunction_.reset(function); } // tolua_export
    101103
    102104    private:
    103105        KeyBinderManager(const KeyBinderManager&);
    104106        void keybindInternal(const std::string& command, bool bTemporary);
    105         void callback(const std::string& keyName);
     107        void keybindKeyPressed(const std::string& keyName);
    106108        void defaultFilenameChanged();
    107109
     
    113115
    114116        // keybind command related
    115         Functor* callbackFunction_;                  //! Function to be called when key was pressed after "keybind" command
     117        shared_ptr<Functor> callbackFunction_;       //! Function to be called when key was pressed after "keybind" command
    116118        bool bBinding_;                              //! Tells whether a key binding process is active
    117119        bool bTemporary_;                            //! Stores tkeybind/keybind value
Note: See TracChangeset for help on using the changeset viewer.