hiscore panel: fix lookup to run on edt

It modifies various fields in the ui and should be running on edt.
Additionally add a clear listener to reset the search state when the
input is cleared.

This requires changing the hiscore client to be async so that the
response can be properly applied on the edt
This commit is contained in:
Adam
2020-08-22 13:36:45 -04:00
parent a89202e230
commit c9859f36b6
3 changed files with 109 additions and 65 deletions

View File

@@ -24,7 +24,6 @@
*/
package net.runelite.client.plugins.hiscore;
import java.util.concurrent.ScheduledExecutorService;
import static net.runelite.client.plugins.hiscore.HiscorePanel.formatLevel;
import okhttp3.OkHttpClient;
import static org.junit.Assert.assertEquals;
@@ -36,7 +35,7 @@ public class HiscorePanelTest
@Test
public void testConstructor()
{
new HiscorePanel(mock(ScheduledExecutorService.class), null, mock(HiscoreConfig.class), mock(NameAutocompleter.class), mock(OkHttpClient.class));
new HiscorePanel(null, mock(HiscoreConfig.class), mock(NameAutocompleter.class), mock(OkHttpClient.class));
}
@Test