Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Conditional WPS backgrounds via %?if
« previous next »
  • Print
Pages: [1]

Author Topic: Conditional WPS backgrounds via %?if  (Read 1833 times)

Offline Progweed

  • Member
  • *
  • Posts: 67
Conditional WPS backgrounds via %?if
« on: August 26, 2010, 06:44:13 AM »
I'm reworking one of my themes and I'd like to display different background images depending on the presence of album art. I want to do this with the new logical comparison tag.

Viewports are defined the usual way:
Code: [Select]
%?C<%Vd(a)|%Vd(b)>

Now I want to do something like this:
Code: [Select]
%?if(, , )<%X(background.bmp)|%X(background_noart.bmp)> 

What tag, operator and operand is required to determine whether an album cover is present or not? Or to put it another way: Is there a way to determine which viewport I'm in?
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Conditional WPS backgrounds via %?if
« Reply #1 on: August 26, 2010, 07:57:17 AM »
you cannot do conditional background images at all (well not currently).

%if() is only needed when the normal conditionals arnt good enough for your needs. %?C<yes aa| no aa> will work just as welll
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Progweed

  • Member
  • *
  • Posts: 67
Re: Conditional WPS backgrounds via %?if
« Reply #2 on: August 26, 2010, 08:19:38 AM »
Quote
you cannot do conditional background images at all (well not currently).
That's a pity…  :(

Quote
%if() is only needed when the normal conditionals arnt good enough for your needs. %?C<yes aa| no aa> will work just as welll
Yes, I thought so too, but %?C<%X(art.bmp)|%X(noart.bmp)> doesn't work as intended. This code *always* displays the 2nd (no art) image. Is this a bug then?
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Conditional WPS backgrounds via %?if
« Reply #3 on: August 26, 2010, 08:22:00 AM »
you cant put %X inside conditionals... you can only put one %X *anywhere* in the skin... after parseing that would actually become %?C<|> because %X is stripped out before it is displayed (You can check this by putting hello inside the yes branch)
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Progweed

  • Member
  • *
  • Posts: 67
Re: Conditional WPS backgrounds via %?if
« Reply #4 on: August 27, 2010, 03:10:38 AM »
Oh, okay then. Is there any other way to put a graphical element behind a progress bar without embedding it in the background image?
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Conditional WPS backgrounds via %?if
« Reply #5 on: August 28, 2010, 04:26:37 AM »
you need to put the background image into a viewport which is in the same place as the viewport with the %pb (but the background one needs to be before the other one). I was going to fix this properly but due to idiots I'm taking a break from coding.
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Progweed

  • Member
  • *
  • Posts: 67
Re: Conditional WPS backgrounds via %?if
« Reply #6 on: September 01, 2010, 06:06:43 AM »
Quote from: JdGordon
you need to put the background image into a viewport which is in the same place as the viewport with the %pb (but the background one needs to be before the other one).
That worked out fine. Thanks!

Quote from: JdGordon
I was going to fix this properly but due to idiots I'm taking a break from coding.
Too many newbies asking idiotic questions?  ;D
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Conditional WPS backgrounds via %?if
« Reply #7 on: September 01, 2010, 06:32:35 AM »
Quote from: Progweed on September 01, 2010, 06:06:43 AM
Too many newbies asking idiotic questions?  ;D

not at all, I'm more than happy to help people who are polite and have put a bit of effort in themselves.
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Conditional WPS backgrounds via %?if
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.067 seconds with 15 queries.