Exemplo n.º 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();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads a plugin using this loader
        /// </summary>
        /// <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;

            LuaExtension.InitializeTypes();

            // Create it
            LuaPlugin plugin = new LuaPlugin(filename, LuaExtension, Watcher);
            plugin.Load();

            // Return it
            return plugin;
        }