Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11162 for code/branches


Ignore:
Timestamp:
Apr 1, 2016, 7:38:22 PM (9 years ago)
Author:
fvultier
Message:

Managed to call a C++ test function from a Lua script that gets executed when a button is pressed.

Location:
code/branches/bindermFS16
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/bindermFS16/data/gui/scripts/SingleplayerMenu.lua

    r11150 r11162  
    172172
    173173function P.CampaignButton_clicked(e)
    174     P.test()
     174    orxonox.CampaignMenu:test()
    175175    showMenuSheet("CampaignMenu", true)
    176176end
    177 function P.test()
    178     orxonox.execute("test")
    179 end
     177
    180178return P
  • code/branches/bindermFS16/src/orxonox/CMakeLists.txt

    r11080 r11162  
    6565    sound/SoundManager.h
    6666    controllers/ScriptController.h
     67    overlays/CampaignMenu.h
    6768  PCH_FILE
    6869    OrxonoxPrecompiledHeaders.h
  • code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc

    r11150 r11162  
    3232#include "core/XMLPort.h"
    3333#include "core/GameMode.h"
    34 #include "core/command/ConsoleCommandIncludes.h"
    35 
    36 
    3734
    3835namespace orxonox
    3936{
    40 
    41     SetConsoleCommand("CampaignMenu", "test", &CampaignMenu::test);
    42 
    4337    RegisterClass(CampaignMenu);
    4438
     
    5852    }
    5953
    60     //loads the new campaign menu
    61     void CampaignMenu::loadnewmenu()
     54    //loads the campaign menu
     55    void CampaignMenu::loadNewMenu()
    6256    {
    6357       
  • code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h

    r11150 r11162  
    3333#include "core/BaseObject.h"
    3434
    35 namespace orxonox
    36 {
    37 class _OrxonoxExport CampaignMenu : public BaseObject
    38     {
     35
     36namespace orxonox // tolua_export
     37{ // tolua_export
     38
     39        class _OrxonoxExport CampaignMenu // tolua_export
     40         : public BaseObject
     41    { // tolua_export
    3942    public:
    4043        CampaignMenu(Context* context);
    4144        ~CampaignMenu();
    42         void test();
    43         void loadnewmenu();
    44     };
    45 
    46 
    47 
    48 }
     45        static void test(); // tolua_export
     46        void loadNewMenu();
     47    };// tolua_export
     48} // tolua_export
    4949
    5050#endif /* _CampaignMenu_H__ */
Note: See TracChangeset for help on using the changeset viewer.