Skip to content

Commit 385864d

Browse files
committed
Fix remaining 4 main editors to be programmatic
Updated the 4 main editors that were still referencing deleted RML files: - trigger_editor.lua - object_editor.lua - heightmap_editor.lua - texture_editor.lua All now extend RmlUiEditorBase and use generic_editor.rml template. No more references to non-existent RML files. This should fix the CI failure.
1 parent 3651016 commit 385864d

File tree

4 files changed

+37
-354
lines changed

4 files changed

+37
-354
lines changed

scen_edit/view/rmlui_editors/heightmap_editor.lua

Lines changed: 8 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,22 @@
11
--- RmlUi Heightmap Editor
2-
--- Stub implementation of heightmap editor UI
2+
--- 100% programmatic - no RML file needed!
33

4-
RmlUiHeightmapEditor = LCS.class{}
4+
RmlUiHeightmapEditor = RmlUiEditorBase:extends{}
55

66
function RmlUiHeightmapEditor:init()
7-
self.rmlPath = Path.Join(SB.DIRS.SRC, 'view/rml/editors/heightmap_editor.rml')
8-
self.document = nil
7+
self:super("init")
8+
self.editorTitle = "Heightmap Editor"
99
self.currentTool = "raise"
10-
end
11-
12-
function RmlUiHeightmapEditor:Initialize()
13-
if not SB.rmlui or not SB.rmlui.initialized then
14-
Log.Error("RmlUi not initialized")
15-
return false
16-
end
17-
18-
self.document = SB.rmlui:LoadDocument(self.rmlPath, false)
19-
if not self.document then
20-
Log.Error("Failed to load heightmap editor")
21-
return false
22-
end
23-
24-
self:BindEvents()
25-
Log.Notice("Heightmap Editor initialized (RmlUi stub)")
26-
return true
27-
end
28-
29-
function RmlUiHeightmapEditor:Show()
30-
if self.document then
31-
self.document:Show()
32-
end
33-
end
34-
35-
function RmlUiHeightmapEditor:Hide()
36-
if self.document then
37-
self.document:Hide()
38-
end
39-
end
40-
41-
function RmlUiHeightmapEditor:BindEvents()
42-
if not self.document then
43-
return
44-
end
45-
46-
-- Tool buttons
47-
local tools = {"raise", "lower", "smooth", "level"}
48-
for _, tool in ipairs(tools) do
49-
local btn = self.document:GetElementById("btn-" .. tool)
50-
if btn then
51-
btn:AddEventListener("click", function()
52-
self:SetTool(tool)
53-
end)
54-
end
55-
end
56-
57-
-- Import/Export buttons
58-
local btnImport = self.document:GetElementById("btn-import")
59-
if btnImport then
60-
btnImport:AddEventListener("click", function()
61-
Log.Notice("Import heightmap (not implemented)")
62-
end)
63-
end
64-
65-
local btnExport = self.document:GetElementById("btn-export")
66-
if btnExport then
67-
btnExport:AddEventListener("click", function()
68-
Log.Notice("Export heightmap (not implemented)")
69-
end)
70-
end
7110

72-
local btnReset = self.document:GetElementById("btn-reset")
73-
if btnReset then
74-
btnReset:AddEventListener("click", function()
75-
Log.Notice("Reset heightmap (not implemented)")
76-
end)
77-
end
11+
-- TODO when implementing: Add fields programmatically
12+
-- self:AddField(ChoiceField({name="tool", title="Tool", items={"Raise", "Lower", "Smooth", "Level"}}))
13+
-- self:AddField(NumericField({name="brushSize", title="Brush Size", min=1, max=100}))
14+
-- self:AddField(NumericField({name="strength", title="Strength", min=0, max=1, step=0.01}))
7815
end
7916

8017
function RmlUiHeightmapEditor:SetTool(tool)
8118
self.currentTool = tool
8219
Log.Notice("Heightmap tool: " .. tool)
83-
-- TODO: Update tool state
8420
end
8521

8622
function RmlUiHeightmapEditor:Update()
Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,24 @@
11
--- RmlUi Object Editor
2-
--- Stub implementation of object property editor UI
2+
--- 100% programmatic - no RML file needed!
33

4-
RmlUiObjectEditor = LCS.class{}
4+
RmlUiObjectEditor = RmlUiEditorBase:extends{}
55

66
function RmlUiObjectEditor:init()
7-
self.rmlPath = Path.Join(SB.DIRS.SRC, 'view/rml/editors/object_editor.rml')
8-
self.document = nil
7+
self:super("init")
8+
self.editorTitle = "Object Editor"
99
self.currentObject = nil
10-
end
11-
12-
function RmlUiObjectEditor:Initialize()
13-
if not SB.rmlui or not SB.rmlui.initialized then
14-
Log.Error("RmlUi not initialized")
15-
return false
16-
end
17-
18-
self.document = SB.rmlui:LoadDocument(self.rmlPath, false)
19-
if not self.document then
20-
Log.Error("Failed to load object editor")
21-
return false
22-
end
23-
24-
self:BindEvents()
25-
Log.Notice("Object Editor initialized (RmlUi stub)")
26-
return true
27-
end
2810

29-
function RmlUiObjectEditor:Show()
30-
if self.document then
31-
self.document:Show()
32-
end
11+
-- TODO when implementing: Add fields programmatically
12+
-- self:AddField(NumericField({name="x", title="X Position"}))
13+
-- self:AddField(NumericField({name="y", title="Y Position"}))
14+
-- self:AddField(NumericField({name="z", title="Z Position"}))
3315
end
3416

35-
function RmlUiObjectEditor:Hide()
36-
if self.document then
37-
self.document:Hide()
38-
end
39-
end
40-
41-
function RmlUiObjectEditor:BindEvents()
42-
if not self.document then
43-
return
44-
end
45-
46-
local btnApply = self.document:GetElementById("btn-apply")
47-
if btnApply then
48-
btnApply:AddEventListener("click", function()
49-
self:OnApply()
50-
end)
51-
end
52-
53-
local btnRevert = self.document:GetElementById("btn-revert")
54-
if btnRevert then
55-
btnRevert:AddEventListener("click", function()
56-
self:OnRevert()
57-
end)
58-
end
59-
end
60-
61-
function RmlUiObjectEditor:SetObject(objectType, objectID)
62-
self.currentObject = {type = objectType, id = objectID}
63-
self:RefreshProperties()
17+
function RmlUiObjectEditor:SetObject(objectID)
18+
self.currentObject = objectID
19+
Log.Notice("Set object: " .. tostring(objectID) .. " (not implemented)")
6420
end
6521

6622
function RmlUiObjectEditor:RefreshProperties()
67-
-- Stub: Populate object properties
68-
Log.Notice("Refreshing object properties (not implemented)")
69-
-- TODO: Get object data and populate form fields
70-
end
71-
72-
function RmlUiObjectEditor:OnApply()
73-
Log.Notice("Apply changes (not implemented)")
74-
-- TODO: Apply property changes to object
75-
end
76-
77-
function RmlUiObjectEditor:OnRevert()
78-
Log.Notice("Revert changes (not implemented)")
79-
-- TODO: Revert to original values
80-
self:RefreshProperties()
81-
end
82-
83-
function RmlUiObjectEditor:Update()
84-
-- Stub
23+
Log.Notice("Refresh properties (not implemented)")
8524
end

scen_edit/view/rmlui_editors/texture_editor.lua

Lines changed: 8 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,23 @@
11
--- RmlUi Texture Editor
2-
--- Stub implementation of texture editor UI
2+
--- 100% programmatic - no RML file needed!
33

4-
RmlUiTextureEditor = LCS.class{}
4+
RmlUiTextureEditor = RmlUiEditorBase:extends{}
55

66
function RmlUiTextureEditor:init()
7-
self.rmlPath = Path.Join(SB.DIRS.SRC, 'view/rml/editors/texture_editor.rml')
8-
self.document = nil
7+
self:super("init")
8+
self.editorTitle = "Texture Editor"
99
self.currentTool = "paint"
1010
self.selectedTexture = 0
11-
end
12-
13-
function RmlUiTextureEditor:Initialize()
14-
if not SB.rmlui or not SB.rmlui.initialized then
15-
Log.Error("RmlUi not initialized")
16-
return false
17-
end
18-
19-
self.document = SB.rmlui:LoadDocument(self.rmlPath, false)
20-
if not self.document then
21-
Log.Error("Failed to load texture editor")
22-
return false
23-
end
24-
25-
self:BindEvents()
26-
Log.Notice("Texture Editor initialized (RmlUi stub)")
27-
return true
28-
end
29-
30-
function RmlUiTextureEditor:Show()
31-
if self.document then
32-
self.document:Show()
33-
end
34-
end
35-
36-
function RmlUiTextureEditor:Hide()
37-
if self.document then
38-
self.document:Hide()
39-
end
40-
end
41-
42-
function RmlUiTextureEditor:BindEvents()
43-
if not self.document then
44-
return
45-
end
46-
47-
-- Tool buttons
48-
local tools = {"paint", "erase", "fill"}
49-
for _, tool in ipairs(tools) do
50-
local btn = self.document:GetElementById("btn-" .. tool)
51-
if btn then
52-
btn:AddEventListener("click", function()
53-
self:SetTool(tool)
54-
end)
55-
end
56-
end
57-
58-
-- Add texture button
59-
local btnAdd = self.document:GetElementById("btn-add-texture")
60-
if btnAdd then
61-
btnAdd:AddEventListener("click", function()
62-
Log.Notice("Add texture (not implemented)")
63-
end)
64-
end
65-
66-
-- Import/Export buttons
67-
local btnImportDiffuse = self.document:GetElementById("btn-import-diffuse")
68-
if btnImportDiffuse then
69-
btnImportDiffuse:AddEventListener("click", function()
70-
Log.Notice("Import diffuse (not implemented)")
71-
end)
72-
end
7311

74-
local btnExportDiffuse = self.document:GetElementById("btn-export-diffuse")
75-
if btnExportDiffuse then
76-
btnExportDiffuse:AddEventListener("click", function()
77-
Log.Notice("Export diffuse (not implemented)")
78-
end)
79-
end
12+
-- TODO when implementing: Add fields programmatically
13+
-- self:AddField(ChoiceField({name="tool", title="Tool", items={"Paint", "Erase", "Fill"}}))
14+
-- self:AddField(NumericField({name="brushSize", title="Brush Size", min=1, max=100}))
15+
-- self:AddField(AssetField({name="texture", title="Texture"}))
8016
end
8117

8218
function RmlUiTextureEditor:SetTool(tool)
8319
self.currentTool = tool
8420
Log.Notice("Texture tool: " .. tool)
85-
-- TODO: Update tool state
8621
end
8722

8823
function RmlUiTextureEditor:Update()

0 commit comments

Comments
 (0)