@@ -126,7 +126,9 @@ void CLuaGUIDefs::LoadFunctions(void)
126
126
CLuaCFunctions::AddFunction (" guiEditSetCaretIndex" , GUIEditSetCaretIndex);
127
127
CLuaCFunctions::AddFunction (" guiEditGetCaretIndex" , GUIEditGetCaretIndex);
128
128
CLuaCFunctions::AddFunction (" guiEditSetMasked" , GUIEditSetMasked);
129
+ CLuaCFunctions::AddFunction (" guiEditIsMasked" , GUIEditIsMasked);
129
130
CLuaCFunctions::AddFunction (" guiEditSetMaxLength" , GUIEditSetMaxLength);
131
+ CLuaCFunctions::AddFunction (" guiEditGetMaxLength" , GUIEditGetMaxLength);
130
132
CLuaCFunctions::AddFunction (" guiEditSetReadOnly" , GUIEditSetReadOnly);
131
133
CLuaCFunctions::AddFunction (" guiEditIsReadOnly" , GUIEditIsReadOnly);
132
134
@@ -281,8 +283,8 @@ void CLuaGUIDefs::AddGuiEditClass(lua_State* luaVM)
281
283
282
284
lua_classvariable (luaVM, " caretIndex" , " guiEditSetCaretIndex" , " guiEditGetCaretIndex" );
283
285
lua_classvariable (luaVM, " readOnly" , " guiEditSetReadOnly" , " guiEditIsReadOnly" );
284
- lua_classvariable (luaVM, " masked" , " guiEditSetMasked" , NULL );
285
- lua_classvariable (luaVM, " maxLength" , " guiEditSetMaxLength" , NULL );
286
+ lua_classvariable (luaVM, " masked" , " guiEditSetMasked" , " guiEditIsMasked " );
287
+ lua_classvariable (luaVM, " maxLength" , " guiEditSetMaxLength" , " guiEditGetMaxLength " );
286
288
287
289
lua_registerclass (luaVM, " GuiEdit" , " GuiElement" );
288
290
}
@@ -3044,6 +3046,28 @@ int CLuaGUIDefs::GUIEditSetMasked(lua_State* luaVM)
3044
3046
return 1 ;
3045
3047
}
3046
3048
3049
+ int CLuaGUIDefs::GUIEditIsMasked (lua_State* luaVM)
3050
+ {
3051
+ // bool guiEditIsMasked(element theElement)
3052
+ CClientGUIElement* theElement;
3053
+
3054
+ CScriptArgReader argStream (luaVM);
3055
+ argStream.ReadUserData <CGUIEdit>(theElement);
3056
+
3057
+ if (!argStream.HasErrors ())
3058
+ {
3059
+ bool masked = static_cast <CGUIEdit*>(theElement->GetCGUIElement ())->IsMasked ();
3060
+ lua_pushboolean (luaVM, masked);
3061
+ return 1 ;
3062
+ }
3063
+ else
3064
+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
3065
+
3066
+ // error: bad arguments
3067
+ lua_pushnil (luaVM);
3068
+ return 1 ;
3069
+ }
3070
+
3047
3071
int CLuaGUIDefs::GUIEditSetMaxLength (lua_State* luaVM)
3048
3072
{
3049
3073
// bool guiEditSetMaxLength ( element theElement, int length )
@@ -3068,6 +3092,27 @@ int CLuaGUIDefs::GUIEditSetMaxLength(lua_State* luaVM)
3068
3092
return 1 ;
3069
3093
}
3070
3094
3095
+ int CLuaGUIDefs::GUIEditGetMaxLength (lua_State* luaVM)
3096
+ {
3097
+ // int guiEditGetMaxLength(element theElement)
3098
+ CClientGUIElement* theElement;
3099
+
3100
+ CScriptArgReader argStream (luaVM);
3101
+ argStream.ReadUserData <CGUIEdit>(theElement);
3102
+
3103
+ if (!argStream.HasErrors ())
3104
+ {
3105
+ lua_pushnumber (luaVM, static_cast <CGUIEdit*>(theElement->GetCGUIElement ())->GetMaxLength ());
3106
+ return 1 ;
3107
+ }
3108
+ else
3109
+ m_pScriptDebugging->LogCustom (luaVM, argStream.GetFullErrorMessage ());
3110
+
3111
+ // error: bad arguments
3112
+ lua_pushboolean (luaVM, false );
3113
+ return 1 ;
3114
+ }
3115
+
3071
3116
int CLuaGUIDefs::GUIEditSetCaretIndex (lua_State* luaVM)
3072
3117
{
3073
3118
// bool guiEditSetCaretIndex ( element theElement, int index )
0 commit comments