Fix Browser Bug

This commit is contained in:
oc 2018-04-25 23:35:45 +08:00
parent 8cd049c720
commit 672afd72b5
6 changed files with 6 additions and 15 deletions

View File

@ -125,8 +125,7 @@ events.prototype.gameOver = function (ending, fromReplay) {
// 清空图片和天气 // 清空图片和天气
core.clearMap('animate', 0, 0, 416, 416); core.clearMap('animate', 0, 0, 416, 416);
while (core.dom.gif2.firstChild) core.dom.gif2.innerHTML = "";
core.dom.gif2.removeChild(core.dom.gif2.firstChild);
core.clearMap('weather', 0, 0, 416, 416) core.clearMap('weather', 0, 0, 416, 416)
core.animateFrame.weather.type = null; core.animateFrame.weather.type = null;
core.animateFrame.weather.level = 0; core.animateFrame.weather.level = 0;
@ -454,8 +453,7 @@ events.prototype.doAction = function() {
core.dom.gif2.appendChild(gif); core.dom.gif2.appendChild(gif);
} }
else { else {
while (core.dom.gif2.firstChild) core.dom.gif2.innerHTML = "";
core.dom.gif2.removeChild(core.dom.gif2.firstChild);
} }
this.doAction(); this.doAction();
break; break;
@ -966,11 +964,6 @@ events.prototype.changeFloor = function (floorId, stair, heroLoc, time, callback
else core.setWeather(); else core.setWeather();
// 清除gif // 清除gif
/*
while (core.dom.gif.firstChild) {
core.dom.gif.removeChild(core.dom.gif.firstChild);
}
*/
core.dom.gif.innerHTML = ""; core.dom.gif.innerHTML = "";
// 检查重生 // 检查重生

View File

@ -331,8 +331,7 @@ maps.prototype.drawMap = function (mapName, callback) {
if (!t[3]) { if (!t[3]) {
core.canvas.bg.drawImage(image, dx * ratio, dy * ratio, Math.min(size - dx * ratio, ratio * image.width), Math.min(size - dy * ratio, ratio * image.height)); core.canvas.bg.drawImage(image, dx * ratio, dy * ratio, Math.min(size - dx * ratio, ratio * image.width), Math.min(size - dy * ratio, ratio * image.height));
if (/.*\.gif/i.test(p)) { if (/.*\.gif/i.test(p)) {
while (core.dom.gif.firstChild) core.dom.gif.innerHTML = "";
core.dom.gif.removeChild(core.dom.gif.firstChild);
var gif = new Image(); var gif = new Image();
gif.src = core.material.images.images[p].src; gif.src = core.material.images.images[p].src;
gif.style.position = 'absolute'; gif.style.position = 'absolute';

View File

@ -20,8 +20,7 @@ ui.prototype.clearMap = function (map, x, y, width, height) {
for (var m in core.canvas) { for (var m in core.canvas) {
core.canvas[m].clearRect(0, 0, 416, 416); core.canvas[m].clearRect(0, 0, 416, 416);
} }
while (core.dom.gif.firstChild) core.dom.gif.innerHTML = "";
core.dom.gif.removeChild(core.dom.gif.firstChild);
} }
else { else {
core.canvas[map].clearRect(x||0, y||0, width||416, height||416); core.canvas[map].clearRect(x||0, y||0, width||416, height||416);

View File

@ -5,7 +5,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"sample0", "sample1", "sample2", "MT0" "sample0", "sample1", "sample2", "MT0"
], ],
"images" : [ "images" : [
"bg.jpg" "bg.jpg", "timg.gif"
], ],
"animates" : [ "animates" : [
"hand", "sword", "zone", "hand", "sword", "zone",

View File

@ -9,7 +9,7 @@ main.floors.sample0 =
"canFlyTo": true, // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器) "canFlyTo": true, // 该楼能否被楼传器飞到(不能的话在该楼也不允许使用楼传器)
"canUseQuickShop": true, // 该层是否允许使用快捷商店 "canUseQuickShop": true, // 该层是否允许使用快捷商店
"defaultGround": "ground", // 默认地面的图块IDterrains中 "defaultGround": "ground", // 默认地面的图块IDterrains中
"images": [], // 该层默认显示的所有图片;详细用法请查看文档“自定义素材”中的说明。 "images": [[0,0,"timg.gif",false]], // 该层默认显示的所有图片;详细用法请查看文档“自定义素材”中的说明。
// "color": [0,0,0,0.3] // 该层的默认画面色调。本项可不写代表无色调如果写需要是一个RGBA数组。 // "color": [0,0,0,0.3] // 该层的默认画面色调。本项可不写代表无色调如果写需要是一个RGBA数组。
// "weather": ["snow",5], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪第二项为1-10之间的数代表强度。 // "weather": ["snow",5], // 该层的默认天气。本项可忽略表示晴天,如果写则第一项为"rain"或"snow"代表雨雪第二项为1-10之间的数代表强度。
"bgm": "bgm.mp3", // 到达该层后默认播放的BGM。本项可忽略。 "bgm": "bgm.mp3", // 到达该层后默认播放的BGM。本项可忽略。

BIN
project/images/timg.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 KiB