Versatile Java game engine with pluggable backends (this was used in Rogue, I think)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gamecore/src/mightypork/gamecore/core/plugins/screenshot/InitTaskPluginScreenshot.java

78 lines
1.2 KiB

10 years ago
package mightypork.gamecore.core.plugins.screenshot;
import mightypork.gamecore.core.init.InitTask;
10 years ago
import mightypork.gamecore.core.plugins.AppPlugin;
import mightypork.utils.files.WorkDir;
10 years ago
/**
* Register screenshot plugin to the App.
*
10 years ago
* @author Ondřej Hruška (MightyPork)
*/
public class InitTaskPluginScreenshot extends InitTask {
10 years ago
private String screenshotDir;
10 years ago
/**
* Initialize to use the "screenshots" directory
*/
public InitTaskPluginScreenshot()
{
10 years ago
this("screenshots");
}
10 years ago
/**
* Initialize to use the given directory for saving.
*
10 years ago
* @param dir screenshot dir (relative to workdir)
*/
public InitTaskPluginScreenshot(String dir)
{
10 years ago
this.screenshotDir = dir;
}
10 years ago
/**
* Set screenshot directory
*
10 years ago
* @param dir screenshot dir (relative to workdir)
*/
public void setScreenshotDir(String dir)
{
this.screenshotDir = dir;
}
10 years ago
@Override
public void run()
{
WorkDir.addPath("_screenshot_dir", screenshotDir);
10 years ago
app.addPlugin(getPluginImpl());
}
10 years ago
protected AppPlugin getPluginImpl()
{
return new ScreenshotPlugin();
10 years ago
}
10 years ago
@Override
public String getName()
{
return "plugin_screenshot";
}
10 years ago
@Override
public String[] getDependencies()
{
return new String[] { "workdir" };
}
10 years ago
}