Ejemplo n.º 1
0
    protected void SetSolListInfo(NkSoldierInfo pkSolinfo)
    {
        long  num  = pkSolinfo.GetExp() - pkSolinfo.GetCurBaseExp();
        long  num2 = pkSolinfo.GetNextExp() - pkSolinfo.GetCurBaseExp();
        float num3 = ((float)num2 - (float)pkSolinfo.GetRemainExp()) / (float)num2;

        if (num3 > 1f)
        {
            num3 = 1f;
        }
        if (0f > num3)
        {
            num3 = 0f;
        }
        if (pkSolinfo.IsMaxLevel())
        {
            num3 = 1f;
        }
        string         text              = string.Empty;
        NewListItem    newListItem       = new NewListItem(this.SoldierList.ColumnNum, true, string.Empty);
        EVENT_HERODATA eventHeroCharCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharCode(pkSolinfo.GetCharKind(), pkSolinfo.GetGrade());

        newListItem.SetListItemData(9, false);
        if (eventHeroCharCode != null)
        {
            newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
            newListItem.SetListItemData(9, true);
        }
        else
        {
            UIBaseInfoLoader legendFrame = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendFrame(pkSolinfo.GetCharKind(), (int)pkSolinfo.GetGrade());

            if (legendFrame != null)
            {
                newListItem.SetListItemData(0, legendFrame, null, null, null);
            }
        }
        newListItem.SetListItemData(1, pkSolinfo.GetListSolInfo(false), null, null, null);
        string legendName = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendName(pkSolinfo.GetCharKind(), (int)pkSolinfo.GetGrade(), pkSolinfo.GetName());

        newListItem.SetListItemData(2, legendName, null, null, null);
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("167"),
            "count1",
            pkSolinfo.GetLevel().ToString(),
            "count2",
            pkSolinfo.GetSolMaxLevel().ToString()
        });

        newListItem.SetListItemData(3, text, null, null, null);
        int num4 = pkSolinfo.GetEquipWeaponOrigin();

        if (num4 > 0)
        {
            newListItem.SetListItemData(4, "Win_I_Weapon" + num4.ToString(), null, null, null);
        }
        num4 = pkSolinfo.GetEquipWeaponExtention();
        if (num4 > 0)
        {
            newListItem.SetListItemData(4, "Win_I_Weapon" + num4.ToString(), null, null, null);
        }
        if (pkSolinfo.IsAwakening())
        {
            newListItem.SetListItemData(5, "Win_I_DarkAlchemy", null, null, null);
        }
        else
        {
            newListItem.SetListItemData(5, false);
        }
        newListItem.SetListItemData(7, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Com_T_GauWaPr4"), 250f * num3, null, null);
        if (pkSolinfo.IsMaxLevel())
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286");
        }
        else
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1871"),
                "exp",
                num.ToString(),
                "maxexp",
                num2.ToString()
            });
        }
        newListItem.SetListItemData(8, text, null, null, null);
        newListItem.Data = pkSolinfo;
        this.SoldierList.Add(newListItem);
    }
    private void OnClickBattlePosSolSelect(IUIObject obj)
    {
        UIRadioBtn uIRadioBtn = (UIRadioBtn)obj;

        if (uIRadioBtn == null || !uIRadioBtn.Value)
        {
            return;
        }
        int   num  = (int)uIRadioBtn.Data;
        short num2 = (short)num;

        if (num2 == this.nSelectedBattelPos)
        {
            return;
        }
        if (this.nSelectedBattelPos < 0)
        {
            this.nSelectedBattelPos = num2;
            bool flag = false;
            for (int i = 0; i < 6; i++)
            {
                NkSoldierInfo nkSoldierInfo = this.m_kBattlePosSolList[i];
                if (nkSoldierInfo != null && nkSoldierInfo.IsValid())
                {
                    if (this.nSelectedBattelPos == nkSoldierInfo.GetBattlePos())
                    {
                        string empty = string.Empty;
                        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                        {
                            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1469"),
                            "count",
                            nkSoldierInfo.GetLevel().ToString()
                        });

                        this.BattlePosSolName.Text = string.Format("{0}({1})", nkSoldierInfo.GetName(), empty);
                        int num3 = nkSoldierInfo.GetEquipWeaponOrigin();
                        this.BattlePosSolWeapon1.Visible = (num3 > 0);
                        if (num3 > 0)
                        {
                            this.BattlePosSolWeapon1.SetTexture(string.Format("Win_I_Weapon{0}", num3.ToString()));
                        }
                        num3 = nkSoldierInfo.GetEquipWeaponExtention();
                        this.BattlePosSolWeapon2.Visible = (num3 > 0);
                        if (num3 > 0)
                        {
                            this.BattlePosSolWeapon2.SetTexture(string.Format("Win_I_Weapon{0}", num3.ToString()));
                        }
                        flag = true;
                        break;
                    }
                }
            }
            if (!flag)
            {
                this.BattlePosSolName.Text       = string.Empty;
                this.BattlePosSolWeapon1.Visible = false;
                this.BattlePosSolWeapon2.Visible = false;
            }
            if (this.nSelectedBattelPos >= 0 && this.nSelectedBattelPos < 9)
            {
                this.BattlePosSelectedPos.SetLocation(this.BattlePosCoverImage[(int)this.nSelectedBattelPos].GetLocationX(), this.BattlePosCoverImage[(int)this.nSelectedBattelPos].GetLocationY(), -0.14f);
                this.BattlePosSelectedPos.Visible = true;
            }
            return;
        }
        NkSoldierInfo nkSoldierInfo2 = null;
        NkSoldierInfo nkSoldierInfo3 = null;
        short         battlePos      = -1;
        short         battlePos2     = -1;

        for (int j = 0; j < 6; j++)
        {
            NkSoldierInfo nkSoldierInfo = this.m_kBattlePosSolList[j];
            if (nkSoldierInfo != null && nkSoldierInfo.IsValid())
            {
                if (nkSoldierInfo.GetBattlePos() >= 0)
                {
                    if (num2 == nkSoldierInfo.GetBattlePos())
                    {
                        nkSoldierInfo3 = nkSoldierInfo;
                    }
                    else if (this.nSelectedBattelPos == nkSoldierInfo.GetBattlePos())
                    {
                        nkSoldierInfo2 = nkSoldierInfo;
                    }
                }
            }
        }
        if (nkSoldierInfo2 == null && nkSoldierInfo3 == null)
        {
            this.nSelectedBattelPos           = -1;
            uIRadioBtn.Value                  = false;
            this.BattlePosSelectedPos.Visible = false;
            return;
        }
        if (nkSoldierInfo2 != null)
        {
            battlePos = nkSoldierInfo2.GetBattlePos();
            nkSoldierInfo2.SetBattlePos(num2);
        }
        if (nkSoldierInfo3 != null)
        {
            battlePos2 = nkSoldierInfo3.GetBattlePos();
            nkSoldierInfo3.SetBattlePos(this.nSelectedBattelPos);
        }
        if (!this.IsValidChangeBattlePos())
        {
            if (nkSoldierInfo2 != null)
            {
                nkSoldierInfo2.SetBattlePos(battlePos);
            }
            if (nkSoldierInfo3 != null)
            {
                nkSoldierInfo3.SetBattlePos(battlePos2);
            }
        }
        this.ShowBattlePosInfo();
        this.nSelectedBattelPos           = -1;
        uIRadioBtn.Value                  = false;
        this.BattlePosSelectedPos.Visible = false;
    }
Ejemplo n.º 3
0
    private void MakeSolListItem(ref NewListItem item, NkSoldierInfo pkSolinfo)
    {
        string text = string.Empty;

        if (pkSolinfo != null)
        {
            item.SetListItemData(1, pkSolinfo.GetListSolInfo(false), null, null, null);
            item.SetListItemData(2, pkSolinfo.GetName(), null, null, null);
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("167"),
                "count1",
                pkSolinfo.GetLevel().ToString(),
                "count2",
                pkSolinfo.GetSolMaxLevel().ToString()
            });

            item.SetListItemData(3, text, null, null, null);
            int num = pkSolinfo.GetEquipWeaponOrigin();
            if (num > 0)
            {
                item.SetListItemData(4, string.Format("Win_I_Weapon{0}", num.ToString()), null, null, null);
            }
            num = pkSolinfo.GetEquipWeaponExtention();
            if (num > 0)
            {
                item.SetListItemData(5, string.Format("Win_I_Weapon{0}", num.ToString()), null, null, null);
            }
            else
            {
                item.SetListItemData(5, false);
            }
            long  exp        = pkSolinfo.GetExp();
            long  curBaseExp = pkSolinfo.GetCurBaseExp();
            long  nextExp    = pkSolinfo.GetNextExp();
            long  num2       = exp - curBaseExp;
            long  num3       = nextExp - curBaseExp;
            float num4       = pkSolinfo.GetExpPercent();
            if (num4 < 0f)
            {
                num4 = 0f;
            }
            item.SetListItemData(6, "Win_T_ReputelPrgBG", null, null, null);
            item.SetListItemData(7, "Com_T_GauWaPr4", 250f * num4, null, null);
            item.SetListItemData(8, string.Empty, pkSolinfo.GetSolID(), new EZValueChangedDelegate(this.OnClickSoldierDelete), null);
            if (pkSolinfo.IsMaxLevel())
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286");
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1871"),
                    "exp",
                    num2.ToString(),
                    "maxexp",
                    num3.ToString()
                });
            }
            item.SetListItemData(9, text, null, null, null);
            item.SetListItemData(10, false);
            item.Data = pkSolinfo.GetSolID();
        }
        else
        {
            for (int i = 0; i < this.m_kSolList.ColumnNum; i++)
            {
                item.SetListItemData(i, false);
            }
            item.SetListItemData(10, true);
            item.SetListItemData(10, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("859"), null, null, null);
            item.Data = 0L;
        }
    }