ipochto / stratagus

The Stratagus strategy game engine
GNU General Public License v2.0
0 stars 0 forks source link

UI Graphics. Add support for images for disabled controls #30

Open ipochto opened 2 years ago

ipochto commented 2 years ago

Andrettin:

these are the variables in the ImageDropDownWidget class:

private:
CGraphic *itemImage;
CGraphic *DownNormalImage;
CGraphic *DownPressedImage;
ImageListBox mListBox;
LuaListModel listmodel;

AFAIK the first CGraphic is the dropdown bar, and the other two are for the down arrow so you need to add a CGraphic pointer there for the disabled bar, i.e.:

private:
CGraphic *itemImage;
CGraphic *itemImageDisabled;
CGraphic *DownNormalImage;
CGraphic *DownPressedImage;
ImageListBox mListBox;
LuaListModel listmodel;

and then you need to add a ImageDropDownWidget::setDisabledItemImage() function, exposing it to Lua and do the necessary things so that the disabled item image is shown instead of the item image if the dropdown is disabled

https://discord.com/channels/780082494447288340/780082494447288344/894252086420705300