Merge branch 'template' into noAnimate

This commit is contained in:
bdf1 2023-03-16 02:47:00 +13:00
commit ce30b15d74
4 changed files with 130 additions and 123 deletions

View File

@ -17,11 +17,12 @@
<meta name="x5-page-mode" content="app"> <meta name="x5-page-mode" content="app">
<link type='text/css' href='styles.css' rel='stylesheet'> <link type='text/css' href='styles.css' rel='stylesheet'>
</head> </head>
<body> <body>
<div id='startImageBackgroundDiv'> <div id='startImageBackgroundDiv'>
<div id='startImageDiv'></div> <div id='startImageDiv'></div>
<img id='startImageLogo' /> <img id='startImageLogo' />
</div> </div>
<script> <script>
(function () { (function () {
var startImageBackgroundDiv = document.getElementById('startImageBackgroundDiv'); var startImageBackgroundDiv = document.getElementById('startImageBackgroundDiv');
@ -145,7 +146,7 @@
</div> </div>
<!-- 状态栏canvas化 --> <!-- 状态栏canvas化 -->
<canvas id="statusCanvas" style="position: absolute; left: 0; top: 0;"></canvas> <canvas id="statusCanvas" style="position: absolute; left: 0; top: 0; z-index: 50;"></canvas>
<canvas id="caidan1" style="position: absolute; left: 0; top: 0;"></canvas> <canvas id="caidan1" style="position: absolute; left: 0; top: 0;"></canvas>
</div> </div>
<div id="toolBar" class="clearfix"> <div id="toolBar" class="clearfix">
@ -183,23 +184,23 @@
<canvas class='gameCanvas' id='data'>此浏览器不支持HTML5</canvas> <canvas class='gameCanvas' id='data'>此浏览器不支持HTML5</canvas>
<div id="next"></div> <div id="next"></div>
</div> </div>
</div> </div>
<div id='inputDiv'> <div id='inputDiv'>
<div id='inputDialog'> <div id='inputDialog'>
<p id="inputMessage">请输入文字...</p> <p id="inputMessage">请输入文字...</p>
<input id='inputBox' type="text" autocomplete="off"/> <input id='inputBox' type="text" autocomplete="off" />
<button id='inputYes'>确定</button> <button id='inputYes'>确定</button>
<button id='inputNo'>取消</button> <button id='inputNo'>取消</button>
</div> </div>
</div> </div>
<div id="ui-editor"></div> <div id="ui-editor"></div>
<!-- injection --> <!-- injection -->
<script src='libs/thirdparty/lz-string.min.js'></script> <script src='libs/thirdparty/lz-string.min.js'></script>
<script src='libs/thirdparty/priority-queue.min.js'></script> <script src='libs/thirdparty/priority-queue.min.js'></script>
<script src='libs/thirdparty/localforage.min.js'></script> <script src='libs/thirdparty/localforage.min.js'></script>
<script src='libs/thirdparty/zip.min.js'></script> <script src='libs/thirdparty/zip.min.js'></script>
<script id='mainScript' src='main.js'></script> <script id='mainScript' src='main.js'></script>
<script>main.init('play');main.listen();</script> <script>main.init('play'); main.listen();</script>
</body> </body>

View File

@ -18,7 +18,7 @@ function core () {
this._HALF_WIDTH_ = Math.floor(this._WIDTH_ / 2); this._HALF_WIDTH_ = Math.floor(this._WIDTH_ / 2);
this._HALF_HEIGHT_ = Math.floor(this._HEIGHT_ / 2); this._HALF_HEIGHT_ = Math.floor(this._HEIGHT_ / 2);
this.__SIZE__ = main.mode == 'editor' ? 15 : this._HEIGHT_; this.__SIZE__ = main.mode == 'editor' ? 13 : this._HEIGHT_;
this.__PIXELS__ = this.__SIZE__ * 32; this.__PIXELS__ = this.__SIZE__ * 32;
this.__HALF_SIZE__ = Math.floor(this.__SIZE__ / 2); this.__HALF_SIZE__ = Math.floor(this.__SIZE__ / 2);
this.material = { this.material = {

130
main.js
View File

@ -20,68 +20,74 @@ function main() {
//------------------------ 用户修改内容 END ------------------------// //------------------------ 用户修改内容 END ------------------------//
this.dom = { this.dom = {
'body': document.body, body: document.body,
'gameGroup': document.getElementById('gameGroup'), gameGroup: document.getElementById('gameGroup'),
'mainTips': document.getElementById('mainTips'), mainTips: document.getElementById('mainTips'),
'musicBtn': document.getElementById('musicBtn'), musicBtn: document.getElementById('musicBtn'),
'enlargeBtn': document.createElement('img'), enlargeBtn: document.createElement('img'),
'startPanel': document.getElementById('startPanel'), startPanel: document.getElementById('startPanel'),
'startTop': document.getElementById('startTop'), startTop: document.getElementById('startTop'),
'startTopProgressBar': document.getElementById('startTopProgressBar'), startTopProgressBar: document.getElementById('startTopProgressBar'),
'startTopProgress': document.getElementById('startTopProgress'), startTopProgress: document.getElementById('startTopProgress'),
'startTopLoadTips': document.getElementById('startTopLoadTips'), startTopLoadTips: document.getElementById('startTopLoadTips'),
'startBackground': document.getElementById('startBackground'), startBackground: document.getElementById('startBackground'),
'startLogo': document.getElementById('startLogo'), startLogo: document.getElementById('startLogo'),
'startButtonGroup': document.getElementById('startButtonGroup'), startButtonGroup: document.getElementById('startButtonGroup'),
'floorMsgGroup': document.getElementById('floorMsgGroup'), floorMsgGroup: document.getElementById('floorMsgGroup'),
'logoLabel': document.getElementById('logoLabel'), logoLabel: document.getElementById('logoLabel'),
'versionLabel': document.getElementById('versionLabel'), versionLabel: document.getElementById('versionLabel'),
'floorNameLabel': document.getElementById('floorNameLabel'), floorNameLabel: document.getElementById('floorNameLabel'),
'statusBar': document.getElementById('statusBar'), statusBar: document.getElementById('statusBar'),
'status': document.getElementsByClassName('status'), status: document.getElementsByClassName('status'),
'toolBar': document.getElementById('toolBar'), toolBar: document.getElementById('toolBar'),
'tools': document.getElementsByClassName('tools'), tools: document.getElementsByClassName('tools'),
'gameCanvas': document.getElementsByClassName('gameCanvas'), gameCanvas: document.getElementsByClassName('gameCanvas'),
'gif': document.getElementById('gif'), gif: document.getElementById('gif'),
'gif2': document.getElementById('gif2'), gif2: document.getElementById('gif2'),
'gameDraw': document.getElementById('gameDraw'), gameDraw: document.getElementById('gameDraw'),
'startButtons': document.getElementById('startButtons'), startButtons: document.getElementById('startButtons'),
'playGame': document.getElementById('playGame'), playGame: document.getElementById('playGame'),
'loadGame': document.getElementById('loadGame'), loadGame: document.getElementById('loadGame'),
'replayGame': document.getElementById('replayGame'), replayGame: document.getElementById('replayGame'),
'levelChooseButtons': document.getElementById('levelChooseButtons'), levelChooseButtons: document.getElementById('levelChooseButtons'),
'data': document.getElementById('data'), data: document.getElementById('data'),
'statusLabels': document.getElementsByClassName('statusLabel'), statusLabels: document.getElementsByClassName('statusLabel'),
'statusTexts': document.getElementsByClassName('statusText'), statusTexts: document.getElementsByClassName('statusText'),
'floorCol': document.getElementById('floorCol'), floorCol: document.getElementById('floorCol'),
'nameCol': document.getElementById('nameCol'), nameCol: document.getElementById('nameCol'),
'lvCol': document.getElementById('lvCol'), lvCol: document.getElementById('lvCol'),
'hpmaxCol': document.getElementById('hpmaxCol'), hpmaxCol: document.getElementById('hpmaxCol'),
'hpCol': document.getElementById('hpCol'), hpCol: document.getElementById('hpCol'),
'manaCol': document.getElementById('manaCol'), manaCol: document.getElementById('manaCol'),
'atkCol': document.getElementById('atkCol'), atkCol: document.getElementById('atkCol'),
'defCol': document.getElementById('defCol'), defCol: document.getElementById('defCol'),
'mdefCol': document.getElementById('mdefCol'), mdefCol: document.getElementById('mdefCol'),
'moneyCol': document.getElementById('moneyCol'), moneyCol: document.getElementById('moneyCol'),
'expCol': document.getElementById('expCol'), expCol: document.getElementById('expCol'),
'upCol': document.getElementById('upCol'), upCol: document.getElementById('upCol'),
'keyCol': document.getElementById('keyCol'), keyCol: document.getElementById('keyCol'),
'pzfCol': document.getElementById('pzfCol'), pzfCol: document.getElementById('pzfCol'),
'debuffCol': document.getElementById('debuffCol'), debuffCol: document.getElementById('debuffCol'),
'skillCol': document.getElementById('skillCol'), skillCol: document.getElementById('skillCol'),
'hard': document.getElementById('hard'), hard: document.getElementById('hard'),
'statusCanvas': document.getElementById('statusCanvas'), statusCanvas: document.getElementById('statusCanvas'),
'statusCanvasCtx': document.getElementById('statusCanvas').getContext('2d'), statusCanvasCtx: document
'caidan1': document.getElementById('caidan1'), .getElementById('statusCanvas')
'caidan1Ctx': document.getElementById('caidan1').getContext('2d'), .getContext('2d'),
'whole': document.getElementById('whole'), caidan1: document.getElementById('caidan1'),
'wholeCtx': document.getElementById('whole').getContext('2d'), caidan1Ctx: document
'inputDiv': document.getElementById('inputDiv'), .getElementById('caidan1')
'inputMessage': document.getElementById('inputMessage'), .getContext('2d'),
'inputBox': document.getElementById('inputBox'), whole: document.getElementById('whole'),
'inputYes': document.getElementById('inputYes'), wholeCtx: document
'inputNo': document.getElementById('inputNo'), .getElementById('whole')
'next': document.getElementById('next') .getContext('2d'),
inputDiv: document.getElementById('inputDiv'),
inputMessage: document.getElementById('inputMessage'),
inputBox: document.getElementById('inputBox'),
inputYes: document.getElementById('inputYes'),
inputNo: document.getElementById('inputNo'),
next: document.getElementById('next')
}; };
this.mode = 'play'; this.mode = 'play';
this.loadList = [ this.loadList = [

View File

@ -1694,7 +1694,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
fill(core.formatBigNumber(core.status.hero.money), 304, 58); fill(core.formatBigNumber(core.status.hero.money), 304, 58);
core.drawImage(ctx, core.statusBar.icons.exp, 6, 70, 25, 25); 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);
} else if (!core.flags.extendToolbar) { // 横屏且未隐藏状态栏 } else if (!core.flags.hideLeftStatusBar) { // 横屏且未隐藏状态栏
core.drawImage(ctx, core.material.images.images[flags.hard == 4 ? 'status.png' : 'status2.png'], 0, 63); core.drawImage(ctx, core.material.images.images[flags.hard == 4 ? 'status.png' : 'status2.png'], 0, 63);
core.drawImage(ctx, core.statusBar.icons.floor, 124, 24, 32, 32); core.drawImage(ctx, core.statusBar.icons.floor, 124, 24, 32, 32);
ctx.textAlign = 'left'; ctx.textAlign = 'left';
@ -1755,7 +1755,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
else core.dom.statusCanvas.style.zIndex=50; else core.dom.statusCanvas.style.zIndex=50;
} }
} else if (core.flags.extendToolbar && !core.domStyle.isVertical) { // 横屏且隐藏状态栏 } else if (core.flags.hideLeftStatusBar && !core.domStyle.isVertical) { // 横屏且隐藏状态栏
if (!core.dymCanvas['status']) if (!core.dymCanvas['status'])
core.ui.createCanvas('status', 0, 0, core._PX_, core._PY_, 66); // 刚好盖过显伤层 core.ui.createCanvas('status', 0, 0, core._PX_, core._PY_, 66); // 刚好盖过显伤层
core.ui.clearMap(ctx = core.dymCanvas['status']); core.ui.clearMap(ctx = core.dymCanvas['status']);