Skip to content

Commit

Permalink
NPC chat bubbles no longer persist between maps or when NPC is out of…
Browse files Browse the repository at this point in the history
… view.
  • Loading branch information
ethanmoffat committed Sep 8, 2022
1 parent 0b7730d commit 03d5ac7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions EndlessClient/Rendering/Chat/ChatBubble.cs
Expand Up @@ -163,6 +163,9 @@ protected override void Dispose(bool disposing)
{
if (disposing)
{
if (Game.Components != null && Game.Components.Contains(this))
Game.Components.Remove(this);

_textLabel.Dispose();
}
}
Expand Down
3 changes: 1 addition & 2 deletions EndlessClient/Rendering/Map/MapRenderer.cs
Expand Up @@ -176,8 +176,7 @@ public void RenderEffect(byte x, byte y, short effectId)
public void ClearTransientRenderables()
{
_mapGridEffectTargets.Clear();
// todo: clear NPC speech bubbles
// todo: hide map item/character/npc name
_mouseCursorRenderer.ClearTransientRenderables();
}

private void UpdateQuakeState()
Expand Down
8 changes: 8 additions & 0 deletions EndlessClient/Rendering/MouseCursorRenderer.cs
Expand Up @@ -346,6 +346,12 @@ public void AnimateClick()
_clickCoordinate = Option.Some(new MapCoordinate(_gridX, _gridY));
}

public void ClearTransientRenderables()
{
_mapItemText.Visible = false;
_startClickTime = Option.None<DateTime>();
}

protected override void Dispose(bool disposing)
{
if (disposing)
Expand All @@ -363,5 +369,7 @@ public interface IMouseCursorRenderer : IXNAControl, IDisposable
void Draw(SpriteBatch spriteBatch, Vector2 additionalOffset);

void AnimateClick();

void ClearTransientRenderables();
}
}
1 change: 1 addition & 0 deletions EndlessClient/Rendering/NPC/NPCRenderer.cs
Expand Up @@ -336,6 +336,7 @@ protected override void Dispose(bool disposing)
if (disposing)
{
_nameLabel.Dispose();
_chatBubble?.Dispose();
}

base.Dispose(disposing);
Expand Down

0 comments on commit 03d5ac7

Please sign in to comment.