I have modified a stopwatch skin to make it work the way I would like it. Link to the skin pack (the Stopwatch Skin is the one in the pack).
I want it to work like this:
When I press the "Stop" button the timer stops, and in this state when I press the reset button (the yellow circle) it doesn't resets and stops the timer, rather resets the timer and immediately restarts the timer counting.
In the current state pressing the reset button, it resets the timer, but it doesn't starts the counting again imediatley.
I only want this behavior to work in the state when the timer is "Stopped" (and the red Stop button is shown), but not when i reset the timer during in the active counting state (so when the "Start button" is shown).
Could you please look at the code, so someone could figure out a solution for this?
Stopwatch.ini (content):
Code: Select all
[Rainmeter]
Author=vlesun (vlesun@newmail.ru) & balala
Background=Background Larger.png
AppVersion=100
Update=50
MouseOverAction=!execute [!ShowMeter Menu][!ShowMeter More][!ShowMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp]
MouseLeaveAction=!execute [!HideMeter Menu][!HideMeter More][!HideMeter Close][!ShowMeter MoveBack][!ShowMeter MoveUp]
OnRefreshAction=!execute [!ShowMeter StopWatchDigits][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset][#!HideMeter TimerReset#]
[Variables]
color.Skin=00000001
color.Title=FFFFFFFF
color.Text=FFFFFFFF
text.Size=8
font.Name=Segoe UI
Snooze=#CURRENTPATH#Ding.wav
[sTimer]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=#text.Size#
StringAlign=CENTER
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
AntiAlias=1
[sStopWatch]
FontColor=#color.Text#
FontEffectColor=00000020
FontFace=#font.Name#
FontSize=42
StringAlign=CENTER
StringCase=NONE
StringEffect=SHADOW
AntiAlias=1
;--------------------------------------------------------------------
;Interface
;--------------------------------------------------------------------
[MeterTimerWindow]
Meter=Image
ImageName=bgtimer.png
[MeterStopwatchWindow]
Meter=Image
ImageName=bgstopwatch.png
Hidden=1
[MeterSettingsTab]
Meter=Image
X=2
Y=3
ImageName=Settings.png
Hidden=1
[MeterAlarmBeforeTab]
Meter=Image
X=2
Y=3
ImageName=AlarmBefore.png
Hidden=1
;--------------------------------------------------------------------
;Counter for stopwatch
;--------------------------------------------------------------------
[MeasureCounterStopwatchTime]
Measure=Time
AverageSize=20
[MeasureCounterStopwatch]
Measure=Calc
Formula=( MeasureCounterStopwatch = 0 ? ( MeasureCounterStopwatchTime - MeasureStopwatch / 10 ) : MeasureCounterStopwatch )
Disabled=1
[MeasureStopwatch]
Measure=Calc
Formula=( MeasureCounterStopwatch = 0 ? MeasureStopwatch : (MeasureCounterStopwatchTime - MeasureCounterStopwatch) *10 )
;--------------------------------------------------------------------
;Stopwatch
;--------------------------------------------------------------------
[MeasureStopwatchDigit1]
Measure=Calc
Formula=MeasureStopwatch%10
MaxValue=3
[MeasureStopwatchDigit1-2]
Measure=Calc
Formula= ( MeasureStopwatchDigit1 > 9 ? 9 : MeasureStopwatchDigit1 )
[MeasureStopwatchDigit2]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/10))%60
Substitute="0":"00","1":"01","2":"02","3":"03","4":"04","5":"05","6":"06","7":"07","8":"08","9":"09","0100":"10","0101":"11","0102":"12","0103":"13","0104":"14","0105":"15","0106":"16","0107":"17","0108":"18","0109":"19","0200":"20","0201":"21","0202":"22","0203":"23","0204":"24","0205":"25","0206":"26","0207":"27","0208":"28","0209":"29","0300":"30","0301":"31","0302":"32","0303":"33","0304":"34","0305":"35","0306":"36","0307":"37","0308":"38","0309":"39","0400":"40","0401":"41","0402":"42","0403":"43","0404":"44","0405":"45","0406":"46","0407":"47","0408":"48","0409":"49","0500":"50","0501":"51","0502":"52","0503":"53","0504":"54","0505":"55","0506":"56","0507":"57","0508":"58","0509":"59"
[MeasureStopwatchDigit3]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/600))%60
Substitute="0":"00","1":"01","2":"02","3":"03","4":"04","5":"05","6":"06","7":"07","8":"08","9":"09","0100":"10","0101":"11","0102":"12","0103":"13","0104":"14","0105":"15","0106":"16","0107":"17","0108":"18","0109":"19","0200":"20","0201":"21","0202":"22","0203":"23","0204":"24","0205":"25","0206":"26","0207":"27","0208":"28","0209":"29","0300":"30","0301":"31","0302":"32","0303":"33","0304":"34","0305":"35","0306":"36","0307":"37","0308":"38","0309":"39","0400":"40","0401":"41","0402":"42","0403":"43","0404":"44","0405":"45","0406":"46","0407":"47","0408":"48","0409":"49","0500":"50","0501":"51","0502":"52","0503":"53","0504":"54","0505":"55","0506":"56","0507":"57","0508":"58","0509":"59"
[MeasureStopwatchDigit4]
Measure=Calc
Formula=(FLOOR(MeasureStopwatch/36000))%100
MaxValue=2
Substitute="0":"00","1":"01","2":"02","3":"03","4":"04","5":"05","6":"06","7":"07","8":"08","9":"09","0100":"10","0101":"11","0102":"12","0103":"13","0104":"14","0105":"15","0106":"16","0107":"17","0108":"18","0109":"19","0200":"20","0201":"21","0202":"22","0203":"23","0204":"24","0205":"25","0206":"26","0207":"27","0208":"28","0209":"29","0300":"30","0301":"31","0302":"32","0303":"33","0304":"34","0305":"35","0306":"36","0307":"37","0308":"38","0309":"39","0400":"40","0401":"41","0402":"42","0403":"43","0404":"44","0405":"45","0406":"46","0407":"47","0408":"48","0409":"49","0500":"50","0501":"51","0502":"52","0503":"53","0504":"54","0505":"55","0506":"56","0507":"57","0508":"58","0509":"59"
[BeepHourly]
Measure=Calc
Formula=((( MeasureStopwatchDigit3=0 ) ? 1 : 0 ) + (( MeasureStopwatchDigit4<>0 ) ? 1 : 0 ))
IfEqualAction=!execute [PLAY #Snooze#]
IfEqualValue=2
;--------------------------------------------------------------------
;Buttons for Stopwatch
;--------------------------------------------------------------------
[MeterTimerStart]
Meter=Image
ImageName=Start Cutted Smaller.png
X=100
Y=95
#MeterStyle=sTimer
#Text=Start
MouseActionCursor=1
LeftMouseDownAction=!Execute [!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch][!HideMeter MeterTimerStart][!ShowMeter MeterTimerStop][#!HideMeter MeterTimerReset#]
[MeterTimerStop]
Meter=Image
ImageName=Stop Cutted Smaller 2.png
X=100
Y=95
#MeterStyle=sTimer
#Text=Stop
MouseActionCursor=1
LeftMouseDownAction=!Execute [!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][!HideMeter MeterTimerStop][!ShowMeter MeterTimerReset]
MeterTimerReset
#MouseActionCursor=1
#LeftMouseDownAction=Command=!Execute [!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch]
[MeterTimerReset]
Meter=Image
ImageName=Reset Button Small Yellow 1.png
X=199
Y=100
#MeterStyle=sTimer
#Text=Reset
MouseActionCursor=1
#IfCondition=[!ShowMeter MeterTimerStop]
#IfTrueAction=!Execute [!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch]
LeftMouseDownAction=!Execute [!DisableMeasure MeasureStopwatch][!DisableMeasure MeasureCounterStopwatch][!ShowMeter MeterTimerStart][#!HideMeter MeterTimerStop#][#!HideMeter MeterTimerReset#]
#IfCondition=[!ShowMeter MeterTimerStop]
#IfTrueAction=!Execute [!EnableMeasure MeasureStopwatch][!EnableMeasure MeasureCounterStopwatch]
Hidden=1
[StopWatchDigits]
Meter=String
MeasureName=MeasureStopwatchDigit4
MeasureName2=MeasureStopwatchDigit3
MeasureName3=MeasureStopwatchDigit2
MeasureName4=MeasureStopwatchDigit1-2
X=138
Y=15
MeterStyle=sStopWatch
Text=%1:%2:%3
AntiAlias=1
Hidden=1
###
[Menu]
Meter=IMAGE
ImageName=Menu Buttons Plain 4.png
X=246
Y=12
Hidden=1
[Close]
Meter=BUTTON
ButtonImage=Close.png
X=246
Y=12
ButtonCommand=!DeactivateConfig
Hidden=1
#[More]
[MoveUp]
Meter=BUTTON
ButtonImage=Move UP.png
X=246
Y=34
ButtonCommand=!Execute [!zpos 2 "#CURRENTCONFIG#" "Stopwatch.ini"]
#ButtonCommand=!ActivateConfig "#CURRENTCONFIG#" "Timer.ini"
Hidden=1
[MoveBack]
Meter=BUTTON
ButtonImage=Move Down 01.png
X=246
Y=54
ButtonCommand=!Execute [!zpos -2 "#CURRENTCONFIG#" "Stopwatch.ini"]
#ButtonCommand=!ActivateConfig "#CURRENTCONFIG#" "Timer.ini"
Hidden=1