ba plugin: cleanup and remove unused code
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Font;
|
||||
import java.awt.Image;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
@@ -47,7 +47,6 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
|
||||
@@ -62,7 +61,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
private static final String START_WAVE = "1";
|
||||
private static final String ENDGAME_REWARD_NEEDLE_TEXT = "<br>5";
|
||||
|
||||
private Font font;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Image clockImage;
|
||||
private int inGameBit = 0;
|
||||
private String currentWave = START_WAVE;
|
||||
@@ -100,8 +99,6 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
{
|
||||
overlayManager.add(timerOverlay);
|
||||
overlayManager.add(healerOverlay);
|
||||
font = FontManager.getRunescapeFont()
|
||||
.deriveFont(Font.BOLD, 24);
|
||||
|
||||
clockImage = ImageUtil.getResourceStreamFromClass(getClass(), "clock.png");
|
||||
}
|
||||
@@ -114,6 +111,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
gameTime = null;
|
||||
currentWave = START_WAVE;
|
||||
inGameBit = 0;
|
||||
clockImage = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -195,9 +193,9 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
announceTime("Wave " + currentWave + " duration: ", gameTime.getTime(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inGameBit = inGame;
|
||||
inGameBit = inGame;
|
||||
}
|
||||
}
|
||||
|
||||
private void setRound(Role role)
|
||||
@@ -225,14 +223,4 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
.runeLiteFormattedMessage(chatMessage)
|
||||
.build());
|
||||
}
|
||||
|
||||
public Font getFont()
|
||||
{
|
||||
return font;
|
||||
}
|
||||
|
||||
public Image getClockImage()
|
||||
{
|
||||
return clockImage;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,11 +87,6 @@ class HealerOverlay extends Overlay
|
||||
}
|
||||
|
||||
Role role = round.getRoundRole();
|
||||
if (role == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (config.showHealerBars() && role == Role.HEALER)
|
||||
{
|
||||
for (HealerTeam teammate : HealerTeam.values())
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.barbarianassault;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
enum Role
|
||||
{
|
||||
ATTACKER(WidgetInfo.BA_ATK_LISTEN_TEXT, WidgetInfo.BA_ATK_CALL_TEXT, WidgetInfo.BA_ATK_ROLE_TEXT, WidgetInfo.BA_ATK_ROLE_SPRITE),
|
||||
@@ -34,23 +37,11 @@ enum Role
|
||||
COLLECTOR(WidgetInfo.BA_COLL_LISTEN_TEXT, WidgetInfo.BA_COLL_CALL_TEXT, WidgetInfo.BA_COLL_ROLE_TEXT, WidgetInfo.BA_COLL_ROLE_SPRITE),
|
||||
HEALER(WidgetInfo.BA_HEAL_LISTEN_TEXT, WidgetInfo.BA_HEAL_CALL_TEXT, WidgetInfo.BA_HEAL_ROLE_TEXT, WidgetInfo.BA_HEAL_ROLE_SPRITE);
|
||||
|
||||
@Getter
|
||||
private final WidgetInfo listen;
|
||||
@Getter
|
||||
private final WidgetInfo call;
|
||||
@Getter
|
||||
private final WidgetInfo roleText;
|
||||
@Getter
|
||||
private final WidgetInfo roleSprite;
|
||||
|
||||
Role(WidgetInfo listen, WidgetInfo call, WidgetInfo role, WidgetInfo roleSprite)
|
||||
{
|
||||
this.listen = listen;
|
||||
this.call = call;
|
||||
this.roleText = role;
|
||||
this.roleSprite = roleSprite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import javax.inject.Inject;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import static net.runelite.client.util.RSTimeUnit.GAME_TICKS;
|
||||
|
||||
@@ -50,19 +51,14 @@ class Round
|
||||
private boolean fightersKilled;
|
||||
|
||||
@Inject
|
||||
public Round(Role role)
|
||||
public Round(@NonNull Role role)
|
||||
{
|
||||
this.roundRole = role;
|
||||
this.roundStartTime = Instant.now().plus(Duration.of(2, GAME_TICKS));
|
||||
}
|
||||
|
||||
public long getRoundTime()
|
||||
public int getTimeToChange()
|
||||
{
|
||||
return Duration.between(roundStartTime, Instant.now()).getSeconds();
|
||||
}
|
||||
|
||||
public long getTimeToChange()
|
||||
{
|
||||
return 30 + (Duration.between(Instant.now(), roundStartTime).getSeconds() % 30);
|
||||
return 30 + ((int) Duration.between(Instant.now(), roundStartTime).getSeconds() % 30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,11 +65,6 @@ class TimerOverlay extends Overlay
|
||||
}
|
||||
|
||||
Role role = round.getRoundRole();
|
||||
if (role == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Widget roleText = client.getWidget(role.getRoleText());
|
||||
Widget roleSprite = client.getWidget(role.getRoleSprite());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user