From bc3f3dc298bb895cb28cbd8a2ec90b1b3d9fc740 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 27 Feb 2019 22:34:24 +0100 Subject: [PATCH] End file browser --- Sources/arm/Project.hx | 12 +++++++++--- Sources/arm/UITrait.hx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Sources/arm/Project.hx b/Sources/arm/Project.hx index 696864b0..cab38a28 100644 --- a/Sources/arm/Project.hx +++ b/Sources/arm/Project.hx @@ -16,7 +16,13 @@ class Project { UITrait.inst.showMessage("Error: .arm file expected"); return; } + + var current = @:privateAccess kha.graphics4.Graphics2.current; + if (current != null) current.end(); + importProject(path); + + if (current != null) current.begin(false); }; } @@ -108,8 +114,8 @@ class Project { iron.data.Data.deleteMesh(UITrait.inst.paintObject.data.handle); iron.data.Data.getMesh("mesh_" + n, n, function(md:MeshData) { - var hasCurrent = @:privateAccess kha.graphics4.Graphics2.current != null; - if (hasCurrent) UITrait.inst.ui.g.end(); + var current = @:privateAccess kha.graphics4.Graphics2.current; + if (current != null) current.end(); UITrait.inst.autoFillHandle.selected = false; UITrait.inst.paintObject.setData(md); @@ -141,7 +147,7 @@ class Project { UITrait.inst.assetId = 0; ViewportUtil.resetViewport(); - if (hasCurrent) UITrait.inst.ui.g.begin(false); + if (current != null) current.begin(false); }); } diff --git a/Sources/arm/UITrait.hx b/Sources/arm/UITrait.hx index da199c7c..8b2ff543 100644 --- a/Sources/arm/UITrait.hx +++ b/Sources/arm/UITrait.hx @@ -1793,7 +1793,7 @@ class UITrait extends iron.Trait { // Fill in last odd spot if (assets.length % 2 == 1) { var empty = bundled.get("empty.jpg"); - ui.image(empty); + ui.image(empty, 0x00000000); } } else {