screenshots will take unique name

This commit is contained in:
minjaesong
2020-11-25 13:39:17 +09:00
parent 79114fcbd0
commit bed6f74462
4 changed files with 11 additions and 5 deletions

View File

@@ -557,11 +557,14 @@ public class AppLoader implements ApplicationListener {
try {
Pixmap p = ScreenUtils.getFrameBufferPixmap(0, 0, appConfig.width, appConfig.height);
PixmapIO2.writeTGA(Gdx.files.absolute(defaultDir + "/Screenshot.tga"), p, true);
PixmapIO2.writeTGA(Gdx.files.absolute(defaultDir+"/Screenshot-"+String.valueOf(System.currentTimeMillis())+".tga"), p, true);
p.dispose();
Terrarum.INSTANCE.getIngame().sendNotification("Screenshot taken");
}
catch (Throwable e) {
e.printStackTrace();
Terrarum.INSTANCE.getIngame().sendNotification("Failed to take screenshot: "+e.getMessage());
}
}