Allez, parce que je viens de me prendre la tête assez longtemps !
TUTO : Comment changer l'ordre des boutons d'une skin pour xbmc !
Appli nécessaire : client FTP, et NOTEPAD ! ( attention, ce dernier est TRES difficile à trouver ! ).
Comment faire ?
Dans le répertoire de xbmc, allez dans skin, puis allez sur dans le répertoire de la skin que vous voulez "modder".
Par exemple : xbmc\skin\maSkin
Dedans, vous aurez encore des répertoires... Allez dans le répertoire "pal" si vous petes en pal, ntsc si vous petes en ntsc, etc.
Vous devrez trouver une tonne de xml. ZINQUIETEZ PAS ! Zavez pas besoin de tout connaitre ! Les seuls fichiers intéressants sont :
home.xml : représente la page de garde de xbmc ( le menu de base )
myprograms.xml : représente le menu de xbmc sous le bouton "My programs"
etc pour les applis, vidéos, gnagna.
Venons en au coeur du sujet : changer l'ordre des boutons !
Editez, par exemple, le fichier Home.xml, pour changer la page de garde . Vous devrez trouver une foule de déclarations xml. Zinquiétez pas ca va être très simple.
Par exemple :
Citation :
<control>
<description>My prog normal push button</description>
<type>button</type>
<id>2</id>
<posX>234</posX>
<posY>180</posY>
<width>145</width>
<height>32</height>
<label>0</label>
<font>font16</font>
<hyperlink>1</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>8</onup>
<ondown>3</ondown>
</control>
<control>
<description>My vids normal push button</description>
<type>button</type>
<id>3</id>
<posX>234</posX>
<posY>212</posY>
<width>145</width>
<height>32</height>
<label>3</label>
<font>font16</font>
<hyperlink>6</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>2</onup>
<ondown>4</ondown>
</control>
<control>
<description>My Music normal push button</description>
<type>button</type>
<id>4</id>
<posX>234</posX>
<posY>244</posY>
<width>145</width>
<height>32</height>
<label>2</label>
<hyperlink>501</hyperlink>
<font>font16</font>
<onleft>15</onleft>
<onright>10</onright>
<onup>3</onup>
<ondown>5</ondown>
</control>
|
Oui je sais vu comme ca c'est moche, mais bon, pas compliqué. Décortiquons la structure :
Citation :
<control> <== début de la déclaration
<description>My vids normal push button</description> <== les commentaires (apparaitront nulle part)
<type>button</type> <== le type de la chose ( ici, un bouton )
<id>3</id> <== son identifiant ( doit être UNIQUE dans la page)
<posX>234</posX> <== Sa position horizontale en pixels par rapport au coin en haut à gauche ( qui est 0)
<posY>212</posY> <== sa position verticale
<width>145</width> <== sa largeur
<height>32</height> <== sa hauteur
<label>3</label> <== jesaispo
<font>font16</font> <== la police utilisée
<hyperlink>6</hyperlink> <== le lien quand on clique dessus (j'imagine)
<onleft>15</onleft> <== l'identifiant du prochain control à sélectionner quand on appuie sur "gauche" sur la manette
<onright>10</onright> <== pareil mais droite
<onup>2</onup> <== haut
<ondown>4</ondown> <== bas
</control>
|
C'est déjà moins barbare hein ? Reprenons l'exemple du début. Imaginons que vous vouliez intervertir le bouton "programs" et le bouton "Music". Le xml d'origine ( à titre de rappel) a cette tête :
Citation :
<control>
<description>My prog normal push button</description>
<type>button</type>
<id>2</id>
<posX>234</posX>
<posY>180</posY>
<width>145</width>
<height>32</height>
<label>0</label>
<font>font16</font>
<hyperlink>1</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>8</onup>
<ondown>3</ondown>
</control>
<control>
<description>My vids normal push button</description>
<type>button</type>
<id>3</id>
<posX>234</posX>
<posY>212</posY>
<width>145</width>
<height>32</height>
<label>3</label>
<font>font16</font>
<hyperlink>6</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>2</onup>
<ondown>4</ondown>
</control>
<control>
<description>My Music normal push button</description>
<type>button</type>
<id>4</id>
<posX>234</posX>
<posY>244</posY>
<width>145</width>
<height>32</height>
<label>2</label>
<hyperlink>501</hyperlink>
<font>font16</font>
<onleft>15</onleft>
<onright>10</onright>
<onup>3</onup>
<ondown>5</ondown>
</control>
|
Cela signifie que les boutons sont disposés ainsi dans xbmc :
Citation :
My programs
My Videos
My Music
|
De haut en bas. Pour les swapper, on peut tout simplement swapper leurs coordonnées Y :
Citation :
<control>
<description>My prog normal push button</description>
<type>button</type>
<id>2</id>
<posX>234</posX>
<posY>244</posY>
<width>145</width>
<height>32</height>
<label>0</label>
<font>font16</font>
<hyperlink>1</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>8</onup>
<ondown>3</ondown>
</control>
<control>
<description>My vids normal push button</description>
<type>button</type>
<id>3</id>
<posX>234</posX>
<posY>212</posY>
<width>145</width>
<height>32</height>
<label>3</label>
<font>font16</font>
<hyperlink>6</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>2</onup>
<ondown>4</ondown>
</control>
<control>
<description>My Music normal push button</description>
<type>button</type>
<id>4</id>
<posX>234</posX>
<posY>180</posY>
<width>145</width>
<height>32</height>
<label>2</label>
<hyperlink>501</hyperlink>
<font>font16</font>
<onleft>15</onleft>
<onright>10</onright>
<onup>3</onup>
<ondown>5</ondown>
</control>
|
Enregistrez et transférez via ftp. Pour activer les changement de xbmc, pas besoin de rebooter : mettez une autre skin, puis remettez celle que vous moddez, et zopla.
Vous voyez ? les deux boutons ont bien changé de place. Maintenant, pour que ca soit joli et que vous vous y retrouviez, je vous conseille de mettre le bouton Music avant Programs dans le fichier xml aussi. Ca change rien mais c'est plus lisible :
Citation :
<control>
<description>My Music normal push button</description>
<type>button</type>
<id>4</id>
<posX>234</posX>
<posY>180</posY>
<width>145</width>
<height>32</height>
<label>2</label>
<hyperlink>501</hyperlink>
<font>font16</font>
<onleft>15</onleft>
<onright>10</onright>
<onup>3</onup>
<ondown>5</ondown>
</control>
<control>
<description>My vids normal push button</description>
<type>button</type>
<id>3</id>
<posX>234</posX>
<posY>212</posY>
<width>145</width>
<height>32</height>
<label>3</label>
<font>font16</font>
<hyperlink>6</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>2</onup>
<ondown>4</ondown>
</control>
<control>
<description>My prog normal push button</description>
<type>button</type>
<id>2</id>
<posX>234</posX>
<posY>244</posY>
<width>145</width>
<height>32</height>
<label>0</label>
<font>font16</font>
<hyperlink>1</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>8</onup>
<ondown>3</ondown>
</control>
|
C'est déjà plus lisible. Mais, remarquez que quand vous vous baladez dans les menus, ca déconne, niveau browsing. Normal, vous avez pas touchés aux touches up, left, etc. Je vous conseille ensuite, pour être toujours "propre", de changer les numéros d'identifiant de games et de vidéo pour que ce soit séquentiel ( on a affiché dans xbmc maintenant Music, Videos, Progs , donc autant mettre des identifiants type 2,3,4 dans l'ordre, ca simplifie les choses ).
Adonc :
Citation :
<control>
<description>My Music normal push button</description>
<type>button</type>
<id>2</id>
<posX>234</posX>
<posY>180</posY>
<width>145</width>
<height>32</height>
<label>2</label>
<hyperlink>501</hyperlink>
<font>font16</font>
<onleft>15</onleft>
<onright>10</onright>
<onup>3</onup>
<ondown>5</ondown>
</control>
<control>
<description>My vids normal push button</description>
<type>button</type>
<id>3</id>
<posX>234</posX>
<posY>212</posY>
<width>145</width>
<height>32</height>
<label>3</label>
<font>font16</font>
<hyperlink>6</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>2</onup>
<ondown>4</ondown>
</control>
<control>
<description>My prog normal push button</description>
<type>button</type>
<id>4</id>
<posX>234</posX>
<posY>244</posY>
<width>145</width>
<height>32</height>
<label>0</label>
<font>font16</font>
<hyperlink>1</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>8</onup>
<ondown>3</ondown>
</control>
|
Ensuite, on veut changer l'ordre de sélection des boutons. Quand on est sur Music (id 2) on veut aller sur Vidéo (id 3) en appuyant sur la touche "bas". Donc, dans la propriété "ondown" de Music, on va mettre 3 (l'identifiant de Vidéo). Ca marche pareil pour les autres !
Citation :
<control>
<description>My Music normal push button</description>
<type>button</type>
<id>2</id>
<posX>234</posX>
<posY>180</posY>
<width>145</width>
<height>32</height>
<label>2</label>
<hyperlink>501</hyperlink>
<font>font16</font>
<onleft>15</onleft>
<onright>10</onright>
<onup>4</onup>
<ondown>3</ondown>
</control>
<control>
<description>My vids normal push button</description>
<type>button</type>
<id>3</id>
<posX>234</posX>
<posY>212</posY>
<width>145</width>
<height>32</height>
<label>3</label>
<font>font16</font>
<hyperlink>6</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>2</onup>
<ondown>4</ondown>
</control>
<control>
<description>My prog normal push button</description>
<type>button</type>
<id>4</id>
<posX>234</posX>
<posY>244</posY>
<width>145</width>
<height>32</height>
<label>0</label>
<font>font16</font>
<hyperlink>1</hyperlink>
<onleft>15</onleft>
<onright>10</onright>
<onup>3</onup>
<ondown>2</ondown>
</control>
|
Et voilà ! Maintenant, vous avez fait une jolie boucle entre Music, Vidéos et Programs avec les touches haut/bas !
Une dernière chose : si vous voulez que Music soit maintenant sélectionné par défaut quand on arrive sur la page, allez tout en haut du fichier xml et vous devriez trouver quelque chose du genre :
Citation :
<window>
<id>0</id>
<defaultcontrol>2</defaultcontrol>
|
Changez la valeur de defaultcontrol en mettant l'id du bouton que vous voulez sélectionner par défaut pour qu'il le soie ! et zopla !
C'est tout. Spa grand chose, mais ca peut être chiant
C'est loni d'être exhaustif, ce tuto a été rédigé après une heure de tuning d'un skin, et j'ai du tout deviner d'après les fichiers xml bruts.... bref
En espérant que cela vous soit utile !
Message édité par Tetedeiench le 10-07-2004 à 23:21:48