Пример #1
0
    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
Пример #2
0
def SetDisplay():
    global DISPLAY
    if not Core.RunInFullScreen:
        DISPLAY = pygame.display.set_mode((Core.MAIN.ScreenWidth, Core.MAIN.ScreenHeight), pygame.DOUBLEBUF | pygame.HWACCEL | pygame.HWSURFACE)

    else:
        DISPLAY = pygame.display.set_mode((Core.MAIN.ScreenWidth, Core.MAIN.ScreenHeight), pygame.DOUBLEBUF | pygame.HWACCEL | pygame.HWSURFACE | pygame.FULLSCREEN)

    pygame.display.set_caption("Taiyou Framework v" + UTILS.FormatNumber(Core.TaiyouGeneralVersion))
Пример #3
0
    def LoadRegKeysInFolder(self):
        """
        Load all keys on Specified Folder
        :param reg_dir:Specified Folder
        :return:
        """
        if self.Reg_Path == "":
            raise Exception("Registry Path was not set.")

        reg_dir = self.Reg_Path
        # -- FIX for working on Windows -- #
        self.Reg_Path = self.SourceFolder + reg_dir.replace(
            self.SourceFolder, "")
        self.Reg_Path = self.Reg_Path.replace(
            "/", CorePaths.TaiyouPath_CorrectSlash)

        start_time = time.time()
        # -- Unload the Registry -- #
        self.UnloadRegistry()

        print("Taiyou.ContentManager.LoadRegistry : Loading Registry...")

        temp_reg_keys = UTILS.Directory_FilesList(reg_dir)
        index = -1

        for x in temp_reg_keys:
            if self.StopLongOperations:
                break

            index += 1

            CorrectKeyName = x.replace(reg_dir, "").replace(".data", "")
            file = open(x, "r")

            CurrentLine = file.read().splitlines()
            AllData = ""
            for x in CurrentLine:
                if not x.startswith("#"):
                    AllData += x + "\n"

            # -- Format the Text -- #
            AllData = AllData.rstrip().replace("%n", "\n").replace(
                "%t", "\t").replace("%s", " ")

            self.reg_keys.append(CorrectKeyName)
            self.reg_contents.append(AllData)

            print("Taiyou.ContentManager.LoadRegistry : KeyLoaded[" +
                  CorrectKeyName + "]")

        print(
            "Taiyou.ContentManager.LoadRegistry : Total of {0} registry keys loaded. In {1} seconds."
            .format(str(len(self.reg_keys)),
                    UTILS.FormatNumber(time.time() - start_time, 4)))

        UTILS.GarbageCollector_Collect()
Пример #4
0
def Draw(DISPLAY):
    global LagIndicatorSurface
    global LagTextColor
    global LagEnabled
    global Alpha
    global FPS

    if not LagEnabled:
        return

    LagText = "LAG: " + Utils.FormatNumber(FPS, 2)
    LagTextWidth = UI.ContentManager.GetFont_width("/PressStart2P.ttf", 14,
                                                   LagText)
    LagTextHeight = UI.ContentManager.GetFont_height("/PressStart2P.ttf", 14,
                                                     LagText)

    Shape.Shape_Rectangle(DISPLAY, (0, 0, 0),
                          (5 - 2, 5 - 2, LagTextWidth + 4, LagTextHeight + 4),
                          0, 3)
    UI.ContentManager.FontRender(DISPLAY, "/PressStart2P.ttf", 14, LagText,
                                 LagTextColor, 5, 5)