aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/load_game.cpp
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2019-02-10 18:16:04 -0500
committerAlexander <alex@cogarr.net>2019-02-10 18:16:04 -0500
commit83a85531ae789e2f30da2379990899f815f53ff1 (patch)
tree81140ea86f6e3d7808b218597874ea927555ef0d /src/client/lua_api/load_game.cpp
parent1482e03dd238643ff47278e207e6450f14011acf (diff)
downloadbrokengine-83a85531ae789e2f30da2379990899f815f53ff1.tar.gz
brokengine-83a85531ae789e2f30da2379990899f815f53ff1.tar.bz2
brokengine-83a85531ae789e2f30da2379990899f815f53ff1.zip
Added new element, added server-specific code for networking
Added a new element for client gui: iguicombobox Added a part of the engine specifically for the server so server is no longer just a stripped down client
Diffstat (limited to 'src/client/lua_api/load_game.cpp')
-rw-r--r--src/client/lua_api/load_game.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/lua_api/load_game.cpp b/src/client/lua_api/load_game.cpp
index 469b219..8a6ad73 100644
--- a/src/client/lua_api/load_game.cpp
+++ b/src/client/lua_api/load_game.cpp
@@ -9,6 +9,7 @@ extern "C" {
}
#include <irrlicht.h>
+#include <shared/lua_api/common.hpp>
#include "gui/iguibutton.hpp"
#include "gui/iguilabel.hpp"
#include "../callbackhandeler.hpp"
@@ -18,6 +19,7 @@ using namespace irr;
using namespace gui;
using namespace core;
+extern video::SColor background;
extern IrrlichtDevice* device;
//exit()
@@ -25,6 +27,12 @@ int exit_game(lua_State *L){
device->closeDevice();
return 0;
}
+int setbackgroundcolor(lua_State* L){
+ long r,g,b;
+ popvector3i(L,&r,&g,&b);
+ background = video::SColor(255,r,g,b);
+ return 0;
+}
void load_gamefuncs(lua_State* L){
lua_newtable(L);
@@ -33,5 +41,10 @@ void load_gamefuncs(lua_State* L){
lua_getglobal(L,"GAME");
lua_pushcfunction(L,exit_game);
lua_setfield(L,-2,"exit");
+
+ lua_pushcfunction(L,setbackgroundcolor);//{game},setbackgroundcolor()
+ lua_setfield(L,-2,"setbackgroundcolor");//{game}
+ lua_pop(L,1);
+
lua_pop(L,1);
}