Author Topic: First shot at packages, failed miserably. [Solved, by me]  (Read 876 times)

This is the add-on I'm trying to modify - http://forum.blockland.us/index.php?topic=183925.0
I'm attempting to make the green part (currently under the tool slider) be anchored next to the paint slider.

Using packages, I had hoped to make the green part slide out with the paint, and then slide back in when the paint slider goes in, so that both were always visible. The best result I've managed to achieve is the green part twitching, and the paint slider functioning normally.

I am very newby when it comes to packages, help please!
Code: [Select]
package PaintCanGlideSupport
{
function playgui::hidepaintbox(%this, %distance, %number, %numberother)
{
if(%distance < 0)
GPScounter.position = (%distance SPC (getWord(getRes(),1) - 80) + getWord($Pref::GPSCounter::posadd,1));
if(%distance > 0)
GPScounter.position = ("-15" SPC (getWord(getRes(),1) - 80) + getWord($Pref::GPSCounter::posadd,1));
parent::hidepaintbox(%this, %distance, %number, %numberother);
echo(%this SPC %distance SPC %number SPC %numberother);
}
};
activatePackage(PaintCanGlideSupport);

EDIT:Visual reference: should move to . This example was obviously manually doctored..

EDIT2:The debug ECHO I have up there returns this:
Code: [Select]
-open-
PlayGui -91 1 0
4352 -91 1 1
-close-
PlayGui 91 10 0
4352 91 10 1
4352 91 10 2
4352 91 10 3
4352 91 10 4
4352 91 10 5
4352 91 10 6
4352 91 10 7
4352 91 10 8
4352 91 10 9
4352 91 10 10

As it would turn out, it was getting reset because I had a loop in the script resetting it. Facepalm.jpg
« Last Edit: February 04, 2012, 10:56:03 PM by Lugnut1206 »

So your all good now?