mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Added subfolders option
This allows for much greater flexibility of screenshotting, we can now pass in any number of levels of subfolders for our preferred directory depth for storing images.
This commit is contained in:
parent
4a5085380e
commit
6d2d8ad36d
2 changed files with 10 additions and 4 deletions
|
|
@ -273,10 +273,10 @@ public class API {
|
|||
Cheat.sendCheatPacket(JagString.of(command));
|
||||
}
|
||||
|
||||
public static void Screenshot() {
|
||||
public static void Screenshot(String... subfolders) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd-HH_mm_ss");
|
||||
String dateTime = dateFormat.format(new Date());
|
||||
client.instance.saveScreenshot(PlayerList.self.username.toString() + "_" + dateTime + ".png");
|
||||
client.instance.saveScreenshot(PlayerList.self.username.toString() + "_" + dateTime + ".png", subfolders);
|
||||
}
|
||||
|
||||
public static void PlaySound(int volume, int trackId, int delay) {
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ public final class client extends GameShell {
|
|||
arg0.pdata(local15, 24);
|
||||
}
|
||||
|
||||
public void saveScreenshot(String filename) {
|
||||
public void saveScreenshot(String filename, String... subfolders) {
|
||||
String homeDirOverride = System.getProperty("clientHomeOverride");
|
||||
String homeDir = null;
|
||||
String osNameRaw = "";
|
||||
|
|
@ -525,7 +525,13 @@ public final class client extends GameShell {
|
|||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
File outputFolder = new File(homeDir + File.separatorChar + "screenshots" + File.separatorChar);
|
||||
|
||||
String subfolderPath = String.join(File.separator, subfolders);
|
||||
if (!subfolderPath.isEmpty()) {
|
||||
subfolderPath += File.separator;
|
||||
}
|
||||
|
||||
File outputFolder = new File(homeDir + File.separatorChar + "screenshots" + File.separatorChar + subfolderPath);
|
||||
if (!outputFolder.exists()){
|
||||
outputFolder.mkdirs();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue