Przeglądaj źródła

Merge branch 'master' of http://git.mokasz.com/zouyong/tower_sanguo

zouyong 5 lat temu
rodzic
commit
e82b8f8dff

Plik diff jest za duży
+ 1024 - 180
tower_sanguo/assets/resources/module/main/main.prefab


+ 8 - 7
tower_sanguo/assets/scripts/module/invest/investModel.ts

@@ -1,6 +1,7 @@
 import { PLAYERPROP } from "../../data/GameDefinition"
 import { PLAYERPROP } from "../../data/GameDefinition"
 import GameController from "../../GameController"
 import GameController from "../../GameController"
 import { HTTPTYPE } from "../../net/HttpCommand"
 import { HTTPTYPE } from "../../net/HttpCommand"
+import MainUI from "../main/MainUI"
 import investItem from "./investItem"
 import investItem from "./investItem"
 import investUI from "./investUI"
 import investUI from "./investUI"
 
 
@@ -32,7 +33,8 @@ export default class investModel {
 
 
     getInvestInfo() {
     getInvestInfo() {
         let data = {}
         let data = {}
-        GameController.http.sendRequest(HTTPTYPE.getInvestInfo, 'POST', JSON.stringify(data), investModel.Instance.getInvestInfoBack.bind(this))
+        // GameController.http.sendRequest(HTTPTYPE.getInvestInfo, 'POST', JSON.stringify(data), investModel.Instance.getInvestInfoBack.bind(this))
+        GameController.http.sendData(HTTPTYPE.getInvestInfo, data, investModel.Instance.getInvestInfoBack.bind(this))
     }
     }
 
 
     getInvestInfoBack(data) {
     getInvestInfoBack(data) {
@@ -40,7 +42,7 @@ export default class investModel {
         this.SurplusTimes = data.SurplusTimes;
         this.SurplusTimes = data.SurplusTimes;
         GameController.commonData.gameTime = data.timestamp * 1000
         GameController.commonData.gameTime = data.timestamp * 1000
 
 
-        this.freshRed();
+        this.checkRed();
 
 
         let investui = GameController.uiM.getUI(investUI);
         let investui = GameController.uiM.getUI(investUI);
         if (investui) {
         if (investui) {
@@ -66,8 +68,7 @@ export default class investModel {
         this.investData = data.investModel
         this.investData = data.investModel
         this.SurplusTimes = data.SurplusTimes
         this.SurplusTimes = data.SurplusTimes
         GameController.commonData.gameTime = data.timestamp * 1000
         GameController.commonData.gameTime = data.timestamp * 1000
-
-        this.freshRed()
+        this.checkRed();
 
 
         let investui = GameController.uiM.getUI(investUI);
         let investui = GameController.uiM.getUI(investUI);
         if (param.investMentType == 0) {
         if (param.investMentType == 0) {
@@ -125,8 +126,8 @@ export default class investModel {
     }
     }
 
 
     /** 刷新红点 */
     /** 刷新红点 */
-    freshRed() {
-        // let state = this.SurplusTimes > 0 ? true : false
-        // UiM.Instance.hallNode.getComponent(Main).setInvestRed(state)
+    checkRed() {
+        let state = this.SurplusTimes > 0 ? true : false
+        GameController.uiM.getUI(MainUI).invest_red.active = state
     }
     }
 }
 }

+ 24 - 2
tower_sanguo/assets/scripts/module/main/MainUI.ts

@@ -24,6 +24,8 @@ import PiggyBankModel from "../piggyBank/PiggyBankModel";
 import CheckpointRedBagModle from "../checkpointRedBag/CheckpointRedBagModle";
 import CheckpointRedBagModle from "../checkpointRedBag/CheckpointRedBagModle";
 import GetLiangCaoUI from "../getLiangCao/GetLiangCaoUI";
 import GetLiangCaoUI from "../getLiangCao/GetLiangCaoUI";
 import GetLiangCaoModel from "../getLiangCao/GetLiangCaoModel";
 import GetLiangCaoModel from "../getLiangCao/GetLiangCaoModel";
+import investUI from "../invest/investUI";
+import investModel from "../invest/investModel";
 
 
 const { ccclass, property } = cc._decorator;
 const { ccclass, property } = cc._decorator;
 
 
@@ -77,6 +79,10 @@ export default class MainUI extends BaseUI {
     barracks_red: cc.Node = null;
     barracks_red: cc.Node = null;
     @property({ type: cc.Node, displayName: "任务红点" })
     @property({ type: cc.Node, displayName: "任务红点" })
     task_red: cc.Node = null;
     task_red: cc.Node = null;
+    @property({ type: cc.Node, displayName: "转盘红点" })
+    turntable_red: cc.Node = null;
+    @property({ type: cc.Node, displayName: "投资红点" })
+    invest_red: cc.Node = null;
 
 
 
 
     @property({ type: cc.Node, displayName: "气泡_统帅" })
     @property({ type: cc.Node, displayName: "气泡_统帅" })
@@ -133,6 +139,9 @@ export default class MainUI extends BaseUI {
         GameController.gameData.player.addComponent(this, PLAYERPROP.TURNTABLE_LUCK_TIMES);
         GameController.gameData.player.addComponent(this, PLAYERPROP.TURNTABLE_LUCK_TIMES);
         GameController.gameData.player.addComponent(this, PLAYERPROP.USE_SKILLS_TIMES);
         GameController.gameData.player.addComponent(this, PLAYERPROP.USE_SKILLS_TIMES);
         GameController.gameData.player.addComponent(this, PLAYERPROP.LOOK_VIDEO_TIMES);
         GameController.gameData.player.addComponent(this, PLAYERPROP.LOOK_VIDEO_TIMES);
+        //转盘每日次数
+        GameController.gameData.player.addComponent(this, PLAYERPROP.TURNTABLE_LEFTTIMES);
+        GameController.gameData.player.addComponent(this, PLAYERPROP.TURNTABLE_CARD);
 
 
         this.mission = this.ui.missions.getComponent(MenuMission) as MenuMission;
         this.mission = this.ui.missions.getComponent(MenuMission) as MenuMission;
 
 
@@ -140,6 +149,10 @@ export default class MainUI extends BaseUI {
 
 
         this.barracks_red.active = barracksModel.getInstance().checkRed();
         this.barracks_red.active = barracksModel.getInstance().checkRed();
         turntableModel.Instance.updateResetTurntable();
         turntableModel.Instance.updateResetTurntable();
+        this.turntable_red.active = turntableModel.Instance.checkRed();
+
+        investModel.Instance.getInvestInfo();
+
         this.task_red.active = TaskModel.checkMainRed();
         this.task_red.active = TaskModel.checkMainRed();
 
 
         this.initScheduler();
         this.initScheduler();
@@ -215,6 +228,11 @@ export default class MainUI extends BaseUI {
                 this.task_red.active = TaskModel.checkMainRed();
                 this.task_red.active = TaskModel.checkMainRed();
                 // cc.log('类型' + type + ':%o', value)
                 // cc.log('类型' + type + ':%o', value)
                 break;
                 break;
+
+            case PLAYERPROP.TURNTABLE_LEFTTIMES:
+            case PLAYERPROP.TURNTABLE_CARD:
+                this.turntable_red.active = turntableModel.Instance.checkRed();
+                break
         }
         }
     }
     }
 
 
@@ -321,8 +339,7 @@ export default class MainUI extends BaseUI {
     }
     }
 
 
     clickOpenGetGeneralUI() {
     clickOpenGetGeneralUI() {
-        //test
-        this.clickTurntableUI();
+
     }
     }
 
 
     clickTurntableUI() {
     clickTurntableUI() {
@@ -330,6 +347,11 @@ export default class MainUI extends BaseUI {
         GameController.uiM.openUI(turntableUI, null, ViewZorder.UI);
         GameController.uiM.openUI(turntableUI, null, ViewZorder.UI);
     }
     }
 
 
+    clickInvestUi() {
+        GameController.audioM.playEffect(AUDIO_TYPE.button);
+        GameController.uiM.openUI(investUI, null, ViewZorder.UI);
+    }
+
     clickOpenGeneralUI() {
     clickOpenGeneralUI() {
         GameController.audioM.playEffect(AUDIO_TYPE.button);
         GameController.audioM.playEffect(AUDIO_TYPE.button);
         GameController.uiM.openUI(GeneralUI, null, ViewZorder.UI, null, null, { tab_type: 0 });
         GameController.uiM.openUI(GeneralUI, null, ViewZorder.UI, null, null, { tab_type: 0 });

+ 7 - 11
tower_sanguo/assets/scripts/module/turntable/turntableModel.ts

@@ -125,9 +125,6 @@ export default class turntableModel {
         this.turntableTimes--
         this.turntableTimes--
         GameController.gameData.player.setProp(PLAYERPROP.TURNTABLE_LEFTTIMES, this.turntableTimes);
         GameController.gameData.player.setProp(PLAYERPROP.TURNTABLE_LEFTTIMES, this.turntableTimes);
         GameController.gameData.updateProp(PLAYERPROP.TURNTABLE_LEFTTIMES, this.turntableTimes);
         GameController.gameData.updateProp(PLAYERPROP.TURNTABLE_LEFTTIMES, this.turntableTimes);
-
-        this.setRed();
-
         // GameM.commonData.addDailyFinishTimesDataByType(2)
         // GameM.commonData.addDailyFinishTimesDataByType(2)
     }
     }
 
 
@@ -148,16 +145,15 @@ export default class turntableModel {
         GameController.gameData.updateProp(PLAYERPROP.TURNTABLE_CARD, this.turntableCard);
         GameController.gameData.updateProp(PLAYERPROP.TURNTABLE_CARD, this.turntableCard);
         GameController.gameData.updateProp(PLAYERPROP.TURNTABLE_USECARDTIMES, this.turntableUseCardTimes);
         GameController.gameData.updateProp(PLAYERPROP.TURNTABLE_USECARDTIMES, this.turntableUseCardTimes);
 
 
-        this.setRed();
         // GameM.commonData.addDailyFinishTimesDataByType(2)
         // GameM.commonData.addDailyFinishTimesDataByType(2)
     }
     }
 
 
-    setRed() {
-        // if (TurntableData.Instance.turntableTimes > 0 || GameM.commonData.roleData.turntableCard > 0) {
-        //     RedPointM.instance.ActiveRedPoint(RedPointType.Turnplate, true)
-        // }
-        // else {
-        //     RedPointM.instance.ActiveRedPoint(RedPointType.Turnplate, false)
-        // }
+    checkRed() {
+        if (this.turntableTimes > 0 || this.turntableCard > 0) {
+            return true;
+        }
+        else {
+            return false;
+        }
     }
     }
 }
 }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików