yyl
4 天以前 9e89e605d5429babb4b33df2e47ea86dff9d2ba7
Main/System/BoneField/BoneFieldWin.cs
@@ -43,7 +43,7 @@
    protected override void OnPreOpen()
    {
        base.OnPreOpen();
        DungeonManager.Instance.UpdateFBInfoChangeEvent += OnUpdateFBInfoChangeEvent;
        DungeonManager.Instance.UpdateFBInfoListEvent += OnUpdateFBInfoChangeEvent;
        AdsManager.Instance.OnAdsInfoListUpdateEvent += OnAdsInfoListUpdateEvent;
        TimeMgr.Instance.OnDayEvent += OnDayEvent;
        Display();
@@ -52,36 +52,30 @@
    protected override void OnPreClose()
    {
        base.OnPreClose();
        DungeonManager.Instance.UpdateFBInfoChangeEvent -= OnUpdateFBInfoChangeEvent;
        DungeonManager.Instance.UpdateFBInfoListEvent -= OnUpdateFBInfoChangeEvent;
        AdsManager.Instance.OnAdsInfoListUpdateEvent -= OnAdsInfoListUpdateEvent;
        TimeMgr.Instance.OnDayEvent -= OnDayEvent;
    }
    private void OnUpdateFBInfoChangeEvent(int mapID, bool isADAddCntChange, bool isBuyAddCntChange, bool isItemAddCntChange)
    private void OnUpdateFBInfoChangeEvent(int mapID)
    {
        int dataMapID = BoneFieldManager.Instance.DataMapID;
        if (mapID != dataMapID)
            return;
        if (!ADAwardConfig.TryGetADIDByADMapID(BoneFieldManager.Instance.DataMapID, out adID) || !ADAwardConfig.HasKey(adID))
        ADAwardConfig aDAwardConfig;
        if (!ADAwardConfig.TryGetADIDByTypeValue(2, BoneFieldManager.Instance.DataMapID, out aDAwardConfig))
            return;
        ADAwardConfig aDAwardConfig = ADAwardConfig.Get(adID);
        if (isADAddCntChange)
        {
            DisplayAdsButton(aDAwardConfig);
        }
        else
        {
            Display();
        }
        Display();
    }
    private void OnAdsInfoListUpdateEvent(int id, int mapId)
    private void OnAdsInfoListUpdateEvent(int id, int type, int mapId)
    {
        if (mapId != BoneFieldManager.Instance.DataMapID)
            return;
        if (!ADAwardConfig.TryGetADIDByADMapID(BoneFieldManager.Instance.DataMapID, out adID) || !ADAwardConfig.HasKey(adID))
        ADAwardConfig aDAwardConfig;
        if (!ADAwardConfig.TryGetADIDByTypeValue(2, BoneFieldManager.Instance.DataMapID, out aDAwardConfig))
            return;
        ADAwardConfig aDAwardConfig = ADAwardConfig.Get(adID);
        DisplayAdsButton(aDAwardConfig);
    }
@@ -107,6 +101,12 @@
        if (showrealRemainSweepCount == showSweepMaxCount)
        {
            BoneFieldManager.Instance.SendBBeginFBWipeOut(dataMapID, (int)fbInfo.PassLineID);
            return;
        }
        if (InvestModel.Instance.GetFBIsFree(dataMapID))
        {
            BoneFieldManager.Instance.SendBuyEnterCount(dataMapID);
            BoneFieldManager.Instance.SendBBeginFBWipeOut(dataMapID, (int)fbInfo.PassLineID);
            return;
        }
@@ -153,10 +153,10 @@
        if (bossId == 0 || !NPCConfig.HasKey(bossId))
            return;
        NPCConfig nPCConfig = NPCConfig.Get(bossId);
        if (!ADAwardConfig.TryGetADIDByADMapID(dataMapID, out adID) || !ADAwardConfig.HasKey(adID))
        ADAwardConfig aDAwardConfig;
        if (!ADAwardConfig.TryGetADIDByTypeValue(2, BoneFieldManager.Instance.DataMapID, out aDAwardConfig))
            return;
        ADAwardConfig aDAwardConfig = ADAwardConfig.Get(adID);
        adID = aDAwardConfig.ADID;
        DisplayFBInfo(nPCConfig, dungeonConfig, nowPassLineID);
        DisplayChallengeButton(dungeonConfig, fbInfo);
@@ -206,22 +206,32 @@
        imgSweep.gray = !isSweepCountOk;
        long myFightPower = PlayerDatas.Instance.baseData.FightPower;
        imgSweepRed.SetActive(isSweepCountOk && myFightPower < dungeonConfig.FightPower);
        txtFirstFree.SetActive(showSweepMaxCount == showrealRemainSweepCount);
        txtTodaySweepCount.SetActive(showSweepMaxCount > showrealRemainSweepCount);
        txtTodaySweepCount.text = UIHelper.AppendColor(isSweepCountOk ? TextColType.LightGreen : TextColType.Red, Language.Get("BoneField08", showrealRemainSweepCount, showSweepMaxCount));
        imgMoneyCount.SetActive(showSweepMaxCount != showrealRemainSweepCount && isSweepCountOk);
        txtNeedMoneyCount.SetActive(showSweepMaxCount != showrealRemainSweepCount && isSweepCountOk);
        if (showSweepMaxCount != showrealRemainSweepCount && isSweepCountOk)
        if (InvestModel.Instance.GetFBIsFree(BoneFieldManager.Instance.DataMapID))
        {
            int dataMapID = BoneFieldManager.Instance.DataMapID;
            DungeonOpenTimeConfig config = DungeonOpenTimeConfig.Get(dataMapID);
            int index = Mathf.Min(Mathf.Max(0, showSweepMaxCount - showrealRemainSweepCount - 1), config.PayMoneyValues.Length - 1);
            int payMoneyValue = config.PayMoneyValues[index];
            int payMoneyType = config.PayMoneyType;
            imgMoneyCount.SetIconWithMoneyType(payMoneyType);
            txtNeedMoneyCount.text = payMoneyValue.ToString();
            txtFirstFree.text = Language.Get("PrivilegeCard1");
            imgMoneyCount.SetActive(false);
            txtNeedMoneyCount.SetActive(false);
        }
    }
        else
        {
            txtFirstFree.text = showSweepMaxCount == showrealRemainSweepCount ? Language.Get("BoneField10") : "";
            imgMoneyCount.SetActive(showSweepMaxCount != showrealRemainSweepCount && isSweepCountOk);
            txtNeedMoneyCount.SetActive(showSweepMaxCount != showrealRemainSweepCount && isSweepCountOk);
            if (showSweepMaxCount != showrealRemainSweepCount && isSweepCountOk)
            {
                int dataMapID = BoneFieldManager.Instance.DataMapID;
                DungeonOpenTimeConfig config = DungeonOpenTimeConfig.Get(dataMapID);
                int index = Mathf.Min(Mathf.Max(0, showSweepMaxCount - showrealRemainSweepCount - 1), config.PayMoneyValues.Length - 1);
                int payMoneyValue = config.PayMoneyValues[index];
                int payMoneyType = config.PayMoneyType;
                imgMoneyCount.SetIconWithMoneyType(payMoneyType);
                txtNeedMoneyCount.text = payMoneyValue.ToString();
            }
        }
    }
    public void DisplayAdsButton(ADAwardConfig aDAwardConfig)
    {
@@ -229,7 +239,7 @@
        bool isShowAds = adsCnt < aDAwardConfig.ADCntMax;
        int remainAdsCount = aDAwardConfig.ADCntMax - adsCnt;
        btnAds.SetActive(isShowAds);
        txtTodayAdsCount.text = UIHelper.AppendColor(isShowAds ? TextColType.LightGreen : TextColType.Red, Language.Get("BoneField09", remainAdsCount, aDAwardConfig.ADCntMax)); ;
        txtTodayAdsCount.text = Language.Get("BoneField09", remainAdsCount, aDAwardConfig.ADCntMax); ;
    }
    public void DisplayItemCellList(List<ItemCell> itemCells, int[][] items)