diff --git a/Libraries/zui b/Libraries/zui index dfe5c129..fcea0860 160000 --- a/Libraries/zui +++ b/Libraries/zui @@ -1 +1 @@ -Subproject commit dfe5c129b5303b126260f7250c748a24700e0492 +Subproject commit fcea0860acfb3bacbd5867ae57a500d01defd122 diff --git a/Sources/arm/App.hx b/Sources/arm/App.hx index 436d45b9..02c224c6 100644 --- a/Sources/arm/App.hx +++ b/Sources/arm/App.hx @@ -74,6 +74,7 @@ class App extends iron.Trait { zui.Ext.dataPath = iron.data.Data.dataPath; kha.System.notifyOnDropFiles(function(filePath:String) { + if (!checkAscii(filePath)) return; dropPath = filePath; dropPath = StringTools.replace(dropPath, "%20", " "); // Linux can pass %20 on drop dropPath = dropPath.split("file://")[0]; // Multiple files dropped on Linux, take first @@ -275,16 +276,17 @@ class App extends iron.Trait { redrawUI(); } - public static function redrawUI(draws = 2) { - UITrait.inst.hwnd.redraws = draws; - UITrait.inst.hwnd1.redraws = draws; - UITrait.inst.hwnd2.redraws = draws; - UITrait.inst.headerHandle.redraws = draws; - UITrait.inst.toolbarHandle.redraws = draws; - UITrait.inst.statusHandle.redraws = draws; - UITrait.inst.menuHandle.redraws = draws; - UITrait.inst.workspaceHandle.redraws = draws; - UINodes.inst.hwnd.redraws = 2; // Full redraw + public static function redrawUI() { + UITrait.inst.hwnd.redraws = 2; + UITrait.inst.hwnd1.redraws = 2; + UITrait.inst.hwnd2.redraws = 2; + UITrait.inst.headerHandle.redraws = 2; + UITrait.inst.toolbarHandle.redraws = 2; + UITrait.inst.statusHandle.redraws = 2; + UITrait.inst.menuHandle.redraws = 2; + UITrait.inst.workspaceHandle.redraws = 2; + UINodes.inst.hwnd.redraws = 2; + if (UITrait.inst.ddirty < 0) UITrait.inst.ddirty = 0; // Tag cached viewport texture redraw } static function update() { @@ -322,6 +324,7 @@ class App extends iron.Trait { if (inViewport || inLayers) { // Create fill layer var l = UITrait.inst.newLayer(); + l.objectMask = UITrait.inst.layerFilter; UITrait.inst.toFillLayer(l); } dragMaterial = null; @@ -341,7 +344,7 @@ class App extends iron.Trait { if (showFiles || showBox) UIBox.update(); - Zui.alwaysRedrawWindow = showMenu; + Zui.alwaysRedrawWindow = showMenu || isDragging || (!UITrait.inst.brush3d); } static function render(g:kha.graphics2.Graphics) { @@ -382,4 +385,15 @@ class App extends iron.Trait { } return 0; } + + public static function checkAscii(s:String):Bool { + for (i in 0...s.length) { + if (s.charCodeAt(i) > 255) { + // Bail out for now :( + UITrait.inst.showError("Error: non-ascii file path detected"); + return false; + } + } + return true; + } } diff --git a/Sources/arm/Uniforms.hx b/Sources/arm/Uniforms.hx index a705c8ce..b01302e4 100644 --- a/Sources/arm/Uniforms.hx +++ b/Sources/arm/Uniforms.hx @@ -59,7 +59,8 @@ class Uniforms { public static function linkVec2(object:Object, mat:MaterialData, link:String):iron.math.Vec4 { var vec2 = UITrait.inst.vec2; if (link == '_sub') { - var seps = UITrait.inst.brushBias * 0.0004 * Config.getTextureResBias(); + var eps = 0.0004; + var seps = UITrait.inst.brushBias * eps * Config.getTextureResBias(); UITrait.inst.sub = (UITrait.inst.sub + 1) % 9; var sub = UITrait.inst.sub; if (sub == 0) vec2.set(0.0 + seps, 0.0, 0.0); diff --git a/Sources/arm/renderpath/RenderPathDeferred.hx b/Sources/arm/renderpath/RenderPathDeferred.hx index a419843e..33ec664f 100644 --- a/Sources/arm/renderpath/RenderPathDeferred.hx +++ b/Sources/arm/renderpath/RenderPathDeferred.hx @@ -418,7 +418,7 @@ class RenderPathDeferred { #if ((rp_ssgi == "RTGI") || (rp_ssgi == "RTAO")) { var ssgi = armory.data.Config.raw.rp_ssgi != false && UITrait.inst.cameraType == 0; - if (ssgi && UITrait.inst.ddirty > 0) { + if (ssgi && UITrait.inst.ddirty > 0 && taaFrame > 0) { path.setTarget("singlea"); path.bindTarget("_main", "gbufferD"); path.bindTarget("gbuffer0", "gbuffer0"); @@ -444,7 +444,7 @@ class RenderPathDeferred { #if rp_voxelao if (armory.data.Config.raw.rp_gi != false) { - var voxelize = path.voxelize() && UITrait.inst.ddirty > 0; + var voxelize = path.voxelize() && UITrait.inst.ddirty > 0 && taaFrame > 0; #if arm_voxelgi_temporal voxelize = ++RenderPathCreator.voxelFrame % RenderPathCreator.voxelFreq == 0; @@ -482,7 +482,7 @@ class RenderPathDeferred { #if (rp_ssgi != "Off") { var ssgi = armory.data.Config.raw.rp_ssgi != false && UITrait.inst.cameraType == 0; - if (ssgi) { + if (ssgi && taaFrame > 0) { path.bindTarget("singlea", "ssaotex"); } else { diff --git a/Sources/arm/ui/UIFiles.hx b/Sources/arm/ui/UIFiles.hx index 6c493dc6..c46aabe9 100644 --- a/Sources/arm/ui/UIFiles.hx +++ b/Sources/arm/ui/UIFiles.hx @@ -18,6 +18,7 @@ class UIFiles { App.showFiles = false; App.path = untyped App.foldersOnly ? Krom.saveDialog(filters, "") : Krom.openDialog(filters, ""); if (App.path != null) { + if (!App.checkAscii(App.path)) return; App.path = StringTools.replace(App.path, "\\\\", "\\"); App.path = StringTools.replace(App.path, "\r", ""); var sep = kha.System.systemId == "Windows" ? "\\" : "/"; diff --git a/Sources/arm/ui/UIMenu.hx b/Sources/arm/ui/UIMenu.hx index c9e44684..ddfcb164 100644 --- a/Sources/arm/ui/UIMenu.hx +++ b/Sources/arm/ui/UIMenu.hx @@ -195,8 +195,7 @@ class UIMenu { } else { App.showMenu = false; - App.redrawUI(0); - UITrait.inst.ddirty = 0; // Tag cached viewport texture redraw + App.redrawUI(); showMenuFirst = true; menuCommands = null; // arm.App.uienabled = true; diff --git a/Sources/arm/ui/UINodes.hx b/Sources/arm/ui/UINodes.hx index 60d38e94..79a338ea 100644 --- a/Sources/arm/ui/UINodes.hx +++ b/Sources/arm/ui/UINodes.hx @@ -208,9 +208,10 @@ class UINodes extends iron.Trait { if (UIView2D.inst.show) { wy += Std.int(iron.App.h() / 2); } + var ww = Std.int(iron.App.w()) + UITrait.inst.toolbarw; var mx = mouse.x + App.x(); var my = mouse.y + App.y(); - if (mx < wx || my < wy) return; + if (mx < wx || mx > wx + ww || my < wy) return; if (ui.isTyping) return; if (addNodeButton) { diff --git a/Sources/arm/ui/UITrait.hx b/Sources/arm/ui/UITrait.hx index 50198ac9..2ab6adf4 100644 --- a/Sources/arm/ui/UITrait.hx +++ b/Sources/arm/ui/UITrait.hx @@ -145,7 +145,7 @@ class UITrait extends iron.Trait { public var decalMaskHandle = new Handle({position: 0}); public var particleMaterial:MaterialData = null; - var layerFilter = 0; + public var layerFilter = 0; var _onBrush:ArrayVoid> = []; @@ -791,7 +791,7 @@ class UITrait extends iron.Trait { Gizmo.update(); } - if (lastCombo != null) ddirty = 0; + if (lastCombo != null) App.redrawUI(); lastCombo = ui.comboSelectedHandle; } @@ -2108,6 +2108,7 @@ class UITrait extends iron.Trait { Canvas.assetMap.remove(asset.id); assets.splice(i, 1); assetNames.splice(i, 1); + // TODO: rebuild affected materials } }); }