activewids = [] #category lists maincat = [filet, calct, settingt, themet, helpt] gamescat = [gttt] welcomecat = [introt] democat = [introt, starryt, rayburstt, dazzlet, pixelpatt] ltoolcat = [TASKMAN, LAUNCHCON, LAUNCHSHELL, LAUNCHFILE] plugincat = [] myvmcat = [] mytromscat = [] otherromscat = [] for vmuserfile in libfilevirtual.diriterate(["VMUSER"]): if (vmuserfile.lower()).endswith(".trom"): mytromscat.extend([ launchtile((vmuserfile.rsplit('.', 1)[0]), romicon, 2, lref=os.path.join("VMUSER", vmuserfile)) ]) for romfile in libfilevirtual.diriterate(["ROMS"]): if (romfile.lower()).endswith(".trom"): otherromscat.extend([ launchtile((romfile.rsplit('.', 1)[0]), romicon, 2, lref=os.path.join("ROMS", romfile))
(screenx, 50), 2) filemenux = filehud.blit(fvfilemenu, (3, 5)) filp1 = filehud.blit(panefilter1, (2, 56)) filp2 = filehud.blit(panefilter2, (94, 56)) filehud.blit(fvbadge, (338, 14)) hudt = hudfont.render("Fileview", True, libthemeconf.hudtext) filehud.blit(hudt, (340, 88)) hudt2 = hudfont.render("Pane 1", True, libthemeconf.hudtext) filehud.blit(hudt2, (433, 1)) hudt3 = hudfont.render("Pane 2", True, libthemeconf.hudtext) filehud.blit(hudt3, (433, 56)) #set list vertical draw to listyoff offset. note that listy is used to blit gxmask listy = listyoff #reset list of fileclick objects. flist = list() for fname in libfilevirtual.diriterate(pathlist): fnamelo = fname.lower() fileval = 0 #directory check if libfilevirtual.isdir(fname, pathlist): if listy < listydef or listy > screeny: fileval = 2 else: textit = simplefontB.render(fname, True, libthemeconf.tiletext) #a small surface is used to create the "tiles" look of the file list. (it also simplifies the click areas to 1 per item) gxmask.fill(tilebgcolor) if fname == "..": gxmask.blit(fvup, (iconx, 0)) else: gxmask.blit(fvdir, (iconx, 0))
def render(self): if self.scup==1: self.widsurf.fill(framebg) if self.runexec==0: self.sw1bx=self.widsurf.blit(fvrunsw, ((2), (2))) else: self.sw1bx=self.widsurf.blit(fvviewsw, ((2), (2))) #ui self.filbtn=self.widsurf.blit(typefilter1, ((42 + 2), (2))) self.filbtn.x += self.x self.filbtn.y += self.y self.sw1bx.x += self.x self.sw1bx.y += self.y self.widsurf.blit(iconlist[self.filterflg], ((82 + 3), (3))) self.scup=0 self.texty=self.yoff self.textx=150 self.taskdict=dict() self.clicklist=list() #filelist parser (uses libfilevirtual_ for self.fileitm in libfilevirtual.diriterate(self.argument): self.fnamelo=self.fileitm.lower() if libfilevirtual.isdir(self.fileitm, self.argument): if self.texty>=0 and self.texty<=self.widy: self.labtx=simplefont.render((self.fileitm), True, libthemeconf.tiletext, libthemeconf.tilecolor) self.clickbx=self.widsurf.blit(self.minibox, (self.textx, self.texty)) self.widsurf.blit(self.labtx, (self.textx+44, self.texty+4)) if self.fileitm=="..": self.widsurf.blit(typ_up.typeicon, (self.textx, self.texty)) else: self.widsurf.blit(typ_dir.typeicon, (self.textx, self.texty)) self.clickbx.x += self.x self.clickbx.y += self.y self.clicklist.extend([fileclick(self.clickbx, self.fileitm, "dir")]) self.texty += 30 else: self.texty += 30 else: for self.typ in typelist: if self.fnamelo.endswith((self.typ.ext)) and (self.filterflg==0 or self.filterflg==self.typ.filterflg): if self.texty>=0 and self.texty<=self.widy: self.labtx=simplefont.render((self.fileitm), True, libthemeconf.tiletext, libthemeconf.tilecolor) self.clickbx=self.widsurf.blit(self.minibox, (self.textx, self.texty)) self.widsurf.blit(self.labtx, (self.textx+44, self.texty+4)) self.widsurf.blit(self.typ.typeicon, (self.textx, self.texty)) self.clickbx.x += self.x self.clickbx.y += self.y self.clicklist.extend([fileclick(self.clickbx, self.fileitm, self.typ.qxtype)]) self.texty += 30 else: self.texty += 30 self.texty += 30 if self.yoff<0: self.widsurf.blit(self.vscrollbtns[0], (self.widx-40, 0)) if self.texty>self.widy: self.widsurf.blit(self.vscrollbtns[1], (self.widx-40, self.widy-20)) drawframe(self.framerect, self.closerect, self.widbox, self.widsurf, self.screensurf, self.title, self.wo) #filter menu render if self.filmenu==1: self.filret=vmui.passivemenu(filtermenu, (self.x + 42 + 2), (self.y + 42), fontsize=24) self.filmenubx=self.filret[1] self.filmenulist=self.filret[0]