helgoboss / helgobox

Helgobox: ReaLearn & Playtime
https://www.helgoboss.org/projects/helgobox
GNU General Public License v3.0
211 stars 20 forks source link

Lua import/export is incorrect for displays #865

Closed Souk21 closed 1 year ago

Souk21 commented 1 year ago

Hello helgoboss, I'm working on a complex mapping and I wanted to use ReaLearn Script to ease out the creation process. The problem is, when exporting the main compartment as Lua and reimporting it, my display mappings lose their source "protocol", "display" and "line". This doesn't seem to happen with JSON import/export.

I'm using v2.16.0-pre.1/x86_64

Steps to reproduce on a fresh instance of ReaLearn:

If that helps, here is the script generated by "Export main compartment as Lua":

{
    kind = "MainCompartment",
    version = "2.16.0-pre.1",
    value = {
        mappings = {
            {
                id = "uh2yDjRaBfhHEV1Rwkytb",
                name = "1",
                source = {
                    kind = "XTouchMackieLcd",
                    extender_index = 1,
                    channel = 2,
                    line = 1,
                },
                glue = {
                    step_size_interval = {0.01, 0.05},
                    step_factor_interval = {1, 5},
                },
                target = {
                    kind = "Dummy",
                },
            },
        },
    },
}

And here is what is generated after importing the script above and exporting again:

{
    kind = "MainCompartment",
    version = "2.16.0-pre.1",
    value = {
        mappings = {
            {
                id = "-jbFt7tZK18vHkQawr8Kq",
                name = "1",
                source = {
                    kind = "MackieLcd",
                },
                glue = {
                    step_size_interval = {0.01, 0.05},
                    step_factor_interval = {1, 5},
                },
                target = {
                    kind = "Dummy",
                },
            },
        },
    },
}

Thanks !

helgoboss commented 1 year ago

Oops! Thanks for spotting this! Fixing.

helgoboss commented 1 year ago

Will be in 2.16.0-pre.2

Souk21 commented 1 year ago

So cool! Thanks a lot :)