新增生成预览功能

This commit is contained in:
MrZ626
2020-09-12 19:30:04 +08:00
parent 1eec4c957d
commit aedec4b26b
4 changed files with 27 additions and 7 deletions

View File

@@ -303,6 +303,7 @@ local langList={
text="消行文本", text="消行文本",
warn="死亡预警", warn="死亡预警",
highCam="超屏视野", highCam="超屏视野",
nextPos="生成预览",
fullscreen="全屏", fullscreen="全屏",
bg="背景", bg="背景",
power="电量显示", power="电量显示",
@@ -799,6 +800,7 @@ local langList={
text="消行文本", text="消行文本",
warn="死亡预警", warn="死亡预警",
highCam="超屏视野", highCam="超屏视野",
nextPos="生成预览",
fullscreen="全屏", fullscreen="全屏",
bg="背景", bg="背景",
power="电量显示", power="电量显示",
@@ -1285,6 +1287,7 @@ local langList={
text="Action Text", text="Action Text",
warn="Death Alert", warn="Death Alert",
highCam="Superhigh view", highCam="Superhigh view",
nextPos="Next preview",
fullscreen="Full Screen", fullscreen="Full Screen",
bg="Background", bg="Background",
power="Power Info", power="Power Info",
@@ -1769,6 +1772,7 @@ local langList={
text="ABC", text="ABC",
warn="!↑↑↑!", warn="!↑↑↑!",
highCam="↑__↑", highCam="↑__↑",
nextPos="???←",
fullscreen="|←→|", fullscreen="|←→|",
bg="__?__", bg="__?__",
power="+.", power="+.",
@@ -2267,6 +2271,7 @@ local langList={
text="消行文本", text="消行文本",
warn="死亡预警", warn="死亡预警",
highCam="超屏视野", highCam="超屏视野",
nextPos="生成预览",
fullscreen="全屏", fullscreen="全屏",
bg="背景", bg="背景",
power="电量显示", power="电量显示",

View File

@@ -281,19 +281,20 @@ local Widgets={
newSwitch({name="text", x=1050, y=180,font=35,disp=SETval("text"),code=SETrev("text")}), newSwitch({name="text", x=1050, y=180,font=35,disp=SETval("text"),code=SETrev("text")}),
newSwitch({name="warn", x=1050, y=240,font=35,disp=SETval("warn"),code=SETrev("warn")}), newSwitch({name="warn", x=1050, y=240,font=35,disp=SETval("warn"),code=SETrev("warn")}),
newSwitch({name="highCam", x=1050, y=300,font=35,disp=SETval("highCam"),code=SETrev("highCam")}), newSwitch({name="highCam", x=1050, y=300,font=35,disp=SETval("highCam"),code=SETrev("highCam")}),
newSwitch({name="fullscreen",x=1050,y=360,font=35,disp=SETval("fullscreen"), newSwitch({name="nextPos", x=1050, y=360,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")}),
newSwitch({name="fullscreen",x=1050,y=420,font=35,disp=SETval("fullscreen"),
code=function() code=function()
setting.fullscreen=not setting.fullscreen setting.fullscreen=not setting.fullscreen
love.window.setFullscreen(setting.fullscreen) love.window.setFullscreen(setting.fullscreen)
love.resize(love.graphics.getWidth(),love.graphics.getHeight()) love.resize(love.graphics.getWidth(),love.graphics.getHeight())
end}), end}),
newSwitch({name="bg", x=1050, y=420,font=35,disp=SETval("bg"), newSwitch({name="bg", x=1050, y=480,font=35,disp=SETval("bg"),
code=function() code=function()
BG.set("none") BG.set("none")
setting.bg=not setting.bg setting.bg=not setting.bg
BG.set("space") BG.set("space")
end}), end}),
newSwitch({name="power", x=1050, y=480,font=35,disp=SETval("powerInfo"), newSwitch({name="power", x=1050, y=540,font=35,disp=SETval("powerInfo"),
code=function() code=function()
setting.powerInfo=not setting.powerInfo setting.powerInfo=not setting.powerInfo
end}), end}),

View File

@@ -31,6 +31,7 @@ setting={
text=true, text=true,
warn=true, warn=true,
highCam=false, highCam=false,
nextPos=false,
fullscreen=false, fullscreen=false,
bg=true, bg=true,
powerInfo=false, powerInfo=false,

View File

@@ -27,6 +27,7 @@ local gameEnv0={
shakeFX=3, shakeFX=3,
highCam=false, highCam=false,
nextPos=false,
drop=60,lock=60, drop=60,lock=60,
wait=0,fall=0, wait=0,fall=0,
@@ -599,10 +600,6 @@ do--function Pdraw_norm(P)
gc.setColor(1,0,0,.2) gc.setColor(1,0,0,.2)
gc.rectangle("fill",0,0,300,-FUP-FBN-10) gc.rectangle("fill",0,0,300,-FUP-FBN-10)
gc.setLineWidth(4)
gc.setColor(1,0,0,min(FUP/9,1)*(sin(Timer()*10)*.5+.5))
gc.rectangle("line",90+2,0-2-FBN,120-4,-60+4)
--Draw field --Draw field
local V=P.visTime local V=P.visTime
local F=P.field local F=P.field
@@ -708,6 +705,22 @@ do--function Pdraw_norm(P)
gc.draw(IMG.spinCenter,x,600-30*(P.imgY+P.sc[1])+15,nil,nil,nil,4,4) gc.draw(IMG.spinCenter,x,600-30*(P.imgY+P.sc[1])+15,nil,nil,nil,4,4)
end end
end end
--Draw next preview
if ENV.nextPos and P.next[1]then
gc.setColor(1,1,1,.8)
local B=P.next[1].bk
local x=int(6-#B[1]*.5)
local y=21+ceil(P.fieldBeneath/30)
for i=1,#B do
for j=1,#B[1]do
if B[i][j]then
gc.draw(puzzleMark[-1],30*(x+j-2),30*(21-y-i))
end
end
end
end
gc.setScissor() gc.setScissor()
gc.pop() gc.pop()