整理代码,调整local函数名规范(较边缘的代码不必遵守,比如外部的库和小程序):

特别临时性的用全大写字母缩写或者单字母
TASK模块用到的任务函数和检查函数开头分别为task_和check_
其他函数开头添加下划线作为指示
This commit is contained in:
MrZ626
2021-08-25 02:40:01 +08:00
parent ee55055385
commit 8f910f95f4
40 changed files with 470 additions and 466 deletions

View File

@@ -1,10 +1,10 @@
local LANG={}
function LANG.init(langList,publicText)--Attention, calling this will destory all initializing methods, create a LANG.set()!
local function langFallback(T0,T)
local function _langFallback(T0,T)
for k,v in next,T0 do
if type(v)=='table'and not v.refuseCopy then--refuseCopy: just copy pointer, not contents
if not T[k]then T[k]={}end
if type(T[k])=='table'then langFallback(v,T[k])end
if type(T[k])=='table'then _langFallback(v,T[k])end
elseif not T[k]then
T[k]=v
end
@@ -22,7 +22,7 @@ function LANG.init(langList,publicText)--Attention, calling this will destory al
--Fallback to other language, default zh
if i>1 then
langFallback(langList[L.fallback or 1],L)
_langFallback(langList[L.fallback or 1],L)
end
--Metatable:__call for table:getTip