discord: add main menu status option

This commit is contained in:
Dillon
2021-02-27 12:00:00 -05:00
committed by GitHub
parent 8535bfc0bf
commit 7054d83e16
2 changed files with 26 additions and 10 deletions

View File

@@ -72,11 +72,22 @@ public interface DiscordConfig extends Config
return 5; return 5;
} }
@ConfigItem(
keyName = "showMainMenu",
name = "Main Menu",
description = "Show status when in main menu",
position = 3
)
default boolean showMainMenu()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = "showSkillActivity", keyName = "showSkillActivity",
name = "Skilling", name = "Skilling",
description = "Show your activity while training skills", description = "Show your activity while training skills",
position = 3 position = 4
) )
default boolean showSkillingActivity() default boolean showSkillingActivity()
{ {
@@ -87,7 +98,7 @@ public interface DiscordConfig extends Config
keyName = "showBossActivity", keyName = "showBossActivity",
name = "Bosses", name = "Bosses",
description = "Show your activity and location while at bosses", description = "Show your activity and location while at bosses",
position = 4 position = 5
) )
default boolean showBossActivity() default boolean showBossActivity()
{ {
@@ -98,7 +109,7 @@ public interface DiscordConfig extends Config
keyName = "showCityActivity", keyName = "showCityActivity",
name = "Cities", name = "Cities",
description = "Show your activity and location while in cities", description = "Show your activity and location while in cities",
position = 5 position = 6
) )
default boolean showCityActivity() default boolean showCityActivity()
{ {
@@ -109,7 +120,7 @@ public interface DiscordConfig extends Config
keyName = "showDungeonActivity", keyName = "showDungeonActivity",
name = "Dungeons", name = "Dungeons",
description = "Show your activity and location while in dungeons", description = "Show your activity and location while in dungeons",
position = 6 position = 7
) )
default boolean showDungeonActivity() default boolean showDungeonActivity()
{ {
@@ -120,7 +131,7 @@ public interface DiscordConfig extends Config
keyName = "showMinigameActivity", keyName = "showMinigameActivity",
name = "Minigames", name = "Minigames",
description = "Show your activity and location while in minigames", description = "Show your activity and location while in minigames",
position = 7 position = 8
) )
default boolean showMinigameActivity() default boolean showMinigameActivity()
{ {
@@ -131,7 +142,7 @@ public interface DiscordConfig extends Config
keyName = "showRaidingActivity", keyName = "showRaidingActivity",
name = "Raids", name = "Raids",
description = "Show your activity and location while in Raids", description = "Show your activity and location while in Raids",
position = 8 position = 9
) )
default boolean showRaidingActivity() default boolean showRaidingActivity()
{ {
@@ -142,7 +153,7 @@ public interface DiscordConfig extends Config
keyName = "showRegionsActivity", keyName = "showRegionsActivity",
name = "Regions", name = "Regions",
description = "Show your activity and location while in other regions", description = "Show your activity and location while in other regions",
position = 9 position = 10
) )
default boolean showRegionsActivity() default boolean showRegionsActivity()
{ {

View File

@@ -358,9 +358,14 @@ public class DiscordPlugin extends Plugin
private void checkForGameStateUpdate() private void checkForGameStateUpdate()
{ {
discordState.triggerEvent(client.getGameState() == GameState.LOGGED_IN final boolean isLoggedIn = client.getGameState() == GameState.LOGGED_IN;
? DiscordGameEventType.IN_GAME
: DiscordGameEventType.IN_MENU); if (config.showMainMenu() || isLoggedIn)
{
discordState.triggerEvent(isLoggedIn
? DiscordGameEventType.IN_GAME
: DiscordGameEventType.IN_MENU);
}
} }
private void checkForAreaUpdate() private void checkForAreaUpdate()