Skip to content

Commit

Permalink
v1.8.1.3
Browse files Browse the repository at this point in the history
* Fixed minimap spillover bug
  • Loading branch information
hamstar0 committed Dec 19, 2018
1 parent 0c084c5 commit c6c5411
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
36 changes: 20 additions & 16 deletions WormholesUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ public void DrawMiniMap( WormholeLink link, SpriteBatch sb ) {
Rectangle l_rect = new Rectangle( (int)link.LeftPortal.Pos.X, (int)link.LeftPortal.Pos.Y, tex.Width, tex.Height );
Rectangle r_rect = new Rectangle( (int)link.RightPortal.Pos.X, (int)link.RightPortal.Pos.Y, tex.Width, tex.Height );

Vector2? l_pos = HudMapHelpers.GetMiniMapScreenPosition( l_rect ).Item1;
if( l_pos != null ) {
var l_pos_data = HudMapHelpers.GetMiniMapScreenPosition( l_rect );
if( l_pos_data.Item2 ) {
Color l_color = link.LeftPortal.BaseColor * Main.mapMinimapAlpha;
sb.Draw( tex, (Vector2)l_pos, this.TexAnim.Frame, l_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
sb.Draw( tex, l_pos_data.Item1, this.TexAnim.Frame, l_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
}

Vector2? r_pos = HudMapHelpers.GetMiniMapScreenPosition( r_rect ).Item1;
if( r_pos != null ) {
var r_pos_data = HudMapHelpers.GetMiniMapScreenPosition( r_rect );
if( r_pos_data.Item2 ) {
Color r_color = link.RightPortal.BaseColor * Main.mapMinimapAlpha;
sb.Draw( tex, (Vector2)r_pos, this.TexAnim.Frame, r_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
sb.Draw( tex, r_pos_data.Item1, this.TexAnim.Frame, r_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
}
}

Expand All @@ -73,16 +73,16 @@ public void DrawOverlayMap( WormholeLink link, SpriteBatch sb ) {
Rectangle l_rect = new Rectangle( (int)link.LeftPortal.Pos.X, (int)link.LeftPortal.Pos.Y, tex.Width, tex.Height );
Rectangle r_rect = new Rectangle( (int)link.RightPortal.Pos.X, (int)link.RightPortal.Pos.Y, tex.Width, tex.Height );

Vector2? l_pos = HudMapHelpers.GetOverlayMapScreenPosition( l_rect ).Item1;
if( l_pos != null ) {
var l_pos_data = HudMapHelpers.GetOverlayMapScreenPosition( l_rect );
if( l_pos_data.Item2 ) {
Color l_color = link.LeftPortal.BaseColor * Main.mapOverlayAlpha;
sb.Draw( tex, (Vector2)l_pos, this.TexAnim.Frame, l_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
sb.Draw( tex, (Vector2)l_pos_data.Item1, this.TexAnim.Frame, l_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
}

Vector2? r_pos = HudMapHelpers.GetOverlayMapScreenPosition( r_rect ).Item1;
if( r_pos != null ) {
var r_pos_data = HudMapHelpers.GetOverlayMapScreenPosition( r_rect );
if( r_pos_data.Item2 ) {
Color r_color = link.RightPortal.BaseColor * Main.mapOverlayAlpha;
sb.Draw( tex, (Vector2)r_pos, this.TexAnim.Frame, r_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
sb.Draw( tex, r_pos_data.Item1, this.TexAnim.Frame, r_color, 0f, new Vector2(), scale, SpriteEffects.None, 1f );
}
}

Expand All @@ -94,12 +94,16 @@ public void DrawFullscreenMap( WormholeLink link, SpriteBatch sb ) {
Texture2D tex = WormholesUI.Tex;

Rectangle l_rect = new Rectangle( (int)link.LeftPortal.Pos.X, (int)link.LeftPortal.Pos.Y, tex.Width, tex.Height );
Vector2 l_pos = HudMapHelpers.GetFullMapScreenPosition( l_rect ).Item1;
sb.Draw( tex, l_pos, this.TexAnim.Frame, link.LeftPortal.BaseColor, 0f, new Vector2 { }, scale, SpriteEffects.None, 1f );
var l_pos_data = HudMapHelpers.GetFullMapScreenPosition( l_rect );
if( l_pos_data.Item2 ) {
sb.Draw( tex, l_pos_data.Item1, this.TexAnim.Frame, link.LeftPortal.BaseColor, 0f, new Vector2 { }, scale, SpriteEffects.None, 1f );
}

Rectangle r_rect = new Rectangle( (int)link.RightPortal.Pos.X, (int)link.RightPortal.Pos.Y, tex.Width, tex.Height );
Vector2 r_pos = HudMapHelpers.GetFullMapScreenPosition( r_rect ).Item1;
sb.Draw( tex, r_pos, this.TexAnim.Frame, link.RightPortal.BaseColor, 0f, new Vector2 { }, scale, SpriteEffects.None, 1f );
var r_pos_data = HudMapHelpers.GetFullMapScreenPosition( r_rect );
if( r_pos_data.Item2 ) {
sb.Draw( tex, r_pos_data.Item1, this.TexAnim.Frame, link.RightPortal.BaseColor, 0f, new Vector2 { }, scale, SpriteEffects.None, 1f );
}
}
}
}
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = hamstar
version = 1.8.1.2
version = 1.8.1.3
displayName = Wormholes
modReferences = HamstarHelpers@4.0.0
buildIgnore = *.csproj, *.user, *.bat, obj\*, bin\*, .vs\*, .git\*
Expand Down

0 comments on commit c6c5411

Please sign in to comment.