Skip to content

Commit 0123926

Browse files
committed
Remove Notes from Compare tab
1 parent 885e780 commit 0123926

1 file changed

Lines changed: 2 additions & 49 deletions

File tree

src/Classes/CompareTab.lua

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ local CompareTabClass = newClass("CompareTab", "ControlHost", "Control", functio
131131
self.configSectionLayout = {} -- computed section layout for drawing
132132
self.configTotalContentHeight = 0
133133

134-
-- Notes view state
135-
self.notesActiveEntry = nil
136-
137134
-- Compare power report state
138135
self.comparePowerStat = nil -- selected data.powerStatList entry
139136
self.comparePowerCategories = { treeNodes = true, items = true, skillGems = true, supportGems = true, config = true }
@@ -154,8 +151,8 @@ end)
154151

155152
function CompareTabClass:InitControls()
156153
-- Sub-tab buttons
157-
local subTabs = { "Summary", "Tree", "Skills", "Items", "Calcs", "Config", "Notes" }
158-
local subTabModes = { "SUMMARY", "TREE", "SKILLS", "ITEMS", "CALCS", "CONFIG", "NOTES" }
154+
local subTabs = { "Summary", "Tree", "Skills", "Items", "Calcs", "Config" }
155+
local subTabModes = { "SUMMARY", "TREE", "SKILLS", "ITEMS", "CALCS", "CONFIG" }
159156

160157
self.controls.subTabAnchor = new("Control", nil, {0, 0, 0, 20})
161158
for i, tabName in ipairs(subTabs) do
@@ -184,18 +181,12 @@ function CompareTabClass:InitControls()
184181
end
185182
end
186183

187-
self.controls.notesEdit = new("EditControl", nil, {0, 0, 0, 0}, "", nil, "^%C\t\n", nil, nil, 16, true)
188-
self.controls.notesEdit.shown = function()
189-
return self.compareViewMode == "NOTES" and #self.compareEntries > 0
190-
end
191-
192184
-- Build B selector dropdown
193185
self.controls.compareBuildLabel = new("LabelControl", {"TOPLEFT", self.controls.subTabAnchor, "TOPLEFT"}, {0, -88, 0, 16}, "^7Compare with:")
194186
self.controls.compareBuildSelect = new("DropDownControl", {"LEFT", self.controls.compareBuildLabel, "RIGHT"}, {4, 0, 250, 20}, {}, function(index, value)
195187
if index and index > 0 and index <= #self.compareEntries then
196188
self.activeCompareIndex = index
197189
self.treeSearchNeedsSync = true
198-
self.notesActiveEntry = nil
199190
end
200191
end)
201192
self.controls.compareBuildSelect.enabled = function()
@@ -1199,7 +1190,6 @@ end
11991190
function CompareTabClass:RemoveBuild(index)
12001191
if index >= 1 and index <= #self.compareEntries then
12011192
t_remove(self.compareEntries, index)
1202-
self.notesActiveEntry = nil
12031193
if self.activeCompareIndex > #self.compareEntries then
12041194
self.activeCompareIndex = #self.compareEntries
12051195
end
@@ -1686,8 +1676,6 @@ function CompareTabClass:Draw(viewPort, inputEvents)
16861676
self:DrawCalcs(contentVP, compareEntry)
16871677
elseif self.compareViewMode == "CONFIG" then
16881678
self:DrawConfig(contentVP, compareEntry)
1689-
elseif self.compareViewMode == "NOTES" then
1690-
self:DrawNotes(contentVP, compareEntry, inputEvents)
16911679
end
16921680
end
16931681

@@ -4443,41 +4431,6 @@ function CompareTabClass:DrawConfig(vp, compareEntry)
44434431
SetViewport()
44444432
end
44454433

4446-
function CompareTabClass:DrawNotes(vp, compareEntry, inputEvents)
4447-
if not compareEntry then return end
44484434

4449-
-- Sync EditControl with the active compare entry
4450-
if self.notesActiveEntry ~= compareEntry then
4451-
self.controls.notesEdit:SetText(compareEntry.notesText or "")
4452-
self.notesActiveEntry = compareEntry
4453-
end
4454-
4455-
-- Handle undo/redo
4456-
for id, event in ipairs(inputEvents) do
4457-
if event.type == "KeyDown" then
4458-
if event.key == "z" and IsKeyDown("CTRL") then
4459-
self.controls.notesEdit:Undo()
4460-
elseif event.key == "y" and IsKeyDown("CTRL") then
4461-
self.controls.notesEdit:Redo()
4462-
end
4463-
end
4464-
end
4465-
4466-
self.controls.notesEdit.x = vp.x + 8
4467-
self.controls.notesEdit.y = vp.y + 8
4468-
self.controls.notesEdit.width = function()
4469-
return vp.width - 16
4470-
end
4471-
self.controls.notesEdit.height = function()
4472-
return vp.height - 38
4473-
end
4474-
4475-
-- Sync edits back to the compare entry
4476-
if compareEntry.notesText ~= self.controls.notesEdit.buf then
4477-
compareEntry.notesText = self.controls.notesEdit.buf
4478-
end
4479-
4480-
main:DrawBackground(vp)
4481-
end
44824435

44834436
return CompareTabClass

0 commit comments

Comments
 (0)