screenshot: Fix BA high gamble toggle

Because both level up dialogs and BA high gambles use the same widget
interface, commit 40f032bede caused BA
high gambles and some level up dialogs to trigger screenshots if either
config was enabled in the config, as that would set a flag to capture a
screenshot on the next game tick based on the widget text. This commit
adds config checks to the DIALOG_SPRITE_TEXT branch to ensure the
appropriate config flag must be set for a screenshot to be captured.
This commit is contained in:
Jordan Atwood
2020-08-14 17:32:02 -07:00
committed by Adam
parent 5316b49d16
commit d1a765091a
2 changed files with 51 additions and 5 deletions

View File

@@ -242,13 +242,19 @@ public class ScreenshotPlugin extends Plugin
String text = client.getWidget(WidgetInfo.DIALOG_SPRITE_TEXT).getText();
if (Text.removeTags(text).contains("High level gamble"))
{
fileName = parseBAHighGambleWidget(text);
screenshotSubDir = "BA High Gambles";
if (config.screenshotHighGamble())
{
fileName = parseBAHighGambleWidget(text);
screenshotSubDir = "BA High Gambles";
}
}
else
{
fileName = parseLevelUpWidget(WidgetInfo.DIALOG_SPRITE_TEXT);
screenshotSubDir = "Levels";
if (config.screenshotLevels())
{
fileName = parseLevelUpWidget(WidgetInfo.DIALOG_SPRITE_TEXT);
screenshotSubDir = "Levels";
}
}
}
else if (client.getWidget(WidgetInfo.QUEST_COMPLETED_NAME_TEXT) != null)