From 42c3df4c060f2bbc2da8a8527deae796693bcb5e Mon Sep 17 00:00:00 2001 From: dborth Date: Thu, 28 May 2009 07:16:15 +0000 Subject: [PATCH] GUI behavioral corrections --- source/ngc/gui/gui_button.cpp | 2 +- source/ngc/gui/gui_filebrowser.cpp | 6 ++++++ source/ngc/gui/gui_optionbrowser.cpp | 9 ++++++--- source/ngc/gui/gui_savebrowser.cpp | 8 ++++++-- source/ngc/menu.cpp | 1 + 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/source/ngc/gui/gui_button.cpp b/source/ngc/gui/gui_button.cpp index b4064b0..0c2c41c 100644 --- a/source/ngc/gui/gui_button.cpp +++ b/source/ngc/gui/gui_button.cpp @@ -161,7 +161,7 @@ void GuiButton::Update(GuiTrigger * t) #ifdef HW_RVL // cursor - if(t->wpad.ir.valid) + if(t->wpad.ir.valid && t->chan >= 0) { if(this->IsInside(t->wpad.ir.x, t->wpad.ir.y)) { diff --git a/source/ngc/gui/gui_filebrowser.cpp b/source/ngc/gui/gui_filebrowser.cpp index e5a7333..183d09f 100644 --- a/source/ngc/gui/gui_filebrowser.cpp +++ b/source/ngc/gui/gui_filebrowser.cpp @@ -365,7 +365,13 @@ void GuiFileBrowser::Update(GuiTrigger * t) gameList[selectedItem]->SetState(STATE_SELECTED, t->chan); } + int currChan = t->chan; + + if(t->wpad.ir.valid && !gameList[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + t->chan = -1; + gameList[i]->Update(t); + t->chan = currChan; if(gameList[i]->GetState() == STATE_SELECTED) { diff --git a/source/ngc/gui/gui_optionbrowser.cpp b/source/ngc/gui/gui_optionbrowser.cpp index 082f889..6a14aff 100644 --- a/source/ngc/gui/gui_optionbrowser.cpp +++ b/source/ngc/gui/gui_optionbrowser.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "gui.h" -#include "filebrowser.h" /** * Constructor for the GuiOptionBrowser class. @@ -270,12 +269,16 @@ void GuiOptionBrowser::Update(GuiTrigger * t) optionBtn[selectedItem]->SetState(STATE_SELECTED, t->chan); } + int currChan = t->chan; + + if(t->wpad.ir.valid && !optionBtn[i]->IsInside(t->wpad.ir.x, t->wpad.ir.y)) + t->chan = -1; + optionBtn[i]->Update(t); + t->chan = currChan; if(optionBtn[i]->GetState() == STATE_SELECTED) - { selectedItem = i; - } } // pad/joystick navigation diff --git a/source/ngc/gui/gui_savebrowser.cpp b/source/ngc/gui/gui_savebrowser.cpp index ce122f3..b0e4688 100644 --- a/source/ngc/gui/gui_savebrowser.cpp +++ b/source/ngc/gui/gui_savebrowser.cpp @@ -284,7 +284,6 @@ void GuiSaveBrowser::Update(GuiTrigger * t) { selectedItem += 2; } - arrowDownBtn->ResetState(); } else if(t->Up() || arrowUpBtn->GetState() == STATE_CLICKED) { @@ -301,11 +300,16 @@ void GuiSaveBrowser::Update(GuiTrigger * t) { selectedItem -= 2; } - arrowUpBtn->ResetState(); } endNavigation: + if(arrowDownBtn->GetState() == STATE_CLICKED) + arrowDownBtn->ResetState(); + + if(arrowUpBtn->GetState() == STATE_CLICKED) + arrowUpBtn->ResetState(); + for(i=0; iAppend(&saveBrowser); + mainWindow->ChangeFocus(&saveBrowser); ResumeGui(); while(menu == MENU_NONE)