Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/mindurka/ui/OCustomRulesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class OCustomRulesDialog extends CustomRulesDialog {
private RevealedContentDialog<Block> revealedBlocks = new RevealedContentDialog<>("@revealedblocks", ContentType.block, b -> !b.name.startsWith("tmp-"));
private BannedContentDialog<UnitType> bannedUnits = new BannedContentDialog<>("@bannedunits", ContentType.unit, u -> true);
private EnvDialog envDialog = new EnvDialog();
private PlanetBackgroundDialog backgroundDialog = new PlanetBackgroundDialog();
private Table main;
private RulesWrite writeRoot;

Expand Down Expand Up @@ -181,6 +182,7 @@ void build() {

write.button("rules.env", () -> envDialog.show());
write.button("rules.weather", () -> Reflect.invoke(CustomRulesDialog.class, this, "weatherDialog", Util.noargs));
write.button("rules.planetbackground", () -> backgroundDialog.show());

write = writeRoot.category("planet");
write.selection("rules.title.planet", addItem -> {
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/mindurka/ui/OEditorDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,15 @@ private void buildMenu() {
"@editor.importimage", "@editor.importimage.description", Icon.fileImage, (Runnable)() ->
Vars.platform.showFileChooser(true, "png", file ->
Vars.ui.loadAnd(() -> {
Pixmap pixmap = null;
try{
Pixmap pixmap = new Pixmap(file);
pixmap = new Pixmap(file);
editor.OBeginEdit(pixmap);
pixmap.dispose();
}catch(Exception e){
Vars.ui.showException("@editor.errorload", e);
Log.err(e);
}finally{
if(pixmap != null) pixmap.dispose();
}
})))
);
Expand Down
Loading
Loading