整理代码,只在代码中使用的字符串由双引号改为单引号

This commit is contained in:
MrZ626
2021-06-29 04:09:06 +08:00
parent 1c553df53a
commit 706fa901e2
17 changed files with 221 additions and 221 deletions

View File

@@ -7,19 +7,19 @@ local themeColor={
}
function THEME.calculate(Y,M,D)
if not Y then Y,M,D=os.date("%Y"),os.date("%m"),os.date("%d")end
if not Y then Y,M,D=os.date('%Y'),os.date('%m'),os.date('%d')end
--Festival calculate within one statement
return
--Christmas
M=="12"and math.abs(D-25)<4 and
M=='12'and math.abs(D-25)<4 and
'xmas'or
--Birthday
M=="06"and D=="06"and
M=='06'and D=='06'and
'birth'or
--Spring festival
M<"03"and math.abs((({
M<'03'and math.abs((({
--Festival days. Jan 26=26, Feb 1=32, etc.
24,43,32,22,40,29,49,38,26,45,
34,23,41,31,50,39,28,47,36,25,
@@ -32,14 +32,14 @@ function THEME.calculate(Y,M,D)
'sprfes'or
--April fool's day
M=="04"and D=="01"and
M=='04'and D=='01'and
'fool'or
--Z day (Feb./Mar./Apr./May./June. 26)
D=="26"and(
(M=="01"or M=="02")and'zday1'or
(M=="03"or M=="04")and'zday2'or
(M=="05"or M=="06")and'zday3'
D=='26'and(
(M=='01'or M=='02')and'zday1'or
(M=='03'or M=='04')and'zday2'or
(M=='05'or M=='06')and'zday3'
)or
'classic'
@@ -48,7 +48,7 @@ end
function THEME.set(theme)
if theme=='classic'then
BG.setDefault('space')
BGM.setDefault("space")
BGM.setDefault('space')
elseif theme=='xmas'then
BG.setDefault('snow')
BGM.setDefault('xmas')
@@ -58,20 +58,20 @@ function THEME.set(theme)
BGM.setDefault('magicblock')
elseif theme=='sprfes'then
BG.setDefault('firework')
BGM.setDefault("spring festival")
BGM.setDefault('spring festival')
MES.new('info',"★☆新年快乐☆★")
elseif theme=='zday1'then
BG.setDefault('lanterns')
BGM.setDefault("empty")
BGM.setDefault('empty')
elseif theme=='zday2'then
BG.setDefault('lanterns')
BGM.setDefault("overzero")
BGM.setDefault('overzero')
elseif theme=='zday3'then
BG.setDefault('lanterns')
BGM.setDefault("vacuum")
BGM.setDefault('vacuum')
elseif theme=='fool'then
BG.setDefault('blockrain')
BGM.setDefault("how feeling")
BGM.setDefault('how feeling')
else
return
end
@@ -87,7 +87,7 @@ function THEME.getThemeColor(theme)
end
function THEME.fresh()
THEME.set(THEME.calculate(os.date("%Y"),os.date("%m"),os.date("%d")))
THEME.set(THEME.calculate(os.date('%Y'),os.date('%m'),os.date('%d')))
end
return THEME