可选六种阴影样式,默认贴图

This commit is contained in:
MrZ626
2021-06-28 03:42:57 +08:00
parent a9a66bf21e
commit 653b256253
11 changed files with 100 additions and 39 deletions

View File

@@ -388,7 +388,7 @@ do--function dumpBasicConfig()
'skin','face',
--Graphic
'block','ghost','center','bagLine',
'ghostType','block','ghost','center','bagLine',
'dropFX','moveFX','shakeFX',
'text','highCam','nextPos',

View File

@@ -314,6 +314,7 @@ SETTING={--Settings
face={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
--Graphic
ghostType='gray',
block=true,ghost=.3,center=1,
smooth=true,grid=.16,
upEdge=true,

View File

@@ -322,6 +322,7 @@ return{
upEdge="3D Block",
bagLine="Bag Separator",
ghostType="Ghost Type",
ghost="Ghost",
grid="Grid",
center="Center",

View File

@@ -297,6 +297,7 @@ return{
upEdge="Bloques en 3D",
bagLine="Línea de Bag de Pzas.",
-- ghostType="Ghost Type",
ghost="Fantasma",
grid="Grilla",
center="Centrar",

View File

@@ -295,6 +295,7 @@ return{
upEdge="Bloc 3D",
bagLine="Ligne du Sac",
-- ghostType="Ghost Type",
ghost="Pièce fantôme",
grid="Grille",
center="Centre",

View File

@@ -321,6 +321,7 @@ return{
upEdge="3D bloco",
bagLine="Linha da bolsa",
-- ghostType="Ghost Type",
ghost="Fantasma",
grid="Rede",
center="Centro",

View File

@@ -150,6 +150,7 @@ return{
upEdge="[]`",
bagLine="123|123",
ghostType="__↓?__",
ghost="__↓__",
grid="#",
center="+",

View File

@@ -322,6 +322,7 @@ return{
upEdge="3D方块",
bagLine="包分界线",
ghostType="阴影样式",
ghost="阴影不透明度",
grid="网格不透明度",
center="旋转中心不透明度",

View File

@@ -205,16 +205,68 @@ local function drawFXs(P)
gc_rectangle('fill',150-x*150,15-S[1]*30-y*15,300*x,y*30)
end
end
local function drawGhost(P,clr,alpha)
gc_setColor(1,1,1,alpha)
local texture=SKIN.curText
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_draw(texture[clr],30*(j+P.curX-1)-30,-30*(i+P.ghoY-1))
end
end end
end
local drawGhost={
color=function(P,clr,alpha)
gc_setColor(1,1,1,alpha)
local texture=SKIN.curText
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_draw(texture[clr],30*(j+P.curX-1)-30,-30*(i+P.ghoY-1))
end
end end
end,
gray=function(P,_,alpha)
gc_setColor(1,1,1,alpha)
local texture=SKIN.curText
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_draw(texture[21],30*(j+P.curX-1)-30,-30*(i+P.ghoY-1))
end
end end
end,
colorLine=function(P,clr,alpha)
clr=minoColor[clr]
gc_setColor(clr[1],clr[2],clr[3],alpha)
gc_setLineWidth(4)
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_rectangle('line',30*(j+P.curX-1)-30+2,-30*(i+P.ghoY-1)+2,26,26)
end
end end
end,
grayLine=function(P,_,alpha)
gc_setColor(1,1,1,alpha)
gc_setLineWidth(4)
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_rectangle('line',30*(j+P.curX-1)-30+2,-30*(i+P.ghoY-1)+2,26,26)
end
end end
end,
colorCell=function(P,clr,alpha)
clr=minoColor[clr]
gc_setColor(clr[1],clr[2],clr[3],alpha)
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_rectangle('fill',30*(j+P.curX-1)-30,-30*(i+P.ghoY-1),30,30)
end
end end
end,
greyCell=function(P,_,alpha)
gc_setColor(1,1,1,alpha)
local CB=P.cur.bk
for i=1,#CB do for j=1,#CB[1]do
if CB[i][j]then
gc_rectangle('fill',30*(j+P.curX-1)-30,-30*(i+P.ghoY-1),30,30)
end
end end
end,
}
local function drawBlockOutline(P,texture,trans)
shader_alpha:send("a",trans)
gc_setShader(shader_alpha)
@@ -611,7 +663,7 @@ function draw.norm(P)
--Draw ghost & rotation center
if ENV.ghost then
drawGhost(P,curColor,ENV.ghost)
drawGhost[ENV.ghostType](P,curColor,ENV.ghost)
if ENV.center then
gc_setColor(1,1,1,ENV.center)
gc_draw(spinCenterImg,centerX,-30*(P.ghoY+P.cur.sc[1])+15,nil,nil,nil,4,4)
@@ -819,7 +871,7 @@ function draw.demo(P)
drawField(P)
drawFXs(P)
if P.cur and P.waiting==-1 then
if ENV.ghost then drawGhost(P,curColor,ENV.ghost)end
if ENV.ghost then drawGhost[ENV.ghostType](P,curColor,ENV.ghost)end
if ENV.block then
local dy=ENV.smooth and P.ghoY~=P.curY and(P.dropDelay/ENV.drop-1)*30 or 0
gc_translate(0,-dy)

View File

@@ -5,6 +5,7 @@ return{
ihs=true,irs=true,ims=true,
swap=true,
ghostType='gray',
block=true,ghost=.3,center=1,
smooth=false,grid=.16,
upEdge=true,

View File

@@ -15,36 +15,37 @@ scene.widgetList={
WIDGET.newButton{name="game", x=1080,y=80,w=240,h=80,color='lC',font=35,code=swapScene('setting_game','swipeL')},
WIDGET.newSwitch{name="block", x=380,y=180,disp=SETval("block"),code=SETrev("block")},
WIDGET.newSwitch{name="smooth", x=380,y=230,disp=SETval("smooth"),code=SETrev("smooth")},
WIDGET.newSwitch{name="upEdge", x=380,y=280,disp=SETval("upEdge"),code=SETrev("upEdge")},
WIDGET.newSwitch{name="bagLine", x=380,y=330,disp=SETval("bagLine"),code=SETrev("bagLine")},
WIDGET.newSwitch{name="smooth", x=380,y=250,disp=SETval("smooth"),code=SETrev("smooth")},
WIDGET.newSwitch{name="upEdge", x=380,y=320,disp=SETval("upEdge"),code=SETrev("upEdge")},
WIDGET.newSwitch{name="bagLine", x=380,y=390,disp=SETval("bagLine"),code=SETrev("bagLine")},
WIDGET.newSlider{name="ghost", x=740,y=180,w=350,unit=.6, disp=SETval("ghost"),show="percent",code=SETsto("ghost")},
WIDGET.newSlider{name="grid", x=740,y=260,w=350,unit=.4, disp=SETval("grid"),show="percent", code=SETsto("grid")},
WIDGET.newSlider{name="center", x=740,y=340,w=350,unit=1, disp=SETval("center"), code=SETsto("center")},
WIDGET.newSelector{name="ghostType",x=915,y=180,w=350,list={'color','gray','colorLine','grayLine','colorCell','greyCell'},disp=SETval("ghostType"),code=SETsto("ghostType")},
WIDGET.newSlider{name="ghost", x=740,y=240,w=350,unit=1, disp=SETval("ghost"),show="percent",code=SETsto("ghost")},
WIDGET.newSlider{name="grid", x=740,y=320,w=350,unit=.4, disp=SETval("grid"),show="percent", code=SETsto("grid")},
WIDGET.newSlider{name="center", x=740,y=400,w=350,unit=1, disp=SETval("center"), code=SETsto("center")},
WIDGET.newSlider{name="lockFX", x=330,y=400,w=540,unit=5, disp=SETval("lockFX"), code=SETsto("lockFX")},
WIDGET.newSlider{name="dropFX", x=330,y=460,w=540,unit=5, disp=SETval("dropFX"), code=SETsto("dropFX")},
WIDGET.newSlider{name="moveFX", x=330,y=520,w=540,unit=5, disp=SETval("moveFX"), code=SETsto("moveFX")},
WIDGET.newSlider{name="clearFX", x=330,y=580,w=540,unit=5, disp=SETval("clearFX"), code=SETsto("clearFX")},
WIDGET.newSlider{name="splashFX", x=330,y=640,w=540,unit=5, disp=SETval("splashFX"),code=SETsto("splashFX")},
WIDGET.newSlider{name="shakeFX", x=330,y=700,w=540,unit=5, disp=SETval("shakeFX"), code=SETsto("shakeFX")},
WIDGET.newSlider{name="atkFX", x=330,y=760,w=540,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")},
WIDGET.newSelector{name="frame", x=600,y=830,w=460,list={8,10,13,17,22,29,37,47,62,80,100},disp=SETval("frameMul"),code=SETsto("frameMul")},
WIDGET.newSlider{name="lockFX", x=330,y=460,w=540,unit=5, disp=SETval("lockFX"), code=SETsto("lockFX")},
WIDGET.newSlider{name="dropFX", x=330,y=520,w=540,unit=5, disp=SETval("dropFX"), code=SETsto("dropFX")},
WIDGET.newSlider{name="moveFX", x=330,y=580,w=540,unit=5, disp=SETval("moveFX"), code=SETsto("moveFX")},
WIDGET.newSlider{name="clearFX", x=330,y=640,w=540,unit=5, disp=SETval("clearFX"), code=SETsto("clearFX")},
WIDGET.newSlider{name="splashFX", x=330,y=700,w=540,unit=5, disp=SETval("splashFX"),code=SETsto("splashFX")},
WIDGET.newSlider{name="shakeFX", x=330,y=760,w=540,unit=5, disp=SETval("shakeFX"), code=SETsto("shakeFX")},
WIDGET.newSlider{name="atkFX", x=330,y=820,w=540,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")},
WIDGET.newSelector{name="frame", x=600,y=890,w=460,list={8,10,13,17,22,29,37,47,62,80,100},disp=SETval("frameMul"),code=SETsto("frameMul")},
WIDGET.newSwitch{name="text", x=450,y=920,disp=SETval("text"), code=SETrev("text")},
WIDGET.newSwitch{name="score", x=450,y=970,disp=SETval("score"), code=SETrev("score")},
WIDGET.newSwitch{name="bufferWarn", x=450,y=1040,disp=SETval("bufferWarn"), code=SETrev("bufferWarn")},
WIDGET.newSwitch{name="showSpike", x=450,y=1090,disp=SETval("showSpike"), code=SETrev("showSpike")},
WIDGET.newSwitch{name="nextPos", x=450,y=1160,disp=SETval("nextPos"), code=SETrev("nextPos")},
WIDGET.newSwitch{name="highCam", x=450,y=1210,disp=SETval("highCam"), code=SETrev("highCam")},
WIDGET.newSwitch{name="warn", x=450,y=1280,disp=SETval("warn"), code=SETrev("warn")},
WIDGET.newSwitch{name="text", x=450,y=980,disp=SETval("text"), code=SETrev("text")},
WIDGET.newSwitch{name="score", x=450,y=1030,disp=SETval("score"), code=SETrev("score")},
WIDGET.newSwitch{name="bufferWarn", x=450,y=1100,disp=SETval("bufferWarn"), code=SETrev("bufferWarn")},
WIDGET.newSwitch{name="showSpike", x=450,y=1150,disp=SETval("showSpike"), code=SETrev("showSpike")},
WIDGET.newSwitch{name="nextPos", x=450,y=1220,disp=SETval("nextPos"), code=SETrev("nextPos")},
WIDGET.newSwitch{name="highCam", x=450,y=1270,disp=SETval("highCam"), code=SETrev("highCam")},
WIDGET.newSwitch{name="warn", x=450,y=1340,disp=SETval("warn"), code=SETrev("warn")},
WIDGET.newSwitch{name="clickFX", x=950,y=920,disp=SETval("clickFX"), code=SETrev("clickFX")},
WIDGET.newSwitch{name="power", x=950,y=1010,disp=SETval("powerInfo"), code=SETrev("powerInfo")},
WIDGET.newSwitch{name="clean", x=950,y=1100,disp=SETval("cleanCanvas"),code=SETrev("cleanCanvas")},
WIDGET.newSwitch{name="fullscreen", x=950,y=1190,disp=SETval("fullscreen"), code=switchFullscreen},
WIDGET.newSwitch{name="bg", x=950,y=1280,disp=SETval("bg"),
WIDGET.newSwitch{name="clickFX", x=950,y=980,disp=SETval("clickFX"), code=SETrev("clickFX")},
WIDGET.newSwitch{name="power", x=950,y=1070,disp=SETval("powerInfo"), code=SETrev("powerInfo")},
WIDGET.newSwitch{name="clean", x=950,y=1160,disp=SETval("cleanCanvas"),code=SETrev("cleanCanvas")},
WIDGET.newSwitch{name="fullscreen", x=950,y=1250,disp=SETval("fullscreen"), code=switchFullscreen},
WIDGET.newSwitch{name="bg", x=950,y=1340,disp=SETval("bg"),
code=function()
BG.set('none')
SETTING.bg=not SETTING.bg