Commit 8b65d668 8b65d66807596cd150a7b3fafa88aea322857eb6 by jinwawa

complete hot-update without sceneGameLobby

1 parent e3315ccf
......@@ -41,8 +41,8 @@
},
"_scale": {
"__type__": "cc.Vec3",
"x": 0.37636718749999937,
"y": 0.37636718749999937,
"x": 0.3763671875,
"y": 0.3763671875,
"z": 1
},
"_quat": {
......@@ -2673,7 +2673,9 @@
"panel": {
"__id__": 61
},
"manifestUrl": null,
"manifestUrl": {
"__uuid__": "12f3d277-6912-4388-a876-d91854f39321"
},
"_id": "dcGJ+cSA5D7qNtScKfLjJJ"
},
{
......
......@@ -13,14 +13,6 @@ var waterfall_three2six = require('waterfall_three2six');
//热更新相关
var UpdatePanel = require('UpdatePanel');
var info = cc.Class({
name: 'info',
_updating: false,
properties: {
target: cc.Node,
num: 0
}
});
/**
* ScrollView有问题,
......@@ -71,8 +63,9 @@ cc.Class({
this._oSceneContext._iPageIndex = 1;
this._oSceneContext._iCurrentLeftIndex = 0;
this._oInit = {};
this._iSceneStatus=0;
this.checkUpdate(); //热更新检查是否有新版本
// this.checkUpdate(); //热更新检查是否有新版本 //放到初始化焦点框后
this.getLeftBgRequest(); //渲染左侧导航
this.getTopBgRequest(); //渲染顶部导航
......@@ -350,6 +343,16 @@ cc.Class({
//初始化焦点框
initFocus: function () {
this._aFocusTargets[1]=[];
let fiHotUpdateClose=cc.find('update/update_panel/close',this.node).addComponent(FocusInfo); //热更新关闭按钮
fiHotUpdateClose.init('',false,null,null,1.0);
this._aFocusTargets[1]['hot_update_close']=cc.find('update/update_panel/close',this.node);
let fiHotUpdateBtn=cc.find('update/update_panel/update_btn',this.node).addComponent(FocusInfo); //热更新按钮
fiHotUpdateBtn.init('',false,null,null,1.0);
this._aFocusTargets[1]['hot_update_btn']=cc.find('update/update_panel/update_btn',this.node);
var nodeInitFocus = cc.find(this._oSceneContext.focusPath, this.node);
// cc.log("初始化 "+nodeInitFocus.name);
var nodeFocus = new cc.Node('nodeFocus');
......@@ -358,6 +361,9 @@ cc.Class({
this._cFocus.init('focusContainer', this,
nodeInitFocus.getComponent(FocusInfo),
Common.SCREEN_WIDTH, Common.SCREEN_HEIGHT, 2, 6, 1.0, true);
this.checkUpdate(); //热更新
this.scheduleOnce(() => { //指定0让回调函数在下一帧立即执行
if (0 == nodeInitFocus.name.indexOf('NaviCell')) {
// nodeInitFocus.getComponent(cc.Sprite).spriteFrame.setRect(cc.rect(0, nodeInitFocus.height, nodeInitFocus.width, nodeInitFocus.height));
......@@ -369,7 +375,6 @@ cc.Class({
);
}
}, 0);
},
onBeforeFocusChange: function (event) {
......@@ -443,7 +448,7 @@ cc.Class({
var fiCurrentFocus = this._fiCurrentFocus;
var oScrollParameter = null;
let aCheckResult;
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, 0, Direct);
fiFocusTarget = this._cFocus.findTarget(fiCurrentFocus, this._aFocusTargets, this._iSceneStatus, Direct);
if (!fiFocusTarget) { return; }
aCheckResult = this.checkFocusTarget(fiFocusTarget);
fiFocusTarget = aCheckResult[0];
......@@ -543,7 +548,18 @@ cc.Class({
case cc.macro.KEY.enter:
case cc.macro.KEY.space:
case Common.ANDROID_KEY.enter:
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
if (0 == this._fiCurrentFocus.node.name.indexOf('close')) {
this._iSceneStatus=0;
cc.find("update", this.node).active = false; //关闭更新面板
let fiAfterNode=cc.find(this._oSceneContext.focusPath,this.node).getComponent(FocusInfo); //热更新按钮
this._cFocus.flyFocus(this._fiCurrentFocus, fiAfterNode, Common.MOVE_DIRECTION_RIGHT, null, null);
}
else if(0 == this._fiCurrentFocus.node.name.indexOf('update_btn')){
this.hotUpdate();
}
else{
this.doCurrentFocusTVLinkAction(Common.TV_LINK_ACTION_CLICK);
}
break;
case cc.macro.KEY.backspace:
case Common.ANDROID_KEY.back:
......@@ -706,11 +722,16 @@ cc.Class({
this.panel.info.string = "Already up to date with the latest remote version.";
break;
case jsb.EventAssetsManager.NEW_VERSION_FOUND: //可以更新了
cc.log("可以更新了");
cc.log("可以更新了"); //处理焦点框跳转
this.panel.info.string = 'New version found, please try to update.';
cc.find("update", this.node).active = true; //显示出来更新面板
this.panel.fileProgress.progress = 0;
// this.panel.byteProgress.progress = 0;
this._iSceneStatus=1; //焦点框跳转层级
cc.find("update", this.node).active = true; //显示出来更新面板
let fiHotUpdateBtn=cc.find('update/update_panel/update_btn',this.node).getComponent(FocusInfo); //热更新按钮
this._cFocus.flyFocus(this._fiCurrentFocus, fiHotUpdateBtn, Common.MOVE_DIRECTION_RIGHT, null, null);
break;
default:
return;
......
{
"ver": "1.0.1",
"uuid": "00c8d4db-68f5-48fe-96ab-f5d85749c29f",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"ver": "1.0.0",
"uuid": "12f3d277-6912-4388-a876-d91854f39321",
"subMetas": {}
}
\ No newline at end of file
......
{"packageUrl":"http://x9niiz.natappfree.cc/remote-assets/","remoteManifestUrl":"http://x9niiz.natappfree.cc/remote-assets/project.manifest","remoteVersionUrl":"http://x9niiz.natappfree.cc/remote-assets/version.manifest","version":"2.0.0"}
\ No newline at end of file
{"packageUrl":"http://x9niiz.natappfree.cc/remote-assets/","remoteManifestUrl":"http://x9niiz.natappfree.cc/remote-assets/project.manifest","remoteVersionUrl":"http://x9niiz.natappfree.cc/remote-assets/version.manifest","version":"1.0.0"}
\ No newline at end of file
......
{
"ver": "1.0.0",
"uuid": "cf2be6f5-e147-4f6e-b96a-abe1079c6213",
"subMetas": {}
}
\ No newline at end of file