help .py file to show image

Discussion of plugin / script development for XBMC4Xbox
Post Reply
NOTTHESAME
Posts: 532
Joined: Thu Aug 02, 2012 7:46 am
Has thanked: 82 times
Been thanked: 61 times

help .py file to show image

Post by NOTTHESAME »

hey guys i was working on this rom launcher which is a .py file.
can some help me out here please, i been trying to add a code for getting a image to show, i cant seem to find the right code, or i cant seem to place it, heck i the truth is i dont know what im doing.

basicly i want the game console to show when selecting a game, this is for the sega genesis.

this code brings up this image with a list heres a preview.

Image

Code: Select all

import xbmc
import xbmcgui
import os

	
emu = "E:\\Emulators\\Genesis\\default.xbe"
emu = "E:\\Emulators\\Genesis\\gensx_mk.xbe"
dir = "E:\\Roms\\Sega Genesis\\"



def savecut(name):
  f = open("z:\\emu.cut","w")
  d = "<shortcut><path>%s</path><custom><game>%s</game></custom></shortcut>" % (emu,name)
  f.write(d)
  f.close()

def checkdir(tdir):
  dl = os.listdir(tdir)
  ret = xbmcgui.Dialog().select("choose",dl)
  if os.path.isdir(tdir+dl[ret]):
    checkdir(tdir+dl[ret])
  else:
    savecut(tdir+dl[ret])
    xbmc.executebuiltin('xbmc.runxbe(z:\\emu.cut)')

checkdir(dir)

if someone can help with .py experience
thanks guys
User avatar
Dan Dar3
Posts: 1176
Joined: Sun Jul 08, 2012 4:09 pm
Has thanked: 273 times
Been thanked: 257 times
Contact:

Re: help .py file to show image

Post by Dan Dar3 »

I don't think you can display an image using xbmcgui.Dialog().select(), that just displays a list of options to choose, in your case it's read with os.listdir() - i don't know what that image control does in there, if it's standard or skin specific. http://mirrors.xbmc.org/docs/python-doc ... log-select

You could change to using xbmcgui.Dialog().browse() instead and point it to the directory you want, might get thumbs for folders and files if they have them built in (e.g. xbe) or you define one of those custom XBMC thumb icons. Limitations include not being able to select folders (it will navigate into them) if you need to or you will be able to navigate anywhere from the starting position. Link below to documentation, trying to find XBMC4Xbox specific one, this is XBMC and might contain parameters that we don't support. http://mirrors.xbmc.org/docs/python-doc ... log-browse
NOTTHESAME
Posts: 532
Joined: Thu Aug 02, 2012 7:46 am
Has thanked: 82 times
Been thanked: 61 times

Re: help .py file to show image

Post by NOTTHESAME »

ahh okay, so let me try this, if i can the xbe icon to show this would also be cool, i tried alot of things and just didnt seem to code it out, i coudlnt find theses pages you send me thanks now let me see what i can do. :)
Post Reply