少年修仙传客户端代码仓库
client_linchunjie
2018-11-19 479398971586485b089fe2e4b2786cad21d2f911
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已修改
123 ■■■■ 已修改文件
System/Dungeon/IceCrystalVeinModel.cs 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/IceCrystalVeinWin.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/IceCrystalVeinModel.cs
@@ -30,21 +30,23 @@
    public int HasSweep = 0;//是否已扫荡
    public int DayLv = 0;//今日等级
    public event Action UpdateIceLodeInf;
    DungeonModel m_Model;
    DungeonModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<DungeonModel>()); } }
    public override void Init()
    {
        Assignment();
    }
    public void OnBeforePlayerDataInitialize()
    {
    }
    public override void UnInit()
    {
    }
    public void OnPlayerLoginOk()
    {
    }
    private void Assignment()
@@ -77,8 +79,8 @@
                }
            }
        }
    }
    public void IceLodeInfo(HB204_tagMCIceLodeInfo info)
@@ -100,7 +102,7 @@
        }
    }
    public void SendGetAward(int Index)
    public void SendGetAward(int Index)//领取奖励
    {
        CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
        getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_IceLodeStar;
@@ -109,6 +111,47 @@
        getReward.DataExStr = string.Empty;
        GameNetSystem.Instance.SendInfo(getReward);
    }
    public int GetAllStar()
    {
        int StarAll = 0;
        for (int i = 0; i < LineList.Count; i++)
        {
            DungeonRecord dungeonRecord;
            if (model.TryGetRecord(31140, out dungeonRecord))
            {
                if (dungeonRecord.lineGrades.ContainsKey(LineList[i]))
                {
                    StarAll += dungeonRecord.lineGrades[(LineList[i])];
                }
            }
        }
        return StarAll;
    }
    public bool IsFree(int Index)
    {
        DungeonRecord dungeonRecord;
        if (model.TryGetRecord(31140, out dungeonRecord))
        {
            if (dungeonRecord.lineGrades.ContainsKey(Index))
            {
                int StarNumber = dungeonRecord.lineGrades[Index];
                if (StarNumber > 0)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else
            {
                return true;
            }
        }
        return true;
    }
}
System/Dungeon/IceCrystalVeinWin.cs
@@ -11,7 +11,8 @@
using TableConfig;
using EnhancedUI.EnhancedScroller;
namespace Snxxz.UI {
namespace Snxxz.UI
{
    public class IceCrystalVeinWin : Window
    {
@@ -52,12 +53,12 @@
        protected override void OnPreOpen()
        {
            GetAllStar();
            StarAll = iceCrystalVeinModel.GetAllStar();
            OnCreateGridLineCell(m_ScrollerController);
            AddIceLodeStarAwardList();
            SetGridMiddle();
            SetGridBotton();
        }
        protected override void OnAfterOpen()
@@ -66,7 +67,7 @@
            iceCrystalVeinModel.UpdateIceLodeInf += UpdateIceLodeInf;
        }
        protected override void OnPreClose()
        {
        }
@@ -79,7 +80,7 @@
        private void UpdateIceLodeInf()
        {
            GetAllStar();
            StarAll = iceCrystalVeinModel.GetAllStar();
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见 
        }
@@ -87,9 +88,9 @@
        {
            if (fbId == 31140)
            {
                GetAllStar();
                StarAll = iceCrystalVeinModel.GetAllStar();
                m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
            }
            }
        }
        #endregion
@@ -103,9 +104,33 @@
        }
        private void OnClickChallenge()
        {
            //model.currentDungeon = new Dungeon(31140, IndexSelect);
            //model.SingleChallenge(model.currentDungeon);
            if (iceCrystalVeinModel.IsFree(IndexSelect))//免费
            {
                EnterTheCopy();
            }
            else//收费
            {
                string str = "重复挑战该副本需要消耗50绑玉,确定要重复挑战?";
                ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), str, (bool isOk) =>
                {
                    if (isOk)
                    {
                        int GoldPaper = (int)UIHelper.GetMoneyCnt(2);
                        if (GoldPaper >= 50)
                        {
                            EnterTheCopy();
                        }
                    }
                });
            }
        }
        private void EnterTheCopy()
        {
            model.currentDungeon = new Dungeon(31140, IndexSelect);
            model.SingleChallenge(model.currentDungeon);
        }
        void OnCreateGridLineCell(ScrollerController gridCtrl)
        {
            gridCtrl.Refresh();
@@ -130,7 +155,7 @@
                Obj2.SetActive(false);
                IceCrystalVeinCell iceCrystal = Obj1.GetComponent<IceCrystalVeinCell>();
                iceCrystal.SetIceCrystalVeinCell(Index);
                iceCrystal._Button.SetListener(()=>
                iceCrystal._Button.SetListener(() =>
                {
                    IndexSelect = Index;
                    m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
@@ -161,7 +186,7 @@
                    ItemCellModel cellModel = new ItemCellModel(IceCrystalVeinMiddle[i], true, (ulong)1);
                    _ItemCell.Init(cellModel);
                    int type = i;
                    _ItemCell.cellBtn.SetListener(()=>
                    _ItemCell.cellBtn.SetListener(() =>
                    {
                        ItemAttrData attrData = new ItemAttrData(IceCrystalVeinMiddle[type], false, (ulong)1);
                        itemTipsModel.SetItemTipsModel(attrData);
@@ -185,8 +210,8 @@
                    IceLodeStarAwardClass IceLode = IceLodeStarAwardList[i];
                    ObjChild.SetActive(true);
                    ItemCell _ItemCell = ObjChild.transform.Find("ItemCell_1").GetComponent<ItemCell>();
                    Text TextStar= ObjChild.transform.Find("Text_Star").GetComponent<Text>();
                    TextStar.text = StarAll + "/"+ IceLode.Star;
                    Text TextStar = ObjChild.transform.Find("Text_Star").GetComponent<Text>();
                    TextStar.text = StarAll + "/" + IceLode.Star;
                    ItemCellModel cellModel = new ItemCellModel(IceLode.ItemID, true, (ulong)1);
                    _ItemCell.Init(cellModel);
                    int type = i;
@@ -214,22 +239,7 @@
                    IceLodeStarAwardList.Add(Dic);
                }
            }
        }
        private void GetAllStar()
        {
            StarAll = 0;
            for (int i = 0; i < iceCrystalVeinModel.LineList.Count; i++)
            {
                DungeonRecord dungeonRecord;
                if (model.TryGetRecord(31140, out dungeonRecord))
                {
                    if (dungeonRecord.lineGrades.ContainsKey(iceCrystalVeinModel.LineList[i]))
                    {
                        StarAll += dungeonRecord.lineGrades[(iceCrystalVeinModel.LineList[i])];
                    }
                }
            }
        }
        }
    }
}