public UIMessageIcon(Message message) { Message = message; var script = RenderScript("messageicon.uis"); button = new UIButton((message.Type == MessageType.Call) ? BackgroundImageCall : BackgroundImageLetter) { ImageStates = 3 }; button.OnButtonClick += Button_OnButtonClick; Add(button); AvatarThumbnail = script.Create <UIMessageIconThumbnail>("AvatarThumbnail"); AvatarThumbnail.Button = button; AvatarThumbnail.FrameTexture = AvatarThumbOverlay; User = new Binding <UserReference>() .WithBinding(this, "Icon", "Icon") .WithBinding(this, "Tooltip", "Name"); User.Value = message.User; Add(AvatarThumbnail); m_TooltipHandler = UIUtils.GiveTooltip(this); }
public UILotButton() { DataService = FSOFacade.Kernel.Get <IClientDataService>(); NameLabel = new UILabel(); NameLabel.Y = 52; NameLabel.X = 2; NameLabel.Alignment = TextAlignment.Center; NameLabel.Size = new Vector2(76, 40); NameLabel.CaptionStyle = NameLabel.CaptionStyle.Clone(); NameLabel.CaptionStyle.Size = 9; NameLabel.Wrapped = true; Add(NameLabel); Target = new Binding <Lot>() .WithBinding(this, "NameLabel.Caption", "Lot_Name") .WithBinding(this, "BgImg", "Lot_IsOnline", x => { var online = (bool)x; return(GetTexture((ulong)((online) ? 0xC000000002 : 0xC200000002))); }) .WithBinding(this, "HoverImg", "Lot_IsOnline", x => { var online = (bool)x; return(GetTexture((ulong)((online) ? 0xC100000002 : 0xC300000002))); }); m_TooltipHandler = UIUtils.GiveTooltip(this); ClickHandler = ListenForMouse(new Rectangle(0, 0, 80, 50), new UIMouseEvent(OnMouseEvent)); }
private void InitCommon() { ClickHandler = ListenForMouse(GetBounds(), new UIMouseEvent(OnMouseEvent)); m_TooltipHandler = UIUtils.GiveTooltip(this); //buttons can have tooltips }
/// <summary> /// /// </summary> /// <param name="Texture"></param> public UIButton(Texture2D Texture) { this.Texture = Texture; ClickHandler = ListenForMouse(new Rectangle(0, 0, m_Width, m_Height), new UIMouseEvent(OnMouseEvent)); m_TooltipHandler = UIUtils.GiveTooltip(this); //buttons can have tooltips }
public UIPersonButton() { DataService = FSOFacade.Kernel.Get <IClientDataService>(); User = new Binding <UserReference>() .WithBinding(this, "Tooltip", "Name") .WithBinding(this, "Icon", "Icon") .WithMultiBinding(x => { Invalidate(); }, "Icon", "Name"); m_TooltipHandler = UIUtils.GiveTooltip(this); _Button = new UIButton(); _Button.OnButtonClick += _Button_OnButtonClick; Add(_Button); }
public UISkillBar() { if (SkillLevelTex == null) { SkillLevelTex = new Texture2D[9]; for (int i = 0; i < 9; i++) { SkillLevelTex[i] = GetTexture(0x00000CB600000001 + (ulong)i * 0x100000000); } } ClickHandler = ListenForMouse(new Rectangle(0, 0, m_Width, m_Height), new UIMouseEvent(OnMouseEvent)); m_TooltipHandler = UIUtils.GiveTooltip(this); //buttons can have tooltips }
public UILotButton() { DataService = FSOFacade.Kernel.Get <IClientDataService>(); NameLabel = new UILabel(); NameLabel.Y = 52; NameLabel.X = 2; NameLabel.Alignment = TextAlignment.Center; NameLabel.Size = new Vector2(76, 40); NameLabel.CaptionStyle = NameLabel.CaptionStyle.Clone(); NameLabel.CaptionStyle.Size = 9; NameLabel.Wrapped = true; Add(NameLabel); Target = new Binding <Lot>() .WithBinding(this, "NameLabel.Caption", "Lot_Name") .WithBinding(this, "ThumbImg", "Lot_Thumbnail", x => { if (ThumbImg != null) { ThumbImg.Dispose(); } var thumb = ((cTSOGenericData)x)?.Data; if (((thumb?.Length) ?? 0) == 0) { return(null); } return(ImageLoader.FromStream(GameFacade.GraphicsDevice, new MemoryStream(thumb))); }) .WithBinding(this, "BgImg", "Lot_IsOnline", x => { var online = (bool)x; return(GetTexture((ulong)((online) ? 0xC000000002 : 0xC200000002))); }) .WithBinding(this, "HoverImg", "Lot_IsOnline", x => { var online = (bool)x; return(GetTexture((ulong)((online) ? 0xC100000002 : 0xC300000002))); }); m_TooltipHandler = UIUtils.GiveTooltip(this); ClickHandler = ListenForMouse(new Rectangle(0, 0, 80, 50), new UIMouseEvent(OnMouseEvent)); }
public void UseTooltip() { m_TooltipHandler = UIUtils.GiveTooltip(this); //images can have tooltips, too }
public UIInteraction(bool Active) { SetActive(Active); m_TooltipHandler = UIUtils.GiveTooltip(this); ClickHandler = ListenForMouse(new Rectangle(0, 0, 45, 45), new UIMouseEvent(MouseEvt)); }
public void ActivateTooltip() { m_TooltipHandler = UIUtils.GiveTooltip(this); //buttons can have tooltips }