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