Eskin block if statement - accident12123/eversion GitHub Wiki

If statements are to give some flexibility to your eskin file.

While designed to work just about anywhere, it is not fully tested or functional in some places. Let us know if your having issues or thinking of using it somewhere. It will work on it's own, in text and images. However to pick which segment or tile or remote control buttons it's not functional but we'll be happy to work on that for you.

Format:

<if> <condition></condition> <segname></segname> <hyper></hyper> <swap></swap> <text></text> <image></image> </if> <text-image> <condition></condition> </text-image>

condition:

condition is your simple if statement of data operand value (1 = 2) for example. Variables are safe and there must be 1 space around the operand to work.

Valid operends:

  • strict equal
  • == or = equal
  • !== strict does not equal
  • != does not equal
  • greater than

  • < less than
  • >= greater than or equal to (=> works also)
  • <= less than or equal to (=< works also)
  • contains substring search (true when found)
  • notcontains substring search (true when not found) (R0166+)
  • startswith start of string search (true when found)
  • notstartswith start of string search (true when not found) (R0166+)
  • endswith end of string search (true when found)
  • notendswith end of string search (true when not found) (R0166+)

WARNING ABOUT XML SPECIAL CHARACTERS:

Because these statements are inside an XML document:

  • < and > are special characters in XML.
  • Use < and > for them.

You can also check multiple items in 1 statement using ++ or || between them.

  • AND:
    • All statements must pass
    • statement1 ++ statement2 ++ statement3
  • OR:
    • only 1 statement needs to pass
    • statement1 || statement2 || statement3

Rules:

  • ++ and || must have spaces before and after
  • you can only have ++ or || in your condition, not both
  • you can have 2 or more statements combined. There is technically no limit

swap

When set to true, swap will leave everything inside the if statement on the scree until it's time to redraw it. Very handy for indexes that have a poster that may look weird if it's cleared because the user is moving fast. Also handy for combined parts of the screen inside the if statement

Segname and hyper

These work exactly the same was as they do in text and image blocks.

Example:

<if> <condition>[:title:] == Avatar</condition> <text> <!-- some text option --> </text> <image> <!-- some image option --> </image> </if>

⚠️ **GitHub.com Fallback** ⚠️