整理代码,使用TABLE.find

This commit is contained in:
MrZ626
2021-05-10 17:28:26 +08:00
parent f3eb95df93
commit fefa5433fd
10 changed files with 33 additions and 63 deletions

View File

@@ -589,17 +589,15 @@ local selector={
}
function selector:reset()
self.ATV=0
local V=self.disp()
local L=self.list
for i=1,#L do
if L[i]==V then
self.select=i
self.selText=self.list[i]
return
end
local V,L=self.disp(),self.list
local i=TABLE.find(L,V)
if i then
self.select=i
self.selText=self.list[i]
else
self.hide=true
LOG.print("Selector "..self.name.." dead, disp= "..tostring(V),'warn')
end
self.hide=true
LOG.print("Selector "..self.name.." dead, disp= "..tostring(V),'warn')
end
function selector:isAbove(x,y)
return