Switching between wide icons and big icons?

Discussion and development of skins for XBMC4XBOX
Post Reply
User avatar
XC-3730C
Posts: 264
Joined: Thu May 15, 2014 6:27 am
Been thanked: 11 times

Switching between wide icons and big icons?

Post by XC-3730C »

As I understand it, either wide or big icons need to be named default.tbn, correct? If this is the case, how can I have both wide and big icons in the same folder so I could switch between the two?
User avatar
Dom DXecutioner
Posts: 585
Joined: Thu Jul 05, 2012 11:59 pm
Location: California
Has thanked: 249 times
Been thanked: 219 times
Contact:

Re: Switching between wide icons and big icons?

Post by Dom DXecutioner »

XC-3730C wrote:As I understand it, either wide or big icons need to be named default.tbn, correct? If this is the case, how can I have both wide and big icons in the same folder so I could switch between the two?
Since you're not being specific, I'll speculate you're referring to the programs section of xbmc!

Normally we use a an image control to, you guessed it, display images; the <texture></texture> property is used to point to the path of the image you wish to display. We use the standard ListItem.Icon info label to display the image that xbmc has scanned by default.

Code: Select all

<control type="image">			<!-- default square icon -->
	<posy>89</posy>
	<posx>49</posx>
	<width>128</width>
	<height>128</height>
	<aspectratio>stretch</aspectratio>
	<texture>$INFO[ListItem.Icon]</texture>
</control>
To override that icon, we then place an image at the root of the game/emulator/program folder named "default.tbn"; we can then continue to use the same ListItem.Icon info label. At this point, it doesn't matter if the default.tbn image is of poster/thumb/icon/wideicon; however, the skin that you'll be using will have to support that specific view.

You really can't have multiple image types, ie. poster/thumb/icon/wideicon for the same item without doing some customization to the skin or creating a new view yourself. At least I'm not aware of any skin that will support this. Most skins will only support one type per game/emulator/program.
Image
User avatar
XC-3730C
Posts: 264
Joined: Thu May 15, 2014 6:27 am
Been thanked: 11 times

Re: Switching between wide icons and big icons?

Post by XC-3730C »

Oh too bad it couldn't be say, default.tbn for a wide icon, and folder.jpg for a big icon and be able to switch icon views based on that.
User avatar
Dom DXecutioner
Posts: 585
Joined: Thu Jul 05, 2012 11:59 pm
Location: California
Has thanked: 249 times
Been thanked: 219 times
Contact:

Switching between wide icons and big icons?

Post by Dom DXecutioner »

Like I said, you can, but you'd have to edit the views of your preferred skin, otherwise you'll have to stick to one type of image.
Image
User avatar
XC-3730C
Posts: 264
Joined: Thu May 15, 2014 6:27 am
Been thanked: 11 times

Re: Switching between wide icons and big icons?

Post by XC-3730C »

It would be awesome if there was a program plugin for xbmc4xbox that somehow would let you rename the default.tbn to folder.jpg and vice versa because it seems to be that whatever is named default.tbn takes precedence over anything else.
User avatar
Dan Dar3
Posts: 1176
Joined: Sun Jul 08, 2012 4:09 pm
Has thanked: 273 times
Been thanked: 257 times
Contact:

Re: Switching between wide icons and big icons?

Post by Dan Dar3 »

@XC-3730C
Change the path in the code below (that's where it starts recursively, backup your stuff so it doesn't break it for you), upload through FTP as Q:\scripts\rename.py and then run from Scripts screen.

Code: Select all

import os

RENAME_IN_PATH = "X:\whatever\path\to\start"
RENAME_FROM    = "default.tbn"
RENAME_TO      = "folder.jpg"

for dirpath, dirnames, filenames in os.walk(RENAME_IN_PATH):
    for filename in filenames:
        if filename == RENAME_FROM:
            rename_from = os.path.join(dirpath, RENAME_FROM)
            rename_to   = os.path.join(dirpath, RENAME_TO)
            print "Rename %s => %s" % (rename_from, rename_to)
            os.rename(rename_from, rename_to)
References:
https://docs.python.org/2/library/os.html
Post Reply