public DraggableHotSpot(Rectangle rect, HotSpotType type) { Rect = rect; _type = type; AnchorAngle = 0; Visible = true; }
public DraggableHotSpot(HotSpotType type) { Rect = Rectangle.Empty; _type = type; AnchorAngle = 0; Visible = true; }
public BehaviorHotspotRunning(WoWPoint[] hotspots, uint[] ids, HotSpotType type, Func <bool> runCondition) { _objectIds.AddRange(ids); _hotSpots.AddRange(hotspots); _hotspotType = type; RunCondition += runCondition; }
protected Size Draw(ViewInfo view, int x, int y, string type, HotSpotType exchange) { Contract.Requires(view != null); Contract.Requires(type != null); if (IsHidden) { return(DrawHidden(view, x, y)); } DrawInvalidMemoryIndicator(view, y); var origX = x; var origY = y; AddSelection(view, x, y, view.Font.Height); x = AddOpenClose(view, x, y); x = AddIcon(view, x, y, Icons.Array, -1, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); x = AddText(view, x, y, view.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; x = AddText(view, x, y, view.Settings.NameColor, HotSpot.NameId, Name); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "["); x = AddText(view, x, y, view.Settings.IndexColor, 0, Count.ToString()); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "]"); x = AddIcon(view, x, y, Icons.LeftArrow, 2, HotSpotType.Click); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, "("); x = AddText(view, x, y, view.Settings.IndexColor, 1, CurrentIndex.ToString()); x = AddText(view, x, y, view.Settings.IndexColor, HotSpot.NoneId, ")"); x = AddIcon(view, x, y, Icons.RightArrow, 3, HotSpotType.Click) + view.Font.Width; x = AddText(view, x, y, view.Settings.ValueColor, HotSpot.NoneId, $"<{InnerNode.Name} Size={MemorySize}>") + view.Font.Width; x = AddIcon(view, x + 2, y, Icons.Change, 4, exchange); x += view.Font.Width; x = AddComment(view, x, y); AddTypeDrop(view, y); AddDelete(view, y); y += view.Font.Height; var size = new Size(x - origX, y - origY); if (levelsOpen[view.Level]) { var childSize = DrawChild(view, tx, y); size.Width = Math.Max(size.Width, childSize.Width + tx - origX); size.Height += childSize.Height; } return(size); }
public RenderInfo() { Origin = new V2(0.0f, 0.0f); Size = new V2(0.0f, 0.0f); Bgf = null; HotspotType = HotSpotType.HOTSPOT_NONE; SubOverlay = null; }
/// <summary> /// Calls DrawSubOverlay for each suboverlay to process /// </summary> /// <param name="IsUnderlays"></param> protected void DrawSubOverlays(bool IsUnderlays) { // There are 3 passes to draw all overlays (and nother 3 to draw all underlays). // Each pass will process a special variant of hotspots for (int pass = 0; pass < 3; pass++) { // the kind of hotspot to process this time HotSpotType hstToProcess = HotSpotType.HOTSPOT_NONE; switch (pass) { case 0: if (IsUnderlays) { hstToProcess = HotSpotType.HOTSPOT_UNDERUNDER; } else { hstToProcess = HotSpotType.HOTSPOT_OVERUNDER; } break; case 1: if (IsUnderlays) { hstToProcess = HotSpotType.HOTSPOT_UNDER; } else { hstToProcess = HotSpotType.HOTSPOT_OVER; } break; case 2: if (IsUnderlays) { hstToProcess = HotSpotType.HOTSPOT_UNDEROVER; } else { hstToProcess = HotSpotType.HOTSPOT_OVEROVER; } break; } foreach (SubOverlay.RenderInfo subInfo in RenderInfo.SubBgf) { if (subInfo.HotspotType == hstToProcess) { DrawSubOverlay(subInfo); } } } }
protected int Draw(ViewInfo view, int x, int y, string type, HotSpotType exchange) { Contract.Requires(view != null); Contract.Requires(type != null); if (IsHidden) { return(DrawHidden(view, x, y)); } AddSelection(view, x, y, view.Font.Height); AddDelete(view, x, y); AddTypeDrop(view, x, y); x = AddOpenClose(view, x, y); x = AddIcon(view, x, y, Icons.Array, -1, HotSpotType.None); var tx = x; x = AddAddressOffset(view, x, y); x = AddText(view, x, y, Program.Settings.TypeColor, HotSpot.NoneId, type) + view.Font.Width; x = AddText(view, x, y, Program.Settings.NameColor, HotSpot.NameId, Name); x = AddText(view, x, y, Program.Settings.IndexColor, HotSpot.NoneId, "["); x = AddText(view, x, y, Program.Settings.IndexColor, 0, Count.ToString()); x = AddText(view, x, y, Program.Settings.IndexColor, HotSpot.NoneId, "]"); x = AddIcon(view, x, y, Icons.LeftArrow, 2, HotSpotType.Click); x = AddText(view, x, y, Program.Settings.IndexColor, HotSpot.NoneId, "("); x = AddText(view, x, y, Program.Settings.IndexColor, 1, CurrentIndex.ToString()); x = AddText(view, x, y, Program.Settings.IndexColor, HotSpot.NoneId, ")"); x = AddIcon(view, x, y, Icons.RightArrow, 3, HotSpotType.Click); x = AddText(view, x, y, Program.Settings.ValueColor, HotSpot.NoneId, $"<{InnerNode.Name} Size={MemorySize}>"); x = AddIcon(view, x + 2, y, Icons.Change, 4, exchange); x += view.Font.Width; AddComment(view, x, y); y += view.Font.Height; if (levelsOpen[view.Level]) { y = DrawChild(view, tx, y); } return(y); }
/// <summary>Draws an icon and adds a <see cref="HotSpot"/> if <paramref name="hitId"/> is not <see cref="HotSpot.NoneId"/>.</summary> /// <param name="view">The view information.</param> /// <param name="x">The x coordinate.</param> /// <param name="y">The y coordinate.</param> /// <param name="icon">The icon.</param> /// <param name="id">The id of the spot.</param> /// <param name="type">The type of the spot.</param> /// <returns>The new x coordinate after drawing the icon.</returns> protected int AddIcon(ViewInfo view, int x, int y, Image icon, int id, HotSpotType type) { Contract.Requires(view != null); Contract.Requires(icon != null); if (y > view.ClientArea.Bottom || y + Icons.Dimensions < 0) { return(x + Icons.Dimensions); } view.Context.DrawImage(icon, x + 2, y, Icons.Dimensions, Icons.Dimensions); if (id != -1) { AddHotSpot(view, new Rectangle(x, y, Icons.Dimensions, Icons.Dimensions), string.Empty, id, type); } return(x + Icons.Dimensions); }
////////////////////////////////////////////////////////////////////////// public HotSpot(Rectangle Rect, IEditorResizable Owner, HotSpotType Type) { this.Rect = Rect; this.Owner = Owner; this.Type = Type; }
/// <summary>Adds a <see cref="HotSpot"/> the user can interact with.</summary> /// <param name="view">The view information.</param> /// <param name="spot">The spot.</param> /// <param name="text">The text to edit.</param> /// <param name="id">The id of the spot.</param> /// <param name="type">The type of the spot.</param> protected void AddHotSpot(ViewInfo view, Rectangle spot, string text, int id, HotSpotType type) { Contract.Requires(view != null); Contract.Requires(view.Memory != null); Contract.Requires(text != null); if (spot.Top > view.ClientArea.Bottom || spot.Bottom < 0) { return; } view.HotSpots.Add(new HotSpot { Rect = spot, Text = text, Address = view.Address.Add(Offset), Id = id, Type = type, Node = this, Level = view.Level, Memory = view.Memory }); }
public BehaviorHotspotRunning(WoWPoint[] hotspots, HotSpotType type, Func <bool> runCondition) : this(hotspots, new uint[0], type, runCondition) { }