Exemplo n.º 1
0
        public XmlUIButton(XmlUIScene scene, XInt.Button button, XInt.Style style) : base(style, scene)
        {
            Button      = button;
            Positioning = button;
            if (Style.HoverStyle != null)
            {
                hoverChunk = LuaStyleEnvironment.L.CompileChunk(
                    style.HoverStyle, "buttonHover", new Neo.IronLua.LuaCompileOptions()
                    );
            }

            ID = button.ID;
        }
Exemplo n.º 2
0
 public XmlUIButton(XmlUIScene scene, XInt.Button button, XInt.Style style) : base(style, scene)
 {
     Button      = button;
     Positioning = button;
     if (Style.HoverStyle != null)
     {
         hoverChunk = LuaStyleEnvironment.L.CompileChunk(
             style.HoverStyle, "buttonHover", new Neo.IronLua.LuaCompileOptions()
             );
     }
     if (Texts.Count > 0)
     {
         Texts[0].Text          = scene.Manager.GetString(button.Strid, button.InfocardId, button.Text);
         Texts[0].ColorOverride = hoverStyle.TextColor;
     }
     ID = button.ID;
 }
Exemplo n.º 3
0
        private static double ExecuteNeoLuaCompiled(string sScript, int iLoops)
        {
            using (Neo.IronLua.Lua lua = new Neo.IronLua.Lua())
            {
                Neo.IronLua.LuaChunk chunk = lua.CompileChunk(sScript, "test", new Neo.IronLua.LuaCompileOptions()
                {
                    DebugEngine = debugNeoLua
                });
                Neo.IronLua.LuaGlobal g = lua.CreateEnvironment();
                g["test"] = new Action <int>(LuaTest);
                g["echo"] = new Func <object, object>(LuaEcho);

                Stopwatch sw = new Stopwatch();
                sw.Start();
                for (int i = 0; i < iLoops; i++)
                {
                    DebugOut("NeoLua-C", i, g.DoChunk(chunk));
                }
                return(sw.ElapsedMilliseconds / (double)iLoops);
            }
        }