PDA

View Full Version : Drawer script... (error)


Naamloos
30th November 2001, 12:29
I have this script :

#include "../../../lib/std.mi"
Global Button LeftToggle, BottomToggle;
Global Boolean BottomDown, LeftDown;
Global Group Drawer;

System.onScriptLoaded()
{
Drawer = System.getContainer("main").getLayout("normal").getObject("drawer");
LeftToggle = Drawer.getobject("leftdrawerbutton");
BottomDown = 1;
LeftDown= 1;
BottomToggle = Drawer.getobject("bottomdrawerbottom");
}


BottomToggle.OnLeftClick()
{
If (BottomDown) {
BottomDown = 0;
Drawer.setTargetH(154);
Drawer.setTargetSpeed(1);
Drawer.GoToTarget();

}

else {
BottomDown = 1;
Drawer.setTargetH(254);
Drawer.setTargetSpeed(1);
Drawer.GoToTarget();
}

}

LeftToggle.OnLeftClick()
{
If (LeftDown) {
LeftDown = 0;
Drawer.setTargetW(55);
Drawer.setTargetSpeed(1);
Drawer.GoToTarget();

}

else {
LeftDown = 1;
Drawer.setTargetW(275);
Drawer.setTargetSpeed(1);
Drawer.GoToTarget();
}

}



For one drawer (yes it's for my new skin) so when one or the other button is pressed it slides verry well :)
Also I used setTargetW cause i made the group resizable... and otherwise it would show up on the other end of the skin...

Now the problem, it only slides in once... when i try to slide out it doesnt... i've got no clue why's that and the script worked fine on an other skin (with only one function for the drawer)....

the drawer is slided out at the loading...

Anyone got help ?

Lucas
30th November 2001, 13:19
I'm not sure if I get it, would you mind to post the skin or some part of it?

-L

Naamloos
30th November 2001, 13:34
Download here, at your own risk :) (http://naamloos.freeservers.com/skins.htm)

Download above... the drawer script = drawer.m

the drawer buttons are that long stretched buttons at the left and at the bottom of the group...

Also is it possible to have a scrollbar for the thinger ? *COPYRIGHT!*

Plague
30th November 2001, 15:23
I have had the same problem as you, with one of the drawers...
I finally figured out that after it was slided out once and in again, the togglebutton would lay itself beneath the group, making it impossible to press.
But I don't know if your togglebutton is located on the drawer or not, but if it is, try resetting the position of it in the script when slided in or out.
Might work, I have had to tweak quite alot, and beta2 caused those problem to arise again, all solved now though.

I do have another drawer problem though that I would apreciate some help with.

How can I make the PL and ML components stick on the drawer and slide in under the main window?

I heard that it would be possible in beta 2.

Also, is it possible to make the drawers(groups) semi transparent against the desktop?

Naamloos
30th November 2001, 15:27
My drawer is already semi-transparant :) And it works verry well, I'm gonna try that, but I'm almost for sure that that isn't the problem cause i haven't got a layer or something to go under :D

How is your PL in your drawer located now, in the group?

I Am Trunks
30th November 2001, 15:36
desktopalpha="1" is that what you mean???
and by the way beta 2 is available

Plague
30th November 2001, 15:42
I Am Trunks: Yeah I know, but what I wanted to know was where to write desktopalpha="1", cuz I have tried everything.


by the way, "I heard that it would be possible in beta 2.", doesn't mean I didn't know it was released, it meant I HAVE beta2 but haven't figured out how to get that function.


Naamloos: I have layers in my drawers but no background, is semi-transparency possible in layers?

----------

<groupdef id="PLGroup">
<component id="pl" param="guid:pl" x="34" y="8" h="124" w="200" relath="0" relatw="0"/>

----------

this is how my PL is located in the group, if that's what you meant.
when slided in, it slides in with the group but doesn't slide under the main window, it slides above it.

Naamloos
30th November 2001, 15:53
I remember that this problem was with the AVS window too...

I'm not saying this often but i think you should regions...

use the search option and search for regions in topic titles, you'll find what you need I hope

Plague
30th November 2001, 16:19
k, I'll try that

Gonzotek
30th November 2001, 17:04
desktopalpha="1" should go inside a layout tag. e.g.
<layout id="Normal" background="blobamp.Background" desktopalpha="1">*

*Borrowed from blobamp

-=Gonzotek=-

Plague
30th November 2001, 17:18
yeah, I know that, but it doesn't work that way with layers and that's where I want it.

Plague
30th November 2001, 17:24
Originally posted by Naamloos
I remember that this problem was with the AVS window too...

I'm not saying this often but i think you should regions...

use the search option and search for regions in topic titles, you'll find what you need I hope


Well, the search didn't give much but I have tested some region scripting but with no success.
the PL is still sliding in and out above the main window, even when it is inside a region.
maybe I just haven't understood all this regions stuff yet, is there any good documentation about this somewhere?

Naamloos
30th November 2001, 18:40
Originally posted by ThePlague



Well, the search didn't give much but I have tested some region scripting but with no success.
the PL is still sliding in and out above the main window, even when it is inside a region.
maybe I just haven't understood all this regions stuff yet, is there any good documentation about this somewhere?

no thats what makes regiosn hard :(
I'm gonna spit in the forums for the code.... :) tomorrow, i've gotta do some things

Naamloos
30th November 2001, 18:43
http://forums.winamp.com/showthread.php?s=&threadid=56435&highlight=regions

check that.. im going to search for the actual code too :)

Plague
30th November 2001, 19:03
thanx.

I have tried that stuff though, didn't make anything different.

Seems to me that regions is just for reshaping stuff, not keeping them on one specific place, am I wrong?

Naamloos
30th November 2001, 19:26
no your not wrong, but you can give the avs a different shape using a map... maybe you could do that too with the Pl or ML i don't know... :(

Plague
30th November 2001, 19:30
yeah, but that wasn't the problem at all...
the shape is ok, but I need the PL and ML to be like attached to the drawer so that they doesn't slide in on top of the main window, covering that.
The EQ and Thinger works perfectly with that, although they aren't components.

Naamloos
30th November 2001, 21:11
Originally posted by ThePlague
yeah, but that wasn't the problem at all...
the shape is ok, but I need the PL and ML to be like attached to the drawer so that they doesn't slide in on top of the main window, covering that.
The EQ and Thinger works perfectly with that, although they aren't components.

yeah I understand now...
The Avs has some sort of alwaysontop because if you put a layer above it it's rendering will be too slow, but I don't know why that is there for the PL and ML

Plague
1st December 2001, 00:11
ok, and I guess you don't know how to disable that or something?



How did you make your drawers semi-transparent?
because that doesn't work for me, yet.

Naamloos
1st December 2001, 07:35
I just made the drawer 40% transparant and used desktopalpha="1"

Plague
1st December 2001, 15:12
I have it 50% transparent but havent figured out where to write desktopalpha="1" for them...



eyy, got it working, yaaayy... :D

Naamloos
1st December 2001, 16:38
it worked for me just putting it in the normal layout :)

btw On RT's site is a function for enable and disable go check that out... ;)

Plague
1st December 2001, 16:40
ok, enable and disable what?

Francis
1st December 2001, 19:47
Originally posted by ThePlague
I have it 50% transparent but havent figured out where to write desktopalpha="1" for them...
[/Edit]

If your layout has desktopalpha enabled, then setting alpha="128" for a group or a layer will make it 50% blended onto the desktop as long as the background is transparent at that position.

Components cannot be go behind a layer for now, they will eventually but for now they don't (AVS uses direct blitting to the screen for instance, as do some other components (ie: list scrollings ), but that'll be modified to allow the integration of components in the alpha tree).

Steve's ETA skin shows & hide AVS as needed while the drawer opens and closes. Dunno is Steve has released it, but as soon as he has, you'll see how to do this.

Francis.

Plague
1st December 2001, 20:12
ok, thanks man.

Naamloos
2nd December 2001, 07:43
Originally posted by ThePlague
ok, enable and disable what?

The ML and PL, but i guess you already figured out, you can use hide and show too, but I can remember that these didn't worked in a previous alpha (667)

Plague
2nd December 2001, 10:29
yeah, I use hide and show...
too bad though that it doesn't look too good...