mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 06:22:17 -08:00
Dont add duplicates to history (console and chat) (#10710)
* Dont add duplicates to history * redundant parenthesis removal
This commit is contained in:
parent
4e2215151f
commit
d6c2ec85f7
2 changed files with 2 additions and 2 deletions
|
|
@ -201,7 +201,7 @@ public class ChatFragment extends Table{
|
|||
//avoid sending prefix-empty messages
|
||||
if(message.isEmpty() || (message.startsWith(mode.prefix) && message.substring(mode.prefix.length()).isEmpty())) return;
|
||||
|
||||
history.insert(1, message);
|
||||
if(history.size < 2 || !history.get(1).equals(message)) history.insert(1, message);
|
||||
|
||||
message = UI.formatIcons(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ public class ConsoleFragment extends Table{
|
|||
return;
|
||||
}
|
||||
|
||||
history.insert(1, message);
|
||||
if(history.size < 2 || !history.get(1).equals(message)) history.insert(1, message);
|
||||
|
||||
addMessage("[lightgray]> " + message.replace("[", "[["));
|
||||
addMessage(mods.getScripts().runConsole(injectConsoleVariables() + message).replace("[", "[["));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue