previewUI part 1

This commit is contained in:
oc 2019-05-27 23:23:32 +08:00
parent ba7eccbf5e
commit 414dd86c81
5 changed files with 126 additions and 3 deletions

View File

@ -3204,7 +3204,7 @@ ActionParser.prototype.parseAction = function() {
break;
case "autoSave": // 自动存档
this.next = MotaActionBlocks['autoSave_s'].xmlText([
this.nohint, this.next]);
data.nohint||false, this.next]);
break;
case "callLoad": // 呼出读档界面
this.next = MotaActionBlocks['callLoad_s'].xmlText([

View File

@ -458,4 +458,53 @@ table.row td {
left: 6px;
top: 6px;
background-image:url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGJhc2VQcm9maWxlPSJmdWxsIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpldj0iaHR0cDovL3d3dy53My5vcmcvMjAwMS94bWwtZXZlbnRzIj4KPGc%2BCgk8cG9seWdvbiBmaWxsPSIjNjY2IiBwb2ludHM9IjkuMjA3LDYuMTI2IDcuNzkzLDcuNTQxIDExLjc5MywxMS41NDEgMTMuMjA3LDEwLjEyNiIgLz4KCTxwYXRoIGZpbGw9IiM2NjYiIGQ9Ik01LjkxNywyYzEuNjA4LDAsMi45MTcsMS4zMDgsMi45MTcsMi45MTdTNy41MjUsNy44MzMsNS45MTcsNy44MzNTMyw2LjUyNSwzLDQuOTE3UzQuMzA4LDIsNS45MTcsMgoJCSBNNS45MTcsMEMzLjIwMSwwLDEsMi4yMDEsMSw0LjkxN3MyLjIwMSw0LjkxNyw0LjkxNyw0LjkxN3M0LjkxNy0yLjIwMSw0LjkxNy00LjkxN0MxMC44MzMsMi4yMDEsOC42MzIsMCw1LjkxNywwTDUuOTE3LDB6IiAvPgo8L2c%2BCjwvc3ZnPgo%3D');
}
#uieventDiv {
display: none;
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: rgba(127,127,127,0.6);
z-index: 2000
}
#uieventDialog {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -60%);
background: white;
width: 436px;
}
#uieventHead {
margin: 10px 20px;
}
#uieventTitle {
font-weight: bold;
}
#uieventNo {
float: right;
}
#uieventYes {
display: none;
float: right;
margin-right: 15px;
}
#uievent {
width: 416px;
height: 416px;
position: relative;
margin-left: 10px;
}
#selectPoint {
display: none;
}

View File

@ -367,3 +367,54 @@ selectBox.isSelected=function(value){
return selectBox._isSelected
}
// ------ UI预览 & 地图选点相关 ------ //
uievent = {};
uievent.uieventDiv = document.getElementById('uieventDiv');
uievent.uieventNo = document.getElementById('uieventNo');
uievent.uieventNo.onclick = function () {
uievent.close();
}
uievent.uieventYes = document.getElementById('uieventYes');
uievent.uieventYes.onclick = function () {
uievent.close();
if (uievent.callback) {
uievent.callback(uievent.floorId, uievent.x, uievent.y);
}
delete uievent.callback;
}
uievent.title = document.getElementById('uieventTitle');
uievent.selectPoint = document.getElementById('selectPoint');
uievent.close = function () {
uievent.isOpen = false;
uievent.uieventDiv.style.display = 'none';
}
uievent.previewUI = function (list) {
uievent.isOpen = true;
uievent.uieventDiv.style.display = 'block';
uievent.mode = 'previewUI';
uievent.selectPoint.style.display = 'none';
uievent.uieventYes.style.display = 'none';
uievent.title.innerText = 'UI绘制预览';
core.clearMap('uievent');
// 绘制UI
core.drawThumbnail(editor.currentFloorId, null, {}, 'uievent');
if (list instanceof Array) {
list.forEach(function (data) {
var type = data.type;
if (!type || !core.ui["_uievent_"+type]) return;
core.ui["_uievent_"+type](data);
})
}
}

View File

@ -514,7 +514,7 @@
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
</div>
</div>
<div id='inputBackground' style='display: none'>
<div id='inputDiv' style='display: none'>
<div id='inputDialog'>
<p id="inputMessage">请输入文字...</p>
<input id='inputBox' type="text"/>

View File

@ -497,7 +497,7 @@
<canvas class='gameCanvas' id='data' width='416' height='416'>此浏览器不支持HTML5</canvas>
</div>
</div>
<div id='inputBackground' style='display: none'>
<div id='inputDiv' style='display: none'>
<div id='inputDialog'>
<p id="inputMessage">请输入文字...</p>
<input id='inputBox' type="text"/>
@ -505,6 +505,29 @@
<button id='inputNo'>取消</button>
</div>
</div>
<!-- UI预览 & 地图选点 -->
<div id='uieventDiv' style='display: none'>
<div id='uieventDialog'>
<div id="uieventHead">
<span id="uieventTitle"></span>
<button id="uieventNo">关闭</button>
<button id="uieventYes">确定</button>
</div>
<hr style="clear: both; margin-top: 0"/>
<canvas class='gameCanvas' id='uievent' width='416' height='416'></canvas>
<div id="selectPoint">
<select id="selectPointFloor"></select>
<div id="selectPointButtons">
<input type="button" value="←"/>
<input type="button" value="↑"/>
<input type="button" value="↓"/>
<input type="button" value="→"/>
</div>
</div>
</div>
</div>
<!-- */</script> -->
<!-- =========================================================== -->