WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
313 stars 45 forks source link

Question: Inline XML Comments (which won't dissappear after save) #463

Closed TheGoodIdeaFairy closed 1 year ago

TheGoodIdeaFairy commented 1 year ago

I'm trying to come up with a method to add inline comments to my .xml profiles that will stick around after saves through the GUI. I've already tried the standard syntax, which admittedly doesn't give an error on loading, but is omitted from the next save. Any help is appreciated.

WhiteMagic commented 1 year ago

Short answer, this won't work no matter what you try. The way profiles are used is:

As such any comments that might exist in the XML are removed as loading doesn't care about them, and the Python objects have no notion of comments.

One way around this could be to use the Description action which is just a text field that can contain whatever you want.

TheGoodIdeaFairy commented 1 year ago

I'd guessed this was the case, but figured it was worth a shot. I've been using Descriptions which works for most of my use cases. I was hoping for inline comments for a few niche cases, such as particularly long macros (logic flag initializers and the like). Thanks for the reply, WM.