def Init(self): if self._Screen != None: if self._Screen._CanvasHWND != None and self._CanvasHWND == None: self._HWND = self._Screen._CanvasHWND self._CanvasHWND = pygame.Surface( (self._Screen._Width, self._BGheight)) self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width ## equal to screen width self._Height = self._Screen._Height DialogBoxs = MultiIconItem() DialogBoxs._ImgSurf = MyIconPool.GiveIconSurface("buttonslayout") DialogBoxs._MyType = ICON_TYPES["STAT"] DialogBoxs._Parent = self DialogBoxs._IconWidth = 300 DialogBoxs._IconHeight = 150 DialogBoxs.Adjust(0, 0, 134, 372, 0) self._Icons["DialogBoxs"] = DialogBoxs self.GenList() self._Scroller = ListScroller() self._Scroller._Parent = self self._Scroller._PosX = self._Width - 10 self._Scroller._PosY = 2 self._Scroller.Init() self._Scroller.SetCanvasHWND(self._HWND) self._ConfirmPage = UpdateConfirmPage() self._ConfirmPage._LayoutMode = GetButtonsLayoutMode() self._ConfirmPage._Screen = self._Screen self._ConfirmPage._Name = "Overwrite RA conf" self._ConfirmPage._Parent = self self._ConfirmPage.Init()
def KeyDown(self, event): if IsKeyMenuOrB(event.key): self.ReturnToUpLevelPage() self._Screen.Draw() self._Screen.SwapAndShow() if IsKeyStartOrA(event.key): self.ToggleMode() if event.key == CurKeys["X"]: self._ConfirmPage._LayoutMode = GetButtonsLayoutMode() self._Screen.PushPage(self._ConfirmPage) self._Screen.Draw() self._Screen.SwapAndShow()
def ToggleMode(self): if GetButtonsLayoutMode() == "xbox": SetButtonsLayoutMode("snes") self._dialog_index = 1 self._Screen.Draw() self._Screen.SwapAndShow() else: SetButtonsLayoutMode("xbox") self._dialog_index = 0 self._Screen.Draw() self._Screen.SwapAndShow()
def OnLoadCb(self): self._Scrolled = 0 self._PosY = 0 self._DrawOnce = False self._dialog_index = 0 if GetButtonsLayoutMode() == "xbox" else 1