Example #1
0
    static int Hide(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                cs.GuiControl obj = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
                obj.Hide();
                return(0);
            }
            else if (count == 2)
            {
                cs.GuiControl obj  = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
                bool          arg0 = LuaDLL.luaL_checkboolean(L, 2);
                obj.Hide(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: cs.GuiControl.Hide"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
 static int Clear(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         cs.GuiControl obj = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
         obj.Clear();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #3
0
 static int Initialize(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         cs.GuiControl obj = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
         bool          o   = obj.Initialize();
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #4
0
 static int ToLabel(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         cs.GuiControl obj = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
         cs.GuiLabel   o   = obj.ToLabel();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #5
0
 static int GetGuiEffectPlayer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         cs.GuiControl      obj = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
         cs.GuiEffectPlayer o   = obj.GetGuiEffectPlayer();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #6
0
 static int SetSortingOrder(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         cs.GuiControl obj  = (cs.GuiControl)ToLua.CheckObject <cs.GuiControl>(L, 1);
         int           arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.SetSortingOrder(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #7
0
 static int GetControl(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         cs.GuiObject  obj  = (cs.GuiObject)ToLua.CheckObject <cs.GuiObject>(L, 1);
         int           arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         cs.GuiControl o    = obj.GetControl(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #8
0
    static int get_ID(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            cs.GuiControl obj = (cs.GuiControl)o;
            int           ret = obj.ID;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index ID on a nil value"));
        }
    }
Example #9
0
    static int get_guiState(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            cs.GuiControl obj = (cs.GuiControl)o;
            cs.EGuiState  ret = obj.guiState;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index guiState on a nil value"));
        }
    }
Example #10
0
        private int _GenValidControlID(GuiControl target)
        {
            Transform currTrans = (target as GuiControl).transform;
            GuiObject guiObject = Utility.FindGuiObjectOwner(currTrans);

            int nCurrentMaxID = 0;

            GuiControl[] arrCtrls = guiObject.GetComponentsInChildren <GuiControl>();
            for (int i = 0; i < arrCtrls.Length; ++i)
            {
                if (arrCtrls[i].ID > nCurrentMaxID)
                {
                    nCurrentMaxID = arrCtrls[i].ID;
                }
            }
            Debug.Log("current id-->" + target.ID + "length--->" + arrCtrls.Length);
            //if (target.ID == nCurrentMaxID) target.setID(nCurrentMaxID+1);
            return(nCurrentMaxID);
        }