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

allow custom widget options icon #4314

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Pxtl
Copy link
Contributor

@Pxtl Pxtl commented Feb 26, 2021

Allow widgets to declare their own options icon.

image

@Pxtl
Copy link
Contributor Author

Pxtl commented Feb 26, 2021

Wasn't sure if the icon should be in GetInfo or in the main body like the options, though.

@GoogleFrog
Copy link
Contributor

Probably in the main body, like options, for consistency. Options have a path parameter that widgets can use to put icons in different paths, eg a widget could make a submenu of Hotkeys for hotkeys it adds, and have a submenu in Settings for some configuration. We're trying to be good about putting everything you might want to hotkey in the hotkeys menu while keeping it clear of settings.

For an icon system to handle multiple paths it would have to look something like this:

options_icon = {
	['Settings/Graphics/Lighting'] = 'LuaUI/ImagesmyLightIcon.png',
}
options_path = 'Settings/Graphics/Lighting'
options_order = etc...

I'd prefer the full solution, but just doing a single options_icon is ok too.

@Pxtl
Copy link
Contributor Author

Pxtl commented Feb 26, 2021

Will do. Wouldn't it be cleaner just to put the icon on the option itself?

options_path = 'Settings/Interface/Player Centroid Marker'
options_icon = "luaui/widgets/player-centroid-marker/main-icon.png"
options_order ={...yadda...}
options = {
	enable = {
		name = "Enable player centroid markers",
		type = 'bool',
		value = false,
		desc = "Toggle the player-name markers over groups of units",
		OnChange = function() ReInitialize() end,
		advanced = false,
		icon = "luaui/widgets/player-centroid-marker/toggle-marker.png"
	},
	...

While it's less flexible than simply allowing a widget to stuff icons wherever it likes into the tree of icons, I think it's easier and more legible this way.

@GoogleFrog
Copy link
Contributor

Submenus are automatically inferred from paths, not directly from options menus. You wouldn't be able to add an icon to a submenu button with an option. Also, options don't have icons at the moment.

@Pxtl
Copy link
Contributor Author

Pxtl commented Feb 27, 2021

Submenus are automatically inferred from paths, not directly from options menus. You wouldn't be able to add an icon to a submenu button with an option. Also, options don't have icons at the moment.

Ahh, that makes sense, I thought you were saying the settings themselves needed icons, but no, they're going deep into various other trees and intermediate nodes on that tree may not be already defined, so we need to be able to insert icons into various points on the tree.

I was just trying to come up with a way to avoid the widget-developer from repeating themselves, but yeah I can see what you mean.

@sprunk
Copy link
Member

sprunk commented Aug 8, 2023

Any news?

@sprunk sprunk marked this pull request as draft October 28, 2023 15:21
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

Successfully merging this pull request may close these issues.

3 participants