diff --git a/source/gui/CList.cpp b/source/gui/CList.cpp index f94b1edc0a..227a80ed2b 100644 --- a/source/gui/CList.cpp +++ b/source/gui/CList.cpp @@ -27,6 +27,7 @@ CList::CList() AddSetting(GUIST_int, "cell_id"); AddSetting(GUIST_EAlign, "text_align"); AddSetting(GUIST_CColor, "textcolor"); + AddSetting(GUIST_CColor, "textcolor_selected"); AddSetting(GUIST_int, "selected"); // Index selected. -1 is none. //AddSetting(GUIST_CStr, "tooltip"); //AddSetting(GUIST_CStr, "tooltip_style"); @@ -151,6 +152,13 @@ void CList::HandleMessage(const SGUIMessage &Message) SetupText(); } + // If selected is changed, call "SelectionChange" + if (Message.value == "selected") + { + // TODO only works if lower-case, shouldn't it be made case sensitive instead? + ScriptEvent("selectionchange"); + } + if (Message.value == CStr("scrollbar")) { SetupText();