Add Config Set import/export feature#9712
Add Config Set import/export feature#9712OursCodeur wants to merge 3 commits intoPathOfBuildingCommunity:devfrom
Conversation
Wires77
left a comment
There was a problem hiding this comment.
I'm on the fence about this PR, mostly because I don't see much of a purpose in sharing configs vs. whole builds. How do you use this right now? I appreciate the test though
| local newConfigSet = self:NewConfigSet(nil, controls.name.buf) | ||
| for _, child in ipairs(xmlConfigSet) do | ||
| if child.elem == "Input" and child.attrib.name then | ||
| if child.attrib.number then | ||
| newConfigSet.input[child.attrib.name] = tonumber(child.attrib.number) | ||
| elseif child.attrib.boolean then | ||
| newConfigSet.input[child.attrib.name] = child.attrib.boolean == "true" | ||
| elseif child.attrib.string then | ||
| newConfigSet.input[child.attrib.name] = child.attrib.string | ||
| end | ||
| elseif child.elem == "Placeholder" and child.attrib.name then | ||
| if child.attrib.number then | ||
| newConfigSet.placeholder[child.attrib.name] = tonumber(child.attrib.number) | ||
| elseif child.attrib.string then | ||
| newConfigSet.placeholder[child.attrib.name] = child.attrib.string | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
I feel like this section could be made into a function that could be called from Load in this same file. Similar to Save, otherwise we're just duplicating a lot of code.
There was a problem hiding this comment.
Err good shout, and that'll make the spec file smaller too. I'll push something shortly.
The main use case has been wanting to compare numbers from my imported char against a fully configured guide in another PoB window, and being lazy about setting it up the exact same way! edit: it also happens to be n.1 in the medium requested features list, but I only saw it after submitting the PR and joining the Discord to say hi |
|
So the full build compare PR is here and I kind of wonder if the need for importing configs is going to go away once that's in, because then you could just compare the build in question instead of importing their configs. Importing configs might make more sense to just copy from the compared build instead of having this extra feature. If you open a PR for that approach I'll close this one and go with that instead |
Added an import/export feature for the Configuration tab based on the existing solution for passive tree management, as well as a standard test spec set.
Edit : updated the label misalignment.