コード例 #1
0
ファイル: TooltipInfoDlg.cs プロジェクト: ftcaicai/ArkClient
	private void SetTextGrade( Item _item )
	{
		if( null == textGrade )
			return;
		if( null == _item )
		{
			textGrade.Text = string.Empty;			
		}
		else
		{
			textGrade.Text = _item.GetStrGrade();
		}
		
		
	}
コード例 #2
0
	public void Open( Tbl_Production_Record _record)
	{
		m_record = _record;
		if( null == _record)
		{
			Debug.LogError("ProductionListTab::InsertItem()[ null == Tbl_Production_Record ]");
			return;
		}

		m_item = ItemMgr.ItemManagement.GetItem( _record.getItemID);
		if( null == m_item)
		{
			Debug.LogError("ProductionListTab::InsertItem()[ null == item ] id : " + _record.getItemID);
			return;
		}

		if( null != m_SlotItem)
			GameObject.DestroyObject( m_SlotItem.gameObject);
	

		if( 1 < m_record.getItemCount)
			textMakingCount.Text = m_record.getItemCount.ToString();
		else
			textMakingCount.Text = string.Empty;

		textItemName.Text = AsTableManager.Instance.GetTbl_String( m_item.ItemData.nameId);
		textNeedTime.Text = AsMath.GetDateConvertRemainTime( (int)_record.itemTime, AsTableManager.Instance.GetTbl_String(88),
			AsTableManager.Instance.GetTbl_String(89), AsTableManager.Instance.GetTbl_String(90));
		textMakeExp.Text = _record.iExpertism.ToString();
		textExp.Text = _record.iExp.ToString();
		textMakingCost.Text = _record.iGold.ToString( "#,#0", CultureInfo.InvariantCulture);

		m_sbMatsTemp.Length = 0;
		m_sbMatsTemp.Append( "Lv.");
		m_sbMatsTemp.Append( m_item.ItemData.levelLimit);

		textLevel.Text = m_sbMatsTemp.ToString();
		textGrade.Text = m_item.GetStrGrade();
		textOptionShow.Text = string.Empty;
		if( null!= textRandomPrint)
			textRandomPrint.Text = string.Empty;
		
		if( null != textShowLevel )
			textShowLevel.Text = string.Empty;
		
		
		textOption.Text = string.Empty;	
		textOption_1.Text = string.Empty;
		m_isRandomItem = _record.IsRandItemType();
		if( false == m_isRandomItem )
		{
			m_SlotItem = ResourceLoad.CreateItemIcon( m_item.GetIcon(), iconImgPos, Vector3.back, minusItemSize, false);
			
			textOption_1.Text = string.Empty;
			int iMin = 0;
			int iMax = 0;
			m_sbMatsTemp.Length= 0;
			if( Item.eITEM_TYPE.EquipItem == m_item.ItemData.GetItemType() || Item.eITEM_TYPE.CosEquipItem == m_item.ItemData.GetItemType())
			{
				switch( (Item.eEQUIP) m_item.ItemData.GetSubType())
				{
				case Item.eEQUIP.Weapon:
					if( m_item.ItemData.needClass == eCLASS.CLERIC || m_item.ItemData.needClass == eCLASS.MAGICIAN)
					{
						iMin = m_item.ItemData.matkDmgMin;
						iMax = m_item.ItemData.matkDmgMax;
						m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String(1059));
					}
					else
					{
						iMin = m_item.ItemData.parkDmgMin;
						iMax = m_item.ItemData.parkDmgMax;
						m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String(1051));
					}
	
					m_sbMatsTemp.Append( iMin);
					m_sbMatsTemp.Append( "~");
					m_sbMatsTemp.Append( iMax);
					textOption.Text = m_sbMatsTemp.ToString();
					break;
				case Item.eEQUIP.Ring:
				case Item.eEQUIP.Earring:
				case Item.eEQUIP.Necklace:
					textOption.Text = m_sbMatsTemp.ToString();
					break;
				default:
					m_sbMatsTemp.Length = 0;
					m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String(1052));
					m_sbMatsTemp.Append( m_item.ItemData.pDef);
					textOption.Text = m_sbMatsTemp.ToString();
	
					m_sbMatsTemp.Length = 0;
					m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String(1053));
					m_sbMatsTemp.Append( m_item.ItemData.mDef);
					textOption_1.Text = m_sbMatsTemp.ToString();
					break;
				}
	
				m_sbMatsTemp.Length = 0;
				m_sbMatsTemp.Append( Color.red);
				m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String(1001));
				textOptionShow.Text = m_sbMatsTemp.ToString();
			}
			else if( Item.eITEM_TYPE.ActionItem == m_item.ItemData.GetItemType())
			{
				Tbl_Skill_Record record = AsTableManager.Instance.GetTbl_Skill_Record( m_item.ItemData.itemSkill);
				if( null == record)
				{
					Debug.LogError("TooltipInfoDlg::SetConsumeItem() [ null == record ] skill level id : " + m_item.ItemData.itemSkill);
					return;
				}
	
				string szDesc = AsTableManager.Instance.GetTbl_String( record.Description_Index);
				szDesc = AsUtil.ModifyDescriptionInTooltip( szDesc, m_item.ItemData.itemSkill, m_item.ItemData.itemSkillLevel, 0);
				textOption.Text = szDesc;
			}
			else
			{
				m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String( m_item.ItemData.destId));
				textOption.Text = m_sbMatsTemp.ToString();
			}
		}
		else
		{
			string levelTemp = string.Format( AsTableManager.Instance.GetTbl_String(901), m_item.ItemData.levelLimit );
			if( null != textShowLevel )
				textShowLevel.Text = levelTemp;	
			
			textLevel.Text = levelTemp;
			
			textGrade.Text = string.Empty;
			m_sbMatsTemp.Length = 0;
			m_sbMatsTemp.Append( Color.red);
			m_sbMatsTemp.Append( AsTableManager.Instance.GetTbl_String(1001));
			//textOptionShow.Text = m_sbMatsTemp.ToString();
			if( null!= textRandomPrint)
				textRandomPrint.Text = m_sbMatsTemp.ToString();
		}
		
		for( int i = 0; i < 4; ++i)
		{
			if( null != m_MatSlotItems[i])
				GameObject.DestroyObject( m_MatSlotItems[i].gameObject);

			int iItemId = 0;
			switch( i)
			{
			case 0:
				iItemId = _record.iBaseID;
				break;
			case 1:
				iItemId = _record.iSubID_1;
				break;
			case 2:
				iItemId = _record.iSubID_2;
				break;
			case 3:
				iItemId = _record.iOpID;
				break;
			}

			if( int.MaxValue == iItemId)
				continue;

			Item _matItem = ItemMgr.ItemManagement.GetItem( iItemId);
			if( null == _matItem)
			{
				Debug.LogError("ProductionPlanTab::Open()[ no find item ] id: " + iItemId);
				continue;
			}
			m_itemList[i] = _matItem;
			m_MatSlotItems[i] = ResourceLoad.CreateItemIcon( _matItem.GetIcon(), iconImgPosMats[i], Vector3.back, minusItemSize, false);
		}

		IsCheckReadyMaking();

		if( AsHudDlgMgr.Instance.IsOpenPlayerStatus)
			AsHudDlgMgr.Instance.ClosePlayerStatus();
	}