Beispiel #1
0
	public AsMessageBox MessageBox( string title, string msg, string ok, string cancel, MonoBehaviour script=null, string method=null, MSG_BOX_TYPE type=MSG_BOX_TYPE.MBT_OK, MSG_BOX_ICON icon=MSG_BOX_ICON.MBI_NOTICE, bool bUseBtnSoundOk=true, bool bUseBtnSoundCancel = true)
	{
		CloseAllMessageBox();

		GameObject clone = GameObject.Instantiate( msgBoxSrc) as GameObject;
		AsMessageBox msgBox = clone.GetComponent<AsMessageBox>() as AsMessageBox;
		msgBox.SetStyle( type, icon);
		msgBox.SetTitle( title);
		msgBox.SetMessage( msg);
		msgBox.script = script;
		msgBox.method = method;
		msgBox.SetOkText( ok);
		msgBox.SetCancelText( cancel);
		msgBox.transform.position = new Vector3( -500.0f, 0, -40.0f);
		msgBox.m_bUseBtnSoundOk = bUseBtnSoundOk;
		msgBox.m_bUseBtnSoundCancel = bUseBtnSoundCancel;
		msgBox.gameObject.transform.parent = m_RootObject.transform;

		switch( type)
		{
		case MSG_BOX_TYPE.MBT_OK:	msgBox.SetCenterText( ok);	break;
		case MSG_BOX_TYPE.MBT_CANCEL:	msgBox.SetCenterText( cancel);	break;
		}

		return msgBox;
	}
Beispiel #2
0
	public AsMessageBox SkillResetMessageBox( long cashCost, string title, string msg, MonoBehaviour script=null, string method=null, string methodCancel = null, MSG_BOX_TYPE type=MSG_BOX_TYPE.MBT_OK, MSG_BOX_ICON icon=MSG_BOX_ICON.MBI_NOTICE, bool lackAlarm=false)
	{
		CloseAllMessageBox();
		
		GameObject clone = GameObject.Instantiate( msgSkillResetSrc) as GameObject;
		AsSkillResetMessageBox msgBox = clone.GetComponent<AsSkillResetMessageBox>() as AsSkillResetMessageBox;
		msgBox.SetStyle( type, icon);
		msgBox.SetTitle( title);
		msgBox.SetMessage( msg);
		msgBox.script = script;
		msgBox.method = method;
		msgBox.method_cancel = methodCancel;
		msgBox.SetOkText( AsTableManager.Instance.GetTbl_String(1152));
		msgBox.SetCancelText( AsTableManager.Instance.GetTbl_String(1151));
		msgBox.transform.position = new Vector3( -500.0f, 0, -40.0f);
		#region - lack alarm - //$yde
		string cost = cashCost.ToString();
		if( lackAlarm == true && AsUserInfo.Instance.nMiracle < cashCost)
			cost = Color.red.ToString() + cost;
		#endregion
		msgBox.SetCashText( cashCost);
		msgBox.SetHaveCashText( AsUserInfo.Instance.nMiracle);
		msgBox.gameObject.transform.parent = m_RootObject.transform;

		msgBox.text_HaveCashTitle.Text = AsTableManager.Instance.GetTbl_String(859);
		msgBox.text_CashTitle.Text     = AsTableManager.Instance.GetTbl_String(858);
		
		switch( type)
		{
		case MSG_BOX_TYPE.MBT_OK:	msgBox.SetCenterText( AsTableManager.Instance.GetTbl_String(1152));	break;
		case MSG_BOX_TYPE.MBT_CANCEL:	msgBox.SetCenterText( AsTableManager.Instance.GetTbl_String(1151));	break;
		}
		
		return msgBox;
	}	
Beispiel #3
0
	public AsMessageBox ItemViewMessageBox( int iItemID, string strPreItemID, string title, string msg, AsItemViewMessageBox.eventFunction _eventFunction,
		MSG_BOX_TYPE type=MSG_BOX_TYPE.MBT_OK, MSG_BOX_ICON icon=MSG_BOX_ICON.MBI_NOTICE, bool isShowTooltip = false)
	{
		CloseAllMessageBox();

		GameObject clone = GameObject.Instantiate( msgItemViewBoxSrc) as GameObject;
		AsItemViewMessageBox msgBox = clone.GetComponent<AsItemViewMessageBox>() as AsItemViewMessageBox;
		msgBox.SetStyle( type, icon);
		msgBox.SetTitle( title);
		msgBox.SetMessage( msg);
		msgBox.script = null;
		msgBox.method = null;
		msgBox.SetOkText( AsTableManager.Instance.GetTbl_String(1152));
		msgBox.SetCancelText( AsTableManager.Instance.GetTbl_String(1151));
		msgBox.m_EventFunction = _eventFunction;
		msgBox.transform.position = new Vector3( -500.0f, 0, -7.0f);
		msgBox.SetReciveItem( iItemID, strPreItemID, isShowTooltip);
		msgBox.gameObject.transform.parent = m_RootObject.transform;

		switch( type)
		{
		case MSG_BOX_TYPE.MBT_OK:	msgBox.SetCenterText( AsTableManager.Instance.GetTbl_String(1152));	break;
		case MSG_BOX_TYPE.MBT_CANCEL:	msgBox.SetCenterText( AsTableManager.Instance.GetTbl_String(1151));	break;
		}

		return msgBox;
	}
Beispiel #4
0
	public AsMessageBox GoldMessageBox( ulong goldCost, string title, string msg, MonoBehaviour script=null, string method=null, MSG_BOX_TYPE type=MSG_BOX_TYPE.MBT_OK, MSG_BOX_ICON icon=MSG_BOX_ICON.MBI_NOTICE, bool lackAlarm=false)
	{
		if( null == msgGoldBoxSrc)
			return null;

		CloseAllMessageBox();

		GameObject clone = GameObject.Instantiate( msgGoldBoxSrc) as GameObject;
		AsGoldMessageBox msgBox = clone.GetComponent<AsGoldMessageBox>() as AsGoldMessageBox;
		msgBox.SetStyle( type, icon);
		msgBox.SetTitle( title);
		msgBox.SetMessage( msg);
		msgBox.script = script;
		msgBox.method = method;
		msgBox.SetOkText( AsTableManager.Instance.GetTbl_String(1152));
		msgBox.SetCancelText( AsTableManager.Instance.GetTbl_String(1151));
		msgBox.transform.position = new Vector3( -500.0f, 0, -40.0f);
		#region - lack alarm - //$yde
		string cost = goldCost.ToString( "#,#0", CultureInfo.InvariantCulture);
		if( lackAlarm == true && AsUserInfo.Instance.nMiracle < (long)goldCost)
			cost = Color.red.ToString() + cost;
		#endregion
		msgBox.SetCashText( cost);
		msgBox.gameObject.transform.parent = m_RootObject.transform;
		
		switch( type)
		{
		case MSG_BOX_TYPE.MBT_OK:	msgBox.SetCenterText( AsTableManager.Instance.GetTbl_String(1152));	break;
		case MSG_BOX_TYPE.MBT_CANCEL:	msgBox.SetCenterText( AsTableManager.Instance.GetTbl_String(1151));	break;
		}

		return msgBox;
	}
Beispiel #5
0
	public AsMessageBox CashMessageBox( long cashCost, string title, string msg, MonoBehaviour script = null, string method = null, MSG_BOX_TYPE type = MSG_BOX_TYPE.MBT_OK, MSG_BOX_ICON icon = MSG_BOX_ICON.MBI_NOTICE, bool lackAlarm = false)
	{
		return CashMessageBox( cashCost, title, msg, script, method, string.Empty, type, icon, lackAlarm);
	}