Old 21st February 2002, 15:41   #1
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
Skinning/Scripting Tips and Tricks

This thread is devoted to all those little things that we skinners and scripters find out which are actually very useful.
Lets try to suppress the useless posts here pls. I want it all to be good stuff to help noobs.

I'll start:

Finding out guid's of other components
This is if you wanna have buttons for other components.
1) Close wa3, rename studio.xnf to something else
2) open the componet you want to find the guid of
3) put in the top left of the screen
4) close wa3
5) open studio.xnf
6) find something that looks like this:
code:
<section name="Container:Component:{163FF355-9B87-49DE-BD72-EF5EA0C57FDD}">
<section name="Layout:normal">
<entry name="odim" value="498,394" />
<entry name="r" value="1." />
<entry name="rect" value="0,0,240,340" />
</section>
</section>

where the value of "rect" begins with "0,0"
7) The code in the curly brackets is the guid.
8) Delete studio.xnf and repeat from 2) for other components.
9) rename the file back to studio.xnf that you renamed in 1)

Here are some guids that i have found using this method:
Colour controls: guid:{163FF355-9B87-49DE-BD72-EF5EA0C57FDD}
Skin Switcher: guid:{0000000A-0078-001E-2878-8C82786EBEC8}
Configurification: guid:{ED3CD0D9-5FE5-4C34-AFE9-52E714D4FAA4}
Shoutcast server list: guid:{AFF7172F-4E42-4A38-9106-86B610B482EF}
Database Explorer: guid:{DED19CA5-0AA6-48AE-8045-9F4975E51253}

Using system.getTimeOfDay()
System.getTimeOfDay() returns an Int which is the number of milliseconds since midnight to the nearest second To find the hours, minutes and seconds from this, use something like this:
code:
int time = system.gettimeofday()/1000;
int hours = time/3600;
int mins = (time/60)-(hours*60);
int secs = time - ((hours*3600)+(mins*60));



Everyone else: Please don't let this thread die! Post loads of things like these pls!

DO NOT PM ME WITH TECH SUPPORT QUESTIONS
will is offline   Reply With Quote
Old 23rd February 2002, 13:09   #2
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
Making Scripts Skinnable

This workes by making a content group and putting it inside a standard frame.

1) First open the container tag
for example
code:
<container id="myscript" name="My Skinned Scipt Window">
2) Now define your content group
code:
<groupdef id="myscript.content.group">
<!-- Inset Content Here -->

So that your MAKI file can use your content, we'll add the script here
code:
<script id="mycoolscript" file="script.maki"/>
Now close off your group definition
code:
</groupdef>


Now we need to create the layout, and put the standard frame into it
code:
<layout
id="normal" background="component.basetexture"
minimum_w="180" minimum_h="160"
default_w="180" default_h="160">

you can set all the minimum_h etc tags as you like
Now we add the standard frame to our layout
code:
<group id="wasabi.standardframe.nostatusbar"
x="0" y="0" w="0" h="0" relatw="1" relath="1"
content="myscript.content.group"
/>

The notify bit tells the standard frame what to use for its content, so we'll tell it to put its content as out content group we defined above.
we also need to close off our layout and continer tags
code:
</layout>
</container>

To link objects in your xml to your maki script just use code like this
code:
Group ScriptGroup = system.getscriptgroup();
MyObject = ScriptGroup.getObject("MyObjectId");

For a working example of this, look in my sig for Alarm or Goodnight.

Other Skinners/Scripters: Lets keep the stuff coming in to this thread pls.

[edit: updated for winamp 3.0]

DO NOT PM ME WITH TECH SUPPORT QUESTIONS

Last edited by will; 14th August 2002 at 16:07.
will is offline   Reply With Quote
Old 23rd February 2002, 14:30   #3
Hollow
Major Dude
 
Hollow's Avatar
 
Join Date: Oct 2001
Location: Baker Lab, Ithaca NY
Posts: 1,128
Send a message via AIM to Hollow
When creating your own containers dont use any names that standard. ie dont name you container "main" and the layout "normal" it will execute fine, but its bad practice. if you do that your cant access the actual main window with that script.

Remember commands can do more than they might first appear to be able to do. .resize(x,y,w,h) can be used to move the window around the screen as well as for changing its size.


[edited for being blind dumb and doing things the hard way.]

The moon is made of cheese.
Oh for some tasty moon cheese.
www.redtetrahedron.org
Hollow is offline   Reply With Quote
Old 11th March 2002, 14:11   #4
Naamloos
Forum King
 
Naamloos's Avatar
 
Join Date: Mar 2001
Location: irc.tehflap.org/*******
Posts: 3,085
Gamma Groups
  • open up your elements.xml and add the code below to every element you want to be accesible by the color controls
    code:
    gammagroup="Bleh"
  • Now open up in the thinger the gamma controls (3 stripes) and select the group..
    Now play with the sliders, and try the checkboxes... when you're done, save it.
  • In the wa3 dir it should say something like themes, and you can manually edit the values there. Copy that file into your skin and you're done
Naamloos is offline   Reply With Quote
Old 11th March 2002, 15:58   #5
Hollow
Major Dude
 
Hollow's Avatar
 
Join Date: Oct 2001
Location: Baker Lab, Ithaca NY
Posts: 1,128
Send a message via AIM to Hollow
Also with the gammagproups make sure to include:
code:
<include file="@COLORTHEMESPATH@*.xml"/>
in your gamma-presets file or the user won't be able to load the color presets that they create.

The moon is made of cheese.
Oh for some tasty moon cheese.
www.redtetrahedron.org
Hollow is offline   Reply With Quote
Old 11th March 2002, 22:29   #6
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
How do I get my buttons to autorepeat?

Check This out

DO NOT PM ME WITH TECH SUPPORT QUESTIONS
will is offline   Reply With Quote
Old 13th March 2002, 08:22   #7
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
Creating animation strips
This gem was orginally posted by Wilba in this thread, and is very, very useful and easy.
_____________________________________________________________

Paint Shop Pro/Animation Shop is a wicked combo when it comes to creating a row of frames in a single PNG image.

Case 1: You've got N frame images each in its own file. Now you need to assemble them into one file (a row of images) so you can load it into an animated layer.

Case 2: You've got two frames and want to apply some funky transition between them, like a clock "swipe" or a fade transition.

Case 3: You've got one image you want to rotate and create an animation.

Now, here's the cool combo:

Using Animation Shop, create the animation you want by loading images into frames. In Case 2, apply some transition. In Case 3, apply some image effect, like rotating. Ultimately, you'll end up with the frames you want in the animation (add/delete as necessary).
Now do "Export Frames" -> "To Picture Tube", select "All Frames".

Now open this .TUB file in Paint Shop Pro (don't USE the picture tube, just OPEN it). The frame images are all nicely placed in a single row, ready for saving as a PNG file.

The beauty of this method is that you can keep individual frames in their own files and then produce the animation bitmap quickly. It also saves a lot of manual cutting/pasting/aligning, as well as doing transition effects for you.

Sample file: Something I created in less than 5 minutes using this method.

Wilba
__________________________________________________________________

Thanks wilba!

DO NOT PM ME WITH TECH SUPPORT QUESTIONS
will is offline   Reply With Quote
Old 16th March 2002, 10:52   #8
Naamloos
Forum King
 
Naamloos's Avatar
 
Join Date: Mar 2001
Location: irc.tehflap.org/*******
Posts: 3,085
Corners on components

ok, you want some nice corners on your components like Koalla?

Here is the trick
  • Make a black and white map, black for the part that must be transparant and white for what doesnt needs to be cut off
  • Make a new layer with the map as the image
  • add sysregion="-2" to the layer
  • save file and reload

Also, make sure you have a background on the group (in standardframe.xml, that's where you're working on) otherwise it doesnt do a thing


Good luck!
Naamloos is offline   Reply With Quote
Old 22nd March 2002, 22:59   #9
Bizzeh
Forum Pirate
Beta Team
 
Bizzeh's Avatar
 
Join Date: Oct 2001
Posts: 2,032
Easy Animated Volume/EQ Sliders

No need for fussy stacked up images now... no need for maps.. all you need is each frame defined in XML and 1 or both of these tw2 scripts (xml demos included in zip)
Attached Files
File Type: zip sliders.zip (8.0 KB, 956 views)
Bizzeh is offline   Reply With Quote
Old 8th April 2002, 10:22   #10
Plague
f(caffeine){
return wasabi;
}
(Forum King)
 
Plague's Avatar
 
Join Date: Jul 2001
Location: Sweden
Posts: 3,984
Choose which kind of vis to show (analyzer or oscilliscope) from maki

Wanna limit your skin to just showing one of the standard vis modes and nothing else?
Wanna be able to change the vis mode by clicking on a standard button instead of clicking on the vis itself?

Sometimes there's only one of the built in vis modes that will look good in a skin and compromises are never funny.

With this script you can choose which mode to use and also limit your skin to ONLY that mode if so desired.

It's very simple and requires only a tiny bit on XML modifying.

Here are the only changes neccesary to XML.

code:

<!-- the standard vis, located in Player-Normal.xml and Player-shade.xml -->

<vis
id="vis"
x="20" y="46"
w="72" h="16"
/>

<!-- below are the things you need to add -->

<!-- Put a cover on top of the vis to prevent changing modes,
make it a button instead of a layer to be able to use it for your
very own mode-changing script -->

<button
id="vis-cover"
x="20" y="46"
image="player.vis-cover"
downImage="player.vis-cover"
rectrgn="1"
/>

<!-- the 'player.vis-cover' image is a fully transparent PNG with
the same size as the vis area, w="72" h="16" in this case. -->



and here is the script for it, explaination inside the .m file.

-Plague

[edit] script updated a little with better example and more explainations [/edit]
Attached Files
File Type: m vis-toggle.m (1.6 KB, 711 views)

Last edited by Plague; 8th April 2002 at 11:22.
Plague is offline   Reply With Quote
Old 21st April 2002, 20:49   #11
Hollow
Major Dude
 
Hollow's Avatar
 
Join Date: Oct 2001
Location: Baker Lab, Ithaca NY
Posts: 1,128
Send a message via AIM to Hollow
Want to have a slider that changes depending on the position of the slider? (like the volume, or eq sliders in winamp2.xx)?

Well the easiest way to create an slider like this is to create a animated layer png with all of the images you want to display. Place this in the xml where it should go (ie for the proper render order), with ghost="1". then you need to place a slider (volume, seek, eq, etc) on top of that. Then you need to do some maki.

What you need to do is catch all of the times that the slider changes, (such as for volume: system.onVolumeChanged(int newvol) then because the values for sliders go from 0 to 255, you want to do this.


code:
MySlider.onSetPosition(int newpos)
{
int frame = (newvol*(MySliderBackground.getLength()-1))/255;
MySliderBackground.gotoFrame(frame);
}




this takes the new position, newpos and converts it to a frame number. (newpos/255 = CurrentPercentage; CurrentPercentage*NumberOfFramesInAnimation-1 = the right frame number.)

As special cases, for volume, you can use System.onVolumeChanged(int newvol) or for seeking, System.onSeek(int newpos). For anything else, Eq bars included, use onSetPosition(int newpos), as System.onEqBandChanged(int band, int newvalue) does not return a 0-255 value.

The moon is made of cheese.
Oh for some tasty moon cheese.
www.redtetrahedron.org
Hollow is offline   Reply With Quote
Old 22nd April 2002, 22:36   #12
skinme!
Forum King
 
skinme!'s Avatar
 
Join Date: Feb 2001
Location: 127.0.0.1 Website: skinme.net
Posts: 3,352
Here's an example of the above for the 10 EQ Bands + PreAmp. Customise it to suit your naming conventions.

And here is an example of the code in player-normal.xml:
code:
<groupdef id="window.eq" background="window.eq.bg">

<slider id="eq.bar.1" x="59" y="10" w="8" h="30"
thumb="eq.bars.thumb" downThumb="eq.bars.thumb"
hoverThumb="eq.bars.thumb" orientation="V" action="EQ_BAND" param="1"/>
<animatedlayer id="eq.anim.1" x="59" y="10" w="8" h="30"
image="eq.bars.anim" framewidth="8" autoreplay="1" ghost="1"/>

<slider id="eq.bar.2" x="69" y="10" w="8" h="30"
thumb="eq.bars.thumb" downThumb="eq.bars.thumb"
hoverThumb="eq.bars.thumb" orientation="V" action="EQ_BAND" param="2"/>
<animatedlayer id="eq.anim.2" x="69" y="10" w="8" h="30"
image="eq.bars.anim" framewidth="8" autoreplay="1" ghost="1"/>

</groupdef>

<layout id="normal" background="frame.bg">

<group id="window.eq" x="284" y="76" w="209" h="50" move="1" sysregion="1" alpha="255"/>

</layout>


Please note that Bands are numbered 1-10 in PARAM but 0-9 in the M file below. Feel free to change this idiotic act of mine.

somebody fluffed.... smell cleared by Winamprocker
Attached Files
File Type: m eqsliders.m (3.1 KB, 610 views)

He had decided to live forever, or die in the attempt
In America - a must see film
skinme! is offline   Reply With Quote
Old 16th May 2002, 08:35   #13
BmmrMPower
Senior Member
 
BmmrMPower's Avatar
 
Join Date: May 2002
Location: TX
Posts: 145
Send a message via ICQ to BmmrMPower Send a message via AIM to BmmrMPower Send a message via Yahoo to BmmrMPower
Some other guids

Here are some of the guids that I have found:
  • {F0816D7B-FFFC-4343-80F2-E8199AA15CC3} = Video
  • {45f3f7c1-a6f3-4ee6-a15e-125e92fc3f8d} = playlist editor
  • {163FF355-9B87-49DE-BD72-EF5EA0C57FDD} = colors
  • {DED13748-0AA6-48AE-8045-9A4975E51253} = classic visualization
  • {ED3CD0D9-5FE5-4C34-AFE9-52E714D4FAA4} = config
  • {DED19CA5-0AA6-48AE-8045-9F4975E51253} = database explorer
BmmrMPower is offline   Reply With Quote
Old 24th May 2002, 02:35   #14
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
Pluggable MAKI images and animations

I originally gave this its own thread, but was advised to stick it in here instead.

Suppose you wanted your skin to display a selection of images at random on the visualisation screen, perhaps when idle.

You can make this task easier for yourself by using a standard naming convention for the bitmaps and layers of the pictures to be displayed, for example:

code:


<elements>
<bitmap id="blah.1" file="idle_images/01.png"/>
<bitmap id="blah.2" file="idle_images/02.png"/>
<!-- ... -->
</elements>

<!-- ... -->

<container id="main">
<layout id="normal">
<layer x="50" y="50" image="blah.1" id="IDLE_PICTURES_1"/>
<layer x="50" y="50" image="blah.2" id="IDLE_PICTURES_2"/>
<!-- ... -->
</layout>
<!-- ... -->
</container>




Then, in the MAKI engine which cycles the pictures, you have code like this:

code:


#define IDLE_PICTURE_ID_PREFIX "IDLE_PICTURES_"

Int numIdlePictures = 0;
Timer idleAnimTimer;
Layout mainLayout;
GuiObject idleAnimPreviousFrame = NULL;

System.onScriptLoaded () {

// probe Layout object to find number of bitmaps in XML

mainLayout = System.getContainer("Main").getLayout("Normal");
while (true) {
GuiObject go = mainLayout.getObject (IDLE_PICTURE_ID_PREFIX + integerToString(j));
if (go == NULL)
break;
numIdlePictures++;
// turn off picture initially
go.hide();
}

IdleAnimTimer = new Timer;
IdleAnimTimer.setDelay (1000);
IdleAnimTimer.start();

// other stuff ...

}

// and then the method to change the picture when the timer fires
IdleAnimTimer.onTimer() {
Int j;
for (j=1;j<=numIdlePictures;j++) {
GuiObject frame = mainLayout.getObject (IDLE_PICTURE_ID_PREFIX + integerToString(random(numIdlePictures + 1)));
frame.show();
if (idleAnimPreviousFrame != NULL)
idleAnimPreviousFrame.hide();
idleAnimPreviousFrame = frame;
}
}




Incidentally, I've not tested that particular example, so don't whine if it doesn't work as expected. You get the idea.

The advantage here is that to add more images (or indeed animations, if you want to do it that way) simply requires addition of the <bitmap> and <layer> tags within the XML, and requires no changes to, or recompilation of, the MAKI. Indeed it is possible to encourage users to add their own bitmaps to the system by including them in the WAL file, and informing them in the XML of the naming convention required for the layer id.

Oh well, I suppose it might be of use to someone other than myself.

DJG
DJGrenola is offline   Reply With Quote
Old 24th May 2002, 23:35   #15
Plague
f(caffeine){
return wasabi;
}
(Forum King)
 
Plague's Avatar
 
Join Date: Jul 2001
Location: Sweden
Posts: 3,984
Wanna have 2 drawers on the same place?
Wanna switch between those 2 drawers so that when you slide one out, the other will slide in automatically?

Well, I've got a small script for you to do just that.

Just make 2 normal drawers, but with the same coordinates.
Then edit the attached script for your own need.

It's really easy and it looks great!

Have fun!

-Plague
Attached Files
File Type: m 2drawers-1location.m (3.3 KB, 630 views)
Plague is offline   Reply With Quote
Old 26th May 2002, 20:52   #16
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
plan scuppered by MAKI bug

OK, so thanks to my discovering a bug in MAKI (see 'Another MAKI bug ? System.getObject()' thread), I should point out that the code I gave you above won't work in its current state, as it cannot detect whether an object exists or not within the Layout object.

To make the above code work correctly you'd need to employ the workaround I gave in the thread I just mentioned.

Sorry,

DJG
DJGrenola is offline   Reply With Quote
Old 14th June 2002, 16:01   #17
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
In case you haven't noticed there is a new xui object in the skinning system (build 477). It is called "rect" and it draws you a rectangle.
Heres an example:
<rect id="MyCoolRectangle"
x="10" y="10"
w="100" h="200"
color="0,255,0"
alpha="127"
filled="1"
/>

This draws you a nice filled (as in filled="1") rectange (as in <rect) offset by 10,10 from top left of your layout. (as in x="10" y="10")
it is 100 pixels wide and 200 pixels high (as in w="100" h="200")
it is green (as in color="0,255,0")
it is see thru (as in alpha="127")

Couldn't be simpler, could it?

DO NOT PM ME WITH TECH SUPPORT QUESTIONS
will is offline   Reply With Quote
Old 25th June 2002, 16:55   #18
spleen
Senior Member
 
spleen's Avatar
 
Join Date: Feb 2002
Location: Split, Croatia
Posts: 180
Send a message via ICQ to spleen
Sonique2 Timer

If you've used Sonique2 and you like it's timer style (00:00:00.00),
then use this script.
It requires "songticker" from Default skin, but that can easily be changed.
I recommend that you don't use standard timer font, because the script
needs "." character to work fine. TTF fonts should work fine.

Script itself runs very fast (ThePlague's assistance) and it remembers
"-" state after reload (thanks Gonzotek). If you click songticker, it
changes its mode to a count-down mode, like Winamp does.
Attached Files
File Type: m sonique2_timer.m (1.7 KB, 605 views)
spleen is offline   Reply With Quote
Old 1st July 2002, 20:24   #19
Bizzeh
Forum Pirate
Beta Team
 
Bizzeh's Avatar
 
Join Date: Oct 2001
Posts: 2,032
How to use "Wasabi" buttons

have you wandered how to use "wasabi" buttons...

you know.. the 1s in config and shit like that

well instead of
code:
<button
id="bleh"
x="0"
y="0"
image="20.by.50.image"
action="play"
/>

you use
code:
<wasabi:button
id="wasabi.bleh"
x="0"
y="0"
h="20"
w="50"
action="play"
text="Play"
/>

which will giv u a standerd button that acts as a play button and has Play writen on it
you can do the same to get:
  • Buttons
  • Dropdown boxes
  • check boxes
  • tab sheets
  • frame boxes
  • path picker (file load box)
  • and a few others
to find more go to [wa3 dir]\wacs\xml... and look in there
Bizzeh is offline   Reply With Quote
Old 3rd July 2002, 07:41   #20
will
Nullsoft Newbie (Moderator)
 
will's Avatar
 
Join Date: Mar 2001
Location: Sheffield, England
Posts: 5,569
Making Your Own XUI Objects

This is kind of an extention of what bizzy wrote about, but now we're gonna make our own.
An xui object is an XML User Interface Object. <Layer /> <button /> etc are all XUI's
In wasabi you can make your own in xml very easily, and you can use it even easier.
To use the xui object that we are about to make is just like this:

<MyCheckBox id="mychkbox" x="0" y="0"
default="1" PrivateIntSection="My Skin"
PrivateIntItem="My Setting" text="My Checkbox"/>

What this will do is make a checkbox with the text next to it set to "My Checkbox",
the checkbox will default to the on state (default="1"). When the checkbox is
toggled it will add a line to studio.xnf, so that the setting can be read by any
script, and will be automatically loaded when the skin starts up the next time.

So, here is the xml to make our xui object:
code:
<groupdef id="mychkbox" xuitag="MyCheckBox">
<ToggleButton
id="checkbox.toggle"
x="0" y="1"
image="wasabi.button.checkbox"
activeImage="wasabi.button.checkbox.pressed"/>

<text
id="checkbox.text" ticker="1"
default="ERROR"
x="10" y="0"
w="-10" relatw="1" h="13"
font="arial" fontsize="13"
color="white" shadowcolor="black"
shadowx="1" shadowy="1" wrap="1"/>

<script id="checkbox control script" file="scripts/chkbox.maki"/>
</groupdef>

this is a very normal group that holds a checkbox toggle button and some text and
loads a script, except for 1 thing: xuitag="MyCheckBox"
The xuitag param in <groupdef> gives a name you your xui object

The script that is loaded contains the following code:
code:
#include "../../../lib/std.mi"

Global Text TxtBox;
Global ToggleButton ChkBox;
Global String Item="";
Global String Section="";
Global int defvalue=100;

system.onscriptloaded() {
TxtBox = getscriptgroup().getobject("checkbox.text"); // get the text from the xml
ChkBox = getscriptgroup().getobject("checkbox.toggle"); // get the checkbox from the xml
}

System.onSetXuiParam(String param, String value) { // this is called when the params in <mycheckbox/> are set
if(strlower(param)=="text") TxtBox.setText(value); // set the text of the textbox
if(strlower(param)=="privateintsection") Section = value;
if(strlower(param)=="privateintitem") Item = value;
if(strlower(param)=="default") defvalue = stringtointeger(value);
if(item != "" && section != "" && defvalue != 100)
ChkBox.setActivated(getPrivateInt(section,item,defvalue)); // when all params have been
// set, load the last saved state of the box from studio.xnf
}

ChkBox.OnToggle(boolean onoff) {
setPrivateInt(Section, item, onoff); //when the checkbox is toggled, set the new value to studio.xnf
}

TxtBox.onLeftButtonUp(int x, int y) { // if the text is clicked, the togglebutton should toggle
boolean activ = !ChkBox.getActivated(); //what the new state should be, the opposite of the current
ChkBox.setActivated(activ); //set the checkbox accordingly
setPrivateInt(Section, item, activ); //set the new value in studio.xnf
}

And thats all that is required!
This is an example copied from BOOM, my latest skin.
There are many other applications for this method, this is just one.

DO NOT PM ME WITH TECH SUPPORT QUESTIONS
will is offline   Reply With Quote
Old 21st July 2002, 19:51   #21
Joshuatree
Major Dude
 
Joshuatree's Avatar
 
Join Date: Dec 2001
Location: Buffalo NY
Posts: 635
Send a message via AIM to Joshuatree
If you liked evil pumpkins gamma generator, but wish it would work with the new builds of winamp, then your in luck. Here is a new version updated (with permission) by me to work with the new builds.
Enjoy
Attached Files
File Type: zip gamma.zip (22.1 KB, 871 views)
Joshuatree is offline   Reply With Quote
Old 1st August 2002, 16:11   #22
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
Curved Slider Engine

Curved sliders - the (reasonably) easy way. =)

http://forums.winamp.com/showthread....threadid=96439
DJGrenola is offline   Reply With Quote
Old 2nd August 2002, 06:42   #23
DJGrenola
Registered User
 
DJGrenola's Avatar
 
Join Date: May 2002
Location: Can't remember
Posts: 268
avoiding getObject() NULL errors

This is a technique which I use as a matter of course in all skins, and will really speed up debugging. It's basically a version of getObject() which performs automatic NULL-checking, so you never need to accidentally call methods on a NULL GuiObject again.

Basically, instead of using getObject(), define a function like so:
code:

#define SKIN_VERSION "Skin Disease 0.2.4"

// ...

Function getAndCheck (String objectID, Group source, boolean nullCheck);

// ...

Function getAndCheck (String objectID, Group source, boolean nullCheck) {
if (source == NULL) {
if (nullCheck)
messageBox (SKIN_VERSION + ": error: source Group is NULL", "", 0, "");
return NULL;
}
GuiObject go = source.getObject (objectID);
if (go == NULL) {
if (nullCheck)
messageBox (SKIN_VERSION + ": error: attempt to get object " + objectID + " from source object " + source.getId() + " returned NULL", "", 0, "");
return NULL;
}
return go;
}



Now, a call such as:
code:
Layer l = mainLayout.getObject ("buttons.play");

would become:
code:
Layer l = getAndCheck ("buttons.play", mainLayout, true);

If the object turns out to be NULL, the function will tell you. If you wish to override the null-checking for whatever reason, simply call it with false instead of true as the last parameter.

It may also speed things up to define a second function which calls the first one:
code:

Function getObj (String objectID) {
return getAndCheck (objectID, mainLayout, true);
}


(assuming you have your main Layout / Group object in global variable mainLayout). Now you can just use:
code:
Layer l = getObj ("buttons.play");

... which saves typing, and does the nullchecking for you. Bear in mind also that you can switch the nullchecking off globally if you do it this way, just change true to false in the getObj() definition.

DJG
DJGrenola is offline   Reply With Quote
Old 5th August 2002, 20:04   #24
Plague
f(caffeine){
return wasabi;
}
(Forum King)
 
Plague's Avatar
 
Join Date: Jul 2001
Location: Sweden
Posts: 3,984
Wanna bring back the old Winamp timer?
[00:00] instead of the new [0:00]

well, I made a script to do just that!

This script is adapted to work without any xml changes at all!
It's also adapted to work with both Shade and Normal timers, it even links them to show the same info (elapsed/remaining)!

It should work without any changes in the default skin, just include it in the xml and it's done!!!

have phun!

(script-code is based on the Sonique2-styled timer script found in this thread, made by Spleen with some help from me)

-Plague
Attached Files
File Type: m oldtimer.m (2.1 KB, 640 views)
Plague is offline   Reply With Quote
Old 9th August 2002, 20:18   #25
Bizzeh
Forum Pirate
Beta Team
 
Bizzeh's Avatar
 
Join Date: Oct 2001
Posts: 2,032
2 things...

how to dectect if desktop alpha and do stuff acordingly
code:
#include </lib/std.mi>
#include </lib/config.mi>


Class ConfigAttribute ToggleConfigAttribute;
Global ToggleConfigAttribute attr_desktopalpha;


System.onScriptLoaded()
{

ConfigItem item;

item = Config.getItem("Skins and UI Tweaks");

if (item != NULL)
{

attr_desktopalpha = item.getAttribute("Enable desktop alpha");

}

if(StringToInteger(attr_desktopalpha.getData()) == 1)
{
//do alpha stuff
}
else
{
//do none alpha stuff
}

}

code by plague

and a new mute script by me
code:
MuteB.onLeftButtonUp(int x, int y)
{

if (!MSTAT)
{
if (MOOO)
{
if (OldVolPos != 0)
{
setVolume(OldVolPos);
MOOO = 0;
}
else
{
setVolume(128);
MOOO = 0;
}
}
else
{
OldVolPos = getVolume();
MOOO = 1;
setVolume(0);
}
}
else
{
OldVolPos = getVolume();
MOOO = 1;
setVolume(0);
MSTAT=0;
}

}

System.onvolumechanged(int newvol)
{
MSTAT = 1;
}


Last edited by Bizzeh; 9th August 2002 at 21:38.
Bizzeh is offline   Reply With Quote
Old 20th August 2002, 02:39   #26
Bizzeh
Forum Pirate
Beta Team
 
Bizzeh's Avatar
 
Join Date: Oct 2001
Posts: 2,032
nem... could u put this in tips and tricks or skin love instead of it bein another sticky?

just thinkin of how forum looks and the space
Bizzeh is offline   Reply With Quote
Old 20th August 2002, 03:43   #27
Mega Wonder
Junior Member
 
Join Date: Aug 2002
Posts: 12
Quote:
Originally posted by Naamloos
Gamma Groups
  • open up your elements.xml and add the code below to every element you want to be accesible by the color controls
    code:
    gammagroup="Bleh"
  • Now open up in the thinger the gamma controls (3 stripes) and select the group..
    Now play with the sliders, and try the checkboxes... when you're done, save it.
  • In the wa3 dir it should say something like themes, and you can manually edit the values there. Copy that file into your skin and you're done
Would that be the dmove-elemente.xml file?
Mega Wonder is offline   Reply With Quote
Old 21st August 2002, 18:34   #28
Mega Wonder
Junior Member
 
Join Date: Aug 2002
Posts: 12
Quote:
Originally posted by Joshuatree
If you liked evil pumpkins gamma generator, but wish it would work with the new builds of winamp, then your in luck. Here is a new version updated (with permission) by me to work with the new builds.
Enjoy
Thank you for the awsome tool!
Mega Wonder is offline   Reply With Quote
Old 23rd August 2002, 15:42   #29
Joshuatree
Major Dude
 
Joshuatree's Avatar
 
Join Date: Dec 2001
Location: Buffalo NY
Posts: 635
Send a message via AIM to Joshuatree
Your welcome.
Joshuatree is offline   Reply With Quote
Old 24th August 2002, 08:15   #30
mc^^^^
Forum King
 
mc^^^^'s Avatar
 
Join Date: Aug 2001
Location: Perth, Australia MSN: mcbriar@ii.net Posts: All your posts are belong to me!!!!
Posts: 2,608
little skinning extras

dont think you skin is skinned enough? add these little things to truly get everything skinned.

Skin winamp icon in Media Library
see the little winamp icon next to 'search' in the media library?

change this bitmap id's image:
code:

<bitmap id="library.drag.icon" file="misc/drag_icon.png" />


default picture is 16x16 pixels.

Skin Tooltips
here are the elements that change the tooltips look

code:

<bitmap id="wasabi.tooltip.top.left" file="player/tooltips-elements.png" x="0" y="0" h="2" w="2"/>
<bitmap id="wasabi.tooltip.top" file="player/tooltips-elements.png" x="2" y="0" h="2" w="11"/>
<bitmap id="wasabi.tooltip.top.right" file="player/tooltips-elements.png" x="15" y="0" h="2" w="2"/>
<bitmap id="wasabi.tooltip.left" file="player/tooltips-elements.png" x="0" y="2" h="11" w="2"/>
<bitmap id="wasabi.tooltip.center" file="player/tooltips-elements.png" x="2" y="2" h="11" w="11"/>
<bitmap id="wasabi.tooltip.right" file="player/tooltips-elements.png" x="15" y="2" h="11" w="2"/>
<bitmap id="wasabi.tooltip.bottom.left" file="player/tooltips-elements.png" x="0" y="15" h="2" w="2"/>
<bitmap id="wasabi.tooltip.bottom" file="player/tooltips-elements.png" x="2" y="15" h="2" w="11"/>
<bitmap id="wasabi.tooltip.bottom.right" file="player/tooltips-elements.png" x="15" y="15" h="2" w="2"/>



if you want to change the text color aswell, put this in your elements tag:
code:

<groupdef id="wasabi.tooltip.group" inherit_content="1">
<sendparams target="tooltip.text" color="230,243,230"/>
</groupdef>



Customise preferences height (a bug in some skins)
on some skins i have noticed that the preferences group overlaps the bottom picture of the component window, add this to an elements tag to make its hieght shorter:
code:

<groupdef id="wasabi.preferences.group" inherit_content="1">
<sendparams target="wasabi.preferences.tree.embedded" h="-20"/>
<sendparams target="wasabi.preferences.configpane" h="-24"/>
</groupdef>



change nealry any text color or other attribute in winamp3
cant seem to change the text color of something in a window? simply add this inside your elements tag:
code:

<groupdef id="whatever.group" inherit_content="1">
<sendparams target="id.of.whatever.object" color="230,243,230"/>
</groupdef>



you can also change shadow color, hieght, width, etc...


these are just a few things i have discovered whilst skinning enefex

mc^^^^ is offline   Reply With Quote
Old 29th August 2002, 08:24   #31
simon snowflake
Skin Wizard
(Forum King)
 
simon snowflake's Avatar
 
Join Date: Aug 2000
Location: Gent, Belgium. does anybody know where the toilets are?
Posts: 4,636
Send a message via ICQ to simon snowflake
for adding some space at the end of your thinger (add a clear field so you can scroll a bit further), add rightmargin="xx" to the component bucket or leftmargin="xx" to get spacing at the biginning.

code:

<layer id="thinger.display" image="thinger.display" > </layer>
<componentbucket id="CB" x="5" y="10" w="98" h="32" rightmargin="48" />


don't be a thief of your own life.... : DEXYD - Digitally EXpressing Your Dreams

Join the Winamp Enthusiasts Forum - Join the Winamp Skin Love facebook group:
simon snowflake is offline   Reply With Quote
Old 29th August 2002, 20:48   #32
Joshuatree
Major Dude
 
Joshuatree's Avatar
 
Join Date: Dec 2001
Location: Buffalo NY
Posts: 635
Send a message via AIM to Joshuatree
To bad that doesn't work with the song ticker.
Joshuatree is offline   Reply With Quote
Old 6th September 2002, 02:06   #33
cloneemperor
Member
 
cloneemperor's Avatar
 
Join Date: Aug 2002
Location: Cardston Alberta Canada
Posts: 55
Quote:
If you liked evil pumpkins gamma generator, but wish it would work with the new builds of winamp, then your in luck. Here is a new version updated (with permission) by me to work with the new builds.
And can someone explain how to use it please? There was no documentation when I downloaded it.
cloneemperor is offline   Reply With Quote
Old 6th September 2002, 02:31   #34
Mega Wonder
Junior Member
 
Join Date: Aug 2002
Posts: 12
If i can remember when I did it. Make a new skin, open it up, and copy the code that you DLed onto the file labled skin. Rename that new skin Gamma adjuster and then select it on winamp. Then the gamma adjuster should automatically be open when you select the Gamma-Adjuster skin.

Hope I'm right about this one.
Mega Wonder is offline   Reply With Quote
Old 6th September 2002, 19:27   #35
Plague
f(caffeine){
return wasabi;
}
(Forum King)
 
Plague's Avatar
 
Join Date: Jul 2001
Location: Sweden
Posts: 3,984
no you are not right..

1. download it
2. unzip to the winamp3\scripts but be sure that it has it's own dir, it shouldn't be in the root of winamp3\scripts it should be in winamp3\scripts\gamma (or something)
3. start winamp3 and open preferences
4. goto "Add-Ons/SkinMods"
5. click "Add" and browse to the Winamp3\scripts\gamma dir
6. press ok, and you're done..

-Plague
Plague is offline   Reply With Quote
Old 6th September 2002, 22:39   #36
Mega Wonder
Junior Member
 
Join Date: Aug 2002
Posts: 12
Welp, I did it wrong then. But it works.
Mega Wonder is offline   Reply With Quote
Old 6th September 2002, 22:56   #37
Plague
f(caffeine){
return wasabi;
}
(Forum King)
 
Plague's Avatar
 
Join Date: Jul 2001
Location: Sweden
Posts: 3,984
yeah, your way works alright..
but it would be a pain in the ass, having to do that procedure for every script downloaded..
especially as there's a built-in function for loading scripts

-Plague
Plague is offline   Reply With Quote
Old 6th September 2002, 23:08   #38
Mega Wonder
Junior Member
 
Join Date: Aug 2002
Posts: 12
True, but I like mine. =P I may change it someday though. =P Thanx for tell'n the other way. ^_^;
Mega Wonder is offline   Reply With Quote
Old 8th September 2002, 03:13   #39
cloneemperor
Member
 
cloneemperor's Avatar
 
Join Date: Aug 2002
Location: Cardston Alberta Canada
Posts: 55
Thanks so much for you're help. I'm on my last couple of steps before my first skin is done, and that's one of them.
cloneemperor is offline   Reply With Quote
Old 1st October 2002, 03:21   #40
drastik
Junior Member
 
drastik's Avatar
 
Join Date: Sep 2002
Location: new york city
Posts: 34
Send a message via AIM to drastik
Quote:
willfisher

Here are some guids that i have found using this method:
Colour controls: guid:{163FF355-9B87-49DE-BD72-EF5EA0C57FDD}
Skin Switcher: guid:{0000000A-0078-001E-2878-8C82786EBEC8}
Configurification: guid:{ED3CD0D9-5FE5-4C34-AFE9-52E714D4FAA4}
Shoutcast server list: guid:{AFF7172F-4E42-4A38-9106-86B610B482EF}
Database Explorer: guid:{DED19CA5-0AA6-48AE-8045-9F4975E51253}
shoutcast server list and color controls dont work anymore.

anyone know if they're even still part of the program?
drastik is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump