Add option to disable time elapsed on discord activity (#5590)

Closes #5282
This commit is contained in:
Mike
2018-09-24 10:55:54 +01:00
committed by Tomas Slusny
parent c8ab330a34
commit cc89cc74c6
3 changed files with 21 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ public class DiscordPresence
private Instant startTimestamp; private Instant startTimestamp;
/** /**
* Unix timestamp (seconds) for the start of the game. * Unix timestamp (seconds) for the end of the game.
*/ */
private Instant endTimestamp; private Instant endTimestamp;

View File

@@ -42,11 +42,22 @@ public interface DiscordConfig extends Config
return 5; return 5;
} }
@ConfigItem(
keyName = "hideElapsedTime",
name = "Hide elapsed time",
description = "Configures if the elapsed time of your activity should be hidden.",
position = 2
)
default boolean hideElapsedTime()
{
return false;
}
@ConfigItem( @ConfigItem(
keyName = "showSkillActivity", keyName = "showSkillActivity",
name = "Show activity while skilling", name = "Show activity while skilling",
description = "Configures if your activity while training skills should be shown.", description = "Configures if your activity while training skills should be shown.",
position = 2 position = 3
) )
default boolean showSkillingActivity() default boolean showSkillingActivity()
{ {
@@ -57,7 +68,7 @@ public interface DiscordConfig extends Config
keyName = "showBossActivity", keyName = "showBossActivity",
name = "Show activity at bosses", name = "Show activity at bosses",
description = "Configures if your activity at bosses should be shown.", description = "Configures if your activity at bosses should be shown.",
position = 3 position = 4
) )
default boolean showBossActivity() default boolean showBossActivity()
{ {
@@ -68,7 +79,7 @@ public interface DiscordConfig extends Config
keyName = "showCityActivity", keyName = "showCityActivity",
name = "Show activity at cities", name = "Show activity at cities",
description = "Configures if your activity at cities should be shown.", description = "Configures if your activity at cities should be shown.",
position = 4 position = 5
) )
default boolean showCityActivity() default boolean showCityActivity()
{ {
@@ -79,7 +90,7 @@ public interface DiscordConfig extends Config
keyName = "showDungeonActivity", keyName = "showDungeonActivity",
name = "Show activity at dungeons", name = "Show activity at dungeons",
description = "Configures if your activity at dungeons should be shown.", description = "Configures if your activity at dungeons should be shown.",
position = 5 position = 6
) )
default boolean showDungeonActivity() default boolean showDungeonActivity()
{ {
@@ -90,7 +101,7 @@ public interface DiscordConfig extends Config
keyName = "showMinigameActivity", keyName = "showMinigameActivity",
name = "Show activity at minigames", name = "Show activity at minigames",
description = "Configures if your activity at minigames should be shown.", description = "Configures if your activity at minigames should be shown.",
position = 6 position = 7
) )
default boolean showMinigameActivity() default boolean showMinigameActivity()
{ {

View File

@@ -87,7 +87,10 @@ class DiscordState
} }
else else
{ {
event = new EventWithTime(eventType, Instant.now()); // If we aren't showing the elapsed time within Discord then
// We null out the event start property
event = new EventWithTime(eventType, config.hideElapsedTime() ? null : Instant.now());
events.add(event); events.add(event);
} }