示例#1
0
        /// <summary>
        /// Saves the config file for the specified plugin
        /// </summary>
        /// <param name="plugintable"></param>
        private static void lua_SaveConfig(LuaTable plugintable)
        {
            LuaPlugin plugin = plugintable["Object"] as LuaPlugin;

            if (plugin == null)
            {
                return;
            }
            plugin.SaveConfig();
        }
示例#2
0
        /// <summary>
        /// Loads a plugin using this loader
        /// </summary>
        /// <param name="manager"></param>
        /// <param name="directory"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public override Plugin Load(string directory, string name)
        {
            // Get the filename
            string filename = Path.Combine(directory, name + ".lua");

            // Check it exists
            if (!File.Exists(filename))
            {
                return(null);
            }

            // Create it
            LuaPlugin plugin = new LuaPlugin(filename, LuaEnvironment, Watcher);

            plugin.Load();

            // Return it
            return(plugin);
        }