移除词典的小程序入口

This commit is contained in:
MrZ626
2021-03-26 19:32:26 +08:00
parent 612850efb6
commit 0113cfb78e
3 changed files with 16 additions and 38 deletions

View File

@@ -39,7 +39,7 @@ return{
{"Applets",
"applets",
"help",
"Type the following codes for some fun applets!\n15-Puzzle: 15p; Schulte Grid: grid\nPong: pong; AtoZ: atoz; 2048: 2048\nCubefield: cube; Just get ten: ten\nUltimate Tic-tac-toe: uttt\nTapping speed test: tap\nDon't touch white: dtw\nCannon: can; Dropper: drp\nCalculater: calc\nReflect: refl\nPolyforge: poly\nCommand Line: cmd",
"[Entrance of applets has been moved to command line]",
},
--Games

View File

@@ -34,7 +34,7 @@ return{
{"小程序",
"小程序 applets",
"help",
"输入以下词语打开小程序:\n15-Puzzle: 15p; Schulte Grid: grid\nPong: pong; AtoZ: atoz; 2048: 2048\nCubefield: cube; Just get ten: ten\nUltimate Tic-tac-toe: uttt\nTapping speed test: tap\nDon't touch white: dtw\nCannon: can; Dropper: drp\nCalculater: calc\nReflect: refl\nPolyforge: poly\nCommand Line: cmd",
"[小程序入口已移动至命令行]",
},
--游戏(题库)

View File

@@ -40,46 +40,24 @@ local function clearResult()
selected,scrollPos=1,0
waiting,lastSearch=0,false
end
local eggInput={
["15p"]=goScene"app_15p",
grid=goScene"app_schulteG",
pong=goScene"app_pong",
atoz=goScene"app_AtoZ",
uttt=goScene"app_UTTT",
cube=goScene"app_cubefield",
["2048"]=goScene"app_2048",
ten=goScene"app_ten",
tap=goScene"app_tap",
dtw=goScene"app_dtw",
can=goScene"app_cannon",
drp=goScene"app_dropper",
calc=goScene"app_calc",
refl=goScene"app_reflect",
poly=goScene"app_polyforge",
cmd=goScene"app_cmd",
}TABLE.reIndex(eggInput)
local function search()
local input=inputBox.value:lower()
if eggInput[input]then
eggInput[input]()
else
clearResult()
local first
for i=1,#dict do
local pos=find(dict[i][2],input,nil,true)
if pos==1 and not first then
ins(result,1,dict[i])
first=true
elseif pos then
ins(result,dict[i])
end
clearResult()
local first
for i=1,#dict do
local pos=find(dict[i][2],input,nil,true)
if pos==1 and not first then
ins(result,1,dict[i])
first=true
elseif pos then
ins(result,dict[i])
end
if #result>0 then
SFX.play("reach")
end
url=(result[1]and result or dict)[selected][5]
lastSearch=input
end
if #result>0 then
SFX.play("reach")
end
url=(result[1]and result or dict)[selected][5]
lastSearch=input
end
function scene.keyDown(key)