Skip to content

Commit 4e4f1a6

Browse files
committed
#1643 Improvements to Raw Editor Renderer
1 parent 453ea1d commit 4e4f1a6

File tree

3 files changed

+48
-43
lines changed

3 files changed

+48
-43
lines changed

GSE/API/StringFunctions.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,12 @@ function GSE.Dump(node)
198198
cache[node] = cur_index + 1
199199
break
200200
else
201-
output_str = output_str .. string.rep("\t", depth) .. key .. ' = "' .. tostring(v) .. '"'
201+
if #GSE.SplitMeIntolines(v) > 1 then
202+
output_str =
203+
output_str .. string.rep("\t", depth) .. key .. " = [[\n" .. tostring(v) .. "\n]]"
204+
else
205+
output_str = output_str .. string.rep("\t", depth) .. key .. ' = "' .. tostring(v) .. '"'
206+
end
202207
end
203208

204209
if (cur_index == size) then

GSE_GUI/Editor.lua

+42-9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,39 @@ editframe.panels = {}
7676

7777
GSE.GUIEditFrame = editframe
7878

79+
local function GUIUpdateSequenceDefinition(classid, SequenceName, sequence)
80+
sequence.LastUpdated = GSE.GetTimestamp()
81+
82+
if not GSE.isEmpty(SequenceName) then
83+
if GSE.isEmpty(classid) then
84+
classid = GSE.GetCurrentClassID()
85+
end
86+
sequence.MetaData.Name = SequenceName
87+
if not GSE.isEmpty(SequenceName) then
88+
local vals = {}
89+
vals.action = "Replace"
90+
vals.sequencename = SequenceName
91+
vals.sequence = sequence
92+
vals.classid = classid
93+
if editframe.NewSequence then
94+
if GSE.ObjectExists(SequenceName) then
95+
editframe:SetStatusText(
96+
string.format(L["Sequence Name %s is in Use. Please choose a different name."], SequenceName)
97+
)
98+
editframe.nameeditbox:SetText(
99+
GSEOptions.UNKNOWN .. editframe.nameeditbox:GetText() .. Statics.StringReset
100+
)
101+
editframe.nameeditbox:SetFocus()
102+
return
103+
end
104+
editframe.NewSequence = false
105+
end
106+
table.insert(GSE.OOCQueue, vals)
107+
editframe:SetStatusText(L["Save pending for "] .. SequenceName)
108+
end
109+
end
110+
end
111+
79112
local basecontainer = AceGUI:Create("SimpleGroup")
80113
basecontainer:SetLayout("Flow")
81114
basecontainer:SetAutoAdjustHeight(false)
@@ -527,15 +560,15 @@ function GSE.GUIEditorPerformLayout()
527560
"OnClick",
528561
function()
529562
if GSE.isEmpty(editframe.invalidPause) then
530-
GSE.GUIEditFrame:SetStatusText(L["Save pending for "] .. nameeditbox:GetText())
563+
editframe:SetStatusText(L["Save pending for "] .. nameeditbox:GetText())
531564
local _, _, _, tocversion = GetBuildInfo()
532565
editframe.Sequence.MetaData.ManualIntervention = true
533566
editframe.Sequence.MetaData.GSEVersion = GSE.VersionNumber
534567
editframe.Sequence.MetaData.EnforceCompatability = true
535568
editframe.Sequence.MetaData.TOC = tocversion
536569
nameeditbox:SetText(nameeditbox:GetText())
537570
editframe.SequenceName = GSE.UnEscapeString(nameeditbox:GetText())
538-
GSE.GUIUpdateSequenceDefinition(editframe.ClassID, editframe.SequenceName, editframe.Sequence)
571+
GUIUpdateSequenceDefinition(editframe.ClassID, editframe.SequenceName, editframe.Sequence)
539572
editframe.save = true
540573
else
541574
GSE.Print(L["Error processing Custom Pause Value. You will need to recheck your macros."], "ERROR")
@@ -585,7 +618,7 @@ function GSE.GUIEditorPerformLayout()
585618
editButtonGroup:AddChild(transbutton)
586619
editButtonGroup:AddChild(editOptionsbutton)
587620
rightContainer:AddChild(editButtonGroup)
588-
GSE.GUIEditFrame:SetStatusText(editframe.statusText)
621+
editframe:SetStatusText(editframe.statusText)
589622
end
590623

591624
function GSE.GetVersionList()
@@ -1207,7 +1240,7 @@ end
12071240

12081241
local function ChooseVersionTab(version, scrollpos)
12091242
GSE.GUIEditorPerformLayout()
1210-
GSE.GUIEditFrame.ContentContainer:SelectTab(tostring(version))
1243+
editframe.ContentContainer:SelectTab(tostring(version))
12111244
if not GSE.isEmpty(editframe.scrollContainer) and scrollpos > 0 then
12121245
editframe.scrollContainer:SetScroll(scrollpos)
12131246
end
@@ -2420,7 +2453,7 @@ local function drawAction(container, action, version, keyPath)
24202453
returnAction["MS"] = tonumber(text)
24212454
end
24222455
editframe.Sequence.Macros[version].Actions[keyPath] = returnAction
2423-
GSE.GUIEditFrame:SetStatusText(editframe.statusText)
2456+
editframe:SetStatusText(editframe.statusText)
24242457
end
24252458
)
24262459

@@ -3203,7 +3236,7 @@ function GSE.GUISelectEditorTab(container, event, group)
32033236
container:ReleaseChildren()
32043237
editframe.SelectedTab = group
32053238

3206-
editframe.nameeditbox:SetText(GSE.GUIEditFrame.SequenceName)
3239+
editframe.nameeditbox:SetText(editframe.SequenceName)
32073240
if group == "config" then
32083241
GSE:GUIDrawMetadataEditor(container)
32093242
elseif group == "new" then
@@ -3336,12 +3369,12 @@ function GSE.GUIDeleteVersion(version)
33363369
table.remove(sequence.Macros, version)
33373370
printtext = printtext .. " " .. L["This change will not come into effect until you save this macro."]
33383371
GSE.GUIEditorPerformLayout()
3339-
GSE.GUIEditFrame.ContentContainer:SelectTab("config")
3340-
GSE.GUIEditFrame:SetStatusText(string.format(printtext, version))
3372+
editframe.ContentContainer:SelectTab("config")
3373+
editframe:SetStatusText(string.format(printtext, version))
33413374
C_Timer.After(
33423375
5,
33433376
function()
3344-
GSE.GUIEditFrame:SetStatusText(editframe.statusText)
3377+
editframe:SetStatusText(editframe.statusText)
33453378
end
33463379
)
33473380
end

GSE_GUI/GUIFunctions.lua

-33
Original file line numberDiff line numberDiff line change
@@ -107,39 +107,6 @@ function GSE.GUILoadEditor(key, recordedstring)
107107
GSE.GUIEditFrame:Show()
108108
end
109109

110-
function GSE.GUIUpdateSequenceDefinition(classid, SequenceName, sequence)
111-
sequence.LastUpdated = GSE.GetTimestamp()
112-
113-
if not GSE.isEmpty(SequenceName) then
114-
if GSE.isEmpty(classid) then
115-
classid = GSE.GetCurrentClassID()
116-
end
117-
sequence.MetaData.Name = SequenceName
118-
if not GSE.isEmpty(SequenceName) then
119-
local vals = {}
120-
vals.action = "Replace"
121-
vals.sequencename = SequenceName
122-
vals.sequence = sequence
123-
vals.classid = classid
124-
if GSE.GUIEditFrame.NewSequence then
125-
if GSE.ObjectExists(SequenceName) then
126-
GSE.GUIEditFrame:SetStatusText(
127-
string.format(L["Sequence Name %s is in Use. Please choose a different name."], SequenceName)
128-
)
129-
GSE.GUIEditFrame.nameeditbox:SetText(
130-
GSEOptions.UNKNOWN .. GSE.GUIEditFrame.nameeditbox:GetText() .. Statics.StringReset
131-
)
132-
GSE.GUIEditFrame.nameeditbox:SetFocus()
133-
return
134-
end
135-
GSE.GUIEditFrame.NewSequence = false
136-
end
137-
table.insert(GSE.OOCQueue, vals)
138-
GSE.GUIEditFrame:SetStatusText(L["Save pending for "] .. SequenceName)
139-
end
140-
end
141-
end
142-
143110
function GSE:OnInitialize()
144111
GSE.GUIRecordFrame:Hide()
145112
GSE.GUIVersionFrame:Hide()

0 commit comments

Comments
 (0)