Peter von Frosta wrote:Hi balala,
thanks for your Suggestion, but I´ve tried your Skin already while searching for a solution of my problem.
As far as I understand you wrote the last five Pictures via *.lua into a seperate *.ini or *.cfg, but the experience on my PC was very - lets say "non smooth"
I want only one Picture back - there must be a simple way to do so, e.g. automaticly writing the mImage-measure to another variable.
You could use that skin, without modifications. This way you don't need no experience at all, just have to make the needed settings (set the appropriate folder where you're storing the images and so on).
However, if you don't want to use it, here is a much simpler solution, which can work. Let's see if it is good enough for your needs.
First you need a variable, which will control which image is shown. I named this variable ImageNo. It has to be defined into the [Variables] section of your skin:
Code: Select all
[Variables]
...
ImageNo=0
CurrentPic=
I also added there the CurrentPic variable. It is left empty and it helps to avoid an error message in the log if you click the later added [MeterPrev] (which will bring back the previous image), before the first update of the [mImage] measure.
The meaning of this variable is that if its value is 0, the current image will be shown by the Image meter (that one which is returned by the [mImage] measure). If its value is 1 (in fact if it is greater than 0), you'll see the previous image.
The skin uses two variables, which are storing, one the path of the previous image and the other the path of the current one. You have to set them each time the [mImage] measure is updated. So add the following option to this measure:
OnUpdateAction=[!SetVariable PreviousPic "#CurrentPic#"][!SetVariable CurrentPic "[mImage]"]. This option also requires to add to the same measure a
DynamicVariables=1 option. Don't forget it.
Now you can remove the MeasureName option of the [Image] meter (don't forget removing it, otherwise the code won't work properly!). We'll set the appropriate option through a !SetOption bang, depending on the value of the above ImageNo variable, that's why you can remove this option.
The next step is to add a Calc measure, which keeps track of the value of ImageNo, setting the appropriate option of the Image meter accordingly:
Code: Select all
[MeasureImage]
Measure=Calc
Formula=#ImageNo#
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!PauseMeasure "mImage"][!SetOption Image ImageName "#*PreviousPic*#"][!SetOption MeterPrev Text "Current"][!UpdateMeter "Image"][!UpdateMeter "MeterPrev"][!Redraw]
IfFalseAction=[!UnpauseMeasure "mImage"][!SetOption Image ImageName "[*mImage*]"][!SetOption MeterPrev Text "Previous"][!UpdateMeter "Image"][!UpdateMeter "MeterPrev"][!Redraw]
IfConditionMode=1
DynamicVariables=1
You also will need a way to can bring back the previous image, or if that one is brought back, to can set again the current image. I did this through a String meter, added
after the [Image] meter:
Code: Select all
[MeterPrev]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
DynamicVariables=1
LeftMouseUpAction=[!SetVariable ImageNo "(1-#ImageNo#)"][!UpdateMeasure "MeasureImage"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
This meter sets the value of the ImageNo variable and using this value, the [MeasureImage] measure sets the appropriate image to the [Image] image meter and the appropriate Text to the [MeterPrev] String meter.
Just one more: The !PauseMeasure and !UnpauseMeasure bangs of the IfTrueAction and IfFalseAction options of the [MeasureImage] measure are pausing the [mImage] measure when the previous image is shown and are unpausing it, when the current one is. This makes the skin to not change the image while the previous image is displayed. If however you'd like to update it even in this case, simple remove these (
[!PauseMeasure "mImage"] and
[!UnpauseMeasure "mImage"]) bangs.
Please check this code and let me know if it works as you'd like.