新增竖屏CG

This commit is contained in:
sakuya committed 2025-01-11 16:14:02 +08:00
1 parent 7ac77f58aa
commit 152282cdea
2 files changed
+314 -3

No files matched your search

+1 -1
View File
@@ -1 +1 @@
{"viewportLoc":[0,0],"editorLastFloorId":"jiuguan","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006Line truncated
{"viewportLoc":[0,0],"editorLastFloorId":"KTV","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006","iLine truncated
+313 -2
View File
@@ -14391,6 +14391,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}
}
mousedown(px, py) {
console.log(px, py);
//鼠标按下时
const makeBox = ([x, y], [w, h]) => {
@@ -14418,6 +14419,159 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
return;
}
if (core.domStyle.isVertical) { //竖屏
const pageupbox = makeBox([1050, 1100], [200, 100]);
const pagedownbox = makeBox([1050, 1700], [200, 100]);
const musicbox = makeBox([100, 1000], [900, this.musicMx[page].length * 100])
const beforebox = makeBox([135, 760], [50, 50])
const afterbox = makeBox([440, 760], [50, 50])
const playbox = makeBox([260, 730], [100, 100])
const typebox = makeBox([580, 730], [100, 100])
const changebox = makeBox([100, 590], [600, 20])
const volumebox = makeBox([890, 200], [20, 500])
if (inRect(pos, pageupbox)) {
if (page !== 0) page -= 1
return;
}
if (inRect(pos, pagedownbox)) {
if (page !== this.musicMx.length - 1) page += 1
return;
}
if (inRect(pos, playbox)) {
if (this.stop) {
this.stop = !this.stop
audio.play()
} else {
this.stop = !this.stop
audio.pause()
}
return;
}
if (inRect(pos, beforebox)) {
switch (this.type) {
case 'danqu':
audio.currentTime = 0
if (!this.stop) audio.play()
this.stop = false
page = this.selection[0]
break;
case 'xunhuan':
if (this.selection[1] === 0) {
if (this.selection[0] === 0) {
this.selection[0] = this.musicMx.length - 1
this.selection[1] = this.musicMx[this.selection[0]].length - 1
} else {
this.selection[0] -= 1
this.selection[1] = this.musicMx[this.selection[0]].length - 1
}
} else {
this.selection[1] -= 1
}
page = this.selection[0]
audio.src = "project/bgms/" + this.musicMx[this.selection[0]][this.selection[1]]
if (!this.stop) audio.play()
this.stop = false
break;
case 'suiji':
this.selection[0] = getRandomInt(0, this.musicMx.length)
this.selection[1] = getRandomInt(0, this.musicMx[this.selection[0]].length)
audio.src = "project/bgms/" + this.musicMx[this.selection[0]][this.selection[1]]
page = this.selection[0]
if (!this.stop) audio.play()
this.stop = false
break;
}
return;
}
if (inRect(pos, afterbox)) {
switch (this.type) {
case 'danqu':
audio.currentTime = 0
if (!this.stop) audio.play()
this.stop = false
page = this.selection[0]
break;
case 'xunhuan':
if (this.selection[1] === this.musicMx[this.selection[0]].length - 1) {
if (this.selection[0] === this.musicMx.length - 1) {
this.selection[0] = 0
this.selection[1] = 0
} else {
this.selection[0] += 1
this.selection[1] = 0
}
} else {
this.selection[1] += 1
}
page = this.selection[0]
audio.src = "project/bgms/" + this.musicMx[this.selection[0]][this.selection[1]]
if (!this.stop) audio.play()
this.stop = false
break;
case 'suiji':
this.selection[0] = getRandomInt(0, this.musicMx.length)
this.selection[1] = getRandomInt(0, this.musicMx[this.selection[0]].length)
audio.src = "project/bgms/" + this.musicMx[this.selection[0]][this.selection[1]]
page = this.selection[0]
if (!this.stop) audio.play()
this.stop = false
break;
}
return;
}
if (inRect(pos, typebox)) {
switch (this.type) {
case 'danqu':
this.type = 'xunhuan'
break;
case 'xunhuan':
this.type = 'suiji'
break;
case 'suiji':
this.type = 'danqu'
break;
}
return;
}
if (inRect(pos, musicbox)) {
const index = Math.floor((py - 1000) / 100)
if (page !== this.selection[0] || index !== this.selection[1]) {
this.selection[0] = page
this.selection[1] = index
audio.src = "project/bgms/" + this.musicMx[page][index]
if (!this.stop) audio.play()
this.stop = false
} else {
if (this.stop) {
this.stop = !this.stop
audio.play()
} else {
this.stop = !this.stop
audio.pause()
}
}
return;
}
if (inRect(pos, changebox)) {
const time = Math.floor((px - 100) / 600 * audio.duration)
audio.pause()
audio.currentTime = time;
ischange = true
}
if (inRect(pos, volumebox)) {
const time = (700 - py) / 500
audio.volume = time
isvolume = true
}
} else { //横屏
const pageupbox = makeBox([1050, 1100], [200, 100]);
@@ -14576,6 +14730,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}
}
mousemove(px, py) {
if (ischange) {
const time = Math.min(Math.max(Math.floor((px - 100) / 600 * audio.duration), 0), audio.duration)
@@ -14583,9 +14738,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}
if (isvolume) {
const time = Math.min(Math.max((px - 100) / 600, 0), 1)
audio.volume = time
if (core.domStyle.isVertical) {
const time = Math.min(Math.max((700 - py) / 500, 0), 1)
audio.volume = time
} else {
const time = Math.min(Math.max((px - 100) / 600, 0), 1)
audio.volume = time
}
}
}
@@ -14614,6 +14774,157 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
6,
core.ui._buildFont(66, true)
);
//core.fillRect(ctx, 440, 760, 50, 50)
ctx.strokeStyle = "#FFFFFF"
ctx.lineWidth = 3
ctx.beginPath()
ctx.moveTo(50, 1000)
ctx.lineTo(50, 1900)
ctx.moveTo(1000, 1000)
ctx.lineTo(1000, 1900)
ctx.stroke()
let posy = 1100
const indexList = this.musicMx[page]
core.setTextAlign(ctx, "left");
for (let i = 0; i < indexList.length; i++) {
const text = this.musicname[indexList[i]]
core.fillBoldText1(
ctx,
text,
100,
posy - 30,
page === this.selection[0] && i === this.selection[1] ? "#FFFFFF" : "#444444",
"#000000",
6,
core.ui._buildFont(66, true)
);
ctx.strokeStyle = "#FFFFFF"
ctx.lineWidth = 3
ctx.beginPath()
ctx.moveTo(100, posy)
ctx.lineTo(900, posy)
ctx.stroke()
posy += 100
}
core.fillBoldText1(
ctx,
'上一页',
1050,
1200 - 30,
page === 0 ? "#444444" : "#FFFFFF",
"#000000",
6,
core.ui._buildFont(66, true)
);
core.fillBoldText1(
ctx,
(page + 1) + "/" + this.musicMx.length,
1050,
1500 - 30,
"#FFFFFF",
"#000000",
6,
core.ui._buildFont(66, true)
);
core.fillBoldText1(
ctx,
'下一页',
1050,
1800 - 30,
page === this.musicMx.length - 1 ? "#444444" : "#FFFFFF",
"#000000",
6,
core.ui._buildFont(66, true)
);
ctx.strokeStyle = "#ffffff"
ctx.lineWidth = 3
ctx.beginPath()
ctx.moveTo(100, 600)
ctx.lineTo(700, 600)
ctx.stroke()
ctx.fillStyle = "#ffffff"
ctx.font = "bold 48px Verdana"
ctx.fillText('|', 130, 797)
ctx.fillText('◀', 140, 800)
ctx.beginPath()
ctx.arc(310, 780, 50, 0, 2 * Math.PI)
ctx.stroke()
if (this.stop) { ctx.fillText('▶', 295, 797) } else { ctx.fillText('||', 285, 794) }
ctx.fillText('|', 470, 797)
ctx.fillText('▶', 450, 800)
ctx.fillText('音', 810, 425)
ctx.fillText('量', 810, 510)
ctx.beginPath()
ctx.moveTo(900, 200)
ctx.lineTo(900, 700)
ctx.stroke()
ctx.strokeStyle = "#ffffff"
ctx.lineWidth = 9
ctx.fillStyle = 'rgba(255,255,255,0.5)'
ctx.beginPath()
ctx.moveTo(900, 700)
ctx.lineTo(900, -500 * audio.volume + 700)
ctx.stroke()
ctx.beginPath()
ctx.arc(900, -500 * audio.volume + 700, 10, 0, 2 * Math.PI)
ctx.fill()
core.fillBoldText1(
ctx,
Math.floor(100 * audio.volume),
915,
200,
"#FFFFFF",
"#000000",
6,
core.ui._buildFont(32, true)
);
const img = core.material.images.images[this.type + '.webp']
if (img) ctx.drawImage(img, 580, 730, 100, 100)
core.setTextAlign(ctx, "center");
ctx.font = "bold 48px Verdana"
ctx.fillText('当前歌曲', 400, 297)
ctx.fillText(this.musicname[this.musicMx[this.selection[0]][this.selection[1]]], 400, 397)
ctx.font = "bold 36px Verdana"
const thistime = audio.currentTime
if (thistime) {
const timetext = (Math.floor(thistime / 60).toString()).padStart(2, '0') + ':' + Math.floor(thistime % 60).toString().padStart(2, '0')
ctx.fillText(timetext, 510, 650)
} else {
const timetext = "00:00"
ctx.fillText(timetext, 510, 650)
}
ctx.fillText("/", 580, 650)
const fulltime = audio.duration
if (fulltime) {
const timetext = Math.floor(fulltime / 60).toString().padStart(2, '0') + ':' + Math.floor(fulltime % 60).toString().padStart(2, '0')
ctx.fillText(timetext, 650, 650)
} else {
const timetext = "00:00"
ctx.fillText(timetext, 650, 650)
}
ctx.strokeStyle = "#ffffff"
ctx.lineWidth = 9
ctx.fillStyle = 'rgba(255,255,255,0.5)'
const pointx = 600 * thistime / fulltime + 100
if (fulltime && thistime) {
ctx.beginPath()
ctx.moveTo(100, 600)
ctx.lineTo(pointx, 600)
ctx.stroke()
ctx.beginPath()
ctx.arc(pointx, 600, 10, 0, 2 * Math.PI)
ctx.fill()
} else {
ctx.beginPath()
ctx.arc(100, 600, 10, 0, 2 * Math.PI)
ctx.fill()
}
} else {
//横屏