Skip to content

Commit 83af5fe

Browse files
committed
Fix #717 (hover highlight works in test mode)
1 parent af5df72 commit 83af5fe

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

[editor]/editor_gui/client/test.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,16 @@ addEventHandler ( "saveloadtest_return", root,
273273
end
274274
end
275275
)
276+
277+
function isTesting()
278+
local editor = getResourceFromName("editor_main")
279+
if not editor or getResourceState(editor) ~= "running" then
280+
return false
281+
end
282+
-- Full test?
283+
if getElementData(getResourceRootElement(editor), "g_in_test") then
284+
return true
285+
end
286+
-- Baisc test?
287+
return inBasicTest
288+
end

[editor]/editor_gui/meta.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<export function="restoreSaveDialog" type="client" />
5858
<export function="stopTest" type="client" />
5959
<export function="restoreSelectedElement" type="client" />
60+
<export function="isTesting" type="client" />
6061

6162
<!-- MessageBox exports -->
6263
<export function="newCallback" type="client" />

[editor]/editor_main/client/gridlines.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ local function drawBoundingBox(corners, r, g, b, a)
426426
end
427427

428428
function renderHoverOverGridLines()
429-
if not exports["editor_gui"]:sx_getOptionData("enableHoverBoundingBox") then
429+
if not exports["editor_gui"]:sx_getOptionData("enableHoverBoundingBox") or exports.editor_gui:isTesting() then
430430
highlightedElement = nil
431431
return
432432
end

0 commit comments

Comments
 (0)