mirror of
https://github.com/clockworkpi/launcher_deot.git
synced 2025-12-12 15:38:52 +01:00
commit
883e9effd8
@ -210,20 +210,12 @@ class CoresPage(Page):
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Left"]: # PageUp
|
||||
move = 3
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollUp()
|
||||
|
||||
self.ScrollUp(3)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Right"]: # PageDown
|
||||
move = 3
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollDown()
|
||||
|
||||
self.ScrollDown(3)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
|
||||
@ -152,30 +152,28 @@ class LanguagesPage(Page):
|
||||
self._Scroller.Init()
|
||||
self._Scroller.SetCanvasHWND(self._HWND)
|
||||
|
||||
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex +=1
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
# def ScrollDown(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex +=1
|
||||
# if self._PsIndex >= len(self._MyList):
|
||||
# self._PsIndex = len(self._MyList) -1
|
||||
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
|
||||
def ScrollUp(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex -= 1
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
|
||||
# def ScrollUp(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex -= 1
|
||||
# if self._PsIndex < 0:
|
||||
# self._PsIndex = 0
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
|
||||
def Click(self):
|
||||
if len(self._MyList) == 0:
|
||||
@ -216,7 +214,8 @@ class LanguagesPage(Page):
|
||||
thelang = thelang.strip()
|
||||
|
||||
if thelang == "":
|
||||
thelang = "English"
|
||||
# thelang = "English"
|
||||
thelang = "DEOT"
|
||||
|
||||
for i in self._MyList:
|
||||
if thelang in i._Value:
|
||||
@ -305,5 +304,3 @@ def Init(main_screen):
|
||||
OBJ.Init(main_screen)
|
||||
def API(main_screen):
|
||||
OBJ.API(main_screen)
|
||||
|
||||
|
||||
|
||||
@ -245,12 +245,14 @@ class TimezoneListPage(Page):
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Right"]:
|
||||
self.FScrollDown(Step=5)
|
||||
# self.FScrollDown(Step=5)
|
||||
self.ScrollDown(5)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Left"]:
|
||||
self.FScrollUp(Step=5)
|
||||
# self.FScrollUp(Step=5)
|
||||
self.ScrollUp(5)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
@ -301,4 +303,4 @@ class TimezoneListPage(Page):
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
|
||||
i.Draw()
|
||||
i.Draw()
|
||||
|
||||
@ -134,20 +134,12 @@ class ListPage(Page):
|
||||
self.Click()
|
||||
|
||||
if event.key == CurKeys["Left"]: # PageUp
|
||||
move = 3
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollUp()
|
||||
|
||||
self.ScrollUp(3)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Right"]: # PageDown
|
||||
move = 3
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollDown()
|
||||
|
||||
self.ScrollDown(3)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
|
||||
@ -532,7 +532,7 @@ class GameStorePage(Page):
|
||||
|
||||
_AList = {}
|
||||
|
||||
_Scrolled = 0
|
||||
# _Scrolled = 0
|
||||
|
||||
_BGwidth = 320
|
||||
_BGheight = 240-24-20
|
||||
@ -1020,32 +1020,32 @@ class GameStorePage(Page):
|
||||
self._Screen.SwapAndShow()
|
||||
"""
|
||||
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex += 1
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList)-1
|
||||
# def ScrollDown(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex += 1
|
||||
# if self._PsIndex >= len(self._MyList):
|
||||
# self._PsIndex = len(self._MyList)-1
|
||||
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY+cur_li._Height > self._Height:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY+cur_li._Height > self._Height:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
|
||||
self._Scrolled_cnt -= self._MyList[i]._Height
|
||||
# self._Scrolled_cnt -= self._MyList[i]._Height
|
||||
|
||||
def ScrollUp(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex -= 1
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
# def ScrollUp(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex -= 1
|
||||
# if self._PsIndex < 0:
|
||||
# self._PsIndex = 0
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
|
||||
self._Scrolled_cnt += self._MyList[i]._Height
|
||||
# self._Scrolled_cnt += self._MyList[i]._Height
|
||||
|
||||
def KeyDown(self,event):
|
||||
if IsKeyMenuOrB(event.key):
|
||||
@ -1116,12 +1116,26 @@ class GameStorePage(Page):
|
||||
self.PreviewGame()
|
||||
|
||||
if event.key == CurKeys["Up"]:
|
||||
self.ScrollUp()
|
||||
# self.ScrollUp()
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollUp(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Down"]:
|
||||
self.ScrollDown()
|
||||
# self.ScrollDown()
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollDown(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Right"]: # PageDown
|
||||
self.ScrollDown(5)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Left"]: # PageUp
|
||||
self.ScrollUp(5)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
@ -1185,4 +1199,3 @@ def Init(main_screen):
|
||||
OBJ.Init(main_screen)
|
||||
def API(main_screen):
|
||||
OBJ.API(main_screen)
|
||||
|
||||
|
||||
@ -3,13 +3,16 @@
|
||||
"InstallDir":"pico-8",
|
||||
"NotFoundMsg":["Please purchase the PICO-8 \n|None|varela16",
|
||||
"and copy it to the \"~/games/PICO-8\"|None|varela16"],
|
||||
"MD5":{"pico-8_0.2.0i_raspi.zip":"be0c708d707fa967c77455512bd456c7",
|
||||
"pico-8_0.1.11g_raspi.zip":"a3f2995cf117499f880bd964d6a0e1f2",
|
||||
"pico-8_0.1.11g_amd64.zip":"6726141c784afd4a41be6b7414c1b932",
|
||||
"pico-8_0.1.12_raspi.zip":"08eda95570e63089a2b9f5531503431e",
|
||||
"pico-8_0.1.12c_raspi.zip":"1a62b0d7d4e4be65f89f23ec9757cb66",
|
||||
"pico-8_0.1.12c2_raspi.zip":"7a878795472fa39304e9a10128c1f712",
|
||||
"pico-8_0.2.0e_raspi.zip":"085edfecd111c2b195b878b2197afe7a",
|
||||
"pico-8.zip":"whatever it takes"},
|
||||
"MD5":
|
||||
{
|
||||
"pico-8_0.1.11g_raspi.zip":"a3f2995cf117499f880bd964d6a0e1f2",
|
||||
"pico-8_0.1.12_raspi.zip":"08eda95570e63089a2b9f5531503431e",
|
||||
"pico-8_0.1.12c_raspi.zip":"1a62b0d7d4e4be65f89f23ec9757cb66",
|
||||
"pico-8_0.1.12c2_raspi.zip":"7a878795472fa39304e9a10128c1f712",
|
||||
"pico-8_0.2.0e_raspi.zip":"085edfecd111c2b195b878b2197afe7a",
|
||||
"pico-8_0.2.0i_raspi.zip":"be0c708d707fa967c77455512bd456c7",
|
||||
"pico-8_0.2.1b_raspi.zip":"d72968c56b4de8bc3dda84a6d5b6270e",
|
||||
"pico-8.zip":"whatever it takes"
|
||||
},
|
||||
"Post-Up":"bash Post-Up.sh"
|
||||
}
|
||||
|
||||
@ -240,10 +240,7 @@ class MusicLibListPage(Page):
|
||||
|
||||
if event.key == CurKeys["Right"]:
|
||||
if self._Backspace:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollDown()
|
||||
self.ScrollDown(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
@ -252,21 +249,22 @@ class MusicLibListPage(Page):
|
||||
if not self._Backspace:
|
||||
self.ReturnToUpLevelPage()
|
||||
else:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollUp()
|
||||
self.ScrollUp(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Up"]:
|
||||
self.ScrollUp()
|
||||
# self.ScrollUp()
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollUp(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Down"]:
|
||||
self.ScrollDown()
|
||||
# self.ScrollDown()
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollDown(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ class PlayListPage(Page):
|
||||
_BGwidth = 75
|
||||
_BGheight = 70
|
||||
|
||||
_Scrolled = 0
|
||||
# _Scrolled = 0
|
||||
|
||||
_CurSongName = ""
|
||||
|
||||
@ -196,45 +196,45 @@ class PlayListPage(Page):
|
||||
self._Scroller.Init()
|
||||
|
||||
|
||||
def ScrollUp(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex -= 1
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
self._Scrolled +=1
|
||||
# def ScrollUp(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex -= 1
|
||||
# if self._PsIndex < 0:
|
||||
# self._PsIndex = 0
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
# self._Scrolled +=1
|
||||
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex +=1
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
# def ScrollDown(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex +=1
|
||||
# if self._PsIndex >= len(self._MyList):
|
||||
# self._PsIndex = len(self._MyList) -1
|
||||
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
self._Scrolled -=1
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
# self._Scrolled -=1
|
||||
|
||||
def SyncScroll(self):# show where it left
|
||||
if self._Scrolled == 0:
|
||||
return
|
||||
# def SyncScroll(self):# show where it left
|
||||
# if self._Scrolled == 0:
|
||||
# return
|
||||
|
||||
if self._PsIndex < len(self._MyList):
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if self._Scrolled > 0:
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
elif self._Scrolled < 0:
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
# if self._PsIndex < len(self._MyList):
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if self._Scrolled > 0:
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
# elif self._Scrolled < 0:
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
|
||||
def Click(self):
|
||||
if len(self._MyList) == 0:
|
||||
@ -264,12 +264,16 @@ class PlayListPage(Page):
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Up"]:
|
||||
self.ScrollUp()
|
||||
# self.ScrollUp()
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollUp(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Down"]:
|
||||
self.ScrollDown()
|
||||
# self.ScrollDown()
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollDown(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
@ -280,20 +284,14 @@ class PlayListPage(Page):
|
||||
self._Screen.PushCurPage()
|
||||
self._Screen.SetCurPage(myvars.MusicLibListPage)
|
||||
else:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollDown()
|
||||
self.ScrollDown(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Left"]:
|
||||
if self._Backspace:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollUp()
|
||||
self.ScrollUp(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
1
sys.py/.lang
Normal file
1
sys.py/.lang
Normal file
@ -0,0 +1 @@
|
||||
99_DEOT_English.ini
|
||||
@ -105,7 +105,8 @@ class NotFoundPage(Page):
|
||||
self._Board.SetAndBlitText(d)
|
||||
|
||||
def KeyDown(self,event):
|
||||
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
|
||||
# if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
|
||||
if IsKeyMenuOrB(event.key):
|
||||
self.ReturnToUpLevelPage()
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
@ -98,7 +98,7 @@ class FavListPage(Page):
|
||||
_Emulator = None
|
||||
_Parent = None
|
||||
_Scroller = None
|
||||
_Scrolled = 0
|
||||
# _Scrolled = 0
|
||||
_BGwidth = 75
|
||||
_BGheight = 73
|
||||
_RomSoConfirmDownloadPage = None
|
||||
@ -259,52 +259,52 @@ class FavListPage(Page):
|
||||
|
||||
self._RomSoConfirmDownloadPage = rom_so_confirm_page
|
||||
|
||||
def ScrollUp(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
# def ScrollUp(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex -= self._ScrollStep
|
||||
# tmp = self._PsIndex
|
||||
# self._PsIndex -= self._ScrollStep
|
||||
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
dy = tmp - self._PsIndex
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height*dy
|
||||
self._Scrolled +=dy
|
||||
# if self._PsIndex < 0:
|
||||
# self._PsIndex = 0
|
||||
# dy = tmp - self._PsIndex
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._MyList[i]._Height*dy
|
||||
# self._Scrolled +=dy
|
||||
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex +=self._ScrollStep
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
# def ScrollDown(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# tmp = self._PsIndex
|
||||
# self._PsIndex +=self._ScrollStep
|
||||
# if self._PsIndex >= len(self._MyList):
|
||||
# self._PsIndex = len(self._MyList) -1
|
||||
|
||||
dy = self._PsIndex - tmp
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height*dy
|
||||
self._Scrolled -= dy
|
||||
# dy = self._PsIndex - tmp
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY -= self._MyList[i]._Height*dy
|
||||
# self._Scrolled -= dy
|
||||
|
||||
def SyncScroll(self):
|
||||
##
|
||||
if self._Scrolled == 0:
|
||||
return
|
||||
# def SyncScroll(self):
|
||||
#
|
||||
# if self._Scrolled == 0:
|
||||
# return
|
||||
|
||||
if self._PsIndex < len(self._MyList):
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if self._Scrolled > 0:
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
elif self._Scrolled < 0:
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
# if self._PsIndex < len(self._MyList):
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if self._Scrolled > 0:
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
# elif self._Scrolled < 0:
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
|
||||
def Click(self):
|
||||
|
||||
@ -385,18 +385,18 @@ class FavListPage(Page):
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
def SpeedScroll(self, thekey):
|
||||
if self._Screen._LastKey == thekey:
|
||||
self._ScrollStep+=1
|
||||
if self._ScrollStep >=5:
|
||||
self._ScrollStep = 5
|
||||
else:
|
||||
self._ScrollStep = 1
|
||||
# def SpeedScroll(self, thekey):
|
||||
# if self._Screen._LastKey == thekey:
|
||||
# self._ScrollStep+=1
|
||||
# if self._ScrollStep >=5:
|
||||
# self._ScrollStep = 5
|
||||
# else:
|
||||
# self._ScrollStep = 1
|
||||
|
||||
cur_time = time.time()
|
||||
# cur_time = time.time()
|
||||
|
||||
if cur_time - self._Screen._LastKeyDown > 0.3:
|
||||
self._ScrollStep = 1
|
||||
# if cur_time - self._Screen._LastKeyDown > 0.3:
|
||||
# self._ScrollStep = 1
|
||||
|
||||
def KeyDown(self,event):
|
||||
|
||||
@ -412,10 +412,7 @@ class FavListPage(Page):
|
||||
|
||||
if event.key == CurKeys["Right"]:
|
||||
if self._Backspace:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollDown()
|
||||
self.ScrollDown(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
@ -424,23 +421,22 @@ class FavListPage(Page):
|
||||
if not self._Backspace:
|
||||
self.ReturnToUpLevelPage()
|
||||
else:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollUp()
|
||||
self.ScrollUp(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Up"]:
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollUp()
|
||||
# self.ScrollUp()
|
||||
self.ScrollUp(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Down"]:
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollDown()
|
||||
# self.ScrollDown()
|
||||
self.ScrollDown(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ class RomListPage(Page):
|
||||
|
||||
_Scroller = None
|
||||
|
||||
_Scrolled = 0
|
||||
# _Scrolled = 0
|
||||
|
||||
_BGwidth = 56
|
||||
_BGheight = 70
|
||||
@ -293,52 +293,52 @@ class RomListPage(Page):
|
||||
|
||||
self._RomSoConfirmDownloadPage = rom_so_confirm_page
|
||||
|
||||
def ScrollUp(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
# def ScrollUp(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex -= self._ScrollStep
|
||||
# tmp = self._PsIndex
|
||||
# self._PsIndex -= self._ScrollStep
|
||||
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
dy = tmp - self._PsIndex
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height*dy
|
||||
self._Scrolled +=dy
|
||||
# if self._PsIndex < 0:
|
||||
# self._PsIndex = 0
|
||||
# dy = tmp - self._PsIndex
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._MyList[i]._Height*dy
|
||||
# self._Scrolled +=dy
|
||||
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex +=self._ScrollStep
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
# def ScrollDown(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# tmp = self._PsIndex
|
||||
# self._PsIndex +=self._ScrollStep
|
||||
# if self._PsIndex >= len(self._MyList):
|
||||
# self._PsIndex = len(self._MyList) -1
|
||||
|
||||
dy = self._PsIndex - tmp
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height*dy
|
||||
self._Scrolled -= dy
|
||||
# dy = self._PsIndex - tmp
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY -= self._MyList[i]._Height*dy
|
||||
# self._Scrolled -= dy
|
||||
|
||||
def SyncScroll(self):
|
||||
##
|
||||
if self._Scrolled == 0:
|
||||
return
|
||||
# def SyncScroll(self):
|
||||
#
|
||||
# if self._Scrolled == 0:
|
||||
# return
|
||||
|
||||
if self._PsIndex < len(self._MyList):
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if self._Scrolled > 0:
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
elif self._Scrolled < 0:
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
# if self._PsIndex < len(self._MyList):
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if self._Scrolled > 0:
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
# elif self._Scrolled < 0:
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
|
||||
def Click(self):
|
||||
if len(self._MyList) == 0:
|
||||
@ -421,18 +421,18 @@ class RomListPage(Page):
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
def SpeedScroll(self, thekey):
|
||||
if self._Screen._LastKey == thekey:
|
||||
self._ScrollStep+=1
|
||||
if self._ScrollStep >=5:
|
||||
self._ScrollStep = 5
|
||||
else:
|
||||
self._ScrollStep = 1
|
||||
# def SpeedScroll(self, thekey):
|
||||
# if self._Screen._LastKey == thekey:
|
||||
# self._ScrollStep+=1
|
||||
# if self._ScrollStep >=5:
|
||||
# self._ScrollStep = 5
|
||||
# else:
|
||||
# self._ScrollStep = 1
|
||||
|
||||
cur_time = time.time()
|
||||
# cur_time = time.time()
|
||||
|
||||
if cur_time - self._Screen._LastKeyDown > 0.3:
|
||||
self._ScrollStep = 1
|
||||
# if cur_time - self._Screen._LastKeyDown > 0.3:
|
||||
# self._ScrollStep = 1
|
||||
|
||||
def KeyDown(self,event):
|
||||
|
||||
@ -448,33 +448,29 @@ class RomListPage(Page):
|
||||
self._Screen.PushCurPage()
|
||||
self._Screen.SetCurPage(self._Parent.FavListPage)
|
||||
else:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollDown()
|
||||
self.ScrollDown(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Left"]:
|
||||
if self._Backspace:
|
||||
move = 6
|
||||
|
||||
for i in range(move):
|
||||
self.ScrollUp()
|
||||
self.ScrollUp(5)
|
||||
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Up"]:
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollUp()
|
||||
# self.ScrollUp()
|
||||
self.ScrollUp(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
if event.key == CurKeys["Down"]:
|
||||
self.SpeedScroll(event.key)
|
||||
self.ScrollDown()
|
||||
# self.ScrollDown()
|
||||
self.ScrollDown(self._ScrollStep)
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
|
||||
@ -16,7 +16,8 @@ class LangManager(object):
|
||||
|
||||
_Langs = {}
|
||||
_Config = None
|
||||
_ConfigFileName = "00_English.ini" ## double % to escape
|
||||
# _ConfigFileName = "00_English.ini" ## double % to escape
|
||||
_ConfigFileName = "99_DEOT_English.ini"
|
||||
_CJKMode = False
|
||||
|
||||
def __init__(self):
|
||||
@ -113,6 +114,5 @@ def InitMyLangManager():
|
||||
global MyLangManager
|
||||
if MyLangManager == None:
|
||||
MyLangManager = LangManager()
|
||||
|
||||
|
||||
InitMyLangManager()
|
||||
|
||||
@ -8,7 +8,7 @@ import sys
|
||||
import math
|
||||
import fnmatch
|
||||
import random
|
||||
|
||||
import time
|
||||
|
||||
from libs import easing
|
||||
|
||||
@ -111,6 +111,8 @@ class Page(Widget):
|
||||
_Padding = pygame.Rect(0, 0, 0, 0) # x,y,w,h
|
||||
_Margin = pygame.Rect(0, 0, 0, 0)
|
||||
_ScrollStep = 1
|
||||
_Scrolled = 0
|
||||
_ItemsPerPage = 6
|
||||
|
||||
def __init__(self):
|
||||
self._Icons = []
|
||||
@ -581,65 +583,165 @@ class Page(Widget):
|
||||
self._Icons[i].Draw()
|
||||
|
||||
# make sure the Class has the _MyList
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
self._PsIndex +=1
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
# def ScrollDown(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex +=1
|
||||
# if self._PsIndex >= len(self._MyList):
|
||||
# self._PsIndex = len(self._MyList) -1
|
||||
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY +cur_li._Height > self._Height:
|
||||
# for i in range(0,len(self._MyList)):
|
||||
# self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
|
||||
def ScrollUp(self):
|
||||
if len(self._MyList) == 0:
|
||||
# def ScrollUp(self):
|
||||
# if len(self._MyList) == 0:
|
||||
# return
|
||||
# self._PsIndex -= 1
|
||||
# if self._PsIndex < 0:
|
||||
# self._PsIndex = 0
|
||||
# cur_li = self._MyList[self._PsIndex]
|
||||
# if cur_li._PosY < 0:
|
||||
# for i in range(0, len(self._MyList)):
|
||||
# self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
|
||||
def ScrollUp(self, step = 1):
|
||||
if len(self._MyList) <= 1:
|
||||
return
|
||||
self._PsIndex -= 1
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
|
||||
def FScrollUp(self,Step=1):
|
||||
if len(self._MyList) == 0:
|
||||
# check step
|
||||
if step > self._ItemsPerPage:
|
||||
step = self._ItemsPerPage - 1
|
||||
if step > len(self._MyList) - 1:
|
||||
step = 1
|
||||
|
||||
# first to end
|
||||
if self._PsIndex - step < 0 and step == 1:
|
||||
# index of the last item on current screen
|
||||
self._PsIndex = 0 + self._ItemsPerPage - 1
|
||||
|
||||
# loop scroll, to end
|
||||
if len(self._MyList) > self._ItemsPerPage:
|
||||
self.FScrollDown(len(self._MyList) - self._ItemsPerPage, True)
|
||||
self._PsIndex = len(self._MyList) - 1
|
||||
self._Scrolled = self._PsIndex
|
||||
return
|
||||
else:
|
||||
self.FScrollUp(step)
|
||||
|
||||
def ScrollDown(self, step = 1):
|
||||
if len(self._MyList) <= 1:
|
||||
return
|
||||
|
||||
# check step
|
||||
if step > self._ItemsPerPage:
|
||||
step = self._ItemsPerPage - 1
|
||||
if step > len(self._MyList) - 1:
|
||||
step = 1
|
||||
|
||||
# end to first
|
||||
if self._PsIndex + step >= len(self._MyList) and step == 1:
|
||||
# index of the first item on current screen
|
||||
self._PsIndex = (len(self._MyList) - 1) - (self._ItemsPerPage - 1)
|
||||
|
||||
# loop scroll, to first
|
||||
if len(self._MyList) > self._ItemsPerPage:
|
||||
self.FScrollUp(len(self._MyList) - self._ItemsPerPage, True)
|
||||
self._PsIndex = 0
|
||||
self._Scrolled = self._PsIndex
|
||||
return
|
||||
else:
|
||||
self.FScrollDown(step)
|
||||
|
||||
# do not directly call this function, please use "ScrollUp(step)"
|
||||
def FScrollUp(self, step = 1, loop_scroll = False):
|
||||
# if len(self._MyList) == 0:
|
||||
if len(self._MyList) <= 1:
|
||||
return
|
||||
|
||||
if step < self._ItemsPerPage and not loop_scroll:
|
||||
if (self._PsIndex - step + 1) - 1 < step:
|
||||
step = 1
|
||||
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex -= Step
|
||||
self._PsIndex -= step
|
||||
|
||||
if self._PsIndex < 0:
|
||||
self._PsIndex = 0
|
||||
dy = tmp-self._PsIndex
|
||||
|
||||
# dy = tmp-self._PsIndex
|
||||
dy = abs(tmp - self._PsIndex)
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height*dy
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height * dy
|
||||
self._Scrolled += dy
|
||||
|
||||
# do not directly call this function, please use "ScrollDown(step)"
|
||||
def FScrollDown(self, step = 1, loop_scroll = False):
|
||||
# if len(self._MyList) == 0:
|
||||
if len(self._MyList) <= 1:
|
||||
return
|
||||
|
||||
if step < self._ItemsPerPage and not loop_scroll:
|
||||
if len(self._MyList) - (self._PsIndex + step + 1) < step:
|
||||
step = 1
|
||||
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex += step
|
||||
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) - 1
|
||||
|
||||
# dy = self._PsIndex - tmp
|
||||
dy = abs(self._PsIndex - tmp)
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY + cur_li._Height > self._Height:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height * dy
|
||||
self._Scrolled -= dy
|
||||
|
||||
def SyncScroll(self):
|
||||
if self._Scrolled == 0:
|
||||
return
|
||||
|
||||
if self._PsIndex < len(self._MyList):
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if self._Scrolled > 0:
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
elif self._Scrolled < 0:
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
|
||||
def SpeedScroll(self, thekey):
|
||||
if self._Screen._LastKey == thekey:
|
||||
self._ScrollStep += 1
|
||||
if self._ScrollStep >= self._ItemsPerPage:
|
||||
self._ScrollStep = self._ItemsPerPage - 1
|
||||
else:
|
||||
self._ScrollStep = 1
|
||||
|
||||
cur_time = time.time()
|
||||
|
||||
if cur_time - self._Screen._LastKeyDown > 0.3:
|
||||
self._ScrollStep = 1
|
||||
|
||||
if len(self._MyList) < self._ItemsPerPage:
|
||||
self._ScrollStep = 1
|
||||
|
||||
def RefreshPsIndex(self):
|
||||
if len(self._MyList) == 0:
|
||||
self._PsIndex = 0
|
||||
if self._PsIndex > (len(self._MyList) -1):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
|
||||
def FScrollDown(self,Step=1):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
tmp = self._PsIndex
|
||||
self._PsIndex +=Step
|
||||
if self._PsIndex >= len(self._MyList):
|
||||
self._PsIndex = len(self._MyList) -1
|
||||
dy = self._PsIndex - tmp
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height*dy
|
||||
|
||||
# def KeyDown(self,event):##default keydown,every inherited page class should have it's own KeyDown
|
||||
# def KeyDown(self,event):##default keydown, every inherited page class should have it's own KeyDown
|
||||
# fast: fast display mode
|
||||
def KeyDown(self, event, fast = False):##default keydown,every inherited page class should have it's own KeyDown
|
||||
def KeyDown(self, event, fast = False):##default keydown, every inherited page class should have it's own KeyDown
|
||||
|
||||
if IsKeyMenuOrB(event.key):
|
||||
self.ReturnToUpLevelPage()
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"gitversion":"fd63173",
|
||||
"gitversion":"d89f523",
|
||||
"version":"200626"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user