Skip to content

Decouple widget config from code. Use a text file to define widgets (optional) #14

@quietbiker

Description

@quietbiker

More of a suggestion really - I'm finding the fairly long constructs for the widgets fairly untidy and tricky to view.
I know I can break them into multiple lines/calls, but this may be an option to consider.

I'm suggesting using a text file that contains the config for buttons/text blocks etc and de-couples the widget config from the AGK code.
Expose all the parameters for each widget (where possible). Run time values (user sprite IDs etc) won't really work, but static icon names will, which is probably the most common use.

I know AGK doesn't have a native config file read/writer, but this concept could be any easy to edit/view text format.
I don't think it would be an issue to then have code to add/manipulate the widgets (ie add dialog buttons) in AGK code, but to get the basic UI up, positions, colours, icons etc would slim down the amount of code.

[button1]
type = OryUIButton
text = "Test Button"
color = "255,0,0"
position = "30,55"

[dialog1]
type = OryUIDialog
autoHeight = True
text = "Error reading file. Retry?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions