summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2011-09-24 03:25:50 (GMT)
committer cracker64 <cracker642@gmail.com>2011-09-24 03:25:50 (GMT)
commit789049b269429107df2f1b73d3e968fea1ab4243 (patch)
treedda35b08261a8e5e9a47c9c1c18bf834ca8a2269 /src
parentc750e659a741e17057c880c86d607330125be3ec (diff)
downloadpowder-789049b269429107df2f1b73d3e968fea1ab4243.zip
powder-789049b269429107df2f1b73d3e968fea1ab4243.tar.gz
Can see selected elements from Lua, tpt.selectedl or tpt.selectedr
Diffstat (limited to 'src')
-rw-r--r--src/luaconsole.c10
-rw-r--r--src/main.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c
index 2a2519c..1e03919 100644
--- a/src/luaconsole.c
+++ b/src/luaconsole.c
@@ -77,6 +77,10 @@ void luacon_open(){
lua_setfield(l, tptProperties, "mousex");
lua_pushinteger(l, 0);
lua_setfield(l, tptProperties, "mousey");
+ lua_pushinteger(l, 0);
+ lua_setfield(l, tptProperties, "selectedl");
+ lua_pushinteger(l, 0);
+ lua_setfield(l, tptProperties, "selectedr");
}
int luacon_keyevent(int key, int modifier, int event){
int i = 0, kpcontinue = 1;
@@ -115,12 +119,16 @@ int luacon_mouseevent(int mx, int my, int mb, int event){
}
return mpcontinue;
}
-int luacon_step(int mx, int my){
+int luacon_step(int mx, int my, int selectl, int selectr){
int tempret = 0, tempb, i, callret;
+ lua_pushinteger(l, selectr);
+ lua_pushinteger(l, selectl);
lua_pushinteger(l, my);
lua_pushinteger(l, mx);
lua_setfield(l, tptProperties, "mousex");
lua_setfield(l, tptProperties, "mousey");
+ lua_setfield(l, tptProperties, "selectedl");
+ lua_setfield(l, tptProperties, "selectedr");
if(step_functions[0]){
//Set mouse globals
for(i = 0; i<6; i++){
diff --git a/src/main.c b/src/main.c
index d756fae..d0fddcf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2559,7 +2559,7 @@ int main(int argc, char *argv[])
b = 0;
}
}
- luacon_step(x/sdl_scale, y/sdl_scale);
+ luacon_step(x/sdl_scale, y/sdl_scale,sl,sr);
#endif
for (i=0; i<SC_TOTAL; i++)//draw all the menu sections