额外素材拖框绘制
This commit is contained in:
parent
0bfef141c7
commit
dc5ff0e309
@ -105,7 +105,7 @@ function editor() {
|
||||
|
||||
// tile
|
||||
tileSize: [1,1],
|
||||
startLoc: {"x":0,"y":0},
|
||||
startLoc: null,
|
||||
lockMode: false,
|
||||
|
||||
// 最近使用的图块
|
||||
|
||||
@ -655,9 +655,9 @@ editor_mappanel_wrapper = function (editor) {
|
||||
* 切换画笔模式
|
||||
*/
|
||||
editor.uifunctions.brushMod3_onchange = function () {
|
||||
if (!editor.config.get('alertTileMode') &&
|
||||
!confirm("从V2.6.6开始,tileset贴图模式已被废弃。\n请右键额外素材,并输入所需要绘制的宽高,然后单击地图以绘制一个区域。\n\n点取消将不再显示此提示。")) {
|
||||
editor.config.set('alertTileMode', true);
|
||||
if (!editor.config.get('alertTileModeV2.7') &&
|
||||
!confirm("从V2.7开始,请直接素材区拖框进行绘制区域。\n\n点取消将不再显示此提示。")) {
|
||||
editor.config.set('alertTileModeV2.7', true);
|
||||
}
|
||||
// tip.showHelp(5)
|
||||
tip.isSelectedBlock(false)
|
||||
|
||||
@ -77,6 +77,8 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
editor.uivalues.startLoc={
|
||||
'x': scrollLeft + e.clientX + editor.dom.iconLib.scrollLeft - right.offsetLeft - editor.dom.iconLib.offsetLeft,
|
||||
'y': scrollTop + e.clientY + editor.dom.iconLib.scrollTop - right.offsetTop - editor.dom.iconLib.offsetTop,
|
||||
'px': e.clientX,
|
||||
'py': e.clientY,
|
||||
'size': 32
|
||||
};
|
||||
}
|
||||
@ -89,6 +91,14 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
lastmoveE=e;
|
||||
if (!editor.uivalues.startLoc) return;
|
||||
var pos0 = editor.uifunctions.locToPos(editor.uivalues.startLoc);
|
||||
|
||||
editor.dom.dataSelection.style.left = 32 * pos0.x + 'px';
|
||||
editor.dom.dataSelection.style.top = 32 * pos0.y + 'px';
|
||||
editor.dom.dataSelection.style.width = e.clientX - editor.uivalues.startLoc.px + 'px';
|
||||
editor.dom.dataSelection.style.height = e.clientY - editor.uivalues.startLoc.py + 'px';
|
||||
editor.dom.dataSelection.style.display = 'block';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,6 +106,9 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
* 素材区的单击/拖拽事件
|
||||
*/
|
||||
editor.uifunctions.material_onup = function (ee) {
|
||||
var startLoc = editor.uivalues.startLoc;
|
||||
editor.uivalues.startLoc = null;
|
||||
|
||||
var e=lastmoveE;
|
||||
if (!editor.isMobile && e.clientY >= editor.dom.iconLib.offsetHeight - editor.uivalues.scrollBarHeight) return;
|
||||
var scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
|
||||
@ -107,7 +120,7 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
};
|
||||
editor.loc = loc;
|
||||
editor.uivalues.tileSize = [1,1];
|
||||
var pos0 = editor.uifunctions.locToPos(editor.uivalues.startLoc);
|
||||
var pos0 = editor.uifunctions.locToPos(startLoc);
|
||||
var pos = editor.uifunctions.locToPos(loc);
|
||||
for (var spriter in editor.widthsX) {
|
||||
if (pos.x >= editor.widthsX[spriter][1] && pos.x < editor.widthsX[spriter][2]) {
|
||||
@ -178,6 +191,9 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
}
|
||||
|
||||
if (editor.info.isTile && e.button == 2) { //这段改一改之类的应该能给手机用,就不删了
|
||||
// 废弃好了
|
||||
alert('V2.7后右键已被废弃,请直接素材区拖框选中区域。');
|
||||
/*
|
||||
var v = prompt("请输入该额外素材区域绑定宽高,以逗号分隔", "1,1");
|
||||
if (v != null && /^\d+,\d+$/.test(v)) {
|
||||
v = v.split(",");
|
||||
@ -193,6 +209,7 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
editor.dom.dataSelection.style.width = 32*x - 6 + 'px';
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
if (editor.info.isTile && e.button != 2) { //左键拖拽框选
|
||||
|
||||
@ -203,7 +220,7 @@ editor_materialpanel_wrapper = function (editor) {
|
||||
|
||||
} else {
|
||||
editor.info = editor.ids[idindex-(x-1)-(y-1)*(widthX[2]-widthX[1])];
|
||||
editor.uifunctions.locToPos(editor.uivalues.startLoc); //重置editor.pos
|
||||
editor.uifunctions.locToPos(startLoc); //重置editor.pos
|
||||
editor.uivalues.tileSize = [x, y];
|
||||
editor.dom.dataSelection.style.left = pos0.x * 32 + 'px';
|
||||
editor.dom.dataSelection.style.top = pos0.y * ysize + 'px';
|
||||
|
||||
@ -292,9 +292,11 @@ core.prototype._init_sys_flags = function () {
|
||||
// 行走速度
|
||||
core.values.moveSpeed = core.getLocalStorage('moveSpeed', 100);
|
||||
core.values.floorChangeTime = core.getLocalStorage('floorChangeTime', 500);
|
||||
core.domStyle.scale = core.getLocalStorage('scale', 1);
|
||||
if (core.domStyle.scale != 1) {
|
||||
core.resize();
|
||||
if (main.mode != 'editor') {
|
||||
core.domStyle.scale = core.getLocalStorage('scale', 1);
|
||||
if (core.domStyle.scale != 1) {
|
||||
core.resize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,12 +44,12 @@
|
||||
(已完成!) 重构全局商店!
|
||||
(已完成!) 读档时色调数据丢失
|
||||
(已完成!) 圆角边框
|
||||
像素高分辨率问题
|
||||
(不处理) 像素高分辨率问题
|
||||
(已完成!) 道具效果优化,删除部分道具相关的开关
|
||||
(已完成!) 素材列表选择
|
||||
(已完成!) 油漆桶,动态更改地图大小
|
||||
地图拉框选择复制剪切删除
|
||||
额外素材区拖动选择一个区域
|
||||
(已完成!) 额外素材区拖动选择一个区域
|
||||
(已完成!) 素材替换
|
||||
(已完成!) 大屏幕下放大游戏界面
|
||||
(已完成!) 最近使用/最常使用的图块
|
||||
|
||||
Loading…
Reference in New Issue
Block a user