From 8517a4c9e8a77d274230c30e597f3150adf635c3 Mon Sep 17 00:00:00 2001 From: Xawotihs Date: Sun, 8 Jan 2012 23:35:19 +0000 Subject: [PATCH] Partial fix for issue 777. Basically options are fixed on all the platforms (you can create and select a profile for example). Regarding the filters, it works perfectly with QML on desktop. For SDL on Android and QML on Meego, it causes either annoying blinking letting you do what you want or some kind of blinking deadlock. I think there is some recursion happening in the GUI items and to be sorted. --- projects/mtg/src/WGui.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/projects/mtg/src/WGui.cpp b/projects/mtg/src/WGui.cpp index 5d992fc02..12b113346 100644 --- a/projects/mtg/src/WGui.cpp +++ b/projects/mtg/src/WGui.cpp @@ -273,7 +273,7 @@ bool WGuiMenu::yieldFocus() //WGuiList WGuiList::WGuiList(string name, WSyncable * syncme) : - WGuiMenu(JGE_BTN_DOWN, JGE_BTN_UP, false, syncme) + WGuiMenu(JGE_BTN_DOWN, JGE_BTN_UP, false, syncme), startWindow(-1), endWindow(-1) { failMsg = "NO OPTIONS AVAILABLE"; width = SCREEN_WIDTH - 10; @@ -432,9 +432,11 @@ bool WGuiList::CheckUserInput(JButton key) int n = currentItem; unsigned int distance2; unsigned int minDistance2 = -1; - for(int k = startWindow; k < endWindow; k++) + int begin = (startWindow == -1) ? 0 : startWindow; + int end = (endWindow == -1) ? items.size() : endWindow; + for(int k = begin; k < end; k++) { - WGuiItem* pItem = (WGuiItem*)items[k]; + WGuiBase* pItem = (items[k]); distance2 = static_cast((pItem->getY() - j) * (pItem->getY() - j) + (pItem->getX() - i) * (pItem->getX() - i)); if (distance2 < minDistance2 && pItem->Selectable()) { @@ -452,7 +454,7 @@ bool WGuiList::CheckUserInput(JButton key) } } - mEngine->LeftClickedProcessed(); +// mEngine->LeftClickedProcessed(); return WGuiMenu::CheckUserInput(key); } @@ -972,7 +974,7 @@ bool WGuiMenu::CheckUserInput(JButton key) unsigned int minDistance2 = -1; for(size_t k = 0; k < items.size(); k++) { - WGuiItem* pItem = (WGuiItem*)items[k]; + WGuiBase* pItem = items[k]; distance2 = static_cast((pItem->getY() - j) * (pItem->getY() - j) + (pItem->getX() - i) * (pItem->getX() - i)); if (distance2 < minDistance2 && pItem->Selectable()) {