public void Close()
	{
		AsSoundManager.Instance.PlaySound( AsSoundPath.ButtonClick, Vector3.zero, false);

		AsHudDlgMgr.dlgPresentState &= ~AsHudDlgMgr.eDlgPresentState.QuestInfo;

		bCallQuestlist = false;
		nowQuestData = null;
		nowSelectItem = -1;
		nowItem = -1;

		foreach( GameObject obj in listItemObject)
			GameObject.DestroyImmediate( obj);

		foreach( GameObject obj in listSelectItemObject)
			GameObject.DestroyImmediate( obj);

		listItemObject.Clear();
		listSelectItemObject.Clear();
		dicSelectItem.Clear();
		dicItem.Clear();

		if( messageBox != null)
			messageBox.Close();

		bLock = false;

		TooltipMgr.Instance.Clear();

		if( AsGameMain.s_gameState == GAME_STATE.STATE_INGAME)
			QuestTutorialMgr.Instance.ProcessQuestTutorialMsg( new QuestTutorialMsgInfo( QuestTutorialMsg.CLOSE_QUEST_ACCEPT_UI));
		
		if( null != m_skillTooltip )
			GameObject.Destroy( m_skillTooltip.gameObject );
	}
	public void ShowQuestInfo( ArkSphereQuestTool.QuestData _questData, bool _isCallQuestList)
	{
		bLock = false;

		AsSoundManager.Instance.PlaySound( AsSoundPath.ButtonClick, Vector3.zero, false);

		int userLv = AsEntityManager.Instance.UserEntity.GetProperty<int>(eComponentProperty.LEVEL);

		selectObj.SetActiveRecursively( false);
		gameObject.SetActiveRecursively( true);

		if( messageBox != null)
			messageBox.Close();

		nRewardSpritePosCount = 0;

		if( _isCallQuestList == false)
			SettingPositionByQuestBook();

		SetText();
		
		questClearType = _questData.Info.QuestClearType;
		questClearPrice = _questData.Info.ClearPrice;

		if( _isCallQuestList == false)
			ShowQuestClearCashBtn( _questData.NowQuestProgressState, questClearType, questClearPrice);
		else
			buttonCashDone.gameObject.SetActiveRecursively( false);

		QuestTutorialMgr.Instance.ProcessQuestTutorialMsg( new QuestTutorialMsgInfo( QuestTutorialMsg.OPEN_QUEST_ACCEPT_UI, 0));

		AsHudDlgMgr.dlgPresentState |= AsHudDlgMgr.eDlgPresentState.QuestInfo;

		bCallQuestlist = _isCallQuestList;
		nowSelectItem = -1;
		nowItem = -1;
		listItem = null;
		listSelectItem = null;
		vItemSize = new Vector2( slotItemTMs[0].gameObject.GetComponent<BoxCollider>().size.x, slotItemTMs[0].gameObject.GetComponent<BoxCollider>().size.y);

		nowQuestData = _questData;
		
		QuestProgressState nowProgress = _questData.NowQuestProgressState;

		if( nowProgress == QuestProgressState.QUEST_PROGRESS_NOTHING)
			nowState = QuestAcceptUIState.QuestAccept_Suggest;
		else if( nowProgress == QuestProgressState.QUEST_PROGRESS_IN)
			nowState = QuestAcceptUIState.QuestAccept_Progress;
		else if( nowProgress == QuestProgressState.QUEST_PROGRESS_FAIL)
			nowState = QuestAcceptUIState.QuestAccept_Fail;
		else if( nowProgress == QuestProgressState.QUEST_PROGRESS_CLEAR || nowProgress == QuestProgressState.QUEST_PROGRESS_IMMEDIATELY_CLEAR)
		{
			if( _isCallQuestList == true)
				nowState = QuestAcceptUIState.QuestAccept_Reward;
			else
			{
				if( nowQuestData.Info.QuestType == QuestType.QUEST_DAILY)
					nowState = QuestAcceptUIState.QuestAccept_Reward;
				else
					nowState = QuestAcceptUIState.QuestAccept_Clear;
			}
		}
		else
		{
			AsHudDlgMgr.Instance.CloseQuestAccept();
			return;
		}

		// quest Level
		List<ConditionLevel> level = _questData.Condition.GetCondition<ConditionLevel>();

		if( _questData.Info.QuestType == QuestType.QUEST_DAILY)
			questLevelLabel.Text = AsTableManager.Instance.GetTbl_String(840);
		else if( level.Count == 0)
			questLevelLabel.Text = "";
		else
			questLevelLabel.Text = "[Lv." + level[0].MinLevel.ToString() + "]";

		// quest location name
		int mapID = _questData.Info.ID / 10000;
		Map map = TerrainMgr.Instance.GetMap( mapID);
		questRegionLabel.Text = map.MapData.GetName();
		questLocationLabel.Text = AsTableManager.Instance.GetTbl_String(_questData.Info.QuestLocationNameID);

		Tbl_QuestReward_Record reward = AsTableManager.Instance.GetTbl_QuestRewardRecord( _questData.Info.ID);

		if( reward != null)
		{
			// show button
			ShowButton( nowState);
			
			StringBuilder sbForTitle = new StringBuilder( nowQuestData.Info.Name);
			sbForTitle.Append( nowQuestData.GetRepeatString());
			
			// set title
			titleLabel.Text = sbForTitle.ToString();
			
			// set explain
			explainLabel.Text = TransColorText( nowQuestData.Info.Explain);
			
			// set achievement
			UpdateAchievementText( nowQuestData.Achievement.GetDatas());
			
			// set quest icon
			SetQuestIcon( _questData.Info.QuestType);
			
			// set exp
			int exp = reward.Reward.ExperiencePoint;
			bool isMaxLv = false;
			double goldExchangeRatio = 0.0f;
			if (AsTableManager.Instance.GetTbl_GlobalWeight_Record(137) != null)
				goldExchangeRatio = AsTableManager.Instance.GetTbl_GlobalWeight_Record(137).Value * 0.001f;

			if (AsTableManager.Instance.GetTbl_GlobalWeight_Record(69) != null)
				if (userLv == (int)AsTableManager.Instance.GetTbl_GlobalWeight_Record(69).Value)
					isMaxLv = true;

			if( exp <= 0)
				expSprite.gameObject.SetActiveRecursively( false);
			else
			{
				expSprite.gameObject.SetActiveRecursively( true);
				
				if (isMaxLv == true)
					rewardLabel1.Text = "MAX";
				else
					rewardLabel1.Text = exp.ToString( "#,#0", CultureInfo.InvariantCulture);

				expSprite.gameObject.transform.localPosition = new Vector3( fRewardSpritePosositions[nRewardSpritePosCount++],
																			expSprite.gameObject.transform.localPosition.y,
																			expSprite.gameObject.transform.localPosition.z);
			}

			// gold
			int money   = reward.Reward.Money;
			int exMoney = 0;
			double exGold = 0.0f;
			if( isMaxLv == true )
			{
				exGold = System.Math.Round((double)exp * goldExchangeRatio * 0.1f) * 10.0f;
			}
			
			if( money <= 0)
			{
				goldSprite.gameObject.SetActiveRecursively( false);
			}
			else
			{
				exMoney = (int)exGold;

				goldSprite.gameObject.SetActiveRecursively( true);

				if (isMaxLv == true)
				{
					StringBuilder sbMoney = new StringBuilder(money.ToString("#,#0", CultureInfo.InvariantCulture));
					sbMoney.Append("(");
					sbMoney.Append("+");
					sbMoney.Append(exMoney.ToString("#,#0", CultureInfo.InvariantCulture));
					sbMoney.Append(")");
					rewardLabel2.Text = sbMoney.ToString();
				}
				else
					rewardLabel2.Text = money.ToString("#,#0", CultureInfo.InvariantCulture);


				goldSprite.gameObject.transform.localPosition = new Vector3( fRewardSpritePosositions[nRewardSpritePosCount++],
						goldSprite.gameObject.transform.localPosition.y,
						goldSprite.gameObject.transform.localPosition.z);
			}
			

			// Miracle
			int miracle = reward.Reward.Miracle;
			if( miracle <= 0)
				miracleSprite.gameObject.SetActiveRecursively( false);
			else
			{
				miracleSprite.gameObject.SetActiveRecursively( true);
				rewardLavelMiracle.Text = miracle.ToString();
				miracleSprite.gameObject.transform.localPosition = new Vector3( fRewardSpritePosositions[nRewardSpritePosCount++],
						miracleSprite.gameObject.transform.localPosition.y,
						miracleSprite.gameObject.transform.localPosition.z);
			}

			// skill
			listRewardItemData.Clear();

			foreach( RewardSkill skill in reward.Reward.skill)
				listRewardItemData.Add( new RewardItemData( RewardItemType.SKILL, skill.ID, skill.Lv));

			// item
			foreach( RewardItem item in reward.Reward.Items)
				listRewardItemData.Add( new RewardItemData( RewardItemType.ITEM, item.ID, item.Class, item.Count));

			listItem = reward.Reward.Items;
			listSelectItem = reward.Reward.ItemsSelect;

			AddItemIcon( listRewardItemData, slotItemTMs);

			AddItemSelectIcon( listSelectItem, slotItemTMs);

			if( reward.Reward.designation.Count > 0)
			{
				RewardDesignation designaion = reward.Reward.designation[0];
	
				DesignationData designaionData = AsDesignationManager.Instance.GetDesignation( designaion.designationID);
	
				if( designaionData != null)
				{
					StringBuilder sb = new StringBuilder();
					sb.Append( AsTableManager.Instance.GetTbl_String(880));
					sb.Append( " ");
					sb.Append( AsTableManager.Instance.GetTbl_String(designaionData.name));
					rewardDesignaionLabel.Text = sb.ToString();
				}
			}
			else
				rewardDesignaionLabel.gameObject.SetActiveRecursively( false);
		}
		else
		{
			rewardDesignaionLabel.gameObject.SetActiveRecursively( false);
		}
	}
Exemple #3
0
        /// <summary>
        /// 노드 리스트에서 QuestData를 얻는다.
        /// </summary>
        /// <param name="nodeList"></param>
        /// <returns></returns>
        public static QuestData GetQuestDataFromXml(XmlNodeList nodeList)
        {
            QuestData data = new QuestData();
            try
            {
                foreach (XmlNode node in nodeList)
                {
                    if (node.Name == "QuestInfo")
                        QuestInfo.LoadFromXml(data.Info, node);
                    else if (node.Name == "Condition")
                        QuestCondition.LoadFromXml(data.Condition, node);
                    else if (node.Name == "Prepare")
                        QuestPreparation.LoadFromXml(data.Preparation, node);
                    else if (node.Name == "Achievement")
                        QuestAchievement.LoadFromXml(data.Info.ID, data.Achievement, node);
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine(e.Message);
                System.Diagnostics.Trace.WriteLine(e.Source);
            }

            return data;
        }