fix:移除无关文件
This commit is contained in:
parent
067a2ad772
commit
599122d37f
300
toolBar1.md
300
toolBar1.md
@ -1,300 +0,0 @@
|
|||||||
'icons': {
|
|
||||||
'floor': 0,
|
|
||||||
'name': null,
|
|
||||||
'lv': 1,
|
|
||||||
'hpmax': 2,
|
|
||||||
'hp': 3,
|
|
||||||
'atk': 4,
|
|
||||||
'def': 5,
|
|
||||||
'mdef': 6,
|
|
||||||
'money': 7,
|
|
||||||
'exp': 8,
|
|
||||||
'up': 9,
|
|
||||||
'book': 10,
|
|
||||||
'fly': 11,
|
|
||||||
'toolbox': 12,
|
|
||||||
'keyboard': 13,
|
|
||||||
'shop': 14,
|
|
||||||
'save': 15,
|
|
||||||
'load': 16,
|
|
||||||
'settings': 17,
|
|
||||||
'play': 18,
|
|
||||||
'pause': 19,
|
|
||||||
'stop': 20,
|
|
||||||
'speedDown': 21,
|
|
||||||
'speedUp': 22,
|
|
||||||
'rewind': 23,
|
|
||||||
'equipbox': 24,
|
|
||||||
'mana': 25,
|
|
||||||
'skill': 26,
|
|
||||||
'btn1': 27,
|
|
||||||
'btn2': 28,
|
|
||||||
'btn3': 29,
|
|
||||||
'btn4': 30,
|
|
||||||
'btn5': 31,
|
|
||||||
'btn6': 32,
|
|
||||||
'btn7': 33,
|
|
||||||
'btn8': 34
|
|
||||||
},
|
|
||||||
|
|
||||||
```html
|
|
||||||
<div id="toolBar" class="clearfix" style="left: 0px; width: 150px; top: 191.308px; height: 19.1538px; background: url("project/materials/ground.png") repeat; border-left: 3px solid rgb(204, 204, 204); font-size: 5.53846px; display: block; border-bottom: 3px solid rgb(204, 204, 204); border-right: 3px solid rgb(204, 204, 204);">
|
|
||||||
<img class="tools" id="img-book" src="<!-- 与问题无关,略。下同-->" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none; opacity: 0.3;">
|
|
||||||
<img class="tools" id="img-fly" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none; opacity: 0.3;">
|
|
||||||
<img class="tools" id="img-toolbox"style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none;">
|
|
||||||
<img class="tools" id="img-keyboard" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none;">
|
|
||||||
<img class="tools" id="img-shop" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none;">
|
|
||||||
<img class="tools" id="img-save" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none; opacity: 1;">
|
|
||||||
<img class="tools" id="img-load" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none;">
|
|
||||||
<img class="tools" id="img-settings" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: none;">
|
|
||||||
<img class="tools" id="img-btn1" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px; display: block;">
|
|
||||||
<img class="tools" id="img-slime" style="height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;">
|
|
||||||
<img class="tools" id="img-btn2" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<img class="tools" id="img-btn3" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<img class="tools" id="img-btn4" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<img class="tools" id="img-btn5" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<img class="tools" id="img-btn6" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<img class="tools" id="img-btn7" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<img class="tools" id="img-btn8" style="display: block; height: 10.5231px; margin-left: 3.11538px; margin-top: 1.03846px;" >
|
|
||||||
<p class="statusLabel tools" id="hard" _style="rgba(64,255,85,1)" style="line-height: 10.5231px; margin-left: 3.11538px; height: 10.5231px; margin-top: 1.03846px; width: 20.5154px; color: rgb(64, 255, 85);"></p>
|
|
||||||
</div>
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
control.prototype._resize_toolBar = function (obj) {
|
|
||||||
// toolBar console.log(obj);
|
|
||||||
var toolBar = core.dom.toolBar;
|
|
||||||
if (core.domStyle.isVertical) {
|
|
||||||
toolBar.style.left = 0;
|
|
||||||
toolBar.style.right = "";
|
|
||||||
toolBar.style.width = obj.outerSize + "px";
|
|
||||||
toolBar.style.top = obj.statusBarHeightInVertical + obj.outerSize + "px";
|
|
||||||
toolBar.style.height = obj.toolbarHeightInVertical + "px";
|
|
||||||
toolBar.style.background = obj.globalAttribute.toolsBackground;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (obj.extendToolbar) {
|
|
||||||
toolBar.style.left = "";
|
|
||||||
toolBar.style.right = 0;
|
|
||||||
toolBar.style.width = obj.outerSize + "px";
|
|
||||||
toolBar.style.top = obj.outerSize + "px";
|
|
||||||
toolBar.style.height = obj.TOOLBAR_HEIGHT * core.domStyle.scale + obj.BORDER + "px";
|
|
||||||
toolBar.style.background = obj.globalAttribute.toolsBackground;
|
|
||||||
} else {
|
|
||||||
toolBar.style.left = 0;
|
|
||||||
toolBar.style.right = "";
|
|
||||||
toolBar.style.width = obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER + "px";
|
|
||||||
toolBar.style.top = 0.718 * obj.outerSize + "px";
|
|
||||||
toolBar.style.height = 0.281 * obj.outerSize + "px";
|
|
||||||
toolBar.style.background = 'transparent';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
toolBar.style.borderLeft = obj.border;
|
|
||||||
toolBar.style.borderRight = toolBar.style.borderBottom = core.domStyle.isVertical || obj.extendToolbar ? obj.border : '';
|
|
||||||
toolBar.style.fontSize = 16 * core.domStyle.scale + "px";
|
|
||||||
|
|
||||||
if (!core.domStyle.showStatusBar && !core.domStyle.isVertical && !obj.extendToolbar) {
|
|
||||||
toolBar.style.display = 'none';
|
|
||||||
} else {
|
|
||||||
toolBar.style.display = 'block';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
目测为控制toolBar形状的关键函数!
|
|
||||||
resize函数很关键
|
|
||||||
```js
|
|
||||||
control.prototype.resize = function () {
|
|
||||||
if (main.mode == 'editor') return;
|
|
||||||
var clientWidth = main.dom.body.clientWidth, clientHeight = main.dom.body.clientHeight;
|
|
||||||
var CANVAS_WIDTH = core.__PIXELS__, BAR_WIDTH = Math.round(core.__PIXELS__ * 0.31);
|
|
||||||
var BORDER = 3;
|
|
||||||
var extendToolbar = core.flags.extendToolbar;
|
|
||||||
|
|
||||||
var horizontalMaxRatio = (clientHeight - 2 * BORDER - (extendToolbar ? BORDER : 0)) / (CANVAS_WIDTH + (extendToolbar ? 38 : 0));
|
|
||||||
|
|
||||||
if (clientWidth - 3 * BORDER >= CANVAS_WIDTH + BAR_WIDTH || (clientWidth > clientHeight && horizontalMaxRatio < 1)) {
|
|
||||||
// 横屏
|
|
||||||
core.domStyle.isVertical = false;
|
|
||||||
|
|
||||||
core.domStyle.availableScale = [];
|
|
||||||
[1, 1.25, 1.5, 1.75, 2, 2.25, 2.5].forEach(function (v) {
|
|
||||||
if (clientWidth - 3 * BORDER >= v * (CANVAS_WIDTH + BAR_WIDTH) && horizontalMaxRatio >= v) {
|
|
||||||
core.domStyle.availableScale.push(v);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (core.domStyle.availableScale.indexOf(core.domStyle.scale) < 0) {
|
|
||||||
core.domStyle.scale = Math.min(1, horizontalMaxRatio);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// 竖屏
|
|
||||||
core.domStyle.isVertical = true;
|
|
||||||
core.domStyle.scale = Math.min((clientWidth - 2 * BORDER) / CANVAS_WIDTH);
|
|
||||||
core.domStyle.availableScale = [];
|
|
||||||
extendToolbar = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var statusDisplayArr = this._shouldDisplayStatus(), count = statusDisplayArr.length;
|
|
||||||
var statusCanvas = core.flags.statusCanvas, statusCanvasRows = core.values.statusCanvasRowsOnMobile || 3;
|
|
||||||
var col = statusCanvas ? statusCanvasRows : Math.ceil(count / 3);
|
|
||||||
if (col > 5) {
|
|
||||||
if (statusCanvas) alert("自绘状态栏的在竖屏下的行数应不超过5!");
|
|
||||||
else alert("当前状态栏数目(" + count + ")大于15,请调整到不超过15以避免手机端出现显示问题。");
|
|
||||||
}
|
|
||||||
var globalAttribute = core.status.globalAttribute || core.initStatus.globalAttribute;
|
|
||||||
|
|
||||||
var obj = {
|
|
||||||
clientWidth: clientWidth,
|
|
||||||
clientHeight: clientHeight,
|
|
||||||
CANVAS_WIDTH: CANVAS_WIDTH,
|
|
||||||
BORDER: BORDER,
|
|
||||||
BAR_WIDTH: BAR_WIDTH,
|
|
||||||
TOOLBAR_HEIGHT: 38,
|
|
||||||
outerSize: CANVAS_WIDTH * core.domStyle.scale + 2 * BORDER,
|
|
||||||
globalAttribute: globalAttribute,
|
|
||||||
border: '3px ' + core.arrayToRGBA(globalAttribute.borderColor) + ' solid',
|
|
||||||
statusDisplayArr: statusDisplayArr,
|
|
||||||
count: count,
|
|
||||||
col: col,
|
|
||||||
statusBarHeightInVertical: core.domStyle.isVertical ? (32 * col + 6) * core.domStyle.scale + 2 * BORDER : 0,
|
|
||||||
toolbarHeightInVertical: core.domStyle.isVertical ? 38 * core.domStyle.scale + 2 * BORDER : 0,
|
|
||||||
extendToolbar: extendToolbar,
|
|
||||||
is15x15: core.__SIZE__ == 15
|
|
||||||
};
|
|
||||||
|
|
||||||
this._doResize(obj);
|
|
||||||
this.setToolbarButton();
|
|
||||||
core.updateStatusBar();
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```js
|
|
||||||
////// 工具栏界面时的点击操作 //////
|
|
||||||
actions.prototype._clickToolbox
|
|
||||||
|
|
||||||
```
|
|
||||||
疑似看的是event.id 神人设计
|
|
||||||
|
|
||||||
尝试修改,改动总结
|
|
||||||
```js
|
|
||||||
// # main.js
|
|
||||||
this.statusBar = {
|
|
||||||
'image': {
|
|
||||||
'floor': document.getElementById('img-floor'),
|
|
||||||
'name': document.getElementById('img-name'),
|
|
||||||
'lv': document.getElementById('img-lv'),
|
|
||||||
'hpmax': document.getElementById('img-hpmax'),
|
|
||||||
'hp': document.getElementById("img-hp"),
|
|
||||||
'mana': document.getElementById("img-mana"),
|
|
||||||
'atk': document.getElementById("img-atk"),
|
|
||||||
'def': document.getElementById("img-def"),
|
|
||||||
'mdef': document.getElementById("img-mdef"),
|
|
||||||
'money': document.getElementById("img-money"),
|
|
||||||
'exp': document.getElementById("img-exp"),
|
|
||||||
'up': document.getElementById("img-up"),
|
|
||||||
'skill': document.getElementById('img-skill'),
|
|
||||||
'book': document.getElementById("img-book"),
|
|
||||||
'fly': document.getElementById("img-fly"),
|
|
||||||
'toolbox': document.getElementById("img-toolbox"),
|
|
||||||
'keyboard': document.getElementById("img-keyboard"),
|
|
||||||
'shop': document.getElementById('img-shop'),
|
|
||||||
'save': document.getElementById("img-save"),
|
|
||||||
'load': document.getElementById("img-load"),
|
|
||||||
'settings': document.getElementById("img-settings"),
|
|
||||||
'btn1': document.getElementById("img-btn1"),
|
|
||||||
'btn2': document.getElementById("img-btn2"),
|
|
||||||
'btn3': document.getElementById("img-btn3"),
|
|
||||||
'btn4': document.getElementById("img-btn4"),
|
|
||||||
'btn5': document.getElementById("img-btn5"),
|
|
||||||
'btn6': document.getElementById("img-btn6"),
|
|
||||||
'btn7': document.getElementById("img-btn7"),
|
|
||||||
'btn8': document.getElementById("img-btn8"),
|
|
||||||
'slime': document.getElementById('img-slime'), // 增加
|
|
||||||
},
|
|
||||||
//... this.statsBar.image中添加slime
|
|
||||||
|
|
||||||
'icons': {
|
|
||||||
'floor': 0,
|
|
||||||
'name': null,
|
|
||||||
'lv': 1,
|
|
||||||
'hpmax': 2,
|
|
||||||
'hp': 3,
|
|
||||||
'atk': 4,
|
|
||||||
'def': 5,
|
|
||||||
'mdef': 6,
|
|
||||||
'money': 7,
|
|
||||||
'exp': 8,
|
|
||||||
'up': 9,
|
|
||||||
'book': 10,
|
|
||||||
'fly': 11,
|
|
||||||
'toolbox': 12,
|
|
||||||
'keyboard': 13,
|
|
||||||
'shop': 14,
|
|
||||||
'save': 15,
|
|
||||||
'load': 16,
|
|
||||||
'settings': 17,
|
|
||||||
'play': 18,
|
|
||||||
'pause': 19,
|
|
||||||
'stop': 20,
|
|
||||||
'speedDown': 21,
|
|
||||||
'speedUp': 22,
|
|
||||||
'rewind': 23,
|
|
||||||
'equipbox': 24,
|
|
||||||
'mana': 25,
|
|
||||||
'skill': 26,
|
|
||||||
'btn1': 27,
|
|
||||||
'btn2': 28,
|
|
||||||
'btn3': 29,
|
|
||||||
'btn4': 30,
|
|
||||||
'btn5': 31,
|
|
||||||
'btn6': 32,
|
|
||||||
'btn7': 33,
|
|
||||||
'btn8': 34,
|
|
||||||
'slime': 35, // 增加
|
|
||||||
},
|
|
||||||
//... this.statsBar.icon中添加slime 会自动采用该列第35个图片作为相应的icon
|
|
||||||
}
|
|
||||||
|
|
||||||
main.statusBar.image.slime.onclick = function (e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
console.log(1);
|
|
||||||
};
|
|
||||||
//... 添加slime的点击事件
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
那么元素img-slime从哪来呢?
|
|
||||||
答案是index.html
|
|
||||||
```js
|
|
||||||
<div id="toolBar" class="clearfix">
|
|
||||||
<img class="tools" id='img-book'>
|
|
||||||
<img class="tools" id='img-fly'>
|
|
||||||
<img class="tools" id='img-toolbox'>
|
|
||||||
<img class="tools" id='img-keyboard'>
|
|
||||||
<img class="tools" id='img-shop'>
|
|
||||||
<img class="tools" id='img-save'>
|
|
||||||
<img class="tools" id='img-load'>
|
|
||||||
<img class="tools" id='img-settings'>
|
|
||||||
<img class="tools" id='img-btn1' >
|
|
||||||
<img class="tools" id='img-slime' >
|
|
||||||
<img class="tools" id='img-btn2' style='display:none'>
|
|
||||||
<img class="tools" id='img-btn3' style='display:none'>
|
|
||||||
<img class="tools" id='img-btn4' style='display:none'>
|
|
||||||
<img class="tools" id='img-btn5' style='display:none'>
|
|
||||||
<img class="tools" id='img-btn6' style='display:none'>
|
|
||||||
<img class="tools" id='img-btn7' style='display:none'>
|
|
||||||
<img class="tools" id='img-btn8' style='display:none'>
|
|
||||||
<p class="statusLabel tools" id="hard"></p>
|
|
||||||
</div>
|
|
||||||
```
|
|
||||||
|
|
||||||
controls中的函数_updateStatusBar_setToolboxIcon也很重要,该函数调控进/出录像模式的图标变化
|
|
||||||
setToolbarButton 改变工具栏为按钮1-8
|
|
||||||
|
|
||||||
todo:长弹幕显示不全 done
|
|
||||||
todo:点取消卡死 done
|
|
||||||
todo:未知的自动拾取导致bug 为什么其它塔没有bug? 有待将来观察
|
|
||||||
todo:2.10其它改动
|
|
||||||
|
|
||||||
todo:放缩下存档界面显示不全 楼传等?
|
|
||||||
快速移动待测 不知道为什么体感时间远比显示时间长
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
tileset只有noPass属性。设置noPass为false的瞬间就会写入project/maps.js
|
|
||||||
其它情况只要不是items就不可过。
|
|
||||||
写入可通行性对tileset只用写canPass就好
|
|
||||||
读档:```core.utils.decompress(core.saves.cache['template_save3'] );```
|
|
||||||
解码录像 core.decodeRoute(a.route);
|
|
||||||
|
|
||||||
可通行性,关键在getBlockByNumber函数。它从core.status.number2Block中获取信息。而number2Block不存在该属性时会initBlock
|
|
||||||
initBlock从blocksInfo中读
|
|
||||||
|
|
||||||
改变canPass后:(模仿setBlock)
|
|
||||||
originBlock = core.getBlock(x, y, floorId, true);获取originBlock
|
|
||||||
core.status.maps[floorId].blocks全要改
|
|
||||||
core.status.mapBlockObjs全要改
|
|
||||||
|
|
||||||
enemyInfo进存档的手法非常简单粗暴 就是存了个变量
|
|
||||||
|
|
||||||
extractBlocks->_mapIntoBlocks->initBlock
|
|
||||||
|
|
||||||
cannotOut和cannotIn的关键
|
|
||||||
箭头还在getBlockByNumber中
|
|
||||||
|
|
||||||
首先抽象一下 思考一下顶层设计
|
|
||||||
ItemBox类
|
|
||||||
需要的属性:当前持有的Item和数量 当前的页数
|
|
||||||
|
|
||||||
使用道具时,情况会改变,所以,每次重绘时,都需要获取一遍core.status.hero.items,然后依据此获取一个列表itemList。根据当前页数(currPage)获取该绘制的内容。
|
|
||||||
|
|
||||||
整个道具栏做成一个大按钮,还需要属性selectedItem 每次根据selectedItem重绘右侧的物品详细说明
|
|
||||||
|
|
||||||
按钮可往前不往后,以防一页的道具全用光会不去
|
|
||||||
|
|
||||||
点击时:点左侧 根据位置和itemList和currPage推导处在哪里,更新selectedItem,更新右侧 左侧是一个大按钮
|
|
||||||
点下方 左右 currPage
|
|
||||||
右侧按键:
|
|
||||||
使用 尝试使用selectedItem
|
|
||||||
批量使用 新功能
|
|
||||||
隐藏/显示 修改道具的隐藏属性
|
|
||||||
显示隐藏 页面级属性 showHidedItem
|
|
||||||
|
|
||||||
最高级 MenuPage 名为boxPage
|
|
||||||
拥有背景和背景中的两个箭头和道具栏|装备栏的字样
|
|
||||||
按键切换两栏 监听tab等
|
|
||||||
右下角的×
|
|
||||||
|
|
||||||
toolBox 拥有底部两按钮,右侧的一切,中间的大按钮
|
|
||||||
equipBox 拥有
|
|
||||||
```js
|
|
||||||
const itemClsName = {
|
|
||||||
"constants": "永久道具",
|
|
||||||
"tools": "消耗道具",
|
|
||||||
}
|
|
||||||
const itemNum = 12;
|
|
||||||
|
|
||||||
core.initThisEventInfo();
|
|
||||||
let info = core.status.thisUIEventInfo
|
|
||||||
info.index = 1;
|
|
||||||
core.setIndexAndSelect('select');
|
|
||||||
let ctx =core.canvas.ui;
|
|
||||||
core.status.thisEventClickArea = [];
|
|
||||||
|
|
||||||
let info1 = core.drawBoxBackground(ctx);
|
|
||||||
info1.itemNum = itemNum;
|
|
||||||
core.drawItemListbox(ctx, info1.obj);
|
|
||||||
core.drawToolboxRightbar(ctx, info1);
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
!mypromt callback疑似需要改回去
|
|
||||||
|
|
||||||
难绷的bug太多了 自动拾取,自动清怪,追猎等等。
|
|
||||||
|
|
||||||
moveBlock:
|
|
||||||
```js
|
|
||||||
let [x, y, steps, time, keep] = [0,0,['down'],1,false];
|
|
||||||
let blockArr = core.maps._getAndRemoveBlock(x, y);
|
|
||||||
let block = blockArr[0], blockInfo = blockArr[1];
|
|
||||||
let canvases = core.maps._initDetachedBlock(blockInfo, x, y, block.event.animate !== false);
|
|
||||||
core.maps._moveDetachedBlock(blockInfo, 32 * x, 32 * y, 1, canvases);
|
|
||||||
```
|
|
||||||
1.blockArr:[block,blockInfo]组成,同时会removeBlock
|
|
||||||
block,blockInfo有一个什么都没有,则blockArr什么都没有,则返回
|
|
||||||
接下来处理moveSteps,得到['down',1];
|
|
||||||
_initDetachedBlock返回三个canvas的对象 {headCanvas,bodyCanvas,damageCanvas}
|
|
||||||
_moveDetachedBlock:疑似是通过该函数不断移动实现移动效果
|
|
||||||
|
|
||||||
模板字符串居然不能随意填字符串,逆天
|
|
||||||
arguments对象是 JavaScript 中的一个特殊对象,它自动提供给每一个函数作为局部变量。它是类数组对象,但缺少真正数组的许多方法。
|
|
||||||
Loading…
Reference in New Issue
Block a user