예제 #1
0
    public void ShowButton(QuestProgressState _questProgress, QuestClearType _clearType, int _price)
    {
        if (miracleImg == null || goldImg == null || textPrice == null || textTitle == null || _questProgress != QuestProgressState.QUEST_PROGRESS_IN)
        {
            gameObject.SetActiveRecursively(false);
            miracleImg.Hide(true);
            goldImg.Hide(true);
            return;
        }

        if (_clearType == QuestClearType.NONE)
        {
            gameObject.SetActiveRecursively(false);
            miracleImg.Hide(true);
            goldImg.Hide(true);
        }
        else if (_clearType == QuestClearType.CASH)
        {
            gameObject.SetActiveRecursively(true);
            miracleImg.Hide(false);
            goldImg.Hide(true);
            textPrice.Text = _price.ToString();
        }
        else if (_clearType == QuestClearType.GOLD)
        {
            gameObject.SetActiveRecursively(true);
            miracleImg.Hide(true);
            goldImg.Hide(false);
            textPrice.Text = _price.ToString();
        }
    }
    public void ShowMessageBox( QuestClearType _clearType, int _clearPrice, MonoBehaviour _mono, string _okFunc, string _calcelFunc)
    {
        gameObject.SetActiveRecursively( true);

        if( _clearType == QuestClearType.CASH)
        {
            miracleImg.Hide( false);
            goldImg.Hide( true);
        }
        else
        {
            miracleImg.Hide( true);
            goldImg.Hide( false);
        }

        textPrice.Text = _clearPrice.ToString();

        buttonOK.scriptWithMethodToInvoke = _mono;
        buttonOK.methodToInvoke = _okFunc;

        buttonCancel.scriptWithMethodToInvoke = _mono;
        buttonCancel.methodToInvoke = _calcelFunc;
    }
예제 #3
0
	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);
		}
	}
예제 #4
0
	public void ShowQuestClearCashBtn( QuestProgressState _qeustProgress, QuestClearType _clearType, int _price)
	{
		QuestClearBtnContoller controller = buttonCashDone.gameObject.GetComponent<QuestClearBtnContoller>();
	
		if( controller == null)
			buttonCashDone.gameObject.SetActiveRecursively( false);
		else
			controller.ShowButton( _qeustProgress, _clearType, _price);
	}