DX Scripting & SysTray

Problems

Monday, August 18, 2008 by Lumic | Discussion: Help

Hey guys,

I downloaded DX 3.5 and realised it has no SysTray support. Has SD decided to make that in professional, did I download a bad version or do I need some kind of plugin? (I'm 13, I can't persuade parents to buy OD)

Also, I'm kind of new to scripting. I was wondering if anyone could help me with abit of scripting. I currently need a script which delays until it goes on to the next step. I am trying to make a Vista-Like Start Menu where on default a clock is showing, but when you mouse over certain items the clock disappears and an icon representing the item fades in. I need the delay because without it the theme lags.

I need a script like this:

Sub Object_OnStateChange (state)
If state = "Mouse Over" then
(A Delay Script Please)
DesktopX.Object("0").state = "1"
DesktopX.Object("clock_bk01").visible = False

I have inputted this script (clock_bk01 is the clock, [something] pic are the icons). It looks like this:

Sub Object_OnScriptEnter
Object.SetTimer 1,300
Object.SetTimer 2,300
End Sub

Sub Object_OnTimer1
DesktopX.Object("clock_bk01").visible = True
DesktopX.Object("User Pic").state = "0"
End Sub

Sub Object_OnTimer2
DesktopX.Object("clock_bk01").visible = False
DesktopX.Object("User Pic").state = "1"
End Sub

Sub Object_OnMouseLeave
            Object.SetTimer 1,300
            End Sub

Sub Object_OnMouseEnter
            Object.SetTimer 2,300
            End Sub

Sub Object_OnScriptExit
Object.KillTimer 1
Object.KillTimer 2
End Sub

The fade is manual (a 10 slide animation using the transparency change while it animates). State "0" is a transparent state, State "1" is an unlooped fade state. The script doesn't work-instead of hiding the clock it makes it flash every second, regardless of anything.
BigDogBigFeet
Reply #1 Monday, August 18, 2008 11:12 PM
There's a timer function where you can set the amount of delay in miliseconds with 100 equal to one full second. You have to remember to kill the timer when done or it will eat memory and keep running. It's in the documentation. Found here. WWW Link
BigDogBigFeet
Reply #2 Monday, August 18, 2008 11:59 PM
I'm just a novice scripter but, this will give you the general idea. The second number, 10, is the delay in ms. The first number refers to the timer which allows you to have multiple timers. I moved your object.state code into an action that occurs after the delay. You should put into the Object_OnTimer1 routine whatever you need it to do. Good luck.

Sub Object_OnScriptEnter
Object.SetTimer 1, 10
End Sub

Sub Object_OnTimer1
DesktopX.Object("0").state = 0
End Sub

Sub MySub_That_needs_a_delay
If DesktopX.Object("whatever").visible = True then
Object.SetTimer 1, 10
End Sub

Sub Object_OnScriptExit
Object.KillTimer 1
End Sub
Lumic
Reply #3 Tuesday, August 19, 2008 1:23 AM
I explained my problem more at top.
BigDogBigFeet
Reply #4 Tuesday, August 19, 2008 7:04 AM
You need to create a clock fade out and fade in routine as well as a icon fade in and out routine by stepping the object's opacity. So in your object you want to mouse over and have the clock fade out and a new object fade in were it once was you need something like:

Sub Object_OnTimer1
DesktopX.Object("clock_bk01").opacity = DesktopX.Object("clock_bk01").opacity - 10
end sub

Sub Clock_FadeOut
For i = 0 to 9
Object.SetTimer 1,300
Object.KillTimer 1
next
end sub

Sub Object_OnMouseEnter
Clock_Fadeout
DesktopX.Object("clock_bk01").opacity = 0 'for safety shouldn't go below 0
Icon_Fadein
DesktopX.Object("Icon1").opacity = 100 'for safety make sure it's fully 100% again
End Sub


This will reduce the clock's opacity from 100% to 0% with a .3 of a second delay in each 10% decrement in opacity. I'll let you work on the Icon_Fadein part. I think this is the right idea for you.

Oh and sorry for my typo above it's 1000 equals one full second.

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01