public void GetPOIColorAndFontInformation(out Color poiColor, out Color fontColor, out string font) { poiColor = Color.White; fontColor = Color.White; font = "White"; switch (this.POIType) { case EnergySignatureType.Group: bool flag = true; EnergySignatureType pointOfInterestType = EnergySignatureType.Single; if (this.m_group.Count > 0) { this.m_group[0].GetPOIColorAndFontInformation(out poiColor, out fontColor, out font); pointOfInterestType = this.m_group[0].POIType; } for (int index = 1; index < this.m_group.Count; ++index) { if (this.m_group[index].POIType != pointOfInterestType) { flag = false; break; } } if (flag) { break; } this.GetColorAndFontForRelationship(this.GetGroupRelation(), out poiColor, out fontColor, out font); break; default: this.GetColorAndFontForRelationship(this.Relationship, out poiColor, out fontColor, out font); break; } }
public void SetState(Vector3D position, EnergySignatureType type, MyRelationsBetweenPlayerAndBlock relationship) { this.WorldPosition = position; this.POIType = type; this.Relationship = relationship; this.Distance = (position - this.GetDistanceMeasuringMatrix().Translation).Length(); this.DistanceToCam = (this.WorldPosition - MyAPIGateway.Session.Camera.WorldMatrix.Translation).Length(); }
private static void DrawIcon( MyHudMarkerRender renderer, EnergySignatureType poiType, MyRelationsBetweenPlayerAndBlock relationship, Vector2 screenPosition, Color markerColor, float sizeScale = 1f) { string empty = string.Empty; Vector2 vector2_1 = new Vector2(12f, 12f); string texture; switch (poiType) { case EnergySignatureType.Single: string iconForRelationship = EnergySignature.GetIconForRelationship(relationship); EnergySignature.DrawIcon(renderer, iconForRelationship, screenPosition, markerColor, sizeScale); return; case EnergySignatureType.Group: return; default: return; } if (!string.IsNullOrWhiteSpace(empty)) { Vector2 vector2_2 = vector2_1 * sizeScale; renderer.AddTexturedQuad(empty, screenPosition, -Vector2.UnitY, markerColor, vector2_2.X, vector2_2.Y); } else { float num = 0.0053336f * sizeScale; renderer.AddTexturedQuad(texture, screenPosition, -Vector2.UnitY, markerColor, num, num); } }