Transform GetTip(TipType tipType) { try { RectTransform tf = transform.Find(tipType.ToString()) as RectTransform; if (!tf || tipType == TipType.SimpleTip) { if (tf && tipType == TipType.SimpleTip) { Destroy(tf.gameObject); } tf = BundleManager.Instance.GetGameObject(GetTipPath(tipType)).transform as RectTransform; tf.SetParent(transform); tf.anchoredPosition = Vector3.zero; tf.sizeDelta = Vector3.zero; tf.localScale = Vector3.one; } tf.gameObject.SetActive(false); return(tf); } catch { return(null); } }
public void ShowTip(TipType type, Vector3 position) { HideTip(); _currentTip = Load(type); _currentTip.transform.position = position; _currentTip.SetActive(true); }
IEnumerator WaitForUIInitial(TipType type, AnchorPivot ac, params object[] value) { while (null == mRoot) { yield return(null); } if (type == TipType.Unknow) { yield break; } mNowTipContentObj = null; yield return(CreateTip(type, ac)); while (null == mNowTipContentObj) { yield return(null); } switch (type) { case TipType.Txt: ShowTip((string)value[0], (string)value[1], (TextAnchor)value[2], (TextAnchor)value[3], 0f); break; case TipType.Img: ShowTip((string)value[0], 0f); break; } }
public void TipShow(Control parentControl, string tipText, TipType tiptype) { type = tiptype.ToString(); label1.Text = tipText; parentControl.Controls.Add(this); this.BringToFront(); }
public void ShowTip(string TipStr, TipType tipType, UnityAction OneBtnEvent = null, UnityAction TwoEnsureEvent = null, UnityAction TwoCancelEvent = null) { gameObject.SetActive(true); TipText.text = TipStr; if (tipType == TipType.OneBnt) { OneBtn.gameObject.SetActive(true); if (OneBtnEvent != null) { OneBtn.onClick.AddListener(OneBtnEvent); } } else if (tipType == TipType.TwoBtn) { TwoEnsure.gameObject.SetActive(true); TwoCancel.gameObject.SetActive(true); if (TwoEnsureEvent != null) { TwoEnsure.onClick.AddListener(TwoEnsureEvent); } if (TwoCancelEvent != null) { TwoCancel.onClick.AddListener(TwoCancelEvent); } } }
public void Result_Continue_TipType(TipType tipType) { string message = "testMessage"; var result = Result.Success().Continue(re => { switch (tipType) { case TipType.Success: return(Result.Success(message)); case TipType.Warning: return(Result.Warning(message)); case TipType.Info: return(Result.Info(message)); case TipType.Error: return(Result.Error(message)); default: return(Result.Success(message)); } }); Assert.Equal(tipType, result.TipType); Assert.Equal(message, result.Message); }
public void TipShow(Control parentControl,string tipText,TipType tiptype) { type = tiptype.ToString(); label1.Text = tipText; parentControl.Controls.Add(this); this.BringToFront(); }
/// <summary> /// 处理结果 /// </summary> /// <param name="handelresult"></param> public Tip_SelectSeatResult(TipType handleresult) { InitializeComponent(); switch (handleresult) { case TipType.SelectSeatResult: string roomNo = clientobject.EnterOutLogData.EnterOutlog.ReadingRoomNo; SeatManage.ClassModel.ReadingRoomInfo roomInfo = clientobject.EnterOutLogData.Student.AtReadingRoom; string shortSeatNo = SeatManage.SeatManageComm.SeatComm.SeatNoToShortSeatNo(roomInfo.Setting.SeatNumAmount, clientobject.EnterOutLogData.EnterOutlog.SeatNo); lblCardNo.Text = clientobject.EnterOutLogData.Student.CardNo; lblReadingRoomName.Text = roomInfo.Name; lblSeatNo.Text = shortSeatNo; break; case TipType.BespeatSeatConfirmSuccess: string roomNum = clientobject.EnterOutLogData.Student.BespeakLog[0].ReadingRoomNo; SeatManage.ClassModel.ReadingRoomInfo roomInfo1 = clientobject.EnterOutLogData.Student.AtReadingRoom; string shortSeatNo1 = SeatManage.SeatManageComm.SeatComm.SeatNoToShortSeatNo(roomInfo1.Setting.SeatNumAmount, clientobject.EnterOutLogData.Student.BespeakLog[0].SeatNo); lblCardNo.Text = clientobject.EnterOutLogData.Student.CardNo; lblReadingRoomName.Text = roomInfo1.Name; lblSeatNo.Text = shortSeatNo1; break; } }
public Tips By(User user, TipType type) { return(SingleOrDefault( t => t.User.ID == user.ID && t.Type == type )); }
private GameObject Load(TipType type) { if (Tips.ContainsKey(type)) { return(Tips[type]); } string src = null; switch (type) { case TipType.Interact: src = "Prefabs/Button_E"; break; case TipType.Attack: src = "Prefabs/Button_J"; break; case TipType.Dash: src = "Prefabs/Button_L"; break; default: Debug.LogWarning("no this tip type !!! "); break; } var go = Instantiate(Resources.Load <GameObject>(src)); go.transform.SetParent(gameObject.transform); Tips.Add(type, go); return(go); }
/// <summary> /// 只进行提示 /// </summary> public static void Tip(string tip, TipType tt = TipType.Normal) { SetConsole(tip); OnTip?.Invoke(tt, tip); LogViewer?.ShowTip(tip); }
IEnumerator OpenTipAc(TipType tipType, string describe, float waitTime, UnityAction sureAction, UnityAction cancelAction) { Instance.gameObject.transform.SetAsLastSibling(); Transform tf = GetTip(tipType); tf.Find("Describe").GetComponent <Text>().text = describe; if (tipType != TipType.SimpleTip) { UIUtils.RegisterButton("BtnSure", () => { ButtonCallBack(tf.gameObject, sureAction); }, tf); UIUtils.RegisterButton("BtnClose", () => { tf.gameObject.SetActive(false); }, tf); if (tipType == TipType.ChooseTip) { UIUtils.RegisterButton("BtnCancel", () => { ButtonCallBack(tf.gameObject, cancelAction); }, tf); } } else { if (waitTime == 0) { waitTime = 2; } UIUtils.RegisterButton("Background", () => { Destroy(tf.gameObject); }, tf); } tf.gameObject.SetActive(true); SetCanvasRarcaster(); if (LoadingNode.instance != null) { LoadingNode.instance.Close(); } Transform timerTf = tf.Find("Timer"); if (waitTime != 0) { if (timerTf) { Timer timer = timerTf.GetComponent <Timer>(); timer.allLength = waitTime; timer.ResetTimer(true); } yield return(new WaitForSecondsRealtime(waitTime)); if (tf && tf.gameObject.activeSelf) { if (cancelAction != null) { cancelAction(); } if (tf) { Destroy(tf.gameObject); } } } else { timerTf.gameObject.SetActive(false); } }
public ItemTip(ItemTipManager m, Vector2 pos_v, TipType type_t, bool max) { this.pos = pos_v; this.tex = m.Tex; this.type = type_t; this.alpha = 0.8f; this.max = max; m.Add(this); }
private static Tips createTip(User user, TipType type) { return(new() { User = user, Type = type, Countdown = countdown, Repeat = repeat, }); }
public void PromptPopup(TipType tipType, string description, OnCallBack callBack) { this.tipType = tipType; this.description = description; this.callBack = callBack; FindObjectOfType <InputTouch>().BLOCK_INPUT = true; popupCanvasGroup.gameObject.SetActive(true); AddButtonListeners(); UpdateUI(); }
public ItemTip(ItemTipManager m, Vector2 pos_v, int score_i, bool max) { this.pos = pos_v; this.tex = m.Tex; this.score = score_i; this.alpha = 0.8f; this.type = TipType.Item; this.max = max; m.Add(this); }
public Tip_Framework(TipType type, int closeTime) { InitializeComponent(); lblTitleAd.Text = clientobject.ClientSetting.TitleAd; this.Location = new Point(clientobject.ClientSetting.DeviceSetting.SystemResoultion.TooltipSize.Location.X, clientobject.ClientSetting.DeviceSetting.SystemResoultion.TooltipSize.Location.Y); this.Size = new System.Drawing.Size(clientobject.ClientSetting.DeviceSetting.SystemResoultion.TooltipSize.Size.X, clientobject.ClientSetting.DeviceSetting.SystemResoultion.TooltipSize.Size.Y); tipType = type; this.closeTime = closeTime; }
public void AddTips(string str, Vector3 pos, TipType type) { if (string.IsNullOrEmpty(str)) { return; } ITipsManager tips = ClientGlobal.Instance().GetTipsManager(); tips.AddTips(str, pos, type); }
/// <summary> /// Opens the dialog_ tip. /// 打开提示框; /// </summary> /// <param name="tipDes">Tip DES.</param> /// <param name="callBack">Call back.</param> public void OpenDialog_Tip(string tipDes, TipType curTipType, Dialog_Tip.SureContinueCall callBack) { GameObject OriginalObj = CatchPoolManage.Instance().GetOnePrefabsObj("UI/Tip/Prefabs/Dialog_Tip"); // if (OriginalObj != null) // { // Dialog_Tip diaSrc = InstantiateObjFun.AddOneObjToParent<Dialog_Tip>(OriginalObj, RootTransform); // diaSrc.curTipType = curTipType; // diaSrc.sureContinueCall = callBack; // // diaSrc.TipDes = tipDes; // } }
private void btnCalculate_Click(object sender, EventArgs e) { try { float total = 0; //Get the subtotal from the textbox float subtotal = float.Parse(txtSubtotal.Text); //Get the tip percentage float tipPercentage = 0; //tipType = (TipType)cmbTipType.Text; //tipType = TipType.POOR; tipType = (TipType)cmbTipType.SelectedItem; switch (tipType) { case TipType.EXCELLENT: tipPercentage = 0.15f; break; case TipType.GOOD: tipPercentage = 0.10f; break; case TipType.POOR: tipPercentage = 0; break; } //Calculate the tip float tip = subtotal * tipPercentage; //Calculate the total total = subtotal + tip; //Create check object Check check = null; if (rdbDineIn.Checked == true) { check = new Check(total, txtLocation.Text); } else if (rdbFastFood.Checked == true) { check = new FastFoodCheck(total, txtLocation.Text); } total = check.calculateTotal(subtotal); //Display the total to the user lblTotal.Text = "" + total; //Add check to list checks.Add(check); //Refresh check list refreshList(); } catch (FormatException fe) { MessageBox.Show("Subtotal only accepts numbers!"); } }
private static MvcHtmlString popoverActionLink(this HtmlHelper html, string title, string content, TipType tip, RouteValueDictionary rv, string controller, string action, string cssClass = null) { var y = new Dictionary<string, object>(); y.Add("title", title); if (!string.IsNullOrEmpty(cssClass)) y.Add("class", cssClass); y.Add("rel", "popover"); y.Add("data-content", content); if (y.ContainsKey("class")) y["class"] = string.Format("{0} {1}", y["class"], tipClass(tip)); else y.Add("class", tipClass(tip)); return html.ActionLink(title, action, controller, rv, y); }
public Tip_Failed(TipType tipType) { InitializeComponent(); switch (tipType) { case TipType.SelectSeatResult: label1.Text = " 对不起,选座失败,该座位正在被其他读者选择。"; break; case TipType.SeatUsing: label1.Text = " 座位正在使用中"; break; } }
/// <summary> /// 选座操作结果提示 /// </summary> /// <param name="form"></param> /// <param name="result"></param> public static void SelectSeatResult(Form form, HandleResult result, TipType type) { switch (result) { case HandleResult.Failed: Tip_Failed FaliedUc = new Tip_Failed(type); break; case HandleResult.Successed: Tip_SelectSeatResult uc = new Tip_SelectSeatResult(type); form.Controls.Add(uc); break; } }
/// <summary> /// 显示窗体 /// </summary> /// <param name="ucType"></param> public void ShowMessage(TipType ucType) { ViewModel.SetMessage(ucType); ShowUC_Type(); ViewModel.CountDown = ucType == TipType.ActivationReadCard ? new FormCloseCountdown(15) : new FormCloseCountdown(7); ViewModel.CountDown.EventCountdown += CountDown_EventCountdown; if (ucType == TipType.ActivationReadCard) { StartRead(); } ViewModel.CountDown.Start(); this.Topmost = true; ShowDialog(); }
private static string tipClass(TipType type) { switch (type) { // Previously tip position was explicit, now it determined based on location cient-side //case TipType.Over: return "tip-over"; //case TipType.After: return "tip-after"; //case TipType.Below: return "tip-below"; //case TipType.Before: return "tip-before"; case TipType.Over: case TipType.After: case TipType.Below: case TipType.Before: return("tip-me"); default: throw new Exception(string.Format("Unhandled tip type: {0}", type)); } }
/// <summary> /// 公用显示Tip接口 /// </summary> /// <param name="content">文本内容</param> /// <param name="type">提示类型</param> public void ShowTip(string content, TipType type = TipType.PopTip, Vector3 startPoint = default(Vector3)) { switch (type) { case TipType.Marquee: mMarqueeTipMgr.ShowMarquee(content); break; case TipType.PopTip: mPopupTipMgr.MgrTipTyp = TipType.PopTip; mPopupTipMgr.StartShowTip(content, startPoint); break; case TipType.FightTip: mPopupTipMgr.MgrTipTyp = type; mPopupTipMgr.StartShowTip(content, startPoint); break; } }
/// <summary> Shows the tips. </summary> /// <param name="type"> The type.</param> public void ShowTips(TipType type) { switch (type) { case TipType.UnInitialized: case TipType.LostTracking: GameObject go; m_TipsDict.TryGetValue(type, out go); int layer = LayerMaskToLayer(m_TipsLayer); if (go == null) { go = Instantiate(Resources.Load(type.ToString() + "Tip"), centerCamera.transform) as GameObject; m_TipsDict.Add(type, go); go.layer = layer; foreach (Transform child in go.transform) { child.gameObject.layer = layer; } } if (go != m_CurrentTip) { m_CurrentTip?.SetActive(false); go.SetActive(true); m_CurrentTip = go; } NRSessionManager.Instance.NRHMDPoseTracker.leftCamera.cullingMask = 1 << layer; NRSessionManager.Instance.NRHMDPoseTracker.rightCamera.cullingMask = 1 << layer; break; case TipType.None: if (m_CurrentTip != null) { m_CurrentTip.SetActive(false); } m_CurrentTip = null; NRSessionManager.Instance.NRHMDPoseTracker.leftCamera.cullingMask = originLayerLCam; NRSessionManager.Instance.NRHMDPoseTracker.rightCamera.cullingMask = originLayerRCam; break; default: break; } }
public void ShowTips(TipType type) { switch (type) { case TipType.UnInitialized: case TipType.LostTracking: GameObject go; m_TipsDict.TryGetValue(type, out go); if (go == m_CurrentTip && go != null) { return; } if (go != null) { go.SetActive(true); } else { go = Instantiate(Resources.Load(type.ToString() + "Tip"), centerCamera.transform) as GameObject; m_TipsDict.Add(type, go); } if (m_CurrentTip != null) { m_CurrentTip.SetActive(false); } m_CurrentTip = go; break; case TipType.None: if (m_CurrentTip != null) { m_CurrentTip.SetActive(false); } break; default: break; } }
public void Show(TipType tip) { if (_tipStatus[(int)tip] == 0) { return; } var stringBuilder = new StringBuilder(); switch (tip) { case TipType.TotalsTab: stringBuilder.AppendLine( "While viewing the Totals tab, the powers which are being included are highlighted green."); stringBuilder.AppendLine( "Clicking a power will toggle it on or off. Dimmed powers can't be toggled as they have no effect on your totals."); break; case TipType.FirstPower: stringBuilder.AppendLine( "If you decide you want to remove a power and replace it with a different one, click on the power name in the power lists"); stringBuilder.AppendLine( "that appear on the left of the screen, or Alt+Click on the power bar. Then the next power you select will be placed into"); stringBuilder.AppendLine("the empty space."); break; case TipType.FirstEnh: stringBuilder.AppendLine("To put an enhancement into a slot, Right-Click on it."); stringBuilder.AppendLine(string.Empty); stringBuilder.AppendLine("To pick up a slot to move it somewhere else, Double-Click it."); stringBuilder.AppendLine("Alternatively, Shift+Clicking enhancement slots will allow you"); stringBuilder.AppendLine("to pick up several slots one after the other before placing them again."); stringBuilder.AppendLine(string.Empty); stringBuilder.AppendLine("You can set the level an Invention enhancement is placed at by keying"); stringBuilder.AppendLine("the number into the enhancement picker before clicking on the enhancement."); break; } _tipStatus[(int)tip] = 0; stringBuilder.AppendLine("\nThis message should not appear again."); MessageBox.Show(stringBuilder.ToString(), "Instructions"); }
public static MvcHtmlString DetailLink(this HtmlHelper html, ILink l, string cssClass = null, TipType? tip = null, string linkText = null, int? returnProjectID = null, int? returnClientID = null) { var rv = routeValuesForILink(l); if (returnProjectID.HasValue && returnClientID.HasValue) { throw new Exception("Cannot handle two different return types"); } else if (returnProjectID.HasValue) { rv.Add("project", returnProjectID.Value); } else if (returnClientID.HasValue) { rv.Add("client", returnClientID.Value); } if (linkText == null) linkText = l.LinkName; if (tip == null) return html.simpleActionLink(linkText, rv, ControllerHelper.Controller(l.Section), l.DetailAction, cssClass); else return html.popoverActionLink(linkText, l.LinkInfo, tip.Value, rv, ControllerHelper.Controller(l.Section), l.DetailAction, cssClass); }
public void ShowNextTip(TipType nextTipType) { if (isTipTour == false) { return; } if (state != (int)nextTipType) { return; } switch (nextTipType) { case TipType.ChooseModelTip: tipImage = transform.GetChild(0).gameObject; break; case TipType.WriteTip: tipImage = transform.GetChild(1).gameObject; break; case TipType.EffectTip: tipImage = transform.GetChild(2).gameObject; break; case TipType.ShotTip: tipImage = transform.GetChild(3).gameObject; break; case TipType.ShareTip: tipImage = transform.GetChild(4).gameObject; break; default: break; } tipImage.gameObject.SetActive(true); state++; }
IEnumerator CreateTip(TipType tipType, AnchorPivot ac = AnchorPivot.Default) { if (!mTipDict.ContainsKey(tipType)) { switch (tipType) { case TipType.Img: ImageTipObj(); break; case TipType.Txt: TextTipObj(); break; } } while (!mTipDict.ContainsKey(tipType)) { yield return(null); } mNowTipType = tipType; mPrefferedAnchor = ac; //tip GameObject mNowTipContentObj = mTipDict[mNowTipType]; mNowTipContentObj.SetActive(true); //tip RectTransform mRect = mNowTipContentObj.GetComponent <RectTransform>(); mRect.pivot = mRectAnchorDict[mPrefferedAnchor]; //tip CanvasGroup mCanvasGroup = mNowTipContentObj.GetComponent <CanvasGroup>(); }
/// <summary> /// 等待座位操作频繁提示。 /// </summary> /// <param name="form"></param> /// <param name="type"></param> public static void WaitSeatFrequent(Form form, TipType type) { Tip_SimpleTip uc = new Tip_SimpleTip(type); form.Controls.Add(uc); }
private static string tipClass(TipType type) { switch (type) { // Previously tip position was explicit, now it determined based on location cient-side //case TipType.Over: return "tip-over"; //case TipType.After: return "tip-after"; //case TipType.Below: return "tip-below"; //case TipType.Before: return "tip-before"; case TipType.Over: case TipType.After: case TipType.Below: case TipType.Before: return "tip-me"; default: throw new Exception(string.Format("Unhandled tip type: {0}", type)); } }
public void RenderTip(GraphicsDevice device, SpriteBatch batch, string tip, MouseState mouse, TipType tipType) { Rectangle viewBounds = device.Viewport.Bounds; Vector2 stringMeasure = Datastructures.SafeMeasure(GUI.SmallFont, tip); Rectangle bounds; if(tipType == TipType.BottomRight) { bounds = new Rectangle(mouse.X + 24, mouse.Y + 24, (int)(stringMeasure.X + 15), (int)(stringMeasure.Y + 15)); } else { bounds = new Rectangle(mouse.X - (int)stringMeasure.X - 15, mouse.Y - (int)stringMeasure.Y - 15, (int)(stringMeasure.X + 15), (int)(stringMeasure.Y + 15)); } if (bounds.Left < viewBounds.Left) { bounds.X = viewBounds.X; } if (bounds.Right > viewBounds.Right) { bounds.X = viewBounds.Right - bounds.Width; } if (bounds.Top < viewBounds.Top) { bounds.Y = viewBounds.Y; } if (bounds.Bottom > viewBounds.Bottom) { bounds.Y = viewBounds.Bottom - bounds.Height; } GUI.Skin.RenderToolTip(bounds, batch, Color.White); Drawer2D.DrawAlignedText(batch, tip, GUI.SmallFont, Color.White, Drawer2D.Alignment.Center, bounds); }