Esempio n. 1
0
	public void SetData( byte _nSlot, sPRODUCT_SLOT _data, bool bProgress )
	{				
		m_nProductSlot = _nSlot;
		m_ServerData = _data;
		m_bProgress = bProgress;
		
				
		if( 0 != _data.nRecipeIndex )
		{
			m_record = AsTableManager.Instance.GetProductionTable().GetRecord( _data.nRecipeIndex );
			if( null == m_record )
			{
				Debug.LogError("ProductionProgData::SetData()[ null == Tbl_Production_Record] id : " + _data.nRecipeIndex );
				return;
			}
		}
		else
		{
			return;
		}		
		
		// reamin time
		m_remainTime = (float)_data.nProductTime * 0.001f;
		m_fStartRealTime = Time.realtimeSinceStartup;	
		
	
		
		
	}	
Esempio n. 2
0
	public void Open( Item _item, Tbl_Production_Record _record )
	{
		if( null == _item )
		{
			Debug.LogError("ProductionListItem::Open()[ null == Item ]");
			return;
		}
		
		if( null == _record )
		{			
			Debug.LogError("ProductionListItem::Open()[ null == Tbl_Production_Record ]");
			return;
		}
		
		m_record = _record;
		
		m_item = _item;	
		textName.Text = AsTableManager.Instance.GetTbl_String( _item.ItemData.nameId );
		
		if( null != textShowLevel )
			textShowLevel.Text = string.Empty;
			
		if( null != m_SlotItem )
			GameObject.DestroyObject( m_SlotItem.gameObject );
		
		if( false == _record.IsRandItemType() )
		{
			m_SlotItem = ResourceLoad.CreateItemIcon( m_item.GetIcon(), iconImgPos, new Vector3(0f,0f,-0.2f), minusItemSize );
			GameObject.DestroyImmediate( m_SlotItem.coolTime.gameObject);
			GameObject.DestroyImmediate( m_SlotItem.itemCountText.gameObject);
			m_SlotItem.iconImg.renderer.enabled = false;
			
			UIListItem _listitem = gameObject.GetComponent<UIListItem>();
			if( null != m_SlotItem && null != _listitem )
			{
				_listitem.layers[0] = m_SlotItem.iconImg;
			}
		}
		else
		{
			if( null != textShowLevel )
				textShowLevel.Text = string.Format( AsTableManager.Instance.GetTbl_String(901), m_item.ItemData.levelLimit );
		}
		IsCheckReadyMaking();
	}
Esempio n. 3
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();
	}
Esempio n. 4
0
	public override void LoadTable(string _path)
	{
		XmlElement root = GetXmlRootElement(_path);
		XmlNodeList nodes = root.ChildNodes;
		
		foreach(XmlNode node in nodes)
		{
			
			Tbl_Production_Record record = new Tbl_Production_Record((XmlElement)node);
			
			if( true == m_dataList.ContainsKey( record.getIndex ) )
			{
				AsUtil.ShutDown("Tbl_ProductionTable::LoadTable()[ same index : " + record.getIndex );
				continue;
			}
			m_dataList.Add( record.getIndex, record );
			
			
			if( false == m_recordList.ContainsKey( record.getType ) )
			{
				Dictionary<int,List<Tbl_Production_Record>> levellist = new Dictionary<int, List<Tbl_Production_Record>>();
				levellist.Add( record.getLevel, new List<Tbl_Production_Record>() );
				
				m_recordList.Add( record.getType, levellist );				
			}
			
			if( false == m_recordList[ record.getType ].ContainsKey( record.getLevel ) )
			{
				m_recordList[ record.getType ].Add( record.getLevel, new List<Tbl_Production_Record>() );
			}
			
			
			m_recordList[ record.getType ][record.getLevel].Add( record );
				
		}
	}
Esempio n. 5
0
	public void OpenPlanTap( Tbl_Production_Record _record )
	{
		if( null == _record )
			return;
		
		//if( ePRODUCTION_STATE.PLAN == m_eCurState)
		//	return;
		
		//m_eCurState = ePRODUCTION_STATE.PLAN;
		
		//technologyTab.SetState(1);
		//listTab.SetState(0);
		//progressTab.SetState(1);
		
		//CloseListTab();
		//CloseTechnologyTab();
		//CloseProgressTab();	
		
		productionPlanTab.gameObject.SetActiveRecursively(true);
		productionPlanTab.Open( _record );		
	}
Esempio n. 6
0
	public void InsertItem( eCLASS _eclass, int _iItemId, Tbl_Production_Record _record )
	{		
		Item _item = ItemMgr.ItemManagement.GetItem( _iItemId );
		if( null == _item )
		{
			Debug.LogError("ProductionListTab::InsertItem()[ null == item ] id : " + _iItemId );
			return;
		}
		
		if( _item.ItemData.needClass != _eclass && _eclass != eCLASS.All && _item.ItemData.needClass != eCLASS.All )
		{
			return;
		}
		
		UIListItem _uiitem = listList.CreateItem( goResListItem ) as UIListItem;		
		ProductionListItem _listItem  = _uiitem.gameObject.GetComponent<ProductionListItem>();	
		_listItem.Open( _item, _record );
		m_listItemList.Add( _listItem );
	}