Do not render emotes if they get deactivated at runtime

This commit is contained in:
Infi
2024-05-12 13:40:37 +02:00
parent 8c88b0acf7
commit 638d462732
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Version>1.24.0</Version> <Version>1.24.1</Version>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
+1 -1
View File
@@ -202,7 +202,7 @@ internal class Message
AddContentAfterURLCheck(builder.ToString(), text, chunk); AddContentAfterURLCheck(builder.ToString(), text, chunk);
builder.Clear(); builder.Clear();
AddChunkWithMessage(new TextChunk(chunk.Source, EmotePayload.ResolveEmote(word), word)); AddChunkWithMessage(new TextChunk(chunk.Source, EmotePayload.ResolveEmote(word), word) { FallbackColour = text.FallbackColour });
builder.Append(' '); builder.Append(' ');
continue; continue;
} }
+2 -2
View File
@@ -1486,7 +1486,7 @@ public sealed class ChatLogWindow : Window
if (i < chunks.Count - 1) if (i < chunks.Count - 1)
ImGui.SameLine(); ImGui.SameLine();
else if (chunks[i].Link is EmotePayload) { else if (chunks[i].Link is EmotePayload && Plugin.Config.ShowEmotes) {
// Emote payloads seem to not automatically put newlines, which // Emote payloads seem to not automatically put newlines, which
// is an issue when modern mode is disabled. // is an issue when modern mode is disabled.
ImGui.SameLine(); ImGui.SameLine();
@@ -1521,7 +1521,7 @@ public sealed class ChatLogWindow : Window
if (chunk is not TextChunk text) if (chunk is not TextChunk text)
return; return;
if (chunk.Link is EmotePayload emotePayload) if (chunk.Link is EmotePayload emotePayload && Plugin.Config.ShowEmotes)
{ {
var emoteSize = ImGui.CalcTextSize("W"); var emoteSize = ImGui.CalcTextSize("W");
emoteSize = emoteSize with { Y = emoteSize.X } * 1.5f; emoteSize = emoteSize with { Y = emoteSize.X } * 1.5f;