feat: 竖屏状态栏 更换图源 允许轻按

This commit is contained in:
bdf1 2023-04-23 04:32:49 +13:00
parent 1d204109b7
commit 4b26f0a252
6 changed files with 65 additions and 16 deletions

View File

@ -909,7 +909,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startUsingCanvas": false,
"statusCanvas": true,
"enableEnemyPoint": false,
"enableGentleClick": false,
"enableGentleClick": true,
"ignoreChangeFloor": true,
"canGoDeadZone": false,
"enableMoveDirectly": true,

View File

@ -58,7 +58,7 @@ main.floors.ND1=
},
{
"type": "function",
"function": "function(){\ncore.status.hard = 'Easy';\nflags.__hardColor__ = 'green'\n//core.setGlobalAttribute(\"borderColor\", \"#8ee877\");\ncore.setGlobalAttribute(\"statusLeftBackground\", \"url(project/images/641-e.jpg)0% 0%/auto 100% repeat\");\ncore.setGlobalAttribute(\"statusTopBackground\", \"url(project/images/641-e.jpg)0% 0%/auto 100% repeat\");\n}"
"function": "function(){\ncore.status.hard = 'Easy';\nflags.__hardColor__ = 'green'\n//core.setGlobalAttribute(\"borderColor\", \"#8ee877\");\ncore.setGlobalAttribute(\"statusLeftBackground\", \"url(project/images/641-e.jpg)0% 0%/auto 100% repeat\");\ncore.setGlobalAttribute(\"statusTopBackground\", \"url(project/images/641-ee.jpg)0% 60%/ 100% repeat\");\n}"
},
{
"type": "break",
@ -90,7 +90,7 @@ main.floors.ND1=
},
{
"type": "function",
"function": "function(){\ncore.status.hard = 'Hard';\n//core.setGlobalAttribute(\"borderColor\", \"#ea7888\");\ncore.setGlobalAttribute(\"statusLeftBackground\", \"url(project/images/641-h.jpg)0% 0%/auto 100% repeat\");\ncore.setGlobalAttribute(\"statusTopBackground\", \"url(project/images/641-h.jpg)0% 0%/auto 100% repeat\");\n}"
"function": "function(){\ncore.status.hard = 'Hard';\n//core.setGlobalAttribute(\"borderColor\", \"#ea7888\");\ncore.setGlobalAttribute(\"statusLeftBackground\", \"url(project/images/641-h.jpg)40% 0%/auto 100% repeat\");\ncore.setGlobalAttribute(\"statusTopBackground\", \"url(project/images/641-h.jpg)0% 70%/ 100% repeat\");\n}"
},
{
"type": "break",

View File

@ -1607,20 +1607,69 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.ui.clearMap(ctx = core.dom.statusCanvasCtx); // 清空状态栏
core.ui.setFillStyle(ctx, core.status.globalAttribute.statusBarColor);
if (core.domStyle.isVertical) { // 竖屏
core.drawImage(ctx, core.statusBar.icons.floor, 6, 6, 25, 25);
fill((core.status.thisMap || {}).name || "Loading", 42, 26);
core.drawImage(ctx, core.statusBar.icons.hp, 137, 6, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('hp')), 173, 26);
core.drawImage(ctx, core.statusBar.icons.atk, 268, 6, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('atk')), 304, 26);
core.drawImage(ctx, core.statusBar.icons.def, 6, 38, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('def')), 42, 58);
core.drawImage(ctx, core.statusBar.icons.mdef, 137, 38, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('mdef')), 173, 58);
core.drawImage(ctx, core.statusBar.icons.money, 268, 38, 25, 25);
fill(core.formatBigNumber(core.status.hero.money), 304, 58);
/*core.drawImage(ctx, core.statusBar.icons.floor, 135, 6, 25, 25);
fill((core.status.thisMap || {}).name || "Loading", 171, 26);
core.drawImage(ctx, core.statusBar.icons.hp, 223, 6, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('hp')), 259, 26);
core.drawImage(ctx, core.statusBar.icons.atk, 311, 6, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('atk')), 347, 26);
core.drawImage(ctx, core.statusBar.icons.def, 135, 38, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('def')), 171, 58);
core.drawImage(ctx, core.statusBar.icons.mdef, 223, 38, 25, 25);
fill(core.formatBigNumber(core.getRealStatus('mdef')), 259, 58);
core.drawImage(ctx, core.statusBar.icons.money, 311, 38, 25, 25);
fill(core.formatBigNumber(core.status.hero.money), 347, 58);
core.drawImage(ctx, core.statusBar.icons.exp, 6, 70, 25, 25);
fill(core.formatBigNumber(core.status.hero.exp), 42, 90);
fill(core.formatBigNumber(core.status.hero.exp), 42, 90);*/
core.drawIcon(ctx, 18, 135, 6, 25, 25);
core.drawIcon(ctx, 34, 311, 6, 25, 25);
core.drawIcon(ctx, 27, 135, 36, 25, 25);
core.drawIcon(ctx, 28, 223, 36, 25, 25);
core.drawIcon(ctx, 29, 311, 36, 25, 25);
fill((core.status.thisMap || {}).name || "Loading", 171, 26);
fill(flags.dynHP || core.formatBigNumber(core.getRealStatus('hp')), 347, 26);
fill(core.formatBigNumber(core.getRealStatus('atk')), 171, 56, '#FF5555');
fill(core.formatBigNumber(core.getRealStatus('def')), 259, 56, '#45D1E0');
fill(core.formatBigNumber(core.getRealStatus('mdef')), 347, 56, '#00AA00');
ctx.textAlign = 'center' //文字居中
ctx.textBaseline = 'middle'
ctx.fillText(core.getLvName(), 40, 35)
fill1("Need: " + core.formatBigNumber(core.getNextLvUpNeed()), 40, 50)
if (core.getNextLvUpNeed()) {
var rat = (core.status.hero.exp) / (core.getNextLvUpNeed() + core.status.hero.exp)
ctx.beginPath() //高亮环路径
ctx.arc(40, 40, 30, -Math.PI / 2, -Math.PI / 2 + 2 * Math.PI * rat, false)
ctx.strokeStyle = 'rgb(255, 255, 0)'
ctx.lineWidth = 5
ctx.lineCap = 'butt'
ctx.stroke()
var act = core.firstData.levelUp[core.status.hero.lv].action,
_ = { hp: 0, atk: 0, def: 0, mdef: 0 }
for (var i of act) {
if (i.name.substr(0, 6) == "status") _[i.name.substr(7)] += parseFloat(i.value);
}
fill1("Next Level", 100, 16, '#FFFFFF');
fill1("Atk + " + core.formatBigNumber(_.atk), 100, 40, '#FF5555');
fill1("Def + " + core.formatBigNumber(_.def), 100, 52, '#45D1E0');
fill1("Mdef + " + core.formatBigNumber(_.mdef), 100, 64, '#00AA00');
fill1("Hp + " + core.formatBigNumber(_.hp), 100, 28, '#FFFFFF');
}
ctx.textAlign = 'left'
ctx.textBaseline = 'alphabetic'
core.drawIcon(ctx, 21, 135, 66, 25, 25);
core.drawIcon(ctx, 22, 179, 66, 25, 25);
core.drawIcon(ctx, 23, 223, 66, 25, 25);
core.drawIcon(ctx, 47, 267, 66, 25, 25);
fill(core.setTwoDigits(core.itemCount('yellowKey')), 159, 86, '#FFCCAA');
fill(core.setTwoDigits(core.itemCount('blueKey')), 203, 86, '#AAAADD');
fill(core.setTwoDigits(core.itemCount('redKey')), 247, 86, '#FF8888');
fill(core.setTwoDigits(core.itemCount('pickaxe')), 291, 86, '#BC6E27');
fill(core.setTwoDigits(core.itemCount('yellowKey') * 2 + core.itemCount('blueKey') * 5 + core.itemCount('redKey') * 15 + core.itemCount('pickaxe') * 30), 335, 86, '#FA1489');
fill(core.setTwoDigits(core.getFlag('lhjnb', 0)), 379, 86, '#8D8600');
} else if (!core.flags.hideLeftStatusBar) { // 横屏且未隐藏状态栏
core.drawIcon(ctx, 18, 6, 5, 25, 25);
core.drawIcon(ctx, 34, 6, 35, 25, 25);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
project/images/641-ee.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 771 KiB