Skip to content

Touchscreen fixes#74

Merged
SwissalpS merged 7 commits intomt-mods:masterfrom
a-tour-ist:fixes
Oct 15, 2025
Merged

Touchscreen fixes#74
SwissalpS merged 7 commits intomt-mods:masterfrom
a-tour-ist:fixes

Conversation

@a-tour-ist
Copy link
Copy Markdown
Contributor

commit 1:
adding a table with color defined causes the string to start with tableoptions => formspec_elements[e] = nil => crash on L26

digiline_send("ts", {
    {
        command = "clear"
    },
    {
        command = "add",
        element = "table",
        color = "red"
    },
    {
        command = "modify",
        index = 1,
    }
})

commit 2:
setting real_coordinates once caused them to always be true in the formspec, no matter of the actual value.

mem = mem or {}
mem.real_coordinates = not mem.real_coordinates
digiline_send("ts", {
    {
        command = "clear" 
    },
    {
        command = "set", 
        real_coordinates = mem.real_coordinates
    },
    {
        command = "add",
        element = "button",
        name = "start",
        label = mem.real_coordinates and "real_coordinates=true" or "real_coordinates=false",  
        X = 0.3,  
        Y = 0.3, 
        W = 4,
        H = 4 
    },
})

commit 3:
trying to modify an item_grid caused the whole grid to disappear, except for the last item.

digiline_send("ts", {
    {
        command = "clear"
    },
    {
        command = "add",
        element = "item_grid",
        X = 0,
        Y = 0,
        W = 2,
        H = 2,
        name = "grid",
        spacing = 0,
        size = 1,
        interactable = true,
        items = {
            "default:dirt 99",
            "default:stone 42",
            "default:apple 13",
            "default:torch"
        },
        offset = 1,
    },
    {
        command = "modify",
        index= 1,
        X = 1
    },
})

modify_element_string might get a string that starts with an element unknown to formspec_elements.lua (p.ex. tableoptions)
Comment thread touchscreen.lua Outdated
@OgelGames OgelGames changed the title touchscreen fixes Touchscreen fixes Apr 9, 2025
@a-tour-ist a-tour-ist requested a review from OgelGames April 25, 2025 17:49
Comment thread touchscreen.lua Outdated
a-tour-ist and others added 2 commits July 5, 2025 12:25
@BuckarooBanzay BuckarooBanzay added the bug Something isn't working label Aug 4, 2025
@SwissalpS
Copy link
Copy Markdown
Contributor

tested the three cases, LGTM.

@SwissalpS SwissalpS merged commit 50b35ec into mt-mods:master Oct 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants