clan chat: fix code style
This commit is contained in:
@@ -24,44 +24,45 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.clanchat;
|
package net.runelite.client.plugins.clanchat;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import net.runelite.api.GameState;
|
import net.runelite.api.GameState;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
|
||||||
import java.util.concurrent.ScheduledFuture;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
public class ClanChat extends Plugin
|
public class ClanChat extends Plugin
|
||||||
{
|
{
|
||||||
|
|
||||||
private final long INTERVAL = 600;
|
private final long INTERVAL = 600;
|
||||||
private ScheduledFuture<?> future;
|
private ScheduledFuture<?> future;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
ScheduledExecutorService executor = RuneLite.getRunelite().getExecutor();
|
ScheduledExecutorService executor = RuneLite.getRunelite().getExecutor();
|
||||||
future = executor.scheduleAtFixedRate(this::updateClanChatTitle, INTERVAL, INTERVAL, TimeUnit.MILLISECONDS);
|
future = executor.scheduleAtFixedRate(this::updateClanChatTitle, INTERVAL, INTERVAL, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void shutDown() throws Exception
|
protected void shutDown() throws Exception
|
||||||
{
|
{
|
||||||
future.cancel(true);
|
future.cancel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateClanChatTitle()
|
private void updateClanChatTitle()
|
||||||
{
|
{
|
||||||
if (RuneLite.getClient().getGameState() != GameState.LOGGED_IN)
|
if (RuneLite.getClient().getGameState() != GameState.LOGGED_IN)
|
||||||
return;
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Widget clanChatTitleWidget = RuneLite.getClient().getWidget(WidgetInfo.CLAN_CHAT_TITLE);
|
Widget clanChatTitleWidget = RuneLite.getClient().getWidget(WidgetInfo.CLAN_CHAT_TITLE);
|
||||||
if (clanChatTitleWidget != null)
|
if (clanChatTitleWidget != null)
|
||||||
{
|
{
|
||||||
clanChatTitleWidget.setText("Clan Chat (" + RuneLite.getClient().getClanChatCount() + "/100)");
|
clanChatTitleWidget.setText("Clan Chat (" + RuneLite.getClient().getClanChatCount() + "/100)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user