using FGUI.rank;

namespace ChillConnect
{
    public class RankRuleUI : BaseUI
    {
        private RankRuleUICtrl ctrl;
        private RankRuleModel model;
        private com_rank_rule ui;



        public RankRuleUI(RankRuleUICtrl ctrl) : base(ctrl)
        {
            uiName = UIConst.RankRuleUI;
            this.ctrl = ctrl;
        }


        protected override void SetUIInfo(UIInfo uiInfo)
        {
            uiInfo.packageName = "rank";
            uiInfo.assetName = "com_rank_rule";
            uiInfo.layerType = UILayerType.Popup;
            uiInfo.isNeedOpenAnim = false;
            uiInfo.isNeedCloseAnim = false;
            uiInfo.isNeedUIMask = true;
        }

        #region 生命周期
        protected override void OnInit()
        {
        }

        protected override void OnClose()
        {
            AdRedeemManager.Instance.Destroy();
        }

        protected override void OnBind()
        {
            ui = baseUI as com_rank_rule;
        }

        protected override void OnOpenBefore(object args)
        {
            // if (Screen.safeArea.y != 0)
            {
                ui.group_top.y += 68;
                ui.rank_panel_partent.y += 68;
            }

            ui.btn_close.SetClick(CtrlCloseUI);

            int value = ConfigSystem.GetConfig<CommonModel>().adsPoints[0];
            ui.rank_panel_partent.rankPanel.lab_purchase.SetVar("num", ConfigSystem.GetConfig<CommonModel>().USDPoints.ToString()).FlushVars();
            ui.rank_panel_partent.rankPanel.lab_elminate.SetVar("num", ConfigSystem.GetConfig<CommonModel>().eliminatePoints.ToString()).FlushVars();
            ui.rank_panel_partent.rankPanel.lab_elminate2.SetVar("num", ConfigSystem.GetConfig<CommonModel>().eliminatePoints.ToString()).FlushVars();
            ui.rank_panel_partent.rankPanel.lab_ads.SetVar("num", ConfigSystem.GetConfig<CommonModel>().adsPoints[0].ToString()).FlushVars();
            ui.rank_panel_partent.rankPanel.lab_ads_limit.SetVar("num", ConfigSystem.GetConfig<CommonModel>().adsPoints[1].ToString()).FlushVars();

            // ConfigSystem.GetConfig<CommonModel>().eliminatePoints;
            
        }

        protected override void OnOpen(object args)
        {
        }

        protected override void OnHide()
        {
        }

        protected override void OnDisplay(object args)
        {
        }
        #endregion

        #region 消息
        protected override void AddListener()
        {
        }
        protected override void RemoveListener()
        {
        }
        #endregion



       
    }
}