// Token: 0x060000B3 RID: 179 RVA: 0x0000A7AC File Offset: 0x000089AC public static Vector2 Get2DW2SVector(Vector2[] Corners, LabelLocation location) { switch (location) { case LabelLocation.TopRight: return(Corners[1]); case LabelLocation.TopMiddle: return(new Vector2((Corners[0].x + Corners[1].x) / 2f, Corners[0].y)); case LabelLocation.TopLeft: return(Corners[0]); case LabelLocation.MiddleRight: return(new Vector2(Corners[0].x, (Corners[1].y + Corners[2].y) / 2f)); case LabelLocation.Center: return(new Vector2(Corners[2].x, (Corners[1].y + Corners[2].y) / 2f)); case LabelLocation.MiddleLeft: return(new Vector2((Corners[2].x + Corners[3].x) / 2f, (Corners[1].y + Corners[2].y) / 2f)); case LabelLocation.BottomRight: return(Corners[2]); case LabelLocation.BottomMiddle: return(new Vector2((Corners[2].x + Corners[3].x) / 2f, Corners[2].y)); case LabelLocation.BottomLeft: return(Corners[3]); default: return(Vector2.zero); } }
void ReleaseDesignerOutlets() { if (LabelLocation != null) { LabelLocation.Dispose(); LabelLocation = null; } if (buttonLocation != null) { buttonLocation.Dispose(); buttonLocation = null; } if (buttonPicture != null) { buttonPicture.Dispose(); buttonPicture = null; } if (imagePhoto != null) { imagePhoto.Dispose(); imagePhoto = null; } }
// Token: 0x06000047 RID: 71 RVA: 0x000046AC File Offset: 0x000028AC public static Vector2 Get3DW2SVector(Camera cam, Bounds b, LabelLocation location) { Vector2 result; switch (location) { case LabelLocation.TopRight: case LabelLocation.TopMiddle: case LabelLocation.TopLeft: result = DrawUtilities.InvertScreenSpace(cam.WorldToScreenPoint(new Vector3(b.center.x, b.center.y + b.extents.y, b.center.z))); break; case LabelLocation.MiddleRight: case LabelLocation.Center: case LabelLocation.MiddleLeft: result = DrawUtilities.InvertScreenSpace(cam.WorldToScreenPoint(b.center)); break; case LabelLocation.BottomRight: case LabelLocation.BottomMiddle: case LabelLocation.BottomLeft: result = DrawUtilities.InvertScreenSpace(cam.WorldToScreenPoint(new Vector3(b.center.x, b.center.y - b.extents.y, b.center.z))); break; default: result = Vector2.zero; break; } return(result); }
/// <summary> /// Default contructor /// </summary> public GraphvizGraph() { m_Url = null; m_BackgroundColor = Color.White; m_IsCentered = false; m_ClusterRank = ClusterMode.Local; m_Comment = null; m_IsCompounded = false; m_IsConcentrated = false; m_Font = null; m_FontColor = Color.Black; m_Label = null; m_LabelJustification = LabelJustification.C; m_LabelLocation = LabelLocation.B; m_Layers = new GraphvizLayerCollection(); m_McLimit = 1.0; m_NodeSeparation = 0.25; m_IsNormalized = false; m_NsLimit = -1; m_NsLimit1 = -1; m_OutputOrder = OutputMode.BreadthFirst; m_PageSize = new Size(0, 0); m_PageDirection = PageDirection.BL; m_Quantum = 0; m_RankSeparation = 0.5; m_Ratio = RatioMode.Auto; m_IsReMinCross = false; m_Resolution = 0.96; m_Rotate = 0; m_SamplePoints = 8; m_SearchSize = 30; m_Size = new Size(0, 0); m_StyleSheet = null; }
private void LocationsCombo_SelectedIndexChanged(object sender, EventArgs e) { LabelLocation[] locations = null; switch (LocationsCombo.SelectedIndex) { case 0: locations = new LabelLocation[] { LabelLocation.Top }; break; case 1: locations = new LabelLocation[] { LabelLocation.Top, LabelLocation.Bottom }; break; case 2: locations = new LabelLocation[] { LabelLocation.Top, LabelLocation.Bottom, LabelLocation.Left, LabelLocation.Right }; break; } NChart chart = nChartControl1.Charts[0]; chart.Series[0].LabelLayout.LabelLocations = locations; nChartControl1.Refresh(); }
private void PrintDocument_Preview(CanvasPrintDocument sender, CanvasPreviewEventArgs args) { PrintTaskOptions options = args.PrintTaskOptions; PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(options); Rect imageableRect = GetImageableRect(options, args.PageNumber); GraphSize size = GetOptionValue <GraphSize>(printDetailedOptions); LabelLocation labelLocation = GetOptionValue <LabelLocation>(printDetailedOptions); DrawPage(args.DrawingSession, imageableRect, size, labelLocation); }
public LabeledPointSet(String filename, LabelLocation labelLocation) { DelimitedFile file = new DelimitedFile(filename); int labelIndex = 0; if (labelLocation == LabelLocation.LastColumn) { labelIndex = file.Data[0].Length - 1; } Labels = new LabelList(file, labelIndex); Points = new PointSet(file.RemoveColumns(labelIndex)); }
private static Tuple <int, int> GetLocationOffsets(LabelLocation location) { switch (location) { case LabelLocation.Left: return(new Tuple <int, int>(-1, 0)); case LabelLocation.Top: return(new Tuple <int, int>(0, -1)); default: throw new ArgumentOutOfRangeException(nameof(location), location, null); } }
private void PrintDocument_Print(CanvasPrintDocument sender, CanvasPrintEventArgs args) { PrintTaskOptions options = args.PrintTaskOptions; PrintTaskOptionDetails printDetailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(options); Rect imageableRect = GetImageableRect(options, pageNumber: 1); GraphSize size = GetOptionValue <GraphSize>(printDetailedOptions); LabelLocation labelLocation = GetOptionValue <LabelLocation>(printDetailedOptions); using (CanvasDrawingSession drawingSession = args.CreateDrawingSession()) { DrawPage(drawingSession, imageableRect, size, labelLocation); } }
private static Vector2 GetLabelLocation(LabelLocation labelLocation, Rect textLayoutBounds, Size canvasSize) { const float offset = 15; return(labelLocation switch { LabelLocation.TopLeft => new Vector2(offset, offset), LabelLocation.TopRight => new Vector2((float)canvasSize.Width - (float)textLayoutBounds.Width - offset, offset), LabelLocation.BottomLeft => new Vector2(offset, (float)canvasSize.Height - (float)textLayoutBounds.Height - offset), LabelLocation.BottomRight => new Vector2( (float)canvasSize.Width - (float)textLayoutBounds.Width - offset, (float)canvasSize.Height - (float)textLayoutBounds.Height - offset), _ => throw new InvalidOperationException($"Unexpected LabelLocation {labelLocation}."), });
// Token: 0x06000048 RID: 72 RVA: 0x000047A4 File Offset: 0x000029A4 public static Vector2 Get2DW2SVector(Camera cam, Vector2[] Corners, LabelLocation location) { Vector2 result; switch (location) { case LabelLocation.TopRight: result = Corners[1]; break; case LabelLocation.TopMiddle: result = new Vector2((Corners[0].x + Corners[1].x) / 2f, Corners[0].y); break; case LabelLocation.TopLeft: result = Corners[0]; break; case LabelLocation.MiddleRight: result = new Vector2(Corners[0].x, (Corners[1].y + Corners[2].y) / 2f); break; case LabelLocation.Center: result = new Vector2(Corners[2].x, (Corners[1].y + Corners[2].y) / 2f); break; case LabelLocation.MiddleLeft: result = new Vector2((Corners[2].x + Corners[3].x) / 2f, (Corners[1].y + Corners[2].y) / 2f); break; case LabelLocation.BottomRight: result = Corners[2]; break; case LabelLocation.BottomMiddle: result = new Vector2((Corners[2].x + Corners[3].x) / 2f, Corners[2].y); break; case LabelLocation.BottomLeft: result = Corners[3]; break; default: result = Vector2.zero; break; } return(result); }
public static Vector2 Get3DW2SVector(Camera cam, Bounds b, LabelLocation location) { switch (location) { case LabelLocation.BottomLeft: case LabelLocation.BottomMiddle: case LabelLocation.BottomRight: return(InvertScreenSpace(cam.WorldToScreenPoint(new Vector3(b.center.x, b.center.y - b.extents.y, b.center.z)))); case LabelLocation.Center: case LabelLocation.MiddleLeft: case LabelLocation.MiddleRight: return(InvertScreenSpace(cam.WorldToScreenPoint(b.center))); case LabelLocation.TopLeft: case LabelLocation.TopMiddle: case LabelLocation.TopRight: return(InvertScreenSpace(cam.WorldToScreenPoint(new Vector3(b.center.x, b.center.y + b.extents.y, b.center.z)))); default: return(Vector2.zero); } }
void ReleaseDesignerOutlets() { if (Button != null) { Button.Dispose(); Button = null; } if (LabelDevice != null) { LabelDevice.Dispose(); LabelDevice = null; } if (LabelLocation != null) { LabelLocation.Dispose(); LabelLocation = null; } if (LabelWeather != null) { LabelWeather.Dispose(); LabelWeather = null; } }
private static void DrawLabelOutsideRect(Rect position, string label, LabelLocation labelLocation) { Matrix4x4 matrix = GUI.matrix; Rect position2 = new Rect(position.x, position.y - 18f, position.width, 16f); switch (labelLocation) { case LabelLocation.Bottom: position2 = new Rect(position.x, position.yMax, position.width, 16f); break; case LabelLocation.Left: GUIUtility.RotateAroundPivot(-90f, position.center); break; case LabelLocation.Right: GUIUtility.RotateAroundPivot(90f, position.center); break; } EditorGUI.BeginDisabledGroup(true); GUI.Label(position2, label); EditorGUI.EndDisabledGroup(); GUI.matrix = matrix; }
/// <summary> /// Create a new image picker option. They underlying value is the <c>uint</c> that is the index /// passed to the <paramref name="drawImage"/> and <paramref name="label"/> functions. /// </summary> /// <param name="getValue">Get the current value from the mod config.</param> /// <param name="setValue">Set a new value in the mod config.</param> /// <param name="getMaxValue"> /// The maximum value this option can have, and thus the maximum value that will be passed to /// <paramref name="drawImage"/> and <paramref name="label"/>. Note that this is a function, so /// theoretically the number of options does not have to be fixed. Should this function return a /// value greater than the option's current value then the option's current value will be clamped. /// In common usage, this parameter should be a function that returns one less than the number /// of images. /// </param> /// <param name="maxImageHeight"> /// A function that returns the maximum image height. Used to center /// arrows vertically in the <c cref="ImageOptionArrowLocation.Sides">Sides</c> arrow placement option. /// </param> /// <param name="maxImageWidth"> /// A function that returns the maximum image width. This is used to place the arrows and label. /// </param> /// <param name="drawImage">A function which draws the image for the given index at the given location</param> /// <param name="label">A function to return the string to display given the image index, or <c>null</c> to disable that display.</param> /// <param name="arrowLocation">Where to draw the arrows in relation to the image.</param> /// <param name="labelLocation">Where to draw the label in relation to the image.</param> public ImagePickerOption(Func <uint> getValue, Action <uint> setValue, Func <uint> getMaxValue, Func <int> maxImageHeight, Func <int> maxImageWidth, Action <uint, SpriteBatch, Vector2> drawImage, Func <uint, String> label = null, ArrowLocation arrowLocation = ArrowLocation.Top, LabelLocation labelLocation = LabelLocation.Top) { GetValue = getValue; SetValue = setValue; GetMaxValue = getMaxValue; MaxImageHeight = maxImageHeight; MaxImageWidth = maxImageWidth; DrawImage = drawImage; Label = label; this.arrowLocation = arrowLocation; this.labelLocation = label is not null ? labelLocation : LabelLocation.None; leftButton = new IconButton(Game1.mouseCursors, LeftArrow, "", LeftButtonClicked, false); rightButton = new IconButton(Game1.mouseCursors, RightArrow, "", RightButtonClicked, false); arrowButtonHeight = Math.Max(leftButton.Height, rightButton.Height); }
private static Vector2 GetLabelLocation(LabelLocation labelLocation, Rect textLayoutBounds, Size canvasSize) { const float offset = 15; switch (labelLocation) { case LabelLocation.TopLeft: return(new Vector2(offset, offset)); case LabelLocation.TopRight: return(new Vector2((float)canvasSize.Width - (float)textLayoutBounds.Width - offset, offset)); case LabelLocation.BottomLeft: return(new Vector2(offset, (float)canvasSize.Height - (float)textLayoutBounds.Height - offset)); case LabelLocation.BottomRight: return(new Vector2( (float)canvasSize.Width - (float)textLayoutBounds.Width - offset, (float)canvasSize.Height - (float)textLayoutBounds.Height - offset)); default: throw new InvalidOperationException($"Unexpected LabelLocation {labelLocation}."); } }
/// <summary> /// Converts to dot code /// </summary> /// <returns>dot code</returns> public String ToDot() { Hashtable pairs = new Hashtable(); if (Url != null) { pairs["URL"] = Url; } if (BackgroundColor != Color.White) { pairs["bgcolor"] = BackgroundColor; } if (IsCentered) { pairs["center"] = true; } if (ClusterRank != ClusterMode.Local) { pairs["clusterrank"] = ClusterRank.ToString().ToLower(); } if (Comment != null) { pairs["comment"] = Comment; } if (IsCompounded) { pairs["compound"] = IsCompounded; } if (IsConcentrated) { pairs["concentrated"] = IsConcentrated; } if (Font != null) { pairs["fontname"] = Font.Name; pairs["fontsize"] = Font.SizeInPoints; } if (FontColor != Color.Black) { pairs["fontcolor"] = FontColor; } if (Label != null) { pairs["label"] = Label; } if (LabelJustification != LabelJustification.C) { pairs["labeljust"] = LabelJustification.ToString().ToLower(); } if (LabelLocation != LabelLocation.B) { pairs["labelloc"] = LabelLocation.ToString().ToLower(); } if (Layers.Count != 0) { pairs["layers"] = Layers.ToDot(); } if (McLimit != 1.0) { pairs["mclimit"] = McLimit; } if (NodeSeparation != 0.25) { pairs["nodesep"] = NodeSeparation; } if (IsNormalized) { pairs["normalize"] = IsNormalized; } if (NsLimit > 0) { pairs["nslimit"] = NsLimit; } if (NsLimit1 > 0) { pairs["nslimit1"] = NsLimit1; } if (OutputOrder != OutputMode.BreadthFirst) { pairs["outputorder"] = OutputOrder.ToString().ToLower(); } if (!PageSize.IsEmpty) { pairs["page"] = String.Format("({0},{1})", PageSize.Width, PageSize.Height); } if (PageDirection != PageDirection.BL) { pairs["pagedir"] = PageDirection.ToString().ToLower(); } if (Quantum > 0) { pairs["quantum"] = Quantum; } if (RankSeparation != 0.5) { pairs["ranksep"] = RankSeparation; } if (Ratio != RatioMode.Auto) { pairs["ratio"] = Ratio.ToString().ToLower(); } if (IsReMinCross) { pairs["remincross"] = IsReMinCross; } if (Resolution != 0.96) { pairs["resolution"] = Resolution; } if (Rotate != 0) { pairs["rotate"] = Rotate; } if (SamplePoints != 8) { pairs["samplepoints"] = SamplePoints; } if (SearchSize != 30) { pairs["searchsize"] = SearchSize; } if (!Size.IsEmpty) { pairs["size"] = String.Format("({0},{1})", Size.Width, Size.Height); } if (StyleSheet != null) { pairs["stylesheet"] = StyleSheet; } return(GenerateDot(pairs)); }
// Token: 0x06000046 RID: 70 RVA: 0x000043EC File Offset: 0x000025EC public static void DrawLabel(Font Font, LabelLocation Location, Vector2 W2SVector, string Content, Color BorderColor, Color InnerColor, int BorderWidth, string outerContent = null, int fontSize = 12) { GUIContent guicontent = new GUIContent(Content); GUIStyle guistyle = new GUIStyle { font = Font, fontSize = fontSize }; Vector2 vector = guistyle.CalcSize(guicontent); float x = vector.x; float y = vector.y; Rect centerRect = new Rect(0f, 0f, x, y); switch (Location) { case LabelLocation.TopRight: centerRect.x = W2SVector.x; centerRect.y = W2SVector.y - y; guistyle.alignment = TextAnchor.UpperLeft; break; case LabelLocation.TopMiddle: centerRect.x = W2SVector.x - x / 2f; centerRect.y = W2SVector.y - y; guistyle.alignment = TextAnchor.LowerCenter; break; case LabelLocation.TopLeft: centerRect.x = W2SVector.x - x; centerRect.y = W2SVector.y - y; guistyle.alignment = TextAnchor.UpperRight; break; case LabelLocation.MiddleRight: centerRect.x = W2SVector.x; centerRect.y = W2SVector.y - y / 2f; guistyle.alignment = TextAnchor.MiddleLeft; break; case LabelLocation.Center: centerRect.x = W2SVector.x - x / 2f; centerRect.y = W2SVector.y - y / 2f; guistyle.alignment = TextAnchor.MiddleCenter; break; case LabelLocation.MiddleLeft: centerRect.x = W2SVector.x - x; centerRect.y = W2SVector.y - y / 2f; guistyle.alignment = TextAnchor.MiddleRight; break; case LabelLocation.BottomRight: centerRect.x = W2SVector.x; centerRect.y = W2SVector.y; guistyle.alignment = TextAnchor.LowerLeft; break; case LabelLocation.BottomMiddle: centerRect.x = W2SVector.x - x / 2f; centerRect.y = W2SVector.y; guistyle.alignment = TextAnchor.UpperCenter; break; case LabelLocation.BottomLeft: centerRect.x = W2SVector.x - x; centerRect.y = W2SVector.y; guistyle.alignment = TextAnchor.LowerRight; break; } bool flag = centerRect.x - 10f < 0f || centerRect.y - 10f < 0f; bool flag2 = !flag; if (flag2) { bool flag3 = centerRect.x + 10f > (float)Screen.width || centerRect.y + 10f > (float)Screen.height; bool flag4 = !flag3; if (flag4) { DrawUtilities.DrawTextWithOutline(centerRect, guicontent.text, guistyle, BorderColor, InnerColor, BorderWidth, outerContent); } } }
public LabelAttribute(string text, LabelLocation location = LabelLocation.Left) { m_location = location; m_text = text; }
/// <summary> /// Default contructor /// </summary> public GraphvizGraph() { m_Url=null; m_BackgroundColor=Color.White; m_IsCentered=false; m_ClusterRank=ClusterMode.Local; m_Comment=null; m_IsCompounded=false; m_IsConcentrated=false; m_Font=null; m_FontColor=Color.Black; m_Label=null; m_LabelJustification=LabelJustification.C; m_LabelLocation=LabelLocation.B; m_Layers=new GraphvizLayerCollection(); m_McLimit=1.0; m_NodeSeparation=0.25; m_IsNormalized=false; m_NsLimit=-1; m_NsLimit1=-1; m_OutputOrder=OutputMode.BreadthFirst; m_PageSize=new Size(0,0); m_PageDirection=PageDirection.BL; m_Quantum=0; m_RankSeparation=0.5; m_Ratio = RatioMode.Auto; m_IsReMinCross=false; m_Resolution=0.96; m_Rotate=0; m_SamplePoints=8; m_SearchSize=30; m_Size=new Size(0,0); m_StyleSheet=null; }
internal static Item LocationToSearchResult(SectorMap.Milieu map, ResourceManager resourceManager, ItemLocation location) { if (location is WorldLocation) { Sector sector; World world; ((WorldLocation)location).Resolve(map, resourceManager, out sector, out world); if (sector == null || world == null) { return(null); } WorldResult r = new WorldResult(); r.SectorX = sector.X; r.SectorY = sector.Y; r.SectorTags = sector.TagString; r.HexX = world.X; r.HexY = world.Y; r.Name = world.Name; r.Sector = sector.Names[0].Text; r.Uwp = world.UWP; r.Importance = world.ImportanceValue; return(r); } if (location is SubsectorLocation) { Sector sector; Subsector subsector; ((SubsectorLocation)location).Resolve(map, out sector, out subsector); if (sector == null || subsector == null) { return(null); } SubsectorResult r = new SubsectorResult(); r.SectorX = sector.X; r.SectorY = sector.Y; r.SectorTags = sector.TagString; r.Name = subsector.Name; r.Index = subsector.Index; r.Sector = sector.Names[0].Text; return(r); } if (location is SectorLocation) { Sector sector = ((SectorLocation)location).Resolve(map); if (sector == null) { return(null); } SectorResult r = new SectorResult(); r.SectorX = sector.X; r.SectorY = sector.Y; r.SectorTags = sector.TagString; r.Name = sector.Names[0].Text; return(r); } if (location is LabelLocation) { LabelLocation label = location as LabelLocation; Location l = Astrometrics.CoordinatesToLocation(label.Coords); Sector sector = label.Resolve(map); LabelResult r = new LabelResult(); r.Name = label.Label; r.SectorX = l.Sector.X; r.SectorY = l.Sector.Y; r.HexX = l.Hex.X;; r.HexY = l.Hex.Y; r.Scale = label.Radius > 80 ? 4 : label.Radius > 40 ? 8 : label.Radius > 20 ? 32 : 64; r.SectorTags = sector.TagString; return(r); } throw new ArgumentException(string.Format("Unexpected result type: {0}", location.GetType().Name), "location"); }
public static void DrawLabel(Font Font, LabelLocation Location, Vector2 W2SVector, string Content, Color BorderColor, Color InnerColor, int BorderWidth, string outerContent = null, int fontSize = 12) { GUIContent gcontent = new GUIContent(Content); GUIStyle LabelStyle = new GUIStyle { font = Font, fontSize = fontSize }; Vector2 dim = LabelStyle.CalcSize(gcontent); float width = dim.x; float height = dim.y; Rect rect = new Rect(0, 0, width, height); switch (Location) { case LabelLocation.BottomLeft: rect.x = W2SVector.x - width; rect.y = W2SVector.y; LabelStyle.alignment = TextAnchor.LowerRight; break; case LabelLocation.BottomMiddle: rect.x = W2SVector.x - width / 2; rect.y = W2SVector.y; LabelStyle.alignment = TextAnchor.UpperCenter; break; case LabelLocation.BottomRight: rect.x = W2SVector.x; rect.y = W2SVector.y; LabelStyle.alignment = TextAnchor.LowerLeft; break; case LabelLocation.Center: rect.x = W2SVector.x - width / 2; rect.y = W2SVector.y - height / 2; LabelStyle.alignment = TextAnchor.MiddleCenter; break; case LabelLocation.MiddleLeft: rect.x = W2SVector.x - width; rect.y = W2SVector.y - height / 2; LabelStyle.alignment = TextAnchor.MiddleRight; break; case LabelLocation.MiddleRight: rect.x = W2SVector.x; rect.y = W2SVector.y - height / 2; LabelStyle.alignment = TextAnchor.MiddleLeft; break; case LabelLocation.TopLeft: rect.x = W2SVector.x - width; rect.y = W2SVector.y - height; LabelStyle.alignment = TextAnchor.UpperRight; break; case LabelLocation.TopMiddle: rect.x = W2SVector.x - width / 2; rect.y = W2SVector.y - height; LabelStyle.alignment = TextAnchor.LowerCenter; break; case LabelLocation.TopRight: rect.x = W2SVector.x; rect.y = W2SVector.y - height; LabelStyle.alignment = TextAnchor.UpperLeft; break; } if (rect.x - 10 < 0 || rect.y - 10 < 0) { return; } if (rect.x + 10 > Screen.width || rect.y + 10 > Screen.height) { return; } DrawTextWithOutline(rect, gcontent.text, LabelStyle, BorderColor, InnerColor, BorderWidth, outerContent); }
// Token: 0x060000B2 RID: 178 RVA: 0x0000A2BC File Offset: 0x000084BC public static void DrawLabel(Font Font, LabelLocation Location, Vector2 W2SVector, string Content, Color innerColor, int borderWidth, int size) { DrawUtilities.guistyle.font = Font; float x; float y; Rect rect; for (;;) { IL_17E: DrawUtilities.guistyle.fontSize = size; DrawUtilities.tempContent.text = Content; for (;;) { IL_160: Vector2 vector = DrawUtilities.guistyle.CalcSize(DrawUtilities.tempContent); x = vector.x; y = vector.y; for (;;) { IL_14B: rect = new Rect(0f, 0f, x, y); for (;;) { IL_11C: switch (Location) { case LabelLocation.TopRight: goto IL_197; case LabelLocation.TopMiddle: goto IL_1C9; case LabelLocation.TopLeft: goto IL_203; case LabelLocation.MiddleRight: goto IL_237; case LabelLocation.Center: goto IL_269; case LabelLocation.MiddleLeft: goto IL_2A3; case LabelLocation.BottomRight: goto IL_2D7; case LabelLocation.BottomMiddle: goto IL_304; case LabelLocation.BottomLeft: goto IL_339; default: { uint num2; uint num = num2 * 230082528u ^ 1769495636u; for (;;) { switch ((num2 = (num ^ 1750197459u)) % 54u) { case 0u: goto IL_4BF; case 1u: goto IL_160; case 2u: case 23u: goto IL_4A0; case 3u: goto IL_370; case 4u: goto IL_2D7; case 5u: goto IL_11C; case 6u: goto IL_3E5; case 7u: goto IL_1DE; case 8u: goto IL_1C9; case 9u: case 40u: goto IL_467; case 10u: goto IL_2B2; case 11u: goto IL_32C; case 12u: goto IL_2C7; case 13u: num = (num2 * 3146714222u ^ 873170528u); continue; case 14u: goto IL_304; case 15u: case 17u: case 24u: case 28u: case 30u: case 32u: case 33u: case 48u: goto IL_366; case 18u: goto IL_3F5; case 19u: case 39u: goto IL_42E; case 20u: goto IL_3AA; case 21u: goto IL_40B; case 22u: goto IL_319; case 25u: case 41u: goto IL_17E; case 26u: goto IL_339; case 27u: goto IL_203; case 29u: goto IL_293; case 31u: goto IL_14B; case 34u: goto IL_47D; case 35u: goto IL_269; case 36u: goto IL_212; case 37u: goto IL_244; case 38u: goto IL_2A3; case 42u: goto IL_197; case 43u: goto IL_490; case 44u: goto IL_3D2; case 45u: goto IL_237; case 46u: goto IL_41E; case 47u: goto IL_259; case 49u: goto IL_38C; case 50u: goto IL_4B4; case 51u: goto IL_1F3; case 52u: goto IL_444; case 53u: goto IL_4D0; } goto Block_1; } break; } } } } } } Block_1: return; IL_197: rect.x = W2SVector.x; rect.y = W2SVector.y - y - 5f; DrawUtilities.guistyle.alignment = TextAnchor.UpperLeft; goto IL_366; IL_1C9: rect.x = W2SVector.x - x / 2f; IL_1DE: rect.y = W2SVector.y - y - 5f; IL_1F3: DrawUtilities.guistyle.alignment = TextAnchor.UpperCenter; goto IL_366; IL_203: rect.x = W2SVector.x - x; IL_212: rect.y = W2SVector.y - y - 5f; DrawUtilities.guistyle.alignment = TextAnchor.UpperRight; goto IL_366; IL_237: rect.x = W2SVector.x; IL_244: rect.y = W2SVector.y - y / 2f; IL_259: DrawUtilities.guistyle.alignment = TextAnchor.MiddleLeft; goto IL_366; IL_269: rect.x = W2SVector.x - x / 2f; rect.y = W2SVector.y - y / 2f; IL_293: DrawUtilities.guistyle.alignment = TextAnchor.MiddleCenter; goto IL_366; IL_2A3: rect.x = W2SVector.x - x; IL_2B2: rect.y = W2SVector.y - y / 2f; IL_2C7: DrawUtilities.guistyle.alignment = TextAnchor.MiddleRight; goto IL_366; IL_2D7: rect.x = W2SVector.x; rect.y = W2SVector.y + 10f; DrawUtilities.guistyle.alignment = TextAnchor.LowerLeft; goto IL_366; IL_304: rect.x = W2SVector.x - x / 2f; IL_319: rect.y = W2SVector.y + 10f; IL_32C: DrawUtilities.guistyle.alignment = TextAnchor.LowerCenter; goto IL_366; IL_339: rect.x = W2SVector.x - x; rect.y = W2SVector.y + 10f; DrawUtilities.guistyle.alignment = TextAnchor.LowerRight; IL_366: if (!ESPOptions.TextStyle) { goto IL_4BF; } IL_370: Rect position = rect; DrawUtilities.tempContent.text = DrawUtilities.regex.Replace(Content, string.Empty); IL_38C: DrawUtilities.guistyle.normal.textColor = ColorUtilities.getColor(DrawUtilities.color); IL_3AA: position.x -= (float)(borderWidth + 1); position.y -= (float)(borderWidth + 1); goto IL_3F5; IL_3D2: position.x += 1f; IL_3E5: GUI.Label(position, DrawUtilities.tempContent, DrawUtilities.guistyle); IL_3F5: if (position.x > rect.x + (float)borderWidth) { goto IL_42E; } goto IL_3D2; IL_40B: position.y += 1f; IL_41E: GUI.Label(position, DrawUtilities.tempContent, DrawUtilities.guistyle); IL_42E: if (position.y <= rect.y + (float)borderWidth) { goto IL_40B; } goto IL_467; IL_444: position.x -= 1f; GUI.Label(position, DrawUtilities.tempContent, DrawUtilities.guistyle); IL_467: if (position.x >= rect.x - (float)borderWidth) { goto IL_444; } goto IL_4A0; IL_47D: position.y -= 1f; IL_490: GUI.Label(position, DrawUtilities.tempContent, DrawUtilities.guistyle); IL_4A0: if (position.y >= rect.y - (float)borderWidth) { goto IL_47D; } IL_4B4: DrawUtilities.tempContent.text = Content; IL_4BF: DrawUtilities.guistyle.normal.textColor = innerColor; IL_4D0: GUI.Label(rect, DrawUtilities.tempContent, DrawUtilities.guistyle); }
private void DrawPage(CanvasDrawingSession drawingSession, Rect imageableRect, GraphSize graphSize, LabelLocation labelLocation) { drawingSession.Transform = GetPrintTransfrom(imageableRect, graphSize, out Size size); _graph.DrawGraph(drawingSession, size, Colors.Black); IReadOnlyList <IFunction> functions = _graph.Functions; if (functions == null || labelLocation == LabelLocation.None) { return; } // Draw function labels. string functionString = GetFunctionString(functions, out FuntionLocation[] locations); using (var layout = new CanvasTextLayout(drawingSession, functionString, LabelFormat, 100, 20)) { foreach (FuntionLocation location in locations) { int start = location.Start; layout.SetColor(start, location.Length, location.Color); int parenLocation = functionString.IndexOf('(', start); // ++ for the f layout.SetTypography(++start, parenLocation - start, SubScriptTypography); } Vector2 labelPoint = GetLabelLocation(labelLocation, layout.LayoutBounds, size); drawingSession.DrawTextLayout(layout, labelPoint, Colors.Black); } }
public void OnGUI() { if (Event.current.type != EventType.Repaint || !ESPOptions.Enabled) return; if (!DrawUtilities.ShouldRun()) return; GUI.depth = 1; if (MainCamera == null) MainCamera = OptimizationVariables.MainCam; Vector3 localPos = OptimizationVariables.MainPlayer.transform.position; Vector3 aimPos = OptimizationVariables.MainPlayer.look.aim.position; Vector3 aimForward = OptimizationVariables.MainPlayer.look.aim.forward; for (int i = 0; i < ESPVariables.Objects.Count; i++) { ESPObject obj = ESPVariables.Objects[i]; ESPVisual visual = ESPOptions.VisualOptions[(int)obj.Target]; GameObject go = obj.GObject; if (!visual.Enabled) { Highlighter highlighter = go.GetComponent<Highlighter>(); if (highlighter != null && highlighter != TrajectoryComponent.Highlighted) highlighter.ConstantOffImmediate(); continue; } if (obj.Target == ESPTarget.Items && ESPOptions.FilterItems) if (!ItemUtilities.Whitelisted(((InteractableItem)obj.Object).asset, ItemOptions.ItemESPOptions)) continue; Color c = ColorUtilities.getColor($"_{obj.Target}"); LabelLocation ll = visual.Location; if (go == null) continue; Vector3 position = go.transform.position; double dist = VectorUtilities.GetDistance(position, localPos); if (dist < 0.5 || (dist > visual.Distance && !visual.InfiniteDistance)) continue; Vector3 cpos = MainCamera.WorldToScreenPoint(position); if (cpos.z <= 0) continue; string text = ""; Vector3 scale = go.transform.localScale; Bounds b; switch (obj.Target) { case ESPTarget.Players: case ESPTarget.Zombies: b = new Bounds(new Vector3(position.x, position.y + 1, position.z), new Vector3(scale.x * 2, scale.y * 3, scale.z * 2)); break; case ESPTarget.Vehicles: b = go.transform.Find("Model_0").GetComponent<MeshRenderer>().bounds; Transform child = go.transform.Find("Model_1"); if (child != null) b.Encapsulate(child.GetComponent<MeshRenderer>().bounds); break; default: b = go.GetComponent<Collider>().bounds; break; } int size = DrawUtilities.GetTextSize(visual, dist); double rounded = Math.Round(dist); /*#if DEBUG DebugUtilities.Log(obj.Target.ToString()); //Holy f**k nuggets this is laggy #endif*/ string outerText = $"<size={size}>"; text = $"<size={size}>"; switch (obj.Target) { #region Players case ESPTarget.Players: { Player p = (Player)obj.Object; if (p.life.isDead) continue; if (visual.ShowName) text += GetSteamPlayer(p).playerID.characterName + "\n"; if (RaycastUtilities.TargetedPlayer == p && RaycastOptions.EnablePlayerSelection) text += "[Targeted]\n"; if (ESPOptions.ShowPlayerWeapon) text += (p.equipment.asset != null ? p.equipment.asset.itemName : "Fists") + "\n"; if (ESPOptions.ShowPlayerVehicle) text += (p.movement.getVehicle() != null ? p.movement.getVehicle().asset.name + "\n" : "No Vehicle\n"); b.size = b.size / 2; b.size = new Vector3(b.size.x, b.size.y * 1.25f, b.size.z); if (FriendUtilities.IsFriendly(p) && ESPOptions.UsePlayerGroup) c = ColorUtilities.getColor("_ESPFriendly"); break; } #endregion #region Zombies case ESPTarget.Zombies: { if (((Zombie)obj.Object).isDead) continue; if (visual.ShowName) text += $"Zombie\n"; break; } #endregion #region Items case ESPTarget.Items: { InteractableItem item = (InteractableItem)obj.Object; if (visual.ShowName) text += item.asset.itemName + "\n"; break; } #endregion #region Sentries case ESPTarget.Sentries: { InteractableSentry sentry = (InteractableSentry)obj.Object; if (visual.ShowName) { text += "Sentry\n"; outerText += "Sentry\n"; } if (ESPOptions.ShowSentryItem) { outerText += SentryName(sentry.displayItem, false) + "\n"; text += SentryName(sentry.displayItem, true) + "\n"; } break; } #endregion #region Beds case ESPTarget.Beds: { InteractableBed bed = (InteractableBed)obj.Object; if (visual.ShowName) { text += "Bed\n"; outerText += "Bed\n"; } if (ESPOptions.ShowClaimed) { text += GetOwned(bed, true) + "\n"; outerText += GetOwned(bed, false) + "\n"; } break; } #endregion #region Claim Flags case ESPTarget.ClaimFlags: { if (visual.ShowName) text += "Claim Flag\n"; break; } #endregion #region Vehicles case ESPTarget.Vehicles: { InteractableVehicle vehicle = (InteractableVehicle)obj.Object; if (vehicle.health == 0) continue; if (ESPOptions.FilterVehicleLocked && vehicle.isLocked) continue; vehicle.getDisplayFuel(out ushort displayFuel, out ushort MaxFuel); float health = Mathf.Round(100 * (vehicle.health / (float)vehicle.asset.health)); float fuel = Mathf.Round(100 * (displayFuel / (float)MaxFuel)); if (visual.ShowName) { text += vehicle.asset.name + "\n"; outerText += vehicle.asset.name + "\n"; } if (ESPOptions.ShowVehicleHealth) { text += $"Health: {health}%\n"; outerText += $"Health: {health}%\n"; } if (ESPOptions.ShowVehicleFuel) { text += $"Fuel: {fuel}%\n"; outerText += $"Fuel: {fuel}%\n"; } if (ESPOptions.ShowVehicleLocked) { text += GetLocked(vehicle, true) + "\n"; outerText += GetLocked(vehicle, false) + "\n"; } break; } #endregion #region Storage case ESPTarget.Storage: { if (visual.ShowName) text += "Storage\n"; break; } #endregion #region Generators case ESPTarget.Generators: { InteractableGenerator gen = (InteractableGenerator)obj.Object; float fuel = Mathf.Round(100 * (gen.fuel / (float)gen.capacity)); if (ESPOptions.ShowGeneratorFuel) { text += $"Fuel: {fuel}%\n"; outerText += $"Fuel: {fuel}%\n"; } if (ESPOptions.ShowGeneratorPowered) { text += GetPowered(gen, true) + "\n"; outerText += GetPowered(gen, false) + "\n"; } break; } #endregion } if (outerText == $"<size={size}>") outerText = null; if (visual.ShowDistance) { text += $"{rounded}m\n"; if (outerText != null) outerText += $"{rounded}m\n"; } if (visual.ShowAngle) { double roundedFOV = Math.Round(VectorUtilities.GetAngleDelta(aimPos, aimForward, position), 2); text += $"Angle: {roundedFOV}°\n"; if (outerText != null) outerText += $"{roundedFOV}°\n"; } text += "</size>"; if (outerText != null) outerText += "</size>"; Vector3[] vectors = DrawUtilities.GetBoxVectors(b); Vector2[] W2SVectors = DrawUtilities.GetRectangleLines(MainCamera, b, c); Vector3 LabelVector = DrawUtilities.Get2DW2SVector(MainCamera, W2SVectors, ll); if (MirrorCameraOptions.Enabled && W2SVectors.Any(v => MirrorCameraComponent.viewport.Contains(v))) { Highlighter highlighter = go.GetComponent<Highlighter>(); if (highlighter != null) highlighter.ConstantOffImmediate(); continue; } if (visual.Boxes) { if (visual.TwoDimensional) DrawUtilities.PrepareRectangleLines(W2SVectors, c); else { DrawUtilities.PrepareBoxLines(vectors, c); LabelVector = DrawUtilities.Get3DW2SVector(MainCamera, b, ll); } } if (visual.Glow) { Highlighter highlighter = go.GetComponent<Highlighter>() ?? go.AddComponent<Highlighter>(); //highlighter.OccluderOn(); //highlighter.SeeThroughOn(); highlighter.occluder = true; highlighter.overlay = true; highlighter.ConstantOnImmediate(c); Highlighters.Add(highlighter); } else { Highlighter highlighter = go.GetComponent<Highlighter>(); if (highlighter != null && highlighter != TrajectoryComponent.Highlighted) highlighter.ConstantOffImmediate(); } if (visual.Labels) DrawUtilities.DrawLabel(ESPFont, ll, LabelVector, text, visual.CustomTextColor ? ColorUtilities.getColor($"_{obj.Target}_Text") : c, ColorUtilities.getColor($"_{obj.Target}_Outline"), visual.BorderStrength, outerText); if (visual.LineToObject) ESPVariables.DrawBuffer2.Enqueue(new ESPBox2 { Color = c, Vertices = new[] { new Vector2(Screen.width / 2, Screen.height), new Vector2(cpos.x, Screen.height - cpos.y) } }); } GLMat.SetPass(0); GL.PushMatrix(); GL.LoadProjectionMatrix(MainCamera.projectionMatrix); GL.modelview = MainCamera.worldToCameraMatrix; GL.Begin(GL.LINES); for (int i = 0; i < ESPVariables.DrawBuffer.Count; i++) { ESPBox box = ESPVariables.DrawBuffer.Dequeue(); GL.Color(box.Color); Vector3[] vertices = box.Vertices; for (int j = 0; j < vertices.Length; j++) GL.Vertex(vertices[j]); } GL.End(); GL.PopMatrix(); GL.PushMatrix(); GL.Begin(GL.LINES); for (int i = 0; i < ESPVariables.DrawBuffer2.Count; i++) { ESPBox2 box = ESPVariables.DrawBuffer2.Dequeue(); GL.Color(box.Color); Vector2[] vertices = box.Vertices; bool Run = true; for (int j = 0; j < vertices.Length; j++) if (j < vertices.Length - 1) { Vector2 v1 = vertices[j]; Vector2 v2 = vertices[j + 1]; if (Vector2.Distance(v2, v1) > Screen.width / 2) { Run = false; break; } } if (!Run) continue; for (int j = 0; j < vertices.Length; j++) GL.Vertex3(vertices[j].x, vertices[j].y, 0); } GL.End(); GL.PopMatrix(); }