Support and General Use > Theming and Appearance Customization
vertical progressbar
[Saint]:
Just a suggestion, but I like to add a "charged" condition too...
By detecting if the charger is plugged and charging is currently false, we can safely assume the device is charged:
--- Code: ---%?bp<%?bc<foo|bar>|baz>
--- End code ---
foo: charger is present, we are currently charging.
bar: charger is present, we are no longer charging. safe to assume the device is charged.
baz: charger not present, cannot be charging...display something else like battery information.
[St.]
Arzhur:
Mmmm I should have warned you, I'm not English, and not a developper. So I must apologize but I haven't understand a single word of your post...
[Saint]:
Ok, my apologies.
What I was saying is that in addition to displaying an image or notification when the player is charging, I also like to display an image or notification when the player is fully charged and it is time to remove the charger.
I shall write full working example here:
--- Code: ---# Preload the needed images:
%xl(battery,battery_image.bmp,0,0)
%xl(charging,charging_image.bmp,0,0)
%xl(charged,charged_image.bmp,0,0)
#
# Viewport
%V(0,0,100,10,-)
%?bp<%?bc<%xd(charging)|%xd(charged)>|%bl(0,0,100,10,battery_image.bmp,vertical)>
--- End code ---
The conditional statement above can be described like this:
--- Code: ---Is the charger present?
Yes: Are we charging?
Yes: We are charging - display 'charging_image.bmp'.
No: Charging completed - display 'charged_image.bmp'.
No: Charger not present - display our battery bar.
--- End code ---
I hope that this helps to explain the code example. Please ask if you have any more questions about this or anything else...
[St.]
Arzhur:
--- Quote from: [St.] on June 13, 2011, 08:54:53 PM ---Ok, my apologies.
--- End quote ---
Never mind, I just don't know speaking foobar language :D
Now it is perfectly clear for me and a very nice idea, that I immediatly applied, and that work just perfectly, except that as my battery is fully charged, I have to wait to check if the charging image is displayed.
Another question, is it possible to determine the language setting, to change the image dependind on this? I mean having a fr_battery and a en_battery set, as my images are verticals, I must display the text as an image, so it will not be translated.
Thanks
JdGordon:
sure :) Check CustomWPS on the wiki.... use the (IIRC) %St() tag
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version