Skip to content

Commit

Permalink
Update XNAControls to latest version. Set MaxWidth on chat text box s…
Browse files Browse the repository at this point in the history
…o long message don't extend beyoned the edge of the UI
  • Loading branch information
ethanmoffat committed Sep 20, 2022
1 parent 227bb8d commit 4d8e64c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion EndlessClient/EndlessClient.csproj
Expand Up @@ -61,6 +61,6 @@
<PackageReference Include="Monogame.Content.Builder.Task" Version="3.8.0.1641" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
<PackageReference Include="XNAControls" Version="1.5.0" />
<PackageReference Include="XNAControls" Version="1.6.0" />
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions EndlessClient/UIControls/ChatTextBox.cs
Expand Up @@ -26,6 +26,15 @@ public ChatTextBox(IContentProvider contentManagerProvider)
_endMuteTime = Option.None<DateTime>();
}

public override void Initialize()
{
base.Initialize();

// This must be done after Initialize because MaxWidth uses the sprite font.
// SpriteFont is loaded in LoadContent which is called by Initialize.
MaxWidth = 440;
}

public void SetMuted(DateTime endMuteTime)
{
_ignoreAllInput = true;
Expand Down

0 comments on commit 4d8e64c

Please sign in to comment.