Pass skin setting to visibility condition? (1 Viewer)

Zoidberg77

MP Donator
  • Premium Supporter
  • July 12, 2011
    392
    206
    Home Country
    Germany Germany
    Update: Found my mistake in my first problem, so only question remains:

    I'd like to pass a variable to the Control.IsVisible inside a visibility condition like:
    Code:
    <visible>Control.IsVisible(#MenuID)</visible>
    where #MenuID is defined in the same xml or any other like SkinSetting.xml. That way I could edit the BasicHome Menu from inside the MP Setting Screen. I tried several possibilities but none worked. Is this somehow possible?

    The answer to my question below: seems as if I always had a "#" too much.
    Code:
    <visible>skin.string(#tester3,1)</visible>
    and
    <visible>skin.hassetting(#tester2)</visible>
    work as expected.

    My original post
    Hi,
    I'm referring to the skin settings introduced with MP 1.3.alpha.
    I would like to pass a variable defined in SkinSettings.xml to a visibility condition.

    I tried the following:
    For tests I defined a boolean variable as well as a string variable in SkinSettings.xml:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <profile>
      <section name="booleansettings">
        <entry name="#tester1">True</entry>
        <entry name="#tester2">False</entry>
      </section>
      <section name="stringsettings">
        <entry name="#tester3">1</entry>
        <entry name="#tester4">2</entry>
      </section>
    </profile>

    Now, I'd like to have a (dummy) label being visible or not visible depending on the SkinSetting. A regular expression like
    Code:
    <visible>Control.IsVisible(1001)|Control.IsVisible(1003)|Control.IsVisible(1007)</visible>
    is working as expected.
    But if I use the example from the wiki:
    Code:
    <visible>#(skin.string(#tester3,1))</visible>
    the expression is always true regardless if I use #tester3 or #tester4. I also tested many other combinations like:
    Code:
    <visible>#tester2</visible>
    or
    <visible>#(skin.hassetting(#tester2))</visible>
    which also is always true with #tester1 as well as #tester2

    Should this work, or not? If it should maybe someone can point me to xml files where such a visibility condition with variables is done?

    Furthermore I'd like to pass a variable to the Control.IsVisible inside a visibility condition like:
    Code:
    <visible>Control.IsVisible(#MenuID)</visible>
    where #MenuID is defined in the same xml or any other like SkinSetting.xml. That way I could edit the BasicHome Menu from inside the MP Setting Screen. I tried several possibilities but none worked. Is this somehow possible?

    Any help is appreciated! Thanks.
     
    Last edited:

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,559
    3,943
    Lehmden
    Home Country
    Germany Germany
    HI.
    I can't answer but I also can really use this if it's possible (planing a basic home editor too)...
     

    Zoidberg77

    MP Donator
  • Premium Supporter
  • July 12, 2011
    392
    206
    Home Country
    Germany Germany
    HI.
    I can't answer but I also can really use this if it's possible (planing a basic home editor too)...
    That' funny, as I thought the same as I read your topic regarding the navigation issue ;)
    Seems like we're working on similar projects just with different skins. My theme for Titan is also backdrop oriented... :whistle:
     

    Attachments

    • BasicHome.jpg
      BasicHome.jpg
      322.6 KB

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,559
    3,943
    Lehmden
    Home Country
    Germany Germany
    Hi.
    Really looks as if.. ;)
    As I can not code C# I was thinking about an Editor a) written in AutoIt or b) inside MP GUI.
    Yours and mine would help a lot on writing such an editor in general, I think...
     

    Zoidberg77

    MP Donator
  • Premium Supporter
  • July 12, 2011
    392
    206
    Home Country
    Germany Germany
    Yes, I thought an BasicHome editor inside of MP Settings GUI would be some nice feature. And should be more or less easily be implemented if the afore-mentioned variables in visibility conditions will work :cautious:
     

    ncoH

    Retired Team Member
  • Premium Supporter
  • January 27, 2007
    925
    1,569
    Hannover
    Home Country
    Germany Germany
    Hi,
    I'm referring to the skin settings introduced with MP 1.3.alpha.
    I would like to pass a variable defined in SkinSettings.xml to a visibility condition.

    I tried the following:
    For tests I defined a boolean variable as well as a string variable in SkinSettings.xml:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <profile>
      <section name="booleansettings">
        <entry name="#tester1">True</entry>
        <entry name="#tester2">False</entry>
      </section>
      <section name="stringsettings">
        <entry name="#tester3">1</entry>
        <entry name="#tester4">2</entry>
      </section>
    </profile>

    Now, I'd like to have a (dummy) label being visible or not visible depending on the SkinSetting. A regular expression like
    Code:
    <visible>Control.IsVisible(1001)|Control.IsVisible(1003)|Control.IsVisible(1007)</visible>
    is working as expected.
    But if I use the example from the wiki:
    Code:
    <visible>#(skin.string(#tester3,1))</visible>
    the expression is always true regardless if I use #tester3 or #tester4. I also tested many other combinations like:

    Hi,
    for string settings you can use
    Code:
    <visible>string.equals(#tester3,1)</visible>

    The <include> condition for that example is:

    Code:
    <include condition="#(eq(#tester3,'1'))">some.xml</include>

    We`re currently working on a BasicHome editor inside MP GUI for Titan (incl. submenus). It will not be <visible> condition based. I use a button template and fill the items via SkinSettings. In that way it`s more generic and you can create your own BasicHome (also for other skins) while having the same editor.
     

    Zoidberg77

    MP Donator
  • Premium Supporter
  • July 12, 2011
    392
    206
    Home Country
    Germany Germany
    Hi,
    for string settings you can use [...]
    thank you! Just found the mistake myself :oops:
    Do you have also an answer to my other question (pass a variable to the Control.IsVisible inside a visibility condition)? A button template would be a good workaround; have to think about it :)
    Thanks!
     
    Last edited:

    ncoH

    Retired Team Member
  • Premium Supporter
  • January 27, 2007
    925
    1,569
    Hannover
    Home Country
    Germany Germany
    Hi,
    Do you have also an answer to my other question (pass a variable to the Control.IsVisible inside a visibility condition)?

    I had the same issue with <onclick>. Try this:

    Code:
    <visible>Control.IsVisible(cint(#MenuID))</visible>

    "cint" converts the value to an integer.
     

    Zoidberg77

    MP Donator
  • Premium Supporter
  • July 12, 2011
    392
    206
    Home Country
    Germany Germany
    Thank you, but that expression is always true. I tried also variations of
    Code:
    <visible>Control.IsVisible(cint(skin.string(#MenuID)))</visible>
    but it seems as if Control.IsVisible() is always true if the argument is anything else then an integer and expressions inside the brackets are ignored.
     

    ncoH

    Retired Team Member
  • Premium Supporter
  • January 27, 2007
    925
    1,569
    Hannover
    Home Country
    Germany Germany
    Thank you, but that expression is always true. I tried also variations of
    Code:
    <visible>Control.IsVisible(cint(skin.string(#MenuID)))</visible>
    but it seems as if Control.IsVisible() is always true if the argument is anything else then an integer and expressions inside the brackets are ignored.
    Can you explain a bit more what you`re trying to do? Perhaps you need another condition to get it working...
     

    Users who are viewing this thread

    Top Bottom