Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Map support #58

Open
QuImUfu opened this issue Jun 16, 2024 · 3 comments
Open

Add Map support #58

QuImUfu opened this issue Jun 16, 2024 · 3 comments

Comments

@QuImUfu
Copy link

QuImUfu commented Jun 16, 2024

I'd love to be able to use maps, e.g. Map<String, Enum> as config options.

@Motschen
Copy link
Member

It is already possible to edit the json files for this kind of option, but I'm not sure how I could implement it in the UI and if it would really be used that much.
If you have any idea how to get this across visually, please lmk.
Also, I'd appreciate an example of a use case for String-Enum maps in the config.

@QuImUfu
Copy link
Author

QuImUfu commented Sep 11, 2024

I'd use String-Enum maps for mapping Blocks to Portal colours in my Colourful Portals mod. In that mod there is a Portal group for each block that is a portal frame block. When portals form, their plane has a colour depending on the frame block.
The config should enable the user to add arbitrary portal frame blocks and set the colour of the planes they get.
My current workaround is a List for each colour, but that enables a user to select multiple portal colours for one block, which is not supported and results in a conflict if set that way. Additionally, its kinda confusing, because the colour is a purely visual, additional setting.

In the same mod, I'd use a String-Int map to allow the user to assign dimension ID's a weight for them being selected when searching for a random destination. I have not found a suitable workaround for that use case.

I think the easiest, useable way to display a Map, is a List with an additional selection field, that prevents duplicates in the first one. Even a Map of Lists could be displayed that way. Other, maybe better options seem to be a lot of work. (e.g. expanding list + suboption(s)...)
Mock-up:
example_map

@whirlfrenzy
Copy link

whirlfrenzy commented Sep 20, 2024

I think the easiest, useable way to display a Map, is a List with an additional selection field, that prevents duplicates in the first one. Even a Map of Lists could be displayed that way. Other, maybe better options seem to be a lot of work. (e.g. expanding list + suboption(s)...)

I had to implement a way to edit a String-Integer map for my mod and I found that using a separate screen was the best way to do it as it made it easier to see the existing entries, especially when there were a lot of them

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants