|
@@ -262,54 +262,55 @@ cc.Class({
|
|
|
var condition2 = skinNode.getChildByName("Condition2");
|
|
|
var lockerSp = skinNode.getChildByName("LockerSp");
|
|
|
var playBtn = skinNode.getChildByName("PlayBtn");
|
|
|
- var unlockSp = skinNode.getChildByName("UnlockSp");
|
|
|
- if (this.skinIndex > 0) {
|
|
|
- if (cfg.skinCondition[this.skinIndex].scoreType == 0) {
|
|
|
- var historyScore = UserInfo.getHistoryScore();
|
|
|
- if (historyScore >= cfg.skinCondition[this.skinIndex].score) {
|
|
|
- condition1.active = false;
|
|
|
- condition2.active = false;
|
|
|
- unlockSp.active = true;
|
|
|
- lockerSp.active = false;
|
|
|
- playBtn.active = true;
|
|
|
- } else {
|
|
|
- condition1.active = true;
|
|
|
- condition2.active = false;
|
|
|
- unlockSp.active = false;
|
|
|
- lockerSp.active = true;
|
|
|
- playBtn.active = false;
|
|
|
-
|
|
|
- condition1.getChildByName("ConditionLabel").getComponent("cc.Label").string = historyScore + "." + cfg.skinCondition[this.skinIndex].score;
|
|
|
- }
|
|
|
-
|
|
|
- } else if (cfg.skinCondition[this.skinIndex].scoreType == 1) {
|
|
|
- var sumScore = UserInfo.getTotalGold();
|
|
|
- if (sumScore >= cfg.skinCondition[this.skinIndex].score) {
|
|
|
- condition1.active = false;
|
|
|
- condition2.active = false;
|
|
|
- unlockSp.active = true;
|
|
|
- lockerSp.active = false;
|
|
|
- playBtn.active = true;
|
|
|
- } else {
|
|
|
- condition1.active = false;
|
|
|
- condition2.active = true;
|
|
|
- unlockSp.active = false;
|
|
|
- lockerSp.active = true;
|
|
|
- playBtn.active = false;
|
|
|
-
|
|
|
- condition2.getChildByName("ConditionLabel").getComponent("cc.Label").string = cfg.skinCondition[this.skinIndex].score;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- condition1.active = false;
|
|
|
- condition2.active = false;
|
|
|
- lockerSp.active = false;
|
|
|
- playBtn.active = true;
|
|
|
- unlockSp.active = true;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //})
|
|
|
+ var unlockSp = skinNode.getChildByName("UnlockSp");
|
|
|
+
|
|
|
+ UserInfo.getUserGameData((data) => {
|
|
|
+ var historyScore = data.maxScore || UserInfo.getItem('score');
|
|
|
+
|
|
|
+ if (this.skinIndex > 0) {
|
|
|
+ if (cfg.skinCondition[this.skinIndex].scoreType == 0) {
|
|
|
+ if (historyScore >= cfg.skinCondition[this.skinIndex].score) {
|
|
|
+ condition1.active = false;
|
|
|
+ condition2.active = false;
|
|
|
+ unlockSp.active = true;
|
|
|
+ lockerSp.active = false;
|
|
|
+ playBtn.active = true;
|
|
|
+ } else {
|
|
|
+ condition1.active = true;
|
|
|
+ condition2.active = false;
|
|
|
+ unlockSp.active = false;
|
|
|
+ lockerSp.active = true;
|
|
|
+ playBtn.active = false;
|
|
|
+
|
|
|
+ condition1.getChildByName("ConditionLabel").getComponent("cc.Label").string = historyScore + "." + cfg.skinCondition[this.skinIndex].score;
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (cfg.skinCondition[this.skinIndex].scoreType == 1) {
|
|
|
+ var sumScore = UserInfo.getTotalGold();
|
|
|
+ if (sumScore >= cfg.skinCondition[this.skinIndex].score) {
|
|
|
+ condition1.active = false;
|
|
|
+ condition2.active = false;
|
|
|
+ unlockSp.active = true;
|
|
|
+ lockerSp.active = false;
|
|
|
+ playBtn.active = true;
|
|
|
+ } else {
|
|
|
+ condition1.active = false;
|
|
|
+ condition2.active = true;
|
|
|
+ unlockSp.active = false;
|
|
|
+ lockerSp.active = true;
|
|
|
+ playBtn.active = false;
|
|
|
+
|
|
|
+ condition2.getChildByName("ConditionLabel").getComponent("cc.Label").string = cfg.skinCondition[this.skinIndex].score;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ condition1.active = false;
|
|
|
+ condition2.active = false;
|
|
|
+ lockerSp.active = false;
|
|
|
+ playBtn.active = true;
|
|
|
+ unlockSp.active = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
onGuideBtn: function (event) {
|