控制台添加一个移除设置项的命令
This commit is contained in:
@@ -192,6 +192,7 @@ USER=FILE.load("conf/user")or{--User infomation
|
|||||||
--Local data
|
--Local data
|
||||||
xp=0,lv=1,
|
xp=0,lv=1,
|
||||||
}
|
}
|
||||||
|
|
||||||
customEnv0={
|
customEnv0={
|
||||||
version=VERSION.code,
|
version=VERSION.code,
|
||||||
|
|
||||||
@@ -240,7 +241,6 @@ if not CUSTOMENV or CUSTOMENV.version~=VERSION.code then
|
|||||||
else
|
else
|
||||||
TABLE.complete(customEnv0,CUSTOMENV)
|
TABLE.complete(customEnv0,CUSTOMENV)
|
||||||
end
|
end
|
||||||
|
|
||||||
SETTING={--Settings
|
SETTING={--Settings
|
||||||
--Tuning
|
--Tuning
|
||||||
das=10,arr=2,dascut=0,
|
das=10,arr=2,dascut=0,
|
||||||
|
|||||||
@@ -127,6 +127,16 @@ do--commands.help(arg)
|
|||||||
"Usage: rst",
|
"Usage: rst",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
rmst={
|
||||||
|
description="Erase setting value",
|
||||||
|
details={
|
||||||
|
"Erase a setting value",
|
||||||
|
"Useful if you have your setting corrupted",
|
||||||
|
"YOU MUST RESTART THE GAME AFTER USING THIS",
|
||||||
|
"",
|
||||||
|
"Usage: rmst [key]",
|
||||||
|
},
|
||||||
|
},
|
||||||
fn={
|
fn={
|
||||||
description="Simulates a Function key press.",
|
description="Simulates a Function key press.",
|
||||||
details={
|
details={
|
||||||
@@ -252,6 +262,7 @@ do--commands.help(arg)
|
|||||||
"mv",
|
"mv",
|
||||||
"cls",
|
"cls",
|
||||||
"rst",
|
"rst",
|
||||||
|
"rmst",
|
||||||
"fn",
|
"fn",
|
||||||
"scrinfo",
|
"scrinfo",
|
||||||
"wireframe",
|
"wireframe",
|
||||||
@@ -302,7 +313,7 @@ function commands.print(name)
|
|||||||
log{C.R,("No file called '%s'"):format(name)}
|
log{C.R,("No file called '%s'"):format(name)}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: print [filename]"}
|
log{C.A,"Usage: print [filename]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.url(url)
|
function commands.url(url)
|
||||||
@@ -312,7 +323,7 @@ function commands.url(url)
|
|||||||
log{C.R,"[ERR] ",C.Z,err}
|
log{C.R,"[ERR] ",C.Z,err}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: url [url]"}
|
log{C.A,"Usage: url [url]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
do--function commands.tree()
|
do--function commands.tree()
|
||||||
@@ -405,8 +416,8 @@ do--function commands.del(name)
|
|||||||
log{C.R,("No file called '%s'"):format(name)}
|
log{C.R,("No file called '%s'"):format(name)}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: del [filename|dirname]"}
|
log{C.A,"Usage: del [filename|dirname]"}
|
||||||
log{C.aqua,"Usage: del -s [dirname]"}
|
log{C.A,"Usage: del -s [dirname]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
commands.rm=commands.del
|
commands.rm=commands.del
|
||||||
@@ -418,7 +429,7 @@ function commands.mv(arg)
|
|||||||
log{C.lY,"Warning: file name with space is not allowed"}
|
log{C.lY,"Warning: file name with space is not allowed"}
|
||||||
return
|
return
|
||||||
elseif #arg<2 then
|
elseif #arg<2 then
|
||||||
log{C.aqua,"Usage: ren [oldfilename] [newfilename]"}
|
log{C.A,"Usage: ren [oldfilename] [newfilename]"}
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -449,15 +460,28 @@ commands.quit=backScene
|
|||||||
commands.bye=backScene
|
commands.bye=backScene
|
||||||
|
|
||||||
--Game commands
|
--Game commands
|
||||||
|
function commands.rmst(key)
|
||||||
|
if #key>0 then
|
||||||
|
if SETTING[key]~=nil then
|
||||||
|
SETTING[key]=nil
|
||||||
|
FILE.save(SETTING,'conf/settings','q')
|
||||||
|
log{C.Y,("Succesfully erased key '%s'"):format(key)}
|
||||||
|
else
|
||||||
|
log{C.R,"No key called "..key}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
log{C.A,"Usage: rmst [key]"}
|
||||||
|
end
|
||||||
|
end
|
||||||
function commands.fn(n)
|
function commands.fn(n)
|
||||||
if tonumber(n)then
|
if tonumber(n)then
|
||||||
n=math.floor(tonumber(n))
|
n=math.floor(tonumber(n))
|
||||||
if n>=1 and n<=12 then
|
if n>=1 and n<=12 then
|
||||||
love.keypressed("f"..n)
|
love.keypressed("f"..n)
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
log{C.A,"Usage: fn [1~12]"}
|
||||||
end
|
end
|
||||||
log{C.aqua,"Usage: fn [1~12]"}
|
|
||||||
end
|
end
|
||||||
function commands.scrinfo()
|
function commands.scrinfo()
|
||||||
for _,v in next,SCR.info()do
|
for _,v in next,SCR.info()do
|
||||||
@@ -469,7 +493,7 @@ function commands.wireframe(bool)
|
|||||||
gc.setWireframe(bool=="true")
|
gc.setWireframe(bool=="true")
|
||||||
log("Wireframe: "..(gc.isWireframe()and"on"or"off"))
|
log("Wireframe: "..(gc.isWireframe()and"on"or"off"))
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: wireframe <true|false>"}
|
log{C.A,"Usage: wireframe <true|false>"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.gammacorrect(bool)
|
function commands.gammacorrect(bool)
|
||||||
@@ -477,7 +501,7 @@ function commands.gammacorrect(bool)
|
|||||||
love._setGammaCorrect(bool=="true")
|
love._setGammaCorrect(bool=="true")
|
||||||
log("GammaCorrect: "..(gc.isGammaCorrect()and"on"or"off"))
|
log("GammaCorrect: "..(gc.isGammaCorrect()and"on"or"off"))
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: gammacorrect <true|false>"}
|
log{C.A,"Usage: gammacorrect <true|false>"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
commands["\114\109\119\116\109"]=function(pw)
|
commands["\114\109\119\116\109"]=function(pw)
|
||||||
@@ -508,7 +532,7 @@ function commands.play(m)--marathon_bfmax can only entered through here
|
|||||||
elseif m~=""then
|
elseif m~=""then
|
||||||
log{C.R,"No mode called "..m}
|
log{C.R,"No mode called "..m}
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: play [modeName]"}
|
log{C.A,"Usage: play [modeName]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.playbgm(bgm)
|
function commands.playbgm(bgm)
|
||||||
@@ -523,7 +547,7 @@ function commands.playbgm(bgm)
|
|||||||
log("Already playing: "..bgm)
|
log("Already playing: "..bgm)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: playbgm [bgmName]"}
|
log{C.A,"Usage: playbgm [bgmName]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
commands.music=commands.playbgm
|
commands.music=commands.playbgm
|
||||||
@@ -542,7 +566,7 @@ function commands.setbg(name)
|
|||||||
log(("Background already set to '%s'"):format(name))
|
log(("Background already set to '%s'"):format(name))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: setbg [bgName]"}
|
log{C.A,"Usage: setbg [bgName]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.theme(name)
|
function commands.theme(name)
|
||||||
@@ -553,7 +577,7 @@ function commands.theme(name)
|
|||||||
log("No theme called "..name)
|
log("No theme called "..name)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage: theme [themeName]"}
|
log{C.A,"Usage: theme [themeName]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function commands.test()
|
function commands.test()
|
||||||
@@ -589,12 +613,12 @@ do--commands.applet(name)
|
|||||||
if i then
|
if i then
|
||||||
SCN.go(appScene[i])
|
SCN.go(appScene[i])
|
||||||
else
|
else
|
||||||
log{C.aqua,"No this applet"}
|
log{C.A,"No this applet"}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log{C.aqua,"Usage:"}
|
log{C.A,"Usage:"}
|
||||||
log{C.aqua,"applet -list"}
|
log{C.A,"applet -list"}
|
||||||
log{C.aqua,"applet [appName]"}
|
log{C.A,"applet [appName]"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
commands.app=commands.applet
|
commands.app=commands.applet
|
||||||
|
|||||||
Reference in New Issue
Block a user