Fix issue #5149: Make chat window not autoscroll
It will autoscroll unless the chat window is open and the scroll position is not at the bottom.
This commit is contained in:
@@ -91,7 +91,7 @@ namespace OpenRA.Widgets
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// This takes advantage of the fact that recentLines is ordered by expiration, from sooner to later
|
// This takes advantage of the fact that recentLines is ordered by expiration, from sooner to later
|
||||||
while (recentLines.Count > 0 && totalTicks >= recentLines [0].Expiration)
|
while (recentLines.Count > 0 && totalTicks >= recentLines[0].Expiration)
|
||||||
recentLines.RemoveAt(0);
|
recentLines.RemoveAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,8 +146,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
template.Bounds.Height += dh;
|
template.Bounds.Height += dh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool scrolledToBottom = chatScrollPanel.ScrolledToBottom;
|
||||||
chatScrollPanel.AddChild(template);
|
chatScrollPanel.AddChild(template);
|
||||||
chatScrollPanel.ScrollToBottom();
|
if (scrolledToBottom)
|
||||||
|
chatScrollPanel.ScrollToBottom();
|
||||||
|
|
||||||
Sound.PlayNotification(null, "Sounds", "ChatLine", null);
|
Sound.PlayNotification(null, "Sounds", "ChatLine", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user