public void SetText(string strText)
    {
        this.m_Percent.Visible                = true;
        this.m_FilePercent.Visible            = true;
        this.ProgressBar_ProgressBar1.Visible = true;
        this.textureBG_Img.Visible            = true;
        this.textureBG_Img1.Visible           = true;
        this.m_Percent.Text     = strText;
        this.m_FilePercent.Text = string.Empty;
        float num = this.m_fSize * this.m_fValue;

        if (num < 0f)
        {
            num = 0f;
        }
        this.ProgressBar_ProgressBar1.SetSize(this.m_fSize * this.m_fValue, this.ProgressBar_ProgressBar1.GetSize().y);
        this.ProgressBar_ProgressBar1.SetTextureUVs(new Vector2(0f, 943f), new Vector2(num, 30f));
        num = this.m_fSize * this.m_fSubValue;
        if (num < 0f)
        {
            num = 0f;
        }
        this.ProgressBar_ProgressBar2.SetSize(this.m_fSize * this.m_fSubValue, this.ProgressBar_ProgressBar2.GetSize().y);
        this.ProgressBar_ProgressBar2.SetTextureUVs(new Vector2(0f, 943f), new Vector2(num, 30f));
        Mobile_PreDownloadDlg mobile_PreDownloadDlg = (Mobile_PreDownloadDlg)NrTSingleton <FormsManager> .Instance.GetForm(G_ID.PREDOWNLOAD_DLG);

        if (mobile_PreDownloadDlg != null)
        {
            mobile_PreDownloadDlg.ShowText = true;
        }
        this.m_fTextTime  = 0f;
        this.m_nTextCount = 0;
    }
Ejemplo n.º 2
0
    public override void OnPrepareSceneChange()
    {
        NrLoadPageScreen.DecideLoadingType(Scene.CurScene, this.SceneType());
        NrLoadPageScreen.StepUpMain(1);
        NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.LOGIN_SELECT_PLATFORM_DLG);

        NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.LOGINRATING_DLG);

        this.PreDownloadDlg = (NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.PREDOWNLOAD_DLG) as Mobile_PreDownloadDlg);
        NmMainFrameWork.DeleteImage();
        this.SetPlatformPath();
    }
Ejemplo n.º 3
0
    public override void OnStartDownloadPack(string fileName, int order)
    {
        if (PlayerPrefs.GetInt(NrPrefsKey.DOWNLOAD_MOVIE, 0) == 0)
        {
            PlayerPrefs.SetInt(NrPrefsKey.DOWNLOAD_MOVIE, 1);
            Mobile_PreDownloadDlg mobile_PreDownloadDlg = (Mobile_PreDownloadDlg)NrTSingleton <FormsManager> .Instance.GetForm(G_ID.PREDOWNLOAD_DLG);

            if (mobile_PreDownloadDlg != null)
            {
                mobile_PreDownloadDlg.PlayMovie();
            }
        }
        Logger.WriteLog(string.Format("Download start : {0}", fileName));
        NPatchLauncherHandler_forInGame.FileDownloadOmniataLog(fileName);
    }
    public void UpdateTotalProgress(float delta, float fSubdelta, long totalCount, string strText)
    {
        if (this.btnGameStart.Visible)
        {
            return;
        }
        this.m_Percent.Visible                = true;
        this.m_FilePercent.Visible            = true;
        this.ProgressBar_ProgressBar1.Visible = true;
        this.ProgressBar_ProgressBar2.Visible = true;
        this.textureBG_Img.Visible            = true;
        this.textureBG_Img1.Visible           = true;
        this.DT_IntroMovie.Visible            = true;
        if (delta < 0f)
        {
            delta = 0f;
        }
        if (delta > 1f)
        {
            delta = 1f;
        }
        if (delta == 0f)
        {
            this.SetTextChange();
            return;
        }
        if (fSubdelta < 0f)
        {
            fSubdelta = 0f;
        }
        if (fSubdelta > 1f)
        {
            fSubdelta = 1f;
        }
        if (delta == 0f)
        {
            this.oldDelta = 0f;
        }
        float num = delta - this.oldDelta;

        if (1f <= num)
        {
            return;
        }
        num /= (float)totalCount;
        float num2 = this.m_fValue + num;

        if (1f <= num2)
        {
            num2 = 1f;
        }
        this.m_fValue           = num2;
        this.m_Percent.Text     = ((int)(this.m_fValue * 100f)).ToString() + "%";
        this.m_FilePercent.Text = strText;
        float num3 = this.m_fSize * this.m_fValue;

        if (num3 < 0f)
        {
            num3 = 0f;
        }
        this.ProgressBar_ProgressBar1.SetSize(this.m_fSize * this.m_fValue, this.ProgressBar_ProgressBar1.GetSize().y);
        this.ProgressBar_ProgressBar1.SetTextureUVs(new Vector2(0f, 943f), new Vector2(num3, 30f));
        this.m_fSubValue = fSubdelta;
        num3             = this.m_fSize * this.m_fSubValue;
        if (num3 < 0f)
        {
            num3 = 0f;
        }
        this.ProgressBar_ProgressBar2.SetSize(this.m_fSize * this.m_fSubValue, this.ProgressBar_ProgressBar2.GetSize().y);
        this.ProgressBar_ProgressBar2.SetTextureUVs(new Vector2(0f, 943f), new Vector2(num3, 30f));
        this.oldDelta = delta;
        Mobile_PreDownloadDlg mobile_PreDownloadDlg = (Mobile_PreDownloadDlg)NrTSingleton <FormsManager> .Instance.GetForm(G_ID.PREDOWNLOAD_DLG);

        if (mobile_PreDownloadDlg != null)
        {
            mobile_PreDownloadDlg.ShowText = true;
        }
    }
    public void SetTotalProgress(float delta, float fSubDelta, string strText)
    {
        if (this.btnGameStart.Visible)
        {
            return;
        }
        this.m_Percent.Visible                = true;
        this.m_FilePercent.Visible            = true;
        this.m_Text.Visible                   = true;
        this.textureBG_Img.Visible            = true;
        this.textureBG_Img1.Visible           = true;
        this.ProgressBar_ProgressBar1.Visible = true;
        this.ProgressBar_ProgressBar2.Visible = true;
        this.DT_IntroMovie.Visible            = true;
        if (delta < 0f)
        {
            delta = 0f;
        }
        if (delta > 1f)
        {
            delta = 1f;
        }
        if (fSubDelta < 0f)
        {
            fSubDelta = 0f;
        }
        if (fSubDelta > 1f)
        {
            fSubDelta = 1f;
        }
        this.m_fValue    = delta;
        this.m_fSubValue = fSubDelta;
        if (this.m_fValue <= 0f)
        {
            this.SetTextChange();
        }
        else
        {
            this.m_Percent.Text = ((int)(this.m_fValue * 100f)).ToString() + "%";
        }
        if (this.m_fSubValue < 0f)
        {
            this.m_FilePercent.Text = string.Empty;
        }
        else
        {
            this.m_FilePercent.Text = strText;
        }
        float num = this.m_fSize * this.m_fValue;

        if (num < 0f)
        {
            num = 0f;
        }
        this.ProgressBar_ProgressBar1.SetSize(this.m_fSize * this.m_fValue, this.ProgressBar_ProgressBar1.GetSize().y);
        this.ProgressBar_ProgressBar1.SetTextureUVs(new Vector2(0f, 943f), new Vector2(num, 30f));
        num = this.m_fSize * this.m_fSubValue;
        if (num < 0f)
        {
            num = 0f;
        }
        this.ProgressBar_ProgressBar2.SetSize(this.m_fSize * this.m_fSubValue, this.ProgressBar_ProgressBar2.GetSize().y);
        this.ProgressBar_ProgressBar2.SetTextureUVs(new Vector2(0f, 943f), new Vector2(num, 30f));
        Mobile_PreDownloadDlg mobile_PreDownloadDlg = (Mobile_PreDownloadDlg)NrTSingleton <FormsManager> .Instance.GetForm(G_ID.PREDOWNLOAD_DLG);

        if (mobile_PreDownloadDlg != null)
        {
            mobile_PreDownloadDlg.ShowText = true;
        }
    }
Ejemplo n.º 6
0
    public override void OnEnter()
    {
        if (StageNPatchLauncher.Instance != null)
        {
            StageNPatchLauncher.Instance = this;
        }
        if (this.PreDownloadDlg == null)
        {
            NrLoadPageScreen.ShowHideLoadingImg(false);
            this.PreDownloadDlg = (Mobile_PreDownloadDlg)NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.PREDOWNLOAD_DLG);
        }
        string text = string.Format("{0} OnEnter OnEnter Memory = {1}MB", base.GetType().FullName, NrTSingleton <NrMainSystem> .Instance.AppMemory);

        TsPlatform.FileLog(text);
        TsLog.LogWarning(text, new object[0]);
        TsLog.Log("====== {0}.OnEnter", new object[]
        {
            base.GetType().FullName
        });
        Scene.ChangeSceneType(this.SceneType());
        NrMainSystem.CheckAndSetReLoginMainCamera();
        Camera.main.gameObject.AddComponent <DefaultCameraController>();
        TsCaching.useCustomCacheOnly = true;
        int num = 0;

        if (!int.TryParse(NrTSingleton <NrGlobalReference> .Instance.ResourcesVer, out num))
        {
            UnityEngine.Debug.LogError(string.Concat(new object[]
            {
                "======================== end",
                NrTSingleton <NrGlobalReference> .Instance.ResourcesVer,
                "== ",
                num
            }));
            if (TsPlatform.IsAndroid)
            {
                NrTSingleton <NrMainSystem> .Instance.QuitGame(false);
            }
            else if (TsPlatform.IsIPhone)
            {
                NrTSingleton <NrMainSystem> .Instance.m_ReLogin     = false;
                NrTSingleton <NrMainSystem> .Instance.m_Login_BG    = true;
                NrTSingleton <NrGlobalReference> .Instance.localWWW = true;
                NrTSingleton <NrMainSystem> .Instance.ReLogin(false);
            }
            return;
        }
        string text2 = string.Format("http://{0}", NrTSingleton <NrGlobalReference> .Instance.GetCurrentServiceAreaInfo().szOriginalDataCDNPath);

        UnityEngine.Debug.LogError("======================== WebPath url : " + text2);
        NPatchLauncherBehaviour.PatchStart(this.m_strLocalFilePath, text2, new NPatchLauncherHandler_forInGame(), false, num, false, string.Empty);
        if (this.PreDownloadDlg != null)
        {
            this.PreDownloadDlg.SetText("Check File...");
        }
        StageNPatchLauncher.DownloadOmniataLog(true);
        base.StartTaskSerial(CommonTasks.InitializeChangeScene());
        base.StartTaskPararell(this._PatchWorkflow());
        base.StartTaskSerial(CommonTasks.FinalizeChangeScene(true));
        this.bPatchEnd = false;
        if (!Launcher.Instance.IsFullPatchLevel)
        {
            NrTSingleton <MATEventManager> .Instance.MeasureEvent("Content DL Start");
        }
        else
        {
            NrTSingleton <MATEventManager> .Instance.MeasureEvent("Add Content DL start");
        }
    }