Enforce map image import sizes
This commit is contained in:
@@ -108,6 +108,10 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
try{
|
try{
|
||||||
Pixmap pixmap = new Pixmap(file);
|
Pixmap pixmap = new Pixmap(file);
|
||||||
|
//if you want to bypass the limit, use mods or the console; larger maps are not supported
|
||||||
|
if(pixmap.width > MapResizeDialog.maxSize || pixmap.height > MapResizeDialog.maxSize){
|
||||||
|
throw new Exception("Image is too large (maximum size is " + MapResizeDialog.maxSize + "x" + MapResizeDialog.maxSize + ")");
|
||||||
|
}
|
||||||
editor.beginEdit(pixmap);
|
editor.beginEdit(pixmap);
|
||||||
pixmap.dispose();
|
pixmap.dispose();
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
Reference in New Issue
Block a user