@@ -149,6 +149,8 @@ void CLuaGUIDefs::LoadFunctions(void)
149
149
150
150
CLuaCFunctions::AddFunction (" guiWindowSetMovable" , GUIWindowSetMovable);
151
151
CLuaCFunctions::AddFunction (" guiWindowSetSizable" , GUIWindowSetSizable);
152
+ CLuaCFunctions::AddFunction (" guiWindowIsMovable" , GUIWindowIsMovable);
153
+ CLuaCFunctions::AddFunction (" guiWindowIsSizable" , GUIWindowIsSizable);
152
154
153
155
CLuaCFunctions::AddFunction (" getChatboxLayout" , GUIGetChatboxLayout);
154
156
@@ -252,11 +254,15 @@ void CLuaGUIDefs::AddGuiWindowClass(lua_State* luaVM)
252
254
lua_newclass (luaVM);
253
255
254
256
lua_classfunction (luaVM, " create" , " guiCreateWindow" );
257
+
255
258
lua_classfunction (luaVM, " setMovable" , " guiWindowSetMovable" );
256
259
lua_classfunction (luaVM, " setSizable" , " guiWindowSetSizable" );
257
260
258
- lua_classvariable (luaVM, " movable" , " guiWindowSetMovable" , NULL );
259
- lua_classvariable (luaVM, " sizable" , " guiWindowSetSizable" , NULL );
261
+ lua_classfunction (luaVM, " isMovable" , " guiWindowIsMovable" );
262
+ lua_classfunction (luaVM, " isSizable" , " guiWindowIsSizable" );
263
+
264
+ lua_classvariable (luaVM, " movable" , " guiWindowSetMovable" , " guiWindowIsMovable" );
265
+ lua_classvariable (luaVM, " sizable" , " guiWindowSetSizable" , " guiWindowIsSizable" );
260
266
261
267
lua_registerclass (luaVM, " GuiWindow" , " GuiElement" );
262
268
}
@@ -3273,6 +3279,28 @@ int CLuaGUIDefs::GUIWindowSetMovable(lua_State* luaVM)
3273
3279
return 1 ;
3274
3280
}
3275
3281
3282
+ int CLuaGUIDefs::GUIWindowIsMovable (lua_State* luaVM)
3283
+ {
3284
+ // bool guiWindowIsMovable( element theElement )
3285
+ CClientGUIElement* theElement;
3286
+
3287
+ CScriptArgReader argStream (luaVM);
3288
+ argStream.ReadUserData <CGUIWindow>(theElement);
3289
+
3290
+ if (!argStream.HasErrors ())
3291
+ {
3292
+ bool movable = static_cast <CGUIWindow*>(theElement->GetCGUIElement ())->IsMovable ();
3293
+ lua_pushboolean (luaVM, movable);
3294
+ return 1 ;
3295
+ }
3296
+ else
3297
+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
3298
+
3299
+ // error: bad arguments
3300
+ lua_pushnil (luaVM);
3301
+ return 1 ;
3302
+ }
3303
+
3276
3304
int CLuaGUIDefs::GUIWindowSetSizable (lua_State* luaVM)
3277
3305
{
3278
3306
// bool guiWindowSetSizable ( element theElement, bool status )
@@ -3297,6 +3325,28 @@ int CLuaGUIDefs::GUIWindowSetSizable(lua_State* luaVM)
3297
3325
return 1 ;
3298
3326
}
3299
3327
3328
+ int CLuaGUIDefs::GUIWindowIsSizable (lua_State* luaVM)
3329
+ {
3330
+ // bool guiWindowIsSizable( elemen theElement )
3331
+ CClientGUIElement* theElement;
3332
+
3333
+ CScriptArgReader argStream (luaVM);
3334
+ argStream.ReadUserData <CGUIWindow>(theElement);
3335
+
3336
+ if (!argStream.HasErrors ())
3337
+ {
3338
+ bool sizable = static_cast <CGUIWindow*>(theElement->GetCGUIElement ())->IsSizingEnabled ();
3339
+ lua_pushboolean (luaVM, sizable);
3340
+ return 1 ;
3341
+ }
3342
+ else
3343
+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
3344
+
3345
+ // error: bad arguments
3346
+ lua_pushnil (luaVM);
3347
+ return 1 ;
3348
+ }
3349
+
3300
3350
int CLuaGUIDefs::GUILabelGetTextExtent (lua_State* luaVM)
3301
3351
{
3302
3352
// float guiLabelGetTextExtent ( element theLabel )
0 commit comments