예제 #1
0
        public LuaArgs print(LuaArgs args)
        {
            var output = new StringBuilder();

            for (int i = 0; i < args.Length; ++i)
            {
                output.Append(args.ToString(i));
                if (i < args.Length - 1)
                {
                    output.Append(", ");
                }
            }
            App.UserLog(output.ToString());
            return(LuaArgs.Empty);
        }
예제 #2
0
        public LuaArgs translate(LuaArgs args)
        {
            var language = m_state.Game.Language;
            var key      = args.GetString(0);

            if (args.Length > 1)
            {
                object[] strings = new object[args.Length - 1];
                for (int i = 1; i < args.Length; ++i)
                {
                    strings[i - 1] = args.ToString(i);
                }
                return(new LuaArgs(
                           language.Translate(key, strings)
                           ));
            }
            else
            {
                return(new LuaArgs(
                           language.Translate(key)
                           ));
            }
        }