Example #1
0
    void RefreshUI()
    {
        int currentPhysics = UserDC.GetPhysical();
        int total          = UserM.GetMaxPhysical(UserDC.GetLevel());

        if (currentPhysics >= total)
        {
            SetType(0);
        }
        else
        {
            SetType(1);
        }

        int serverTime = GlobalTimer.GetNowTimeInt();

        NGUIUtil.SetLableText <string>(MyHead.LblTime, NdUtil.ConvertServerTime(serverTime));
        if (m_iType == 1)
        {
            int resumePhysicsTime = GlobalTimer.instance.GetPhysicsResumeCounter();
            NGUIUtil.SetLableText <string>(MyHead.LblNextResumeTime, NdUtil.TimeFormat(resumePhysicsTime));

            int resumePhysicsAllTime = GlobalTimer.instance.GetPhysicsResumeAllCounter();
            NGUIUtil.SetLableText <string>(MyHead.LblResumeAllTime, NdUtil.TimeFormat(resumePhysicsAllTime));
        }
    }
Example #2
0
    public bool ShowCaptionUpWnd()
    {
        CombatScene combat = SceneM.GetCurIScene() as CombatScene;

        if (combat != null)
        {
            UserInfo old = combat.m_oldUserInfo;
            if (old.Level < UserDC.GetLevel())
            {
                CaptionUpgradeWnd cuw = WndManager.GetDialog <CaptionUpgradeWnd>();
                int oldMaxPhysical    = UserM.GetMaxPhysical(old.Level);
                int newMaxPhysical    = UserM.GetMaxPhysical(UserDC.GetLevel());
                int oldMaxherolevel   = UserM.GetUserMaxHeroLevel(old.Level);
                int newMaxherolevel   = UserM.GetUserMaxHeroLevel(UserDC.GetLevel());
                cuw.SetData(old.Level, UserDC.GetLevel(),
                            StageDC.GetStageResult().win ? old.Physical - StageDC.GetCounterPartInfo().win_physical : old.Physical - StageDC.GetCounterPartInfo().lose_physical,
                            UserDC.GetPhysical(),
                            oldMaxPhysical, newMaxPhysical, oldMaxherolevel, newMaxherolevel);

                cuw.MyHead.BtnBg.OnClickEventHandler    += BackMainScence;
                cuw.MyHead.BtnClose.OnClickEventHandler += BackMainScence;

                return(true);
            }
        }

        return(false);
    }
Example #3
0
    public int GetPhysicsResumeAllCounter()
    {
        int current = UserDC.GetPhysical();
        int total   = UserM.GetMaxPhysical(UserDC.GetLevel());
        int temp    = (total - current - 1) * ConfigM.GetResumePhysicsTime();

        return(PhysicsResumeCounter + temp);
    }