// - ui window - public void Recv_PetInfo( byte[] _packet) { body_SC_PET_INFO info = new body_SC_PET_INFO(); info.PacketBytesToClass( _packet); if(m_dicPetList.ContainsKey(info.nSlot) == true) { if(m_PetManageDlg != null && m_CurDisplayingInfoOnPetInfoDlg != null) m_PetManageDlg.SetSlotToBase(m_CurDisplayingInfoOnPetInfoDlg.Element); m_CurDisplayingInfoOnPetInfoDlg = new PetInfo(info); m_CurDisplayingInfoOnPetInfoDlg.Element = m_dicPetList[info.nSlot]; if(m_PetManageDlg != null) m_PetManageDlg.SetSlotToSelect(m_CurDisplayingInfoOnPetInfoDlg.Element); } else { Debug.LogError("AsPetManager:: Recv_PetInfo: invalid uniq slot idx. info.nSlot = " + info.nSlot); return; } if(m_PetDlg == null) { GameObject obj = Instantiate( ResourceLoad.LoadGameObject( "UI/AsGUI/GUI_PetInfo") ) as GameObject; m_PetDlg = obj.GetComponentInChildren<UIPetInfoDlg>(); } m_PetDlg.Open( info); // if(m_PetInfo.nPetUniqSlot == m_CurDisplayingInfoOnPetInfoDlg.nPetUniqSlot) // { //// m_PetInfo.SetHungry(m_CurDisplayingInfoOnPetInfoDlg.Hungry); // AsEntityManager.Instance.MessageToPlayer(new Msg_PetHungryIndicate()); // } }
public void Open( body_SC_PET_INFO _info) { m_Info = _info; Tbl_Pet_Record petRec = AsTableManager.Instance.GetPetRecord( _info.nPetTableIdx); if( petRec == null) return; int maxExp = petRec.GetNextMaxExp(_info.nLevel); int exceptExp = petRec.GetPrevMaxExp(_info.nLevel); maxExp -= exceptExp; int curExp = _info.nExp - exceptExp; // name & personality txt_Name.Text = AsTableManager.Instance.GetTbl_String( 2201) + AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( _info.szPetName)); Tbl_PetScript_Record scriptRec = AsTableManager.Instance.GetPetScriptRecord(_info.nPetPersonality); if(scriptRec != null) txt_Character.Text = AsTableManager.Instance.GetTbl_String( 2202) + AsTableManager.Instance.GetTbl_String(scriptRec.PersonName); // level txt_Level.Text = AsTableManager.Instance.GetTbl_String( 2203) + _info.nLevel.ToString(); gauge_Level.Value = (float)curExp / (float)maxExp; text_GaugeLevel.Text = curExp + " / " + maxExp; // hungry m_HungryMaxTime = AsTableManager.Instance.GetTbl_GlobalWeight_Record( "Pet_HungryTime").Value; m_HungryGradeValue[(int)eHungry.Normal] = AsTableManager.Instance.GetTbl_GlobalWeight_Record( "Pet_Normal").Value; m_HungryGradeValue[(int)eHungry.Satisfy] = AsTableManager.Instance.GetTbl_GlobalWeight_Record( "Pet_Good").Value; float degree = (float)_info.nHungryPoint; txt_Hungry.Text = AsTableManager.Instance.GetTbl_String( 2204); if( degree > m_HungryGradeValue[(int)eHungry.Satisfy]) txt_Hungry.Text += m_HungryGrade[(int)eHungry.Satisfy]; else if( degree > m_HungryGradeValue[(int)eHungry.Normal]) txt_Hungry.Text += m_HungryGrade[(int)eHungry.Normal]; else txt_Hungry.Text += m_HungryGrade[(int)eHungry.Hungry]; gauge_Hungry.Value = degree / m_HungryMaxTime; text_GaugeHungry.Text = ((int)(degree / m_HungryMaxTime * 100f)).ToString() + "%"; // icon img1_.SetSlotImg(petRec.Icon); // if( AsPetManager.Instance.isPetEquip == true) // { // img2.SetSlotImg_Item(_info.sItem); // slot2.SetSlotInfo(_info.sItem); // } // accessory if(_info.sItem.nItemTableIdx > 0) { img2.SetSlotImg_Item(_info.sItem); slot2.SetSlotInfo(_info.sItem); txt_5accessory.Text = _info.sItem.GetNameWithStrengthCount(); btn_Accessory.renderer.material.color = Color.white; } else { ReleaseEquip(); } // passive skill sPETSKILL passive = _info.sSkill[(int)ePET_SKILL_TYPE.ePET_SKILL_TYPE_PASSIVE]; if(passive.nSkillTableIdx > 0) { img3.SetSlotImg_Skill(passive); Tbl_Skill_Record skillRec = AsTableManager.Instance.GetTbl_Skill_Record(passive.nSkillTableIdx); if( skillRec != null) { string title = AsTableManager.Instance.GetTbl_String( skillRec.SkillName_Index); text_IndexTitle1.Text = title; text_Index1.Text = "LV " + passive.nLevel; // string desc = AsTableManager.Instance.GetTbl_String( skillRec.Description_Index); // desc = AsUtil.ModifyDescriptionInTooltip( desc, passive.nSkillTableIdx, passive.nLevel, 0); // text_Index1.Text = desc; } else Debug.LogError(" UIPetInfoDlg:: Open: there is no PASSIVE Tbl_Skill_Record. id = " + _info.sSkill[0].nSkillTableIdx); } else { img3.DeleteSlotImg(); text_IndexTitle1.Text = ""; text_Index1.Text = ""; } // active skill sPETSKILL active = _info.sSkill[(int)ePET_SKILL_TYPE.ePET_SKILL_TYPE_ACTIVE]; if(active.nSkillTableIdx > 0) { img4.SetSlotImg_Skill(active); Tbl_Skill_Record skillRec = AsTableManager.Instance.GetTbl_Skill_Record(active.nSkillTableIdx); if( skillRec != null) { string title = AsTableManager.Instance.GetTbl_String( skillRec.SkillName_Index); text_IndexTitle2.Text = title; text_Index2.Text = "LV " + active.nLevel; // string desc = AsTableManager.Instance.GetTbl_String( skillRec.Description_Index); // desc = AsUtil.ModifyDescriptionInTooltip( desc, active.nSkillTableIdx, active.nLevel, 0); // text_Index2.Text = desc; } else Debug.LogError(" UIPetInfoDlg:: Open: there is no ACTIVE Tbl_Skill_Record. id = " + _info.sSkill[1].nSkillTableIdx); } else { img4.DeleteSlotImg(); text_IndexTitle2.Text = ""; text_Index2.Text = AsTableManager.Instance.GetTbl_String(2746); } // special skill sPETSKILL special = _info.sSkill[(int)ePET_SKILL_TYPE.ePET_SKILL_TYPE_SPECIAL]; if(special.nSkillTableIdx > 0) { img5.SetSlotImg_Skill(special); Tbl_Skill_Record skillRec = AsTableManager.Instance.GetTbl_Skill_Record(special.nSkillTableIdx); if( skillRec != null) { string title = AsTableManager.Instance.GetTbl_String( skillRec.SkillName_Index); text_IndexTitle3.Text = title; text_Index3.Text = "LV " + special.nLevel; // string desc = AsTableManager.Instance.GetTbl_String( skillRec.Description_Index); // desc = AsUtil.ModifyDescriptionInTooltip( desc, special.nSkillTableIdx, special.nLevel, 0); // text_Index3.Text = desc; } else Debug.LogError(" UIPetInfoDlg:: Open: there is no SPECIAL Tbl_Skill_Record. id = " + _info.sSkill[1].nSkillTableIdx); } else { img5.DeleteSlotImg(); text_IndexTitle3.Text = ""; text_Index3.Text = AsTableManager.Instance.GetTbl_String(2748); } // button if(AsPetManager.Instance.CheckInfoViewingPetSummoning() == true) text_BtnSummon.Text = AsTableManager.Instance.GetTbl_String( 2750); else text_BtnSummon.Text = AsTableManager.Instance.GetTbl_String( 2749); }
public PetInfo( body_SC_PET_INFO _info) { nPetUniqSlot = _info.nSlot; nPetTableIdx = _info.nPetTableIdx; nPersonality = _info.nPetPersonality; szPetName = _info.szPetName; nLevel = _info.nLevel; nExp = _info.nExp; // m_Hungry = _info.nHungryPoint; sSkill = new sPETSKILL[(int)ePET_SKILL_TYPE.ePET_SKILL_TYPE_MAX]; itemView.nItemTableIdx = _info.sItem.nItemTableIdx; itemView.nStrengthenCount = _info.sItem.nStrengthenCount; m_PetRecord = AsTableManager.Instance.GetPetRecord( nPetTableIdx); if( m_PetRecord == null) Debug.LogError( "PetInfo:: SetValue: there is no pet record. id = " + nPetTableIdx); }