[Orxonox-commit 6518] r11162 - in code/branches/bindermFS16: data/gui/scripts src/orxonox src/orxonox/overlays
fvultier at orxonox.net
fvultier at orxonox.net
Fri Apr 1 19:38:22 CEST 2016
Author: fvultier
Date: 2016-04-01 19:38:22 +0200 (Fri, 01 Apr 2016)
New Revision: 11162
Modified:
code/branches/bindermFS16/data/gui/scripts/SingleplayerMenu.lua
code/branches/bindermFS16/src/orxonox/CMakeLists.txt
code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc
code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h
Log:
Managed to call a C++ test function from a Lua script that gets executed when a button is pressed.
Modified: code/branches/bindermFS16/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/bindermFS16/data/gui/scripts/SingleplayerMenu.lua 2016-03-27 19:37:44 UTC (rev 11161)
+++ code/branches/bindermFS16/data/gui/scripts/SingleplayerMenu.lua 2016-04-01 17:38:22 UTC (rev 11162)
@@ -171,10 +171,8 @@
end
function P.CampaignButton_clicked(e)
- P.test()
+ orxonox.CampaignMenu:test()
showMenuSheet("CampaignMenu", true)
end
-function P.test()
- orxonox.execute("test")
-end
-return P
+
+return P
\ No newline at end of file
Modified: code/branches/bindermFS16/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/bindermFS16/src/orxonox/CMakeLists.txt 2016-03-27 19:37:44 UTC (rev 11161)
+++ code/branches/bindermFS16/src/orxonox/CMakeLists.txt 2016-04-01 17:38:22 UTC (rev 11162)
@@ -64,6 +64,7 @@
infos/PlayerInfo.h
sound/SoundManager.h
controllers/ScriptController.h
+ overlays/CampaignMenu.h
PCH_FILE
OrxonoxPrecompiledHeaders.h
LINK_LIBRARIES
Modified: code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc
===================================================================
--- code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc 2016-03-27 19:37:44 UTC (rev 11161)
+++ code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.cc 2016-04-01 17:38:22 UTC (rev 11162)
@@ -31,15 +31,9 @@
#include "core/GUIManager.h"
#include "core/XMLPort.h"
#include "core/GameMode.h"
-#include "core/command/ConsoleCommandIncludes.h"
-
-
namespace orxonox
{
-
- SetConsoleCommand("CampaignMenu", "test", &CampaignMenu::test);
-
RegisterClass(CampaignMenu);
CampaignMenu::CampaignMenu(Context* context)
@@ -57,8 +51,8 @@
orxout()<<"test"<< endl;
}
- //loads the new campaign menu
- void CampaignMenu::loadnewmenu()
+ //loads the campaign menu
+ void CampaignMenu::loadNewMenu()
{
}
Modified: code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h
===================================================================
--- code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h 2016-03-27 19:37:44 UTC (rev 11161)
+++ code/branches/bindermFS16/src/orxonox/overlays/CampaignMenu.h 2016-04-01 17:38:22 UTC (rev 11162)
@@ -32,19 +32,19 @@
#include <string>
#include "core/BaseObject.h"
-namespace orxonox
-{
-class _OrxonoxExport CampaignMenu : public BaseObject
- {
+
+namespace orxonox // tolua_export
+{ // tolua_export
+
+ class _OrxonoxExport CampaignMenu // tolua_export
+ : public BaseObject
+ { // tolua_export
public:
CampaignMenu(Context* context);
~CampaignMenu();
- void test();
- void loadnewmenu();
- };
+ static void test(); // tolua_export
+ void loadNewMenu();
+ };// tolua_export
+} // tolua_export
-
-
-}
-
#endif /* _CampaignMenu_H__ */
More information about the Orxonox-commit
mailing list