Results 1 to 8 of 8

Thread: Need little help with custom list with C#

  1. #1
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855

    Red face Need little help with custom list with C#

    I try to play with the RR plugin for the first time with C#.
    I need to create a custom list with differents logo for each line!
    I do that very well with VB.NET (thanks to El Camino) but in C# just the first logo is ok !

    this is my C# code:
    Code:
                    case "rrtranslator_fromtolanguage":
                        SDK.Execute("MENU;RRTranslator_Languages.skin||CLCLEAR;ALL");
                        if (File.Exists(DPath + "Languages.txt")) {
                            string[] sArray = null;
                            sArray = File.ReadAllLines(DPath + "Languages.txt");
    	                    for (int p = 0; p <= sArray.Length; p++) {
    		                    SDK.Execute("CLADD;" + sArray[p]);
                                if (File.Exists(DPath + "Languages\\" + sArray[p] + "\\" + sArray[p] + ".gif"))
                                {
                                    SDK.Execute("CLSETIMG;" + p + 1 + ";" + DPath + "Languages\\" + sArray[p] + "\\" + sArray[p] + ".gif");
    		                    } else {
                                    SDK.Execute("CLSETIMG;" + p + 1 + ";" + DPath + "Languages\\" + "Error.gif");
    		                    }
    	                    }
                            //selectionne la ligne du language actuel
    	                    SDK.Execute("CLFIND;" + Language);
    	                                        } else {
                            SDK.ErrScrn("!! Info !!", DPath  + "Languages.txt file is not found !!!", "");
                        }
                        result = ProcessCommandResults.CommandProcessedStayOnScreen;
                        break;
    My list is the Languages.txt file, and each language is in his own folder into a main folder Languages .

    .\Languages
    .\Languages\Chinese\Chinese.gif
    .\Languages\English\English.gif

    ...

    Thanks for your help

  2. #2
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855

    Unhappy

    I think that i know where is the issue:
    Skintool return me:

    MENU;RRTranslator_Languages.skin
    -
    CLCLEAR;ALL
    -
    CLADD;Chinese
    -
    CLSETIMG;01;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Chinese\Chin ese.gif
    -
    CLADD;English
    -
    CLSETIMG;11;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\English\Engl ish.gif
    -
    CLADD;French
    -
    CLSETIMG;21;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\French\Frenc h.gif
    -
    CLADD;Dutch
    -
    CLSETIMG;31;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Dutch\Dutch. gif
    -
    CLADD;Greek
    -
    CLSETIMG;41;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Greek\Greek. gif
    -
    CLADD;Japanese
    -
    CLSETIMG;51;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Japanese\Jap anese.gif
    -
    CLADD;Portuguese
    -
    CLSETIMG;61;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Portuguese\P ortuguese.gif
    -
    CLADD;Russian
    -
    CLSETIMG;71;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Russian\Russ ian.gif
    -
    CLADD;Spanish
    -
    CLSETIMG;81;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Spanish\Span ish.gif

    But i don't know how why!

  3. #3
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,168
    Blog Entries
    53
    because your not adding the integer your combining a number to another number. Enclose your p+1 in parenthesis to indicate it's an add and not a combine

    convert.ToInt32(p+1)
    Last edited by Sonicxtacy02; 06-28-2012 at 08:16 AM.
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  4. #4
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855
    I have always the same issue:
    Skintools return me :
    CLSETIMG;01;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Chinese\Chin ese.gif
    and not
    CLSETIMG;1;D:\Program Files\Ride Runner\Plugins\RRTranslator\Languages\Chinese\Chin ese.gif

  5. #5
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855
    I have always the same issue:
    My new code is:
    Code:
                    case "rrtranslator_fromtolanguage":
                        SDK.Execute("MENU;RRTranslator_Languages.skin||CLCLEAR;ALL");
                        if (File.Exists(DPath + "Languages.txt")) {
                            string[] sArray = null;
                            sArray = File.ReadAllLines(DPath + "Languages.txt");
    	                    for (int p = 0; p <= sArray.GetUpperBound(0); p++) {
    		                    SDK.Execute("CLADD;" + sArray[p]);
                                if (File.Exists(DPath + "Languages\\" + sArray[p] + "\\" + sArray[p] + ".gif"))
                                {
                                    SDK.Execute("CLSETIMG;" + p + 1 + ";" + DPath + "Languages\\" + sArray[p] + "\\" + sArray[p] + ".gif");
    		                    } else {
                                    SDK.Execute("CLSETIMG;" + p + 1 + ";" + DPath + "Languages\\Error.gif");
    		                    }
    	                    }
                            //selectionne la ligne du language actuel
    	                    SDK.Execute("CLFIND;" + Language);
    	                                        } else {
                            SDK.ErrScrn("!! Info !!", DPath  + "Languages.txt file is not found !!!", "");
                        }
                        result = ProcessCommandResults.CommandProcessedStayOnScreen;
                        break;

  6. #6
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,168
    Blog Entries
    53
    recheck my post i edited it lol
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  7. #7
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855
    Quote Originally Posted by Sonicxtacy02 View Post
    because your not adding the integer your combining a number to another number. Enclose your p+1 in parenthesis to indicate it's an add and not a combine

    convert.ToInt32(p+1)
    All is ok now, great thanks!!!
    My code is now:
    Code:
                    case "rrtranslator_fromtolanguage":
                        SDK.Execute("MENU;RRTranslator_Languages.skin||CLCLEAR;ALL");
                        if (File.Exists(DPath + "Languages.txt")) {
                            string[]  sArray = File.ReadAllLines(DPath + "Languages.txt");
                            for (int p = 0; p <= sArray.GetUpperBound(0); p++)
                            {
                                SDK.Execute("CLADD;" + sArray[p]);
                                if (File.Exists(DPath + "Languages\\" + sArray[p] + "\\" + sArray[p] + ".gif"))
                                {
                                    SDK.Execute("CLSETIMG;" + (p + 1) + ";" + DPath + "Languages\\" + sArray[p] + "\\" + sArray[p] + ".gif");
                                }
                                else
                                {
                                    SDK.Execute("CLSETIMG;" + (p + 1) + ";" + DPath + "Languages\\Error.gif");
                                }
                            }
    
                            //selectionne la ligne du language actuel
                            SDK.Execute("CLFIND;" + INI.ReadString("RRTranslator", "Language", ""));
    	                                        } else {
                            SDK.ErrScrn("!! Info !!", DPath  + "Languages.txt file is not found !!!", "");
                        }
                        result = ProcessCommandResults.CommandProcessedStayOnScreen;
                        break;

  8. #8
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,855
    I am just always my RR issue , i think than i have also with vb.bet with the CLFIND command where the command:
    SDK.Execute("CLFIND;" + Language) create a copy of the logo selected into the first line !!!
    Name:  bug.jpg
Views: 159
Size:  185.1 KB

Similar Threads

  1. Custom List with Variables
    By MGD in forum Road Runner
    Replies: 8
    Last Post: 03-17-2012, 02:40 PM
  2. Custom List question??
    By eribs4e in forum RR Skins
    Replies: 2
    Last Post: 08-11-2009, 09:12 AM
  3. Custom List creation
    By lambosprit in forum Road Runner
    Replies: 11
    Last Post: 05-12-2009, 07:46 PM
  4. Custom List for Extension plugin
    By mukow in forum RR Plugins
    Replies: 8
    Last Post: 02-21-2008, 04:56 PM
  5. Custom List (SC)
    By EL CAMINO in forum Road Runner
    Replies: 2
    Last Post: 10-29-2007, 12:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •