def __init__(self, pDefaultContent, pRootObj): self.DefaultContent = pDefaultContent self.RootObj = pRootObj self.ApplicationSelector = UI.ApplicationSelector( pDefaultContent, Core.MAIN.ScreenWidth / 2 - 550 / 2, Core.MAIN.ScreenHeight / 2 - 120 / 2) self.NoFoldersFound = False self.LoadApplicationsList() self.BottomButtonsList = Widget.Widget_Controller( pDefaultContent, (5, Core.MAIN.ScreenHeight - 50 - 5, Core.MAIN.ScreenWidth - 10, 50)) VersionText = "Taiyou Framework v" + CoreUtils.FormatNumber(Core.TaiyouGeneralVersion) + \ "\nTaiyou UI/Taskbar v" + Core.Get_TaiyouUIVersion() self.BottomButtonsList.Append( Widget.Widget_Label(pDefaultContent, "/Ubuntu_Bold.ttf", VersionText, 14, (200, 200, 200), 5, 5, 0)) self.ApplicationManagerBarAnimatorDisableToggle = True self.ApplicationManagerBarAnimator = CoreUtils.AnimationController(2) self.ApplicationManagerBarAnimator.Enabled = False self.ApplicationManagerBar = Widget.Widget_Controller( pDefaultContent, (5, 650, Core.MAIN.ScreenWidth - 10, 50)) self.ApplicationManagerBar.Append( Widget.Widget_Button(pDefaultContent, "Open Application", 14, 5, 5, 0)) self.ApplicationManagerEnabled = False self.TextsBaseX = 0 self.DisableInput = False
def __init__(self, pDefaultContent, pRootProcess): self.Enabled = False self.DisableToggle = False self.RootProcess = pRootProcess self.Animation = CoreUtils.AnimationController(3, multiplierRestart=True) self.CurrentMode = None self.GoToModeWhenReturning = None self.DefaultContent = pDefaultContent self.LastDisplayFrame = pygame.Surface( (Core.MAIN.ScreenWidth, Core.MAIN.ScreenHeight), pygame.HWACCEL | pygame.HWSURFACE) self.Workaround_RenderLastFrame = False self.BluredBackgroundResult = pygame.Surface( (0, 0), pygame.HWACCEL | pygame.HWSURFACE) self.SetMode(0)
def Initialize(self): global LagIndicatorSurface global LagTextWidth global LagTextHeight global LagTextColor global FlashingAnimation global ProcessInstanceRefence ProcessInstanceRefence = self LagTextWidth = UI.ContentManager.GetFont_width("/PressStart2P.ttf", 14, "LAG") LagTextHeight = UI.ContentManager.GetFont_height("/PressStart2P.ttf", 14, "LAG") LagIndicatorSurface = pygame.Surface((LagTextWidth + 4, LagTextHeight + 4)) LagTextColor = (255, 0, 0) FlashingAnimation = Utils.AnimationController(5, 255, multiplierRestart=True)
def __init__(self, pPID, pProcessName, pROOT_MODULE, pInitArgs, pProcessIndex): self.ImagesHasBeenLoaded = False self.Timer = pygame.time.Clock() self.BootloaderKeys = Core.CntMng.ContentManager() self.BootloaderKeys.SetSourceFolder("", True) self.BootloaderKeys.SetRegKeysPath("reg/BOOTLOADER") self.BootloaderKeys.LoadRegKeysInFolder() # Load DefaultUI Contents UI.SystemResources = Core.CntMng.ContentManager() UI.SystemResources.SetSourceFolder("", True) UI.SystemResources.SetFontPath("fonts") UI.SystemResources.SetImageFolder("img") UI.SystemResources.SetRegKeysPath("reg") UI.SystemResources.SetSoundPath("sound") UI.SystemResources.SetFontPath("fonts") UI.SystemResources.InitSoundSystem() UI.SystemResources.LoadRegKeysInFolder() UI.SystemResources.LoadSoundsInFolder() UI.SystemSoundsVolume = float( UI.SystemResources.Get_RegKey("UI/system_sounds_volume")) self.DefaultContent = UI.SystemResources self.Progress = 0 self.ProgressAddDelay = 0 self.ProgressProgression = True self.ProgressMax = 2 self.LoadingComplete = False self.InitialLoadingDelay = 0 self.LastProgress = 0 self.NoFoldersFound = False self.FatalErrorScreen = False self.ApplicationSeletorWelcomeSound = False self.InitialSignal = False super().__init__(pPID, pProcessName, pROOT_MODULE, pInitArgs, pProcessIndex) self.CenterX = self.DISPLAY.get_width() / 2 self.CenterY = self.DISPLAY.get_height() / 2 self.ApplicationSeletor = False self.ApplicationSeletorAnimatorStart = UTILS.AnimationController( 0.5, multiplierRestart=True) self.ApplicationSelectorObj = ApplicationSelector( self.DefaultContent, self.CenterX - 550 / 2, self.CenterY - 120 / 2) # List all valid folders folder_list = UTILS.Directory_FilesList( "." + CorePaths.TaiyouPath_CorrectSlash) BootFolders = list() for file in folder_list: if file.endswith(CorePaths.TaiyouPath_CorrectSlash + "boot"): BootFolders.append(file) ListInstalledApplications(BootFolders, self.ApplicationSelectorObj) if len(BootFolders) == 0 or len( self.ApplicationSelectorObj.SeletorItems_Index) == 0: self.NoFoldersFound = True