public static void UpdateThumb(FamilyTreeThumb ths) { ImageDrawable drawable = ths.ThumbWin.Drawable as ImageDrawable; if (drawable != null) { drawable.Image = UIManager.GetThumbnailImage(MiniSims.GetThumbnailKey(ths.SimDescription, ThumbnailSize.Large, 0x0)); ths.ThumbWin.Invalidate(); } }
// Retain private new FamilyTreeThumb CreateFamilyTreeThumb(IMiniSimDescription desc, Vector2 pos) { FamilyTreeThumb windowByExportID = UIManager.LoadLayout(ResourceKey.CreateUILayoutKey("HUDSimologyFamilyTreeThumbItem", 0x0)).GetWindowByExportID(0x1) as FamilyTreeThumb; //windowByExportID.SimDescription = desc; windowByExportID.mSimDesc = desc; UpdateThumb(windowByExportID); windowByExportID.Position = pos; mThumbParentWin.AddChild(windowByExportID); // Custom windowByExportID.MouseUp += OnFamilyTreeThumbClick; windowByExportID.TooltipText = desc.FullName; return(windowByExportID); }
// Retain private void OnFamilyTreeThumbClick(WindowBase sender, UIMouseEventArgs eventArgs) { try { FamilyTreeThumb thumb = sender as FamilyTreeThumb; if (thumb != null) { if (eventArgs.MouseKey == MouseKeys.kMouseLeft) { RefreshTree(thumb.SimDescription); } else { ShowMenuTask.Perform(thumb.SimDescription); } } } catch (Exception e) { Common.Exception("OnFamilyTreeThumbClick", e); } }