Need a hand

Discussion of XBMC4XBOX development.
Post Reply
User avatar
Rocky5
Posts: 974
Joined: Sat Feb 08, 2014 5:27 am
Has thanked: 101 times
Been thanked: 257 times

Need a hand

Post by Rocky5 »

Update:
Well managed to get what I was wanting, had to split the xml up into 12 separate ones for each month. ( Sorry Americans and Canadians only the rest of the worlds date month format is supported )
http://www.xbmc4xbox.org.uk/forum/viewt ... =60#p36763



OK, well where to begin.

I have been trying to get SubString to work with info labels and I got there but it crashes :? if the variable doesn't match.

So I went about making a work around.
http://pastebin.com/huQFkKtZ
It works, just it slows XBMC down to the point its in slow motion :lol: even if its loaded directly into and xml.

What I'm asking is, I need a hand with the SubString code.

GUIInfoManager.cpp

Code: Select all

  else if (strTest.Left(10).Equals("substring("))
  {
    int pos = strTest.Find(",");
    int info = TranslateString(strTest.Mid(10, pos-10));
    // pipe our original string through the localize parsing then make it lowercase (picks up $LBRACKET etc.)
    CStdString label = CGUIInfoLabel::GetLabel(original.Mid(pos + 1, original.GetLength() - (pos + 2))).ToLower();
    int compareString = ConditionalStringParameter(label);
    return AddMultiInfo(GUIInfo(bNegate ? -STRING_STR: STRING_STR, info, compareString));
  }
to

Code: Select all

  else if (strTest.Left(10).Equals("substring("))
  {
    int pos = strTest.Find(",");
    int info = TranslateString(strTest.Mid(10, pos-10));
    int info2 = TranslateString(strTest.Mid(pos + 1, strTest.GetLength() - (pos + 2)));
    if (info2 > 0)
      return AddMultiInfo(GUIInfo(bNegate ? -STRING_STR: STRING_STR, info, -info2));
    // pipe our original string through the localize parsing then make it lowercase (picks up $LBRACKET etc.)
    CStdString label = CGUIInfoLabel::GetLabel(original.Mid(pos + 1, original.GetLength() - (pos + 2))).ToLower();
    int compareString = ConditionalStringParameter(label);
    return AddMultiInfo(GUIInfo(bNegate ? -STRING_STR: STRING_STR, info, compareString));
  }
Also this needs changing, but I havent a clue what to change it to. I have tried hacking together parts of the compare code but it works or it doesn't or it crashes :lol:

Code: Select all

      case STRING_STR:
        {
          CStdString compare = m_stringParameters[info.GetData2()];
          // our compare string is already in lowercase, so lower case our label as well
          // as CStdString::Find() is case sensitive
          CStdString label;
          if (item && item->IsFileItem() && info.GetData1() >= LISTITEM_START && info.GetData1() < LISTITEM_END)
            label = GetItemImage((const CFileItem *)item, info.GetData1()).ToLower();
          else
            label = GetImage(info.GetData1(), contextWindow).ToLower();
          if (compare.Right(5).Equals(",left"))
            bReturn = label.Find(compare.Mid(0,compare.size()-5)) == 0;
          else if (compare.Right(6).Equals(",right"))
          {
            compare = compare.Mid(0,compare.size()-6);
            bReturn = label.Find(compare) == (int)(label.size()-compare.size());
          }
          else
            bReturn = label.Find(compare) > -1;
        }
        break;
Now I have looked at the newer versions of XBMC ( PC Side ) and also Kodi as these support $INFO strings in SubString but the code looks the same, so I'm guessing it else where?
Download Xbox Softmodding Tool & Extras Disc
XBMC4Kids Mod


Xbox Gamertag = Connxtion
PSN ID = JCRocky5
Post Reply