public bool IsChangeChar(E_CHAR_TRIBE eCharTribe)
    {
        if (this.m_lNeedMoney > NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_Money)
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("89"), SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return(false);
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return(false);
        }
        NkSoldierInfo leaderSoldierInfo = charPersonInfo.GetLeaderSoldierInfo();

        if (leaderSoldierInfo == null)
        {
            return(false);
        }
        int changeCharKindFormIndex = CharChangeMainDlg.GetChangeCharKindFormIndex(eCharTribe);

        if (changeCharKindFormIndex == leaderSoldierInfo.GetCharKind())
        {
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("212"), SYSTEM_MESSAGE_TYPE.IMPORTANT_MESSAGE);
            return(false);
        }
        if (leaderSoldierInfo.IsEquipItem())
        {
            CharChangeMainDlg.ShowMessageBoxEquipItem();
            return(false);
        }
        return(true);
    }
    public void SetCharFace(Transform CharFace, int CHARKIND)
    {
        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(CHARKIND);

        if (charKindInfo == null)
        {
            return;
        }
        CharChangeMainDlg.m_strBuilder.Remove(0, CharChangeMainDlg.m_strBuilder.Length);
        if (CHARKIND % 2 == 1)
        {
            CharChangeMainDlg.m_strBuilder.Append(string.Format("UI/CharSelect/{0}male{1}", charKindInfo.GetCHARKIND_INFO().CharTribe, NrTSingleton <UIDataManager> .Instance.AddFilePath));
        }
        else
        {
            CharChangeMainDlg.m_strBuilder.Append(string.Format("UI/CharSelect/{0}female{1}", charKindInfo.GetCHARKIND_INFO().CharTribe, NrTSingleton <UIDataManager> .Instance.AddFilePath));
        }
        Texture2D texture2D = ResourceCache.GetResource(CharChangeMainDlg.m_strBuilder.ToString()) as Texture2D;

        if (null == texture2D)
        {
            CharChangeMainDlg.RequestDownload(CharChangeMainDlg.m_strBuilder.ToString(), new PostProcPerItem(CharChangeMainDlg._OnImageProcessFace), CharFace.gameObject);
        }
        else
        {
            CharChangeMainDlg.SetCharFaceTexture(CharFace.gameObject, texture2D);
        }
    }
    public static Texture2D RequestDownload(string strAssetPath, PostProcPerItem callbackDelegate, object obj)
    {
        Texture2D texture2D = null;
        WWWItem   wWWItem   = Holder.TryGetOrCreateBundle(strAssetPath + Option.extAsset, null);

        if (wWWItem != null && (wWWItem.isCanceled || !wWWItem.canAccessAssetBundle))
        {
            wWWItem.SetItemType(ItemType.TEXTURE2D);
            wWWItem.SetCallback(callbackDelegate, obj);
            TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true);
        }
        if (!(wWWItem.mainAsset == null))
        {
            texture2D = (wWWItem.mainAsset as Texture2D);
            DrawTexture drawTexture = obj as DrawTexture;
            if (drawTexture != null)
            {
                CharChangeMainDlg.SetTexture(drawTexture, texture2D);
            }
            else
            {
                GameObject gameObject = obj as GameObject;
                if (gameObject != null)
                {
                    CharChangeMainDlg.SetCharFaceTexture(gameObject, texture2D);
                }
            }
        }
        return(texture2D);
    }
Example #4
0
    public void SetMainTexture(E_CHAR_TRIBE eCharTribe)
    {
        string text = string.Empty;

        switch (eCharTribe)
        {
        case E_CHAR_TRIBE.HUMAN:
        case E_CHAR_TRIBE.HUMANF:
            text = string.Format("UI/charselect/HumanBG" + NrTSingleton <UIDataManager> .Instance.AddFilePath, new object[0]);
            break;

        case E_CHAR_TRIBE.FURRY:
            text = string.Format("UI/charselect/FurryBG" + NrTSingleton <UIDataManager> .Instance.AddFilePath, new object[0]);
            break;

        case E_CHAR_TRIBE.ELF:
            text = string.Format("UI/charselect/FairyBG" + NrTSingleton <UIDataManager> .Instance.AddFilePath, new object[0]);
            break;
        }
        if (string.Empty != text)
        {
            Texture2D texture2D = ResourceCache.GetResource(text) as Texture2D;
            if (null == texture2D)
            {
                CharChangeMainDlg.RequestDownload(text, new PostProcPerItem(CharChangeMainDlg._OnImageProcess), this.m_dtMainBG);
            }
            else
            {
                CharChangeMainDlg.SetTexture(this.m_dtMainBG, texture2D);
            }
        }
    }
Example #5
0
    public void ClickChange(IUIObject obj)
    {
        CharChangeMainDlg charChangeMainDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.CHARCHANGEMAIN_DLG) as CharChangeMainDlg;

        if (charChangeMainDlg == null || charChangeMainDlg.SetClassChange(this.m_eCharTribe))
        {
        }
    }
 public bool SetClassChange(E_CHAR_TRIBE eCharTribe)
 {
     if (!this.IsChangeChar(eCharTribe))
     {
         return(false);
     }
     CharChangeMainDlg.ShowMessageBoxClassChange(eCharTribe);
     return(true);
 }
Example #7
0
    public void SelectCharInfo(E_CHAR_TRIBE eCharTribe)
    {
        int            changeCharKindFormIndex = CharChangeMainDlg.GetChangeCharKindFormIndex(eCharTribe);
        NrCharKindInfo charKindInfo            = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(changeCharKindFormIndex);

        if (charKindInfo == null)
        {
            return;
        }
        this.SetMainTexture(eCharTribe);
        CharChangeMainDlg.SetCharImage(this.m_dtCharBG, changeCharKindFormIndex);
        BATTLESKILL_BASE battleSkillBase = NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillBase(charKindInfo.GetCHARKIND_STATINFO().kBattleSkillData[0].BattleSkillUnique);

        if (battleSkillBase != null)
        {
            this.m_dtSkillIcon1.SetTexture(NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillIconTexture(battleSkillBase.m_nSkillUnique));
            this.m_lbSkillName1.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(battleSkillBase.m_strTextKey));
        }
        BATTLESKILL_BASE battleSkillBase2 = NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillBase(charKindInfo.GetCHARKIND_STATINFO().kBattleSkillData[1].BattleSkillUnique);

        if (battleSkillBase2 != null)
        {
            this.m_dtSkillIcon2.SetTexture(NrTSingleton <BattleSkill_Manager> .Instance.GetBattleSkillIconTexture(battleSkillBase2.m_nSkillUnique));
            this.m_lbSkillName2.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(battleSkillBase2.m_strTextKey));
        }
        switch (eCharTribe)
        {
        case E_CHAR_TRIBE.HUMAN:
            this.m_dtWeapon1.SetTextureKey("Win_I_Weapon1");
            this.m_dtWeapon2.SetTextureKey("Win_I_Weapon2");
            this.m_lbClass.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50006"));
            this.m_lbInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50011"));
            break;

        case E_CHAR_TRIBE.FURRY:
            this.m_dtWeapon1.SetTextureKey("Win_I_Weapon3");
            this.m_dtWeapon2.SetTextureKey("Win_I_Weapon6");
            this.m_lbClass.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50004"));
            this.m_lbInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50008"));
            break;

        case E_CHAR_TRIBE.ELF:
            this.m_dtWeapon1.SetTextureKey("Win_I_Weapon7");
            this.m_dtWeapon2.SetTextureKey("Win_I_Weapon8");
            this.m_lbClass.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50007"));
            this.m_lbInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50009"));
            break;

        case E_CHAR_TRIBE.HUMANF:
            this.m_dtWeapon1.SetTextureKey("Win_I_Weapon4");
            this.m_dtWeapon2.SetTextureKey("Win_I_Weapon5");
            this.m_lbClass.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50005"));
            this.m_lbInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromCharInfo("50010"));
            break;
        }
    }
    public static bool Send_GS_CHANGE_CLASS_REQ(E_CHAR_TRIBE eCharTribe)
    {
        if (0 >= CharChangeMainDlg.GetChangeCharKindFormIndex(eCharTribe))
        {
            return(false);
        }
        GS_CHANGE_CLASS_REQ gS_CHANGE_CLASS_REQ = new GS_CHANGE_CLASS_REQ();

        gS_CHANGE_CLASS_REQ.i32CharTribe = (int)eCharTribe;
        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_CHANGE_CLASS_REQ, gS_CHANGE_CLASS_REQ);
        NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.CHARCHANGE_DLG);

        return(true);
    }
Example #9
0
    public override void SetComponent()
    {
        this.m_eCharTribeList = new E_CHAR_TRIBE[4];
        this.m_dtMainBG       = (base.GetControl("DrawTexture_DrawTexture26") as DrawTexture);
        this.m_dtCharBG       = (base.GetControl("BT_DrawTexture25") as DrawTexture);
        this.m_dtShadowBG     = (base.GetControl("BT_DrawTexture_CharShadow1") as DrawTexture);
        string    text      = string.Format("UI/charselect/ChShadow" + NrTSingleton <UIDataManager> .Instance.AddFilePath, new object[0]);
        Texture2D texture2D = ResourceCache.GetResource(text) as Texture2D;

        if (null == texture2D)
        {
            CharChangeMainDlg.RequestDownload(text, new PostProcPerItem(CharChangeMainDlg._OnImageProcess), this.m_dtShadowBG);
        }
        else
        {
            CharChangeMainDlg.SetTexture(this.m_dtShadowBG, texture2D);
        }
        this.m_btPrev = (base.GetControl("BT_Back") as Button);
        this.m_btPrev.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickPrev));
        this.m_btNext = (base.GetControl("BT_Next") as Button);
        this.m_btNext.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickNext));
        this.m_lbClass   = (base.GetControl("LB_Title") as Label);
        this.m_dtWeapon1 = (base.GetControl("DT_Weapon01") as DrawTexture);
        this.m_dtWeapon2 = (base.GetControl("DT_Weapon02") as DrawTexture);
        this.m_lbInfo    = (base.GetControl("LB_Info") as Label);
        this.m_btMovie   = (base.GetControl("BT_Movie") as Button);
        this.m_btMovie.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickMovie));
        this.m_dtSkillIcon1 = (base.GetControl("DT_SkillIcon01") as DrawTexture);
        this.m_lbSkillName1 = (base.GetControl("LB_SkillName01") as Label);
        this.m_dtSkillIcon2 = (base.GetControl("DT_SkillIcon02") as DrawTexture);
        this.m_lbSkillName2 = (base.GetControl("LB_SkillName02") as Label);
        this.m_lbMoney      = (base.GetControl("LB_Gold") as Label);
        charSpend charSpend = NrTSingleton <NrBaseTableManager> .Instance.GetCharSpend(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetLevel().ToString());

        if (charSpend != null)
        {
            this.m_lNeedMoney = charSpend.lCharChangeGold;
        }
        this.m_lbMoney.SetText(ANNUALIZED.Convert(this.m_lNeedMoney));
        this.m_btBack = (base.GetControl("Button_Button15") as Button);
        this.m_btBack.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickBack));
        this.m_btChange = (base.GetControl("BT_Change") as Button);
        this.m_btChange.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickChange));
        this.m_eCharTribeList[0] = E_CHAR_TRIBE.FURRY;
        this.m_eCharTribeList[1] = E_CHAR_TRIBE.ELF;
        this.m_eCharTribeList[2] = E_CHAR_TRIBE.HUMAN;
        this.m_eCharTribeList[3] = E_CHAR_TRIBE.HUMANF;
        base.SetScreenCenter();
    }
 public static void _OnImageProcessFace(IDownloadedItem wItem, object obj)
 {
     if (wItem != null && wItem.canAccessAssetBundle)
     {
         Texture2D  texture2D  = wItem.mainAsset as Texture2D;
         GameObject gameObject = obj as GameObject;
         if (gameObject != null)
         {
             CharChangeMainDlg.SetCharFaceTexture(gameObject, texture2D);
         }
     }
     if (wItem.mainAsset == null)
     {
         TsLog.LogWarning("wItem.mainAsset is null -> Path = {0}", new object[]
         {
             wItem.assetPath
         });
     }
 }
 public static void _OnImageProcess(IDownloadedItem wItem, object obj)
 {
     if (wItem != null && wItem.canAccessAssetBundle)
     {
         Texture2D   texture2D   = wItem.mainAsset as Texture2D;
         DrawTexture drawTexture = obj as DrawTexture;
         if (drawTexture != null)
         {
             CharChangeMainDlg.SetTexture(drawTexture, texture2D);
         }
     }
     if (wItem.mainAsset == null)
     {
         TsLog.LogWarning("wItem.mainAsset is null -> Path = {0}", new object[]
         {
             wItem.assetPath
         });
     }
 }
    public static void ShowMessageBoxClassChange(E_CHAR_TRIBE eCharTribe)
    {
        MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

        if (msgBoxUI == null)
        {
            return;
        }
        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("87"),
            "targetname",
            CharChangeMainDlg.GetClassName(eCharTribe)
        });

        msgBoxUI.SetMsg(new YesDelegate(CharChangeMainDlg.MessageBoxClassChangeOK), eCharTribe, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("951"), empty, eMsgType.MB_OK_CANCEL, 2);
        msgBoxUI.Show();
    }
    public override void SetComponent()
    {
        this.m_dtCharBG   = new DrawTexture[4];
        this.m_btSelect   = new Button[4];
        this.m_btDetail   = new Button[4];
        this.m_dtShadowBG = new DrawTexture[4];
        string text = string.Empty;

        this.m_dtMaingBG = (base.GetControl("BT_DrawTexture_DrawTexture22") as DrawTexture);
        Texture2D texture2D;

        for (int i = 0; i < 4; i++)
        {
            text = string.Format("BT_DrawTexture_CharBG{0}", (i + 1).ToString());
            this.m_dtCharBG[i] = (base.GetControl(text) as DrawTexture);
            text = string.Format("BT_Select0{0}", (i + 1).ToString());
            this.m_btSelect[i] = (base.GetControl(text) as Button);
            this.m_btSelect[i].AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickSelect));
            text = string.Format("BT_Detail0{0}", (i + 1).ToString());
            this.m_btDetail[i] = (base.GetControl(text) as Button);
            this.m_btDetail[i].AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickDetail));
            text = string.Format("BT_DrawTexture_CharShadow{0}", (i + 1).ToString());
            this.m_dtShadowBG[i] = (base.GetControl(text) as DrawTexture);
            text      = string.Format("UI/charselect/ChShadow" + NrTSingleton <UIDataManager> .Instance.AddFilePath, new object[0]);
            texture2D = (ResourceCache.GetResource(text) as Texture2D);
            if (null == texture2D)
            {
                CharChangeMainDlg.RequestDownload(text, new PostProcPerItem(CharChangeMainDlg._OnImageProcess), this.m_dtShadowBG[i]);
            }
            else
            {
                CharChangeMainDlg.SetTexture(this.m_dtShadowBG[i], texture2D);
            }
        }
        this.m_dtSelect = (base.GetControl("DT_Select01") as DrawTexture);
        this.m_dtSelect.Hide(true);
        this.m_btSelect[0].TabIndex = 2;
        this.m_btSelect[1].TabIndex = 3;
        this.m_btSelect[2].TabIndex = 1;
        this.m_btSelect[3].TabIndex = 4;
        this.m_btDetail[0].TabIndex = 2;
        this.m_btDetail[1].TabIndex = 3;
        this.m_btDetail[2].TabIndex = 1;
        this.m_btDetail[3].TabIndex = 4;
        this.m_lbMoney = (base.GetControl("LB_Gold") as Label);
        charSpend charSpend = NrTSingleton <NrBaseTableManager> .Instance.GetCharSpend(NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.GetLevel().ToString());

        if (charSpend != null)
        {
            this.m_lNeedMoney = charSpend.lCharChangeGold;
        }
        this.m_lbMoney.SetText(ANNUALIZED.Convert(this.m_lNeedMoney));
        this.m_HelpButton = (base.GetControl("Help_Button") as Button);
        this.m_HelpButton.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickHelp));
        this.m_btChange = (base.GetControl("BT_Change") as Button);
        this.m_btChange.AddValueChangedDelegate(new EZValueChangedDelegate(this.ClickChange));
        text      = string.Format("UI/charselect/ChaSelect_BG" + NrTSingleton <UIDataManager> .Instance.AddFilePath, new object[0]);
        texture2D = (ResourceCache.GetResource(text) as Texture2D);
        if (null == texture2D)
        {
            CharChangeMainDlg.RequestDownload(text, new PostProcPerItem(CharChangeMainDlg._OnImageProcess), this.m_dtMaingBG);
        }
        else
        {
            CharChangeMainDlg.SetTexture(this.m_dtMaingBG, texture2D);
        }
        CharChangeMainDlg.SetCharImage(this.m_dtCharBG[0], 3);
        CharChangeMainDlg.SetCharImage(this.m_dtCharBG[1], 6);
        CharChangeMainDlg.SetCharImage(this.m_dtCharBG[2], 1);
        CharChangeMainDlg.SetCharImage(this.m_dtCharBG[3], 2);
        base.SetScreenCenter();
    }
 public static void MessageBoxClassChangeOK(object a_oObject)
 {
     CharChangeMainDlg.Send_GS_CHANGE_CLASS_REQ((E_CHAR_TRIBE)((int)a_oObject));
 }
Example #15
0
    public void ClickMovie(IUIObject obj)
    {
        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(CharChangeMainDlg.GetChangeCharKindFormIndex(this.m_eCharTribe));

        if (charKindInfo == null)
        {
            return;
        }
        string sOLINTRO = charKindInfo.GetCHARKIND_INFO().SOLINTRO;

        if (NrTSingleton <NrGlobalReference> .Instance.localWWW)
        {
            if (NrTSingleton <NrGlobalReference> .Instance.useCache)
            {
                string str = string.Format("{0}SOLINTRO/", Option.GetProtocolRootPath(Protocol.HTTP));
                NmMainFrameWork.PlayMovieURL(str + sOLINTRO + ".mp4", true, false, true);
            }
            else
            {
                NmMainFrameWork.PlayMovieURL("http://klohw.ndoors.com/at2mobile_android/SOLINTRO/" + sOLINTRO + ".mp4", true, false, true);
            }
        }
        else
        {
            string str2 = string.Format("{0}SOLINTRO/", NrTSingleton <NrGlobalReference> .Instance.basePath);
            NmMainFrameWork.PlayMovieURL(str2 + sOLINTRO + ".mp4", true, false, true);
        }
    }