Skip to content

Commit b3703e4

Browse files
committed
Add Plugin Metafuntion / remake charlist derma.
1 parent de738ad commit b3703e4

File tree

46 files changed

+122
-1013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+122
-1013
lines changed

nutscript/gamemode/derma/cl_charlist.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function PANEL:Init()
88
self:SetVisible(false);
99

1010
self.name = vgui.Create("DLabel", self);
11+
self.name:SetPos(0, 10);
1112
self.name:SetFont("nut_LargeFont");
1213
self.name:SetTextColor(color_white)
1314
self.name:SetExpensiveShadow(1, Color(0, 0, 0, 100))

nutscript/gamemode/kernel/cl_kernel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ function GM:HUDPaintTargetID(entity)
365365
if (targetIsValid and (!drawnEntities[entity] and entity != client and entity:IsPlayer() or hook.Run("ShouldDrawTargetEntity", entity) == true or entity.DrawTargetID)) then
366366
drawnEntities[entity] = true
367367
end
368-
368+
369369
for v in pairs(drawnEntities) do
370370
if (IsValid(v) and v != client and (v:IsPlayer() or hook.Run("ShouldDrawTargetEntity", v) == true or v.DrawTargetID)) then
371371
local target = 0

nutscript/gamemode/language/sh_english.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ nut.lang.Add("cant_equip_weapon", "이 무기를 장착한 상태에서는 할
284284

285285
// Vendor (framework)
286286
nut.lang.Add("no_afford", "당신은 이 아이템을 구매할 충분한 돈이 없습니다.", language);
287-
nut.lang.Add("vendor_no_afford", "상인은 이 아이템을 구매하기에 충분한 돈을 가지고 있지 않습니다.", language);
288-
nut.lang.Add("vendor_cash", "이 상인은 %s을(를) 가지고 있습니다.", language);
289287
nut.lang.Add("purchased_for", "당신은 %s을(를) %s 에 구매하였습니다.", language);
290288
nut.lang.Add("sold", "당신은 %s을(를) %s 에 판매하였습니다.", language);
291289
nut.lang.Add("notenoughitem", "당신은 판매할 %s을(를) 가지고 있지 않습니다.", language);

nutscript/gamemode/libs/sh_plugin.lua

Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

nutscript/gamemode/utils/sh_advutil.lua

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ function AdvNut.util.DrawRoundedBox(panel, corner, x, y, w, h)
117117
end;
118118
end;
119119

120-
function AdvNut.util.PluginIncludeDir(directory, uniqueID, isBasePlugin)
121-
local pluginPath = ((!isBasePlugin and SCHEMA.folderName) or "nutscript").."/plugins/"..uniqueID.."/"..directory;
122-
123-
for k, v in pairs(file.Find(pluginPath.."/*.lua", "LUA")) do
124-
nut.util.Include(pluginPath.."/"..v);
125-
end
126-
end
127-
128120
function AdvNut.util.GetCurrentMenuSize()
129121
return (ScrW() * nut.config.menuWidth), (ScrH() * nut.config.menuHeight);
130122
end;

nutscript/plugins/3dpanel/sh_plugin.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ PLUGIN.name = "3D 패널 (3D Panels)"
33
PLUGIN.author = "Chessnut / 번역자 : Tensa"
44
PLUGIN.desc = "3D 패널을 추가시켜 줍니다."
55
PLUGIN.panels = PLUGIN.panels or {}
6+
PLUGIN.base = true;
67

7-
AdvNut.util.Include("language", PLUGIN.uniqueID, true);
8+
PLUGIN:IncludeDir("language");
89

910
nut.util.Include("sv_plugin.lua");
1011
nut.util.Include("cl_plugin.lua");

nutscript/plugins/3dtext/sh_plugin.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ PLUGIN.name = "3D 텍스트 (3D Text)"
33
PLUGIN.author = "Chessnut / 번역자 : Tensa"
44
PLUGIN.desc = "아무곳에나 3D 텍스트를 쓸수 있게 해줍니다."
55
PLUGIN.text = PLUGIN.text or {}
6+
PLUGIN.base = true;
67

7-
AdvNut.util.Include("language", PLUGIN.uniqueID, true);
8+
PLUGIN:IncludeDir("language");
89

910
nut.util.Include("sv_plugin.lua");
1011
nut.util.Include("cl_plugin.lua");

nutscript/plugins/act/language/sh_korean.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local language = "korean";
22
local PLUGIN = PLUGIN;
3-
3+
44
PLUGIN:AddPluginLanguage("act_menu", "모션", language);
55
PLUGIN:AddPluginLanguage("act_cant_fallover", "기절한 상태에서는 할 수 없습니다.", language);
66
PLUGIN:AddPluginLanguage("act_closewall", "해당 모션은 벽에 기대야 할 수 있습니다.", language);

nutscript/plugins/act/sh_plugin.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ PLUGIN.name = "플레이어 동작 (Player Acts)"
33
PLUGIN.author = "Chessnut and rebel1324 / 번역자 : Tensa and Renée"
44
PLUGIN.desc = "플레이어의 행동을 추가시켜 줍니다."
55
PLUGIN.sequences = {}
6+
PLUGIN.base = true;
67

7-
AdvNut.util.Include("language", PLUGIN.uniqueID, true);
8+
PLUGIN:IncludeDir("language");
89

910
local function lean(client)
1011
local data = {

nutscript/plugins/area/sh_plugin.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ local PLUGIN = PLUGIN or { };
22
PLUGIN.name = "구역 (Area)"
33
PLUGIN.author = "Chessnut / 번역자 : Tensa"
44
PLUGIN.desc = "구역과 관련된 기능을 추가합니다."
5+
PLUGIN.base = true;
56

6-
7-
AdvNut.util.Include("language", PLUGIN.uniqueID, true);
7+
PLUGIN:IncludeDir("language");
88

99
nut.util.Include("sv_plugin.lua");
1010
nut.util.Include("cl_plugin.lua");

0 commit comments

Comments
 (0)