|
@@ -14,6 +14,7 @@ cc.Class({
|
|
|
_aboutUs: cc.Node,
|
|
|
_logout: cc.Node,
|
|
|
mClientVersion: cc.Label,
|
|
|
+ mLangueageNode: cc.Node,
|
|
|
},
|
|
|
|
|
|
onLoad: function () {
|
|
@@ -105,8 +106,9 @@ cc.Class({
|
|
|
},
|
|
|
|
|
|
initLanguageToggleListener: function () {
|
|
|
- let toggleContainer = this.node.getChildByName("rootNode").getChildByName("language_node");
|
|
|
+ // let toggleContainer = this.node.getChildByName("rootNode").getChildByName("language_node");
|
|
|
|
|
|
+ let toggleContainer = this.mLangueageNode.getChildByName("btnNode");
|
|
|
for (let toggle of toggleContainer.children) {
|
|
|
if (toggle.active) {
|
|
|
let languageStr = toggle.name.slice(4);
|
|
@@ -214,6 +216,7 @@ cc.Class({
|
|
|
if (saveLang != "")
|
|
|
topTipMsg.showTopTipMsg(LanguageKey.t("set.switch_success"));
|
|
|
}
|
|
|
+ this.hideLanguagePanel();
|
|
|
},
|
|
|
|
|
|
showSet: function () {
|
|
@@ -221,8 +224,10 @@ cc.Class({
|
|
|
this.refreshSound();
|
|
|
|
|
|
let languageKey = Global.getLocalStorageVaule("LanguageKey");
|
|
|
+ // if(languageKey)
|
|
|
+ // cc.find("rootNode/language_node/btn_" + languageKey, this.node).getComponent(cc.Toggle).check();
|
|
|
if(languageKey)
|
|
|
- cc.find("rootNode/language_node/btn_" + languageKey, this.node).getComponent(cc.Toggle).check();
|
|
|
+ cc.find("rootNode/LangueageNode/btnNode/btn_" + languageKey, this.node).getComponent(cc.Toggle).check();
|
|
|
|
|
|
var animation = this.node.getComponent(cc.Animation);
|
|
|
animation.play("ShowSet");
|
|
@@ -237,6 +242,15 @@ cc.Class({
|
|
|
// cc.find("rootNode/language_node/btn_" + languageKey, this.node).getComponent(cc.Toggle).check();
|
|
|
},
|
|
|
|
|
|
+ showLanguagePanel: function () {
|
|
|
+ this.mLangueageNode.active = true;
|
|
|
+ },
|
|
|
+ hideLanguagePanel: function () {
|
|
|
+ this.mLangueageNode.active = false;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
});
|
|
|
|