历史场景优化

This commit is contained in:
MrZ626
2021-01-07 22:04:13 +08:00
parent 3ef57cde27
commit c57c9a972f
2 changed files with 7 additions and 22 deletions

View File

@@ -21,9 +21,9 @@ function scene.wheelMoved(_,y)
end
function scene.keyDown(key)
if key=="up"then
scrollPos=max(scrollPos-1,1)
scrollPos=max(scrollPos-6,1)
elseif key=="down"then
scrollPos=min(scrollPos+1,#texts)
scrollPos=min(scrollPos+6,#texts-22)
elseif key=="escape"then
SCN.back()
end
@@ -36,7 +36,9 @@ function scene.draw()
gc.setLineWidth(4)
gc.rectangle("line",30,45,1000,632)
setFont(20)
gc.print(texts[scrollPos],40,50)
for i=0,22 do
gc.print(texts[scrollPos+i],40,50+27*i)
end
end
scene.widgetList={

View File

@@ -1,5 +1,4 @@
local S=[=[
"Patron"(time ordered, may not accurate):
return splitStr([=[
<<<<<<<<<<rmb1000+>>>>>>>>>>
★☆白羽☆★
<<<rmb100+>>>
@@ -1357,20 +1356,4 @@ local S=[=[
GUI position editted
grid BG changed
smarter AI
]=]
local find,sub=string.find,string.sub
local L,c={},0--List, \n counter,
local p,p1=1,0--Cut start/end pos
local EOF=#S
while true do
p1=find(S,"\n",p1+1)
c=c+1
if c==23 or p1==EOF then
L[#L+1]=sub(S,p,p1-1)
if p1==EOF then return L end
p=p1+1
c=0
end
end
]=],"\n")