From 0c43b33b2a76435c4f21cec040629184a68a0986 Mon Sep 17 00:00:00 2001 From: cuu Date: Sat, 2 Jun 2018 23:40:30 +0800 Subject: [PATCH] fix fav PsIndex out of index --- Menu/GameShell/10_Settings/Brightness/brightness_page.py | 4 ++-- sys.py/UI/Emulator/fav_list_page.py | 6 ++++++ sys.py/UI/Emulator/rom_list_page.py | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Menu/GameShell/10_Settings/Brightness/brightness_page.py b/Menu/GameShell/10_Settings/Brightness/brightness_page.py index afcf641..1ecb4a0 100644 --- a/Menu/GameShell/10_Settings/Brightness/brightness_page.py +++ b/Menu/GameShell/10_Settings/Brightness/brightness_page.py @@ -56,8 +56,7 @@ class BSlider(Slider): scale.Adjust(0,0,82,63,0) self._Icons["scale"] = scale - def SetValue(self,brt):#pct 0-100 - + def SetValue(self,brt): self._Value = brt def Further(self): @@ -89,6 +88,7 @@ class BSlider(Slider): icon_idx = self._Value - 1 if icon_idx < 0: icon_idx = 0 + self._Icons["scale"]._IconIndex = icon_idx self._Icons["scale"].Draw() """ diff --git a/sys.py/UI/Emulator/fav_list_page.py b/sys.py/UI/Emulator/fav_list_page.py index cb08dec..6598056 100644 --- a/sys.py/UI/Emulator/fav_list_page.py +++ b/sys.py/UI/Emulator/fav_list_page.py @@ -291,6 +291,12 @@ class FavListPage(Page): self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height def Click(self): + + if len(self._MyList) == 0: + return + + if self._PsIndex > len(self._MyList) - 1: + return cur_li = self._MyList[self._PsIndex] diff --git a/sys.py/UI/Emulator/rom_list_page.py b/sys.py/UI/Emulator/rom_list_page.py index 3efccb6..891d0cf 100644 --- a/sys.py/UI/Emulator/rom_list_page.py +++ b/sys.py/UI/Emulator/rom_list_page.py @@ -316,6 +316,9 @@ class RomListPage(Page): def Click(self): if len(self._MyList) == 0: return + + if self._PsIndex > len(self._MyList) - 1: + return cur_li = self._MyList[self._PsIndex]