Enforce map image import sizes

This commit is contained in:
Anuken
2025-11-30 12:10:09 -05:00
parent 3791a7f375
commit 8b9fc34811

View File

@@ -108,6 +108,10 @@ public class MapEditorDialog extends Dialog implements Disposable{
ui.loadAnd(() -> {
try{
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);
pixmap.dispose();
}catch(Exception e){