Skip to content

Commit 0b546d7

Browse files
committed
Fix RmlUi action button icon paths
Adjust image paths to be relative to RML document location. RML documents are at scen_edit/view/rml/, icons are at LuaUI/images/. Add ../../../ prefix to LuaUI/ paths to make them resolve correctly.
1 parent 469af98 commit 0b546d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scen_edit/view/rmlui_field_compat.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ function RmlUiTabbedPanelButton:GenerateRml()
117117
self.id, pressedClass, self.tooltip, disabledAttr)
118118

119119
if self.image then
120-
html = html .. string.format('<img src="%s" class="action-button-icon"/>', self.image)
120+
-- Make image path relative to RML document (scen_edit/view/rml/)
121+
-- Icons are at LuaUI/images/scenedit/, so need to go up 3 levels
122+
local imagePath = self.image
123+
if imagePath:sub(1, 6) == "LuaUI/" then
124+
imagePath = "../../../" .. imagePath
125+
end
126+
html = html .. string.format('<img src="%s" class="action-button-icon"/>', imagePath)
121127
end
122128

123129
if self.caption and self.caption ~= "" then

0 commit comments

Comments
 (0)