Merge pull request #1674 from HypoxiaOSRS/HypoxiaOSRS-KINGDOM-SCREENSHOT
Screenshot Kingdom Rewards
This commit is contained in:
@@ -80,6 +80,7 @@ public class WidgetID
|
||||
public static final int RAIDS_REWARD_GROUP_ID = 539;
|
||||
public static final int EXPERIENCE_TRACKER_GROUP_ID = 122;
|
||||
public static final int TITHE_FARM_GROUP_ID = 241;
|
||||
public static final int KINGDOM_GROUP_ID = 392;
|
||||
|
||||
static class WorldMap
|
||||
{
|
||||
|
||||
@@ -90,11 +90,22 @@ public interface ScreenshotConfig extends Config
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "kingdom",
|
||||
name = "Screenshot Kingdom Reward",
|
||||
description = "Configures whether screenshots are taken of Kingdom Reward",
|
||||
position = 5
|
||||
)
|
||||
default boolean screenshotKingdom()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "uploadScreenshot",
|
||||
name = "Upload To Imgur",
|
||||
description = "Configures whether or not screenshots are uploaded to Imgur and copied into your clipboard",
|
||||
position = 5
|
||||
position = 6
|
||||
)
|
||||
default boolean uploadScreenshot()
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
@@ -57,7 +58,9 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import static net.runelite.api.widgets.WidgetID.BARROWS_REWARD_GROUP_ID;
|
||||
import static net.runelite.api.widgets.WidgetID.CLUE_SCROLL_REWARD_GROUP_ID;
|
||||
import static net.runelite.api.widgets.WidgetID.DIALOG_SPRITE_GROUP_ID;
|
||||
@@ -232,6 +235,20 @@ public class ScreenshotPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void loadWidgets(WidgetLoaded event)
|
||||
{
|
||||
if (!config.screenshotKingdom())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (event.getGroupId() == WidgetID.KINGDOM_GROUP_ID)
|
||||
{
|
||||
String fileName = "Kingdom " + LocalDate.now();
|
||||
takeScreenshot(fileName, config.displayDate());
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void hideWidgets(WidgetHiddenChanged event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user