移除词典的小程序入口

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",
"applets", "applets",
"help", "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 --Games

View File

@@ -34,7 +34,7 @@ return{
{"小程序", {"小程序",
"小程序 applets", "小程序 applets",
"help", "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 selected,scrollPos=1,0
waiting,lastSearch=0,false waiting,lastSearch=0,false
end 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 function search()
local input=inputBox.value:lower() local input=inputBox.value:lower()
if eggInput[input]then clearResult()
eggInput[input]() local first
else for i=1,#dict do
clearResult() local pos=find(dict[i][2],input,nil,true)
local first if pos==1 and not first then
for i=1,#dict do ins(result,1,dict[i])
local pos=find(dict[i][2],input,nil,true) first=true
if pos==1 and not first then elseif pos then
ins(result,1,dict[i]) ins(result,dict[i])
first=true
elseif pos then
ins(result,dict[i])
end
end end
if #result>0 then
SFX.play("reach")
end
url=(result[1]and result or dict)[selected][5]
lastSearch=input
end end
if #result>0 then
SFX.play("reach")
end
url=(result[1]and result or dict)[selected][5]
lastSearch=input
end end
function scene.keyDown(key) function scene.keyDown(key)