How to include 2 different conditions in one rule? (1 Viewer)

powermarcel10

Retired Team Member
  • Premium Supporter
  • November 30, 2010
    2,839
    898
    35
    Groningen
    Home Country
    Netherlands Netherlands
    Hi guys,

    I'm busy with a mod for Titan, and there is one thing I do not understand..

    I like to add something like this in basichome.xml:

    <include condition="#(plugin.isenabled('Moving Pictures')) + (#skin.enable.submenu.MovingPictures,'True'))">include.BasicHomeButton.movingpictures.submenu.enabled.xml</include>

    The behavior should be: If the plugin Moving Pictures is enabled AND #skin.enable.submenu.MovingPictures is set to true in SkinSettings.xml, 'include.BasicHomeButton.movingpictures.submenu.enabled.xml' should be included..

    I have tried a lot of things, but I can't get it done.. I'm able to set more than one enabled or disabled plugins into one rule to specify wich .xml should been loaded, but two of these different strings in one rule is not working..

    I hope someone can help me a bit with this! :)

    Cheers
     

    Pog

    Retired Team Member
  • Premium Supporter
  • September 7, 2009
    401
    315
    Wicklow
    Home Country
    Ireland Ireland
    This should do what you want...
    Code:
    <include condition="#(and(plugin.isenabled('Moving Pictures'),eq(#skin.enable.submenu.MovingPictures,'True')))">include.BasicHomeButton.movingpictures.submenu.enabled.xml</include>
     

    powermarcel10

    Retired Team Member
  • Premium Supporter
  • November 30, 2010
    2,839
    898
    35
    Groningen
    Home Country
    Netherlands Netherlands
    @Pog

    I'm busy again with this part of my MOD but can't get it done..

    Thise is what I have now, but that fail:

    Code:
            <include condition="#(and (eq(#skin.basichome.moviePlugin,'Moving Pictures')),eq(#skin.enable.submenu.MovingPictures,'True')))">include.BasicHomeButton.movingpictures.submenu.enabled.xml</include>
            <include condition="#(and (eq(#skin.basichome.moviePlugin,'Moving Pictures')),eq(#skin.enable.submenu.MovingPictures,'False')))">include.BasicHomeButton.movingpictures.submenu.disabled.xml</include>

    Any idea how to include this condition?
     

    Pog

    Retired Team Member
  • Premium Supporter
  • September 7, 2009
    401
    315
    Wicklow
    Home Country
    Ireland Ireland
    Your very close there but you have an extra parentheses ")" that will break MP expressions.

    "#(and (eq(#skin.basichome.moviePlugin,'Moving Pictures')),eq(#skin.enable.submenu.MovingPictures,'True')))"

    That line should read:

    Code:
    <include condition="#(and(eq(#skin.basichome.moviePlugin,'Moving Pictures'),eq(#skin.enable.submenu.MovingPictures,'True')))">include.BasicHomeButton.movingpictures.submenu.enabled.xml</include>

    This is a very easy mistake to make and can be very hard to spot. It doesn't help in that MP will not catch the error and just break.
     

    Users who are viewing this thread

    Top Bottom