133 lines
4.7 KiB
C#
133 lines
4.7 KiB
C#
#if USE_UNI_LUA
|
|
using LuaAPI = UniLua.Lua;
|
|
using RealStatePtr = UniLua.ILuaState;
|
|
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
|
|
#else
|
|
using LuaAPI = XLua.LuaDLL.Lua;
|
|
using RealStatePtr = System.IntPtr;
|
|
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
|
|
#endif
|
|
|
|
using XLua;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace XLua.CSObjectWrap
|
|
{
|
|
using Utils = XLua.Utils;
|
|
public class BFGameConstWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.GameConst);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 12, 2, 2);
|
|
|
|
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DESIGN_RESOLUTION_WIDTH", BF.GameConst.DESIGN_RESOLUTION_WIDTH);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DESIGN_RESOLUTION_HEIGHT", BF.GameConst.DESIGN_RESOLUTION_HEIGHT);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BIG_TEXTURE_WIDTH", BF.GameConst.BIG_TEXTURE_WIDTH);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BIG_TEXTURE_HEIGHT", BF.GameConst.BIG_TEXTURE_HEIGHT);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "EDITOR_MODE", BF.GameConst.EDITOR_MODE);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DEBUG", BF.GameConst.DEBUG);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "USE_AB", BF.GameConst.USE_AB);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "SKIP_VERSION", BF.GameConst.SKIP_VERSION);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BF_APP_DEV", BF.GameConst.BF_APP_DEV);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BF_APP_TEST", BF.GameConst.BF_APP_TEST);
|
|
Utils.RegisterObject(L, translator, Utils.CLS_IDX, "BF_APP_PUBLISH", BF.GameConst.BF_APP_PUBLISH);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "C_FREE_CHAR", _g_get_C_FREE_CHAR);
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "C_CONFIG_CHAR", _g_get_C_CONFIG_CHAR);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "C_FREE_CHAR", _s_set_C_FREE_CHAR);
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "C_CONFIG_CHAR", _s_set_C_CONFIG_CHAR);
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
return LuaAPI.luaL_error(L, "BF.GameConst does not have a constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_C_FREE_CHAR(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, BF.GameConst.C_FREE_CHAR);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_C_CONFIG_CHAR(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
translator.Push(L, BF.GameConst.C_CONFIG_CHAR);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_C_FREE_CHAR(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
BF.GameConst.C_FREE_CHAR = (char[])translator.GetObject(L, 1, typeof(char[]));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_C_CONFIG_CHAR(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
BF.GameConst.C_CONFIG_CHAR = (char[])translator.GetObject(L, 1, typeof(char[]));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|