@@ -156,8 +156,8 @@ function nut.plugin.Load(directory)
156156 nut .lang .Add (self :_GetPluginLanguageIdentifier (key ), value , language );
157157 end ;
158158
159- function PLUGIN :GetPluginLanguage (key )
160- return nut .lang .Get (self :_GetPluginLanguageIdentifier (key ));
159+ function PLUGIN :GetPluginLanguage (key , ... )
160+ return nut .lang .Get (self :_GetPluginLanguageIdentifier (key ), ... );
161161 end ;
162162
163163 function PLUGIN :GetPluginConfig (key , default )
@@ -184,9 +184,9 @@ function nut.plugin.Load(directory)
184184 end ;
185185 end ;
186186
187- function PLUGIN :IncludeDir (dir , isBase )
187+ function PLUGIN :IncludeDir (dir )
188188 local path ;
189- if (SCHEMA and !isBase ) then
189+ if (SCHEMA and !self . base ) then
190190 path = SCHEMA .folderName .. " /plugin/" .. self .uniqueID .. " /" .. dir ;
191191 else
192192 path = " nutscript/plugins/" .. self .uniqueID .. " /" .. dir ;
@@ -227,55 +227,68 @@ function nut.plugin.Load(directory)
227227 if (!blocked ) then
228228 PLUGIN = nut .plugin .Get (cleanName ) or {};
229229 PLUGIN .uniqueID = v ;
230-
231- function PLUGIN :WriteTable (data , ignoreMap , global )
232- return nut .util .WriteTable (v , data , ignoreMap , global )
233- end
230+
231+ function PLUGIN :WriteTable (data , ignoreMap , global )
232+ return nut .util .WriteTable (v , data , ignoreMap , global )
233+ end
234234
235- function PLUGIN :ReadTable (ignoreMap , forceRefresh )
236- return nut .util .ReadTable (v , ignoreMap , forceRefresh )
237- end
235+ function PLUGIN :ReadTable (ignoreMap , forceRefresh )
236+ return nut .util .ReadTable (v , ignoreMap , forceRefresh )
237+ end
238238
239- function PLUGIN :CreatePluginIdentifier (key , caller )
240- return AdvNut .util .CreateIdentifier (" " , caller ).. " Plugin." .. self .uniqueID .. " ." .. key ;
241- end ;
239+ function PLUGIN :GetPluginIdentifier (key , caller )
240+ return AdvNut .util .CreateIdentifier (" " , caller ).. " Plugin." .. self .uniqueID .. " ." .. key ;
241+ end ;
242242
243- /// Don ' t use this function. it' s private function .
244- function PLUGIN :_GetPluginLanguageIdentifier (key )
245- return self :GetPluginIdentifier (" " ).. " Language." .. key ;
246- end ;
243+ /// Don ' t use this function. it' s private function .
244+ function PLUGIN :_GetPluginLanguageIdentifier (key )
245+ return self :GetPluginIdentifier (" " ).. " Language." .. key ;
246+ end ;
247247
248- function PLUGIN :AddPluginLanguage (key , value , language )
249- nut .lang .Add (self :_GetPluginLanguageIdentifier (key ), value , language );
250- end ;
248+ function PLUGIN :AddPluginLanguage (key , value , language )
249+ nut .lang .Add (self :_GetPluginLanguageIdentifier (key ), value , language );
250+ end ;
251251
252- function PLUGIN :GetPluginLanguage (key )
253- return nut .lang .Get (self :_GetPluginLanguageIdentifier (key ));
254- end ;
252+ function PLUGIN :GetPluginLanguage (key , ... )
253+ return nut .lang .Get (self :_GetPluginLanguageIdentifier (key ), ... );
254+ end ;
255255
256- function PLUGIN :GetPluginConfig (key , default )
257- if (self ) then
258- if (nut .config [self .uniqueID ]) then
259- return nut .config [self .uniqueID ][key ] or default ;
256+ function PLUGIN :GetPluginConfig (key , default )
257+ if (self ) then
258+ if (nut .config [self .uniqueID ]) then
259+ return nut .config [self .uniqueID ][key ] or default ;
260+ else
261+ return default ;
262+ end ;
260263 else
261264 return default ;
262265 end ;
263- else
264- return default ;
265266 end ;
266- end ;
267267
268- function PLUGIN :SetPluginConfig (key , value )
269- if (self .uniqueID ) then
270- local uniqueID = self .uniqueID ;
268+ function PLUGIN :SetPluginConfig (key , value )
269+ if (self .uniqueID ) then
270+ local uniqueID = self .uniqueID ;
271271
272- if (!nut .config [uniqueID ]) then
273- nut .config [uniqueID ] = {};
274- end ;
272+ if (!nut .config [uniqueID ]) then
273+ nut .config [uniqueID ] = {};
274+ end ;
275275
276- nut .config [self .uniqueID ][key ] = value ;
276+ nut .config [self .uniqueID ][key ] = value ;
277+ end ;
278+ end ;
279+
280+ function PLUGIN :IncludeDir (dir )
281+ local path ;
282+ if (SCHEMA and !self .base ) then
283+ path = SCHEMA .folderName .. " /plugin/" .. self .uniqueID .. " /" .. dir ;
284+ else
285+ path = " nutscript/plugins/" .. self .uniqueID .. " /" .. dir ;
286+ end ;
287+
288+ for k , v in pairs (file .Find (path .. " /*.lua" , " LUA" )) do
289+ nut .util .Include (path .. " /" .. v );
290+ end
277291 end ;
278- end ;
279292
280293 nut .util .Include (directory .. " /plugins/" .. v , " shared" );
281294 nut .plugin .buffer [cleanName ] = PLUGIN ;
0 commit comments