Old 26th January 2006, 23:41   #1
QuadHeliX
Major Dude
 
QuadHeliX's Avatar
 
Join Date: Jan 2003
Location: Washington State
Posts: 1,133
Gotta be an easier way

here is the delemma to make a Standard frame PL ML ect.. Transparent you need to use Rpeter Clarks scripts from
Halloween 2003 and Terminator 3 skin. here is a link to a skin that uses petes scripts cover amp and here is a pic of Clear-ones scripts that use Petes maki. Is there a Way to consolidate the scripts into one Maki and just one xml like,

<elements>

<bitmap id="wasabi.frame.basetexture" file="window/background.png" gammagroup="Background" />
<elementalias id="component.basetexture" target="wasabi.frame.basetexture" />
<elementalias id="studio.basetexture" target="wasabi.frame.basetexture" />

<bitmap id="component.top.left" file="window/standardframe.png"
x="0" y="0" w="27" h="27" gammagroup="Background" />
<bitmap id="component.top.middle" file="window/standardframe.png" x="27"
y="0" w="142" h="19" gammagroup="Background" />
<bitmap id="component.top.right" file="window/standardframe.png" x="169"
y="0" w="27" h="27" gammagroup="Background" />
<bitmap id="component.left" file="window/standardframe.png"
x="0" y="27" w="19" h="56" gammagroup="Background" />
<bitmap id="component.right" file="window/standardframe.png"
x="177" y="27" w="19" h="56" gammagroup="Background" />
<bitmap id="component.bottom.left" file="window/standardframe.png"
x="0" y="83" w="30" h="27" gammagroup="Background" />
<bitmap id="component.bottom.middle" file="window/standardframe.png"
x="30" y="92" w="137" h="18" gammagroup="Background" />
<bitmap id="component.bottom.right" file="window/standardframe.png"
x="167" y="83" w="29" h="27" gammagroup="Background" />

<bitmap id="component.region.top.left" file="window/regions.png" gammagroup="Background"
x="0" y="0" w="5" h="5"/>
<bitmap id="component.region.top.right" file="window/regions.png" gammagroup="Background"
x="191" y="0" w="5" h="5"/>
<bitmap id="component.region.bottom.left" file="window/regions.png" gammagroup="Background"
x="0" y="105" w="5" h="5"/>
<bitmap id="component.region.bottom.right" file="window/regions.png" gammagroup="Background"
x="191" y="105" w="5" h="5"/>

<bitmap id="component.closebutton" file="window/closebutton.png"
x="0" y="0" w="12" h="12" gammagroup="GlassButtons"/>
<bitmap id="component.closebutton.pressed" file="window/closebutton.png"
x="0" y="12" w="12" h="12" gammagroup="GlassButtons"/>

</elements>


<groupdef id="wasabi.frame.layout">
<layer id="region.top.left" image="component.region.top.left" x="0" y="0" sysregion="-2"/>
<layer id="region.top.right" image="component.region.top.right"
x="-5" y="0" relatx="1" sysregion="-2"/>
<layer id="region.bottom.left" image="component.region.bottom.left" x="0" y="-5"
relaty="1" sysregion="-2"/>
<layer id="region.bottom.right" image="component.region.bottom.right" x="-5" y="-5" relatx="1" relaty="1" sysregion="-2"/>

<layer id="left" x="0" y="27" w="19" h="-54"
relath="1" image="component.left" resize="left"/>
<layer id="right" x="-19" y="27" w="19" h="-54"
relatx="1" relath="1" image="component.right" resize="right"/>

<layer id="top.left" x="0" y="0" image="component.top.left" resize="topleft"/>
<layer id="top.middle" x="27" y="0" w="-54" h="19" relatw="1" image="component.top.middle"/>
<layer id="top.right" x="-27" y="0" relatx="1" image="component.top.right" resize="topright"/>

<layer id="bottom.left" x="0" y="-27" relaty="1" image="component.bottom.left" resize="bottomleft"/>
<layer id="bottom.middle" x="30" y="-18" w="-59" h="18" relaty="1" relatw="1" tile="1" image="component.bottom.middle" resize="bottom"/>
<layer id="bottom.right" x="-29" y="-27" relaty="1" relatx="1" image="component.bottom.right" resize="bottomright"/>

<button id="close"
x="-18" y="3" relatx="1"
action="CLOSE"
image="shadeplay"
downimage="shadeplayd"
hoverImage="shadeplayd"
tooltip="Close"
/>

<text id="titlebar" ghost="1" x="30"
y="0" h="10" w="-60" relatw="1"
default=":componentname"
font="player.font.title"
align="center" fontsize="14" antialias="1" color="font.title" doborder="0" border="0"
/>


<LayoutStatus id="sysmenu.status" bg="0"
x="5" y="3" w="14" h="9" includeonly="{system}" />
<hideobject target="sysmenu.status"/>

<Wasabi:TitleBar id="wasabi.titlebar"
x="22" y="2" w="-42" h="11" relatw="1" />
<hideobject target="wasabi.titlebar"/>

</groupdef>


<!-- Wasabi:StandardFrame:Status -->

<groupdef id="wasabi.standardframe.statusbar" background="wasabi.frame.basetexture" sysregion="1" xuitag="Wasabi:StandardFrame:Status">

<group id="wasabi.frame.layout" x="0" y="0" w="0" relatw="1" h="0" relath="1"/>

<LayoutStatus id="standardframe.layoutstatus" x="30" y="-17" relaty="1" w="-60" relatw="1" h="15" exclude="{system}" />
<script id="standardframe.script" file="scripts/standardframe.maki" param="19,16,-38,-34,0,0,1,1" />

</groupdef>


<!-- Wasabi:StandardFrame:NoStatus -->

<groupdef id="wasabi.standardframe.nostatusbar" background="wasabi.frame.basetexture" sysregion="1" xuitag="Wasabi:StandardFrame:NoStatus">

<group id="wasabi.frame.layout" x="0" y="0" w="0" h="0" relatw="1" relath="1"/>

<script id="standardframe.script" file="scripts/standardframe.maki" param="19,16,-38,-34,0,0,1,1" />

</groupdef>


<!-- Wasabi:StandardFrame:Modal -->

<groupdef id="wasabi.standardframe.modal" inherit_group="wasabi.standardframe.nostatusbar" sysregion="1" xuitag="Wasabi:StandardFrame:Modal">
<hideobject target="sysmenu;sysmenu.inactive"/>
<sendparams target="wasabi.titlebar" x="4" w="-24" relatw="1" />
<sendparams target="window.top.left;

</groupdef>


<!-- Wasabi:StandardFrame:Static -->

<groupdef id="wasabi.standardframe.static" inherit_group="wasabi.standardframe.nostatusbar" sysregion="1" xuitag="Wasabi:StandardFrame:Static">
<sendparams " resize="0" />
</groupdef>
Attached Images
File Type: jpg co.jpg (56.2 KB, 296 views)

Last edited by QuadHeliX; 27th January 2006 at 02:33.
QuadHeliX is offline   Reply With Quote
Old 27th January 2006, 02:14   #2
axialix
Senior Member
 
axialix's Avatar
 
Join Date: Jun 2002
Posts: 209
I didn't have any luck getting it to work that way. Since the transparent layer (clear layer) has to lay over the regular standard frame, it needs to be in a container of its own. I did include all the xml in one file (window.xml) but each maki script needed to be separate. If hope you can find a better way, it would sure simplify things.
axialix is offline   Reply With Quote
Old 27th January 2006, 05:24   #3
leechbite
Major Dude
 
leechbite's Avatar
 
Join Date: Sep 2003
Location: Canada
Posts: 635
Send a message via Yahoo to leechbite
i think its possible to create a single/common script of this. if you create the transparent container dynamically and create it everytime the standardframe.maki gets called then it should be possible.

although, knowing RPC, there might be a good reason why he had the standframe scripts separate.
leechbite is offline   Reply With Quote
Old 27th January 2006, 06:12   #4
axialix
Senior Member
 
axialix's Avatar
 
Join Date: Jun 2002
Posts: 209
Quote:
...if you create the transparent container dynamically and create it everytime the standardframe.maki gets called...
That's how it's currently working. Each time you show any of the component windows, a dynamic container gets created especially for that window.

I just looked at rpc's T3_Amp skin again, and he has one standardframe.maki for all the windows' shadows. This works, but I can't remember why I created a separate script for each window. I'm gonna do some investigating...
axialix is offline   Reply With Quote
Old 27th January 2006, 08:30   #5
axialix
Senior Member
 
axialix's Avatar
 
Join Date: Jun 2002
Posts: 209
Ok, after playing around with an old version of my skin, I finally realized why I separated all the scripts. To resize any of the windows, you click and drag one corner or edge of the clear layer to a new position. After you do that, the function SyncStandardframe kicks in and resizes the standardframe to the new size of the clear layer. This is different from T3_Amp since with that skin, you actually drag/resize the standardframe itself and not the clear (shadow) layer . Clear as mud? Yeah I know. There have to be seperate scripts because each window has its own size. For instance, if the PL is 200px wide, the clear layer and standardframe are 200px wide. But if the ML is 300px wide, what now does the function SyncStandardframe think about it if you only have one standardframe script? It doesn't know what to think, so it doesn't work.

There is an alternative though. You can always make the user grab part of the standardframe to resize or move the window. This is how T3 works and will allow you to only use one script.

I just checked out the cover_amp skin. Pretty good, maybe not as good as clearONE , but at least now people can have transparency where there was none before. This is exactly what needs to happen, what with Vista right around the corner and all. To my knowledge, WMP can't do it yet, and foobar, oh well whatever. I must say, without rpc's original script, I could never have come up with the Sync idea. Thank you sir!
axialix is offline   Reply With Quote
Old 27th January 2006, 14:15   #6
QuadHeliX
Major Dude
 
QuadHeliX's Avatar
 
Join Date: Jan 2003
Location: Washington State
Posts: 1,133
Hey Pete,

can we use this code from t3?

#include "../../../lib/std.mi"

Function setNewGroup(String strGroupID);
Function syncShadow();
Function Boolean shadowIsSynced();

Global Layout layoutStandardFrame;
Global Layout layoutStandardFrameShadow;
Global Group groupStandardFrame;
Global Group groupStandardFrameContent;
Global Group groupStandardFrameTitlebar;
Global Layer layerMouseTrap;
Global Layer layerMoverTop, layerMoverBottom;
Global Layer layerScratchesTop, layerScratchesBottom;
Global String strParamX, strParamY, strParamW, strParamH, strParamRX, strParamRY, strParamRW, strParamRH;
Global Timer timerSyncSettings;
Global Boolean boolLayoutIsDragging;

System.onScriptLoaded() {
groupStandardFrame = System.getScriptGroup();
layoutStandardFrame = groupStandardFrame.getParentLayout();
layoutStandardFrameShadow = System.newGroupAsLayout("wasabi.frame.layout.shadow");

layerMoverTop = groupStandardFrame.findObject("window.mover.top");
layerMoverBottom = groupStandardFrame.findObject("window.mover.bottom");

layerScratchesTop = groupStandardFrame.findObject("window.top.abuse");
layerScratchesBottom = groupStandardFrame.findObject("window.bottom.abuse");

layoutStandardFrameShadow.setXMLParam("x", "0");
layoutStandardFrameShadow.setXMLParam("y", "0");
layoutStandardFrameShadow.setXMLParam("w", "0");
layoutStandardFrameShadow.setXMLParam("h", "0");
layoutStandardFrameShadow.setXMLParam("relatw", "1");
layoutStandardFrameShadow.setXMLParam("relath", "1");
layoutStandardFrameShadow.setXMLParam("ghost", "1");
layoutStandardFrameShadow.setXMLParam("move", "0");
layoutStandardFrameShadow.setXMLParam("desktopalpha", "1");
layoutStandardFrameShadow.setXMLParam("noparent", "1");
layoutStandardFrameShadow.setXMLParam("nodock", "1");
layoutStandardFrameShadow.setXMLParam("noactivation", "1");
layoutStandardFrameShadow.hide();

String strParam = System.getParam();
strParamX = System.getToken(strParam, ",", 0);
strParamY = System.getToken(strParam, ",", 1);
strParamW = System.getToken(strParam, ",", 2);
strParamH = System.getToken(strParam, ",", 3);
strParamRX = System.getToken(strParam, ",", 4);
strParamRY = System.getToken(strParam, ",", 5);
strParamRW = System.getToken(strParam, ",", 6);
strParamRH = System.getToken(strParam, ",", 7);

boolLayoutIsDragging = false;

timerSyncSettings = new Timer;
timerSyncSettings.setDelay(500);
timerSyncSettings.start();
}

System.onScriptUnloading() {
timerSyncSettings.stop();
delete timerSyncSettings;
}

System.onSetXuiParam(String strParam, String strValue) {
if (strParam == "content") {
setNewGroup(strValue);
groupStandardFrameTitlebar = groupStandardFrame.findObject("wasabi.titlebar");
if (groupStandardFrameTitlebar != NULL) {
layerMouseTrap = groupStandardFrameTitlebar.findObject("mousetrap");
}
}
if (strParam == "padtitleright" || strParam == "padtitleleft") {
if (groupStandardFrameTitlebar != NULL) {
groupStandardFrameTitlebar.setXMLParam(strParam, strValue);
}
}
if (strParam == "shade") {
if (layerMouseTrap != NULL) {
layerMouseTrap.setXMLParam("dblclickaction", "switch;" + strValue);
} else {
messagebox("Cannot set shade parameter for StandardFrame object, no mousetrap found", "Skin Error", 0, "");
}
}
}

layoutStandardFrame.onDock() {
layoutStandardFrameShadow.hide();
}

groupStandardFrame.onNotify(String strCommandPair, String strParam, Int intA, Int intB) {
String strCommand = System.getToken(strCommandPair, ",", 0);
String strCommandParam = System.getToken(strCommandPair, ",", 1);
if (strCommand == "content" || strCommand == "padtitleright" || strCommand == "padtitleleft" || strCommand == "shade") {
System.onSetXuiParam(strCommand, strCommandParam);
}
}

timerSyncSettings.onTimer() {
Int intCurrentScratchesEnabled = System.getPrivateInt("T3C", "ScratchesEnabled", 1);
layerScratchesTop.setXMLParam("visible", System.integerToString(intCurrentScratchesEnabled));
layerScratchesBottom.setXMLParam("visible", System.integerToString(intCurrentScratchesEnabled));

if (!System.isAppActive() || !System.getPrivateInt("T3C", "ComponentShadowsEnabled", 1)) {
layoutStandardFrameShadow.hide();
} else if (System.isAppActive() && layoutStandardFrame.isVisible() && !layoutStandardFrameShadow.isVisible() && !boolLayoutIsDragging) {
syncShadow();
}
}

layoutStandardFrame.onSetVisible(Boolean boolIsVisible) {
if (boolIsVisible && System.getPrivateInt("T3C", "ComponentShadowsEnabled", 1)) {
syncShadow();
} else {
layoutStandardFrameShadow.hide();
}
}

layoutStandardFrame.onResize(Int intWidth, Int intHeight, Int intPosX, Int intPosY) {
if (layoutStandardFrame.isVisible()) {
layoutStandardFrameShadow.hide();
syncShadow();
}
}

layerMoverTop.onLeftButtonDown(Int intPosX, Int intPosY) {
boolLayoutIsDragging = true;
layoutStandardFrameShadow.hide();
}
layerMoverTop.onLeftButtonUp(Int intPosX, Int intPosY) {
boolLayoutIsDragging = false;
syncShadow();
}

layerMoverBottom.onLeftButtonDown(Int intPosX, Int intPosY) {
boolLayoutIsDragging = true;
layoutStandardFrameShadow.hide();
}
layerMoverBottom.onLeftButtonUp(Int intPosX, Int intPosY) {
boolLayoutIsDragging = false;
syncShadow();
}

setNewGroup(String strGroupID) {
groupStandardFrameContent = System.newGroup(strGroupID);
if (groupStandardFrameContent == NULL) {
messagebox("group \"" + strGroupID + "\" not found", "ButtonGroup", 0, "");
return;
}
groupStandardFrameContent.setXMLParam("x", strParamX);
groupStandardFrameContent.setXMLParam("y", strParamY);
groupStandardFrameContent.setXMLParam("w", strParamW);
groupStandardFrameContent.setXMLParam("h", strParamH);
groupStandardFrameContent.setXMLParam("relatx", strParamRX);
groupStandardFrameContent.setXMLParam("relaty", strParamRY);
groupStandardFrameContent.setXMLParam("relatw", strParamRW);
groupStandardFrameContent.setXMLParam("relath", strParamRH);
groupStandardFrameContent.init(groupStandardFrame);
}

syncShadow() {
if (System.getPrivateInt("T3C", "ComponentShadowsEnabled", 1)) {
layoutStandardFrameShadow.resize(layoutStandardFrame.getLeft() - 11, layoutStandardFrame.getTop() - 10, layoutStandardFrame.getWidth() + 22, layoutStandardFrame.getHeight() + 20);
layoutStandardFrameShadow.show();
layoutStandardFrame.setFocus();
}
}

Boolean shadowIsSynced() {
Boolean boolReturnValue = true;
if (layoutStandardFrameShadow.getLeft() != (layoutStandardFrame.getLeft() - 11)) { boolReturnValue = false; }
if (layoutStandardFrameShadow.getTop() != (layoutStandardFrame.getTop() - 10)) { boolReturnValue = false; }
if (layoutStandardFrameShadow.getWidth() != (layoutStandardFrame.getWidth() + 22)) { boolReturnValue = false; }
if (layoutStandardFrameShadow.getHeight() != (layoutStandardFrame.getHeight() + 20)) { boolReturnValue = false; }
return boolReturnValue;
}
QuadHeliX is offline   Reply With Quote
Old 30th January 2006, 00:16   #7
rpeterclark
Major Dude
(Reviewer)
 
rpeterclark's Avatar
 
Join Date: Aug 2002
Location: South Florida
Posts: 1,388
Sure! Sorry about the late response. Work has been tough on me lately and I haven't been able to visit as often as I'd like...
rpeterclark is offline   Reply With Quote
Old 30th January 2006, 01:13   #8
QuadHeliX
Major Dude
 
QuadHeliX's Avatar
 
Join Date: Jan 2003
Location: Washington State
Posts: 1,133
thanks much! will credit you in future skins.
QuadHeliX 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