public override void DefineApi(LuaInterpreter script)
        {
            base.DefineApi(script);

            script.AddFunction("music", (Action <int, int?, int?>)Music);
            script.AddFunction("sfx", (Action <int, int?, int?, int?>)Sfx);
        }
示例#2
0
        public override void DefineApi(LuaInterpreter script)
        {
            base.DefineApi(script);

            script.AddFunction("btn", (Func <int?, int?, object>)Btn);
            script.AddFunction("btnp", (Func <int?, int?, object>)Btnp);
        }
示例#3
0
        public void InitApi(LuaInterpreter script)
        {
            foreach (var unit in units)
            {
                unit.DefineApi(script);
            }

            script.AddFunction("printh", (Action <object>)Printh);
            script.AddFunction("stat", (Func <object>)Stat);
            script.AddFunction("menuitem", (Action <int, string, object>)Menuitem);

            script.RunScript(LuaPatcher.PatchCode(Api.All));
        }
        public override void DefineApi(LuaInterpreter script)
        {
            base.DefineApi(script);

            script.AddFunction("reload", (Action <int, int, int, string>)Reload);
            script.AddFunction("cstore", (Action <int, int, int, string>)Cstore);
            script.AddFunction("cartdata", (Action <string>)Cartdata);
            script.AddFunction("dget", (Func <int, object>)Dget);
            script.AddFunction("dset", (Action <int, double>)Dset);
            script.AddFunction("import", (Action <string, bool>)Import);
            script.AddFunction("export", (Action <string>)Export);
            script.AddFunction("run", (Action)Run);

            script.AddFunction("time", (Func <double>)Time);
            script.AddFunction("t", (Func <double>)Time);
        }
示例#5
0
        public void DefineApi(LuaInterpreter script)
        {
            script.AddFunction("color", (Action <byte?>)Color);
            script.AddFunction("cursor", (Action <int?, int?>)Cursor);
            script.AddFunction("fillp", (Action <double?>)Fillp);
            script.AddFunction("camera", (Action <int?, int?>)Camera);
            script.AddFunction("pal", (Action <int?, int?, int>)Pal);
            script.AddFunction("palt", (Action <int?, bool>)Palt);
            script.AddFunction("clip", (Action <int?, int?, int?, int?>)Clip);

            Palt();
        }
        public override void DefineApi(LuaInterpreter script)
        {
            base.DefineApi(script);

            script.AddFunction("memset", (Func <int, byte, int, object>)Memset);
            script.AddFunction("memcpy", (Func <int, int, int, object>)Memcpy);
            script.AddFunction("peek", (Func <int, byte>)Peek);
            script.AddFunction("poke", (Func <int, byte, object>)Poke);

            script.AddFunction("fget", (Func <int, byte?, object>)Fget);
            script.AddFunction("fset", (Action <int, byte?, bool?>)Fset);
            script.AddFunction("mget", (Func <int, int, byte>)Mget);
            script.AddFunction("mset", (Action <int, int, byte>)Mset);

            drawState.DefineApi(script);
        }
        public override void DefineApi(LuaInterpreter script)
        {
            script.AddFunction("rnd", (Func <double?, double>)Rnd);
            script.AddFunction("srand", (Action <int>)Srand);

            script.AddFunction("flr", (Func <double, double>)Flr);
            script.AddFunction("sgn", (Func <double, double>)Sgn);
            script.AddFunction("max", (Func <double, double, double>)Max);
            script.AddFunction("min", (Func <double, double, double>)Min);
            script.AddFunction("mid", (Func <double, double, double, double>)Mid);
            script.AddFunction("abs", (Func <double, double>)Abs);
            script.AddFunction("sqrt", (Func <double, double>)Sqrt);

            script.AddFunction("cos", (Func <double, double>)Cos);
            script.AddFunction("sin", (Func <double, double>)Sin);
            script.AddFunction("atan2", (Func <double, double, double>)Atan2);

            script.AddFunction("band", (Func <float, float, double>)Band);
            script.AddFunction("bor", (Func <float, float, double>)Bor);
            script.AddFunction("bxor", (Func <float, float, double>)Bxor);
            script.AddFunction("bnot", (Func <float, double>)Bnot);
            script.AddFunction("shl", (Func <float, int, double>)Shl);
            script.AddFunction("shr", (Func <float, int, double>)Shr);
        }
示例#8
0
        public override void DefineApi(LuaInterpreter script)
        {
            base.DefineApi(script);

            script.AddFunction("pset", (Action <int, int, byte?>)Pset);
            script.AddFunction("pget", (Func <int, int, byte>)Pget);
            script.AddFunction("flip", (Action)Flip);
            script.AddFunction("cls", (Action <byte?>)Cls);

            script.AddFunction("spr", (Action <int, int?, int?, int?, int?, bool, bool>)Spr);
            script.AddFunction("sspr", (Action <int, int, int, int, int, int, int?, int?, bool, bool>)Sspr);

            script.AddFunction("print", (Action <string, int?, int?, byte?>)Print);
            script.AddFunction("map", (Action <int?, int?, int?, int?, int?, int?, byte?>)Map);
            // Old name of map
            script.AddFunction("mapdraw", (Action <int?, int?, int?, int?, int?, int?, byte?>)Map);

            script.AddFunction("line", (Action <int, int, int?, int?, byte?>)Line);
            script.AddFunction("rect", (Action <int, int, int, int, byte?>)Rect);
            script.AddFunction("rectfill", (Action <int, int, int, int, byte?>)Rectfill);
            script.AddFunction("circ", (Action <int, int, double?, byte?>)Circ);
            script.AddFunction("circfill", (Action <int, int, double?, byte?>)Circfill);

            script.AddFunction("sset", (Action <int, int, byte?>)Sset);
            script.AddFunction("sget", (Func <int, int, byte>)Sget);
        }