最近使用图块可滚动

This commit is contained in:
ckcz123 2020-06-07 11:29:03 +08:00
parent a64f80414a
commit a52c151dd8
4 changed files with 13 additions and 9 deletions

View File

@ -123,7 +123,7 @@ ActionParser.prototype.parse = function (obj,type) {
}
var info = parser.getTitleAndPosition(obj.text || '');
return MotaActionBlocks['shopsub'].xmlText([
obj.id,obj[0],info[1],info[3],obj.textInList,obj.mustEnable,obj.disablePreview,text_choices,next
obj.id,info[0],info[1],info[3],obj.textInList,obj.mustEnable,obj.disablePreview,text_choices,next
]);
}
var buildcommentevent = function(obj,parser,next){

View File

@ -154,7 +154,8 @@ body {
height: auto;
bottom: 0;
margin-top: 20px;
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
}
#mid .tools {

View File

@ -206,20 +206,21 @@ editor.prototype.init = function (callback) {
editor.file = editor_file;
editor_mode = editor_mode(editor);
editor.mode = editor_mode;
var canvases = document.getElementsByClassName('gameCanvas');
for (var one in canvases) {
canvases[one].width = canvases[one].height = core.__PIXELS__;
}
core.resetGame(core.firstData.hero, null, core.firstData.floorId, core.clone(core.initStatus.maps));
var lastFloorId = editor.config.get('editorLastFloorId', core.status.floorId);
if (core.floorIds.indexOf(lastFloorId) < 0) lastFloorId = core.status.floorId;
core.changeFloor(lastFloorId, null, core.firstData.hero.loc, null, function () {
core.changeFloor(lastFloorId, null, {x: 0, y: 0, direction:"up"}, null, function () {
afterCoreReset();
}, true);
});
}
var afterCoreReset = function () {
var canvases = document.getElementsByClassName('gameCanvas');
for (var one in canvases) {
canvases[one].width = canvases[one].height = core.__PIXELS__;
}
editor.game.idsInit(core.maps, core.icons.icons); // 初始化图片素材信息
editor.drawInitData(core.icons.icons); // 初始化绘图
@ -463,6 +464,7 @@ editor.prototype.setLastUsedType = function (type) {
= type == 'frequent' ? (_buildHtml('recent', '最近使用') + " | " + _buildHtml(null, '最常使用'))
: (_buildHtml(null, '最近使用') + " | " + _buildHtml('frequent', '最常使用'));
this.updateLastUsedMap();
editor.dom.lastUsedDiv.scroll(0,0);
}
editor.prototype.updateLastUsedMap = function () {

View File

@ -848,8 +848,8 @@ editor_mappanel_wrapper = function (editor) {
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop
var px = scrollLeft + e.clientX - editor.dom.mid2.offsetLeft - editor.dom.lastUsedDiv.offsetLeft,
py = scrollTop + e.clientY - editor.dom.mid2.offsetTop - editor.dom.lastUsedDiv.offsetTop;
var px = scrollLeft + e.clientX - editor.dom.mid2.offsetLeft - editor.dom.lastUsedDiv.offsetLeft + editor.dom.lastUsedDiv.scrollLeft,
py = scrollTop + e.clientY - editor.dom.mid2.offsetTop - editor.dom.lastUsedDiv.offsetTop + editor.dom.lastUsedDiv.scrollTop;
var x = parseInt(px / 32), y = parseInt(py / 32);
var index = x + core.__SIZE__ * y;
if (index >= editor.uivalues.lastUsed.length) return;
@ -880,6 +880,7 @@ editor_mappanel_wrapper = function (editor) {
editor.uivalues.lastUsed = [];
editor.config.set('lastUsed', []);
editor.updateLastUsedMap();
editor.dom.lastUsedDiv.scroll(0,0);
}
}