View Single Post
  #1  
Old 07-16-2006, 11:42 AM
Giltwist2k1 Giltwist2k1 is offline
Registered User
Giltwist2k1's Avatar
Join Date: Jun 2002
Posts: 13
Giltwist2k1 is on a distinguished road
Send a message via ICQ to Giltwist2k1 Send a message via AIM to Giltwist2k1 Send a message via Yahoo to Giltwist2k1
Gift Script: GS2 GUI Tailor

I'm sick to death of going on servers that have "/setcoat black" or whatnot. Here's a no-frills GUI that impliments all the basic functions of a tailor without the need for tedius chat-commands. Feel free to use and edit at your will. Also available on Graal.net

PHP Code:
//Created by Giltwist
//#CLIENTSIDE
function onweaponfired(){
showtailor();
}
function 
showtailor(){
if (!
tailormenu.active)
{
settimer(1);
new 
GuiWindowCtrl("tailormenu")  
   {    
    
width 325;   
    
height 156;

    
client.tailorx;    
    
client.tailory;  

    
canMove true;      
    
canResize false;   
    
canMaximize false;
    
canClose false;
    
canMinimize false;
    
tile true;
    
text "Outfit";  
    
visible true;
// Color Attributes    
parts={"Skin","Shoes","Sleeves","Coat","Belt"};
for (
m=0;m<5;m++){

new 
GuiMLTextCtrl("text" parts[m]){
    
width 60;   
    
height 25;
allowcolorchars=true;
parsetags=true;
    
10;    
    
27+25*m;  
    
text "<font size=20 color='black'>" parts[m] @ ":</font>"
  }
  
new 
GuiPopUpMenuCtrl("tailor" parts[m]){
width=70;
height=25;
x=75;
y=25+25*m;

addcolors();
canMove false;     
    
canResize false;   
    
canMaximize false;
    
canClose false;
    
canMinimize false;
    
tile true;
    
visible true;
    
    
thiso.catchevent(this,"onSelect","updatecolor");
}
}
//Body

new GuiMLTextCtrl("bodytext"){
    
width 50;   
    
height 25;
allowcolorchars=true;
parsetags=true;
    
160;    
    
27;  
    
text "<font size=20 color='black'>Body:</font>"
  }
  
new 
GuiTextEditCtrl("tailorbody")
{
width=100;
height=25;
x215;
y25;
canMove false;      
    
canResize false;   
    
canMaximize false;
    
canClose false;
    
canMinimize false;
    
tile true;
    
visible true;
text=player.bodyimg;

}
//Head

new GuiMLTextCtrl("headtext"){
    
width 50;   
    
height 25;
allowcolorchars=true;
parsetags=true;
    
160;    
    
52;  
    
text "<font size=20 color='black'>Head:</font>"
  }
  
new 
GuiTextEditCtrl("tailorhead")
{
width=100;
height=25;
x215;
y50;
canMove false;      
    
canResize false;   
    
canMaximize false;
    
canClose false;
    
canMinimize false;
    
tile true;
    
visible true;
text=player.headimg;

}
//Sword

new GuiMLTextCtrl("swordtext"){
    
width 50;   
    
height 25;
allowcolorchars=true;
parsetags=true;
    
160;    
    
77;  
    
text "<font size=20 color='black'>Sword:</font>"
  }
  
new 
GuiTextEditCtrl("tailorsword")
{
width=100;
height=25;
x215;
y75;
canMove false;      
    
canResize false;   
    
canMaximize false;
    
canClose false;
    
canMinimize false;
    
tile true;
    
visible true;
text=player.swordimg;

}
//shield

new GuiMLTextCtrl("shieldtext"){
    
width 50;   
    
height 25;
allowcolorchars=true;
parsetags=true;
    
160;    
    
102;  
    
text "<font size=20 color='black'>Body:</font>"
  }
  
new 
GuiTextEditCtrl("tailorshield")
{
width=100;
height=25;
x215;
y100;
canMove false;      
    
canResize false;   
    
canMaximize false;
    
canClose false;
    
canMinimize false;
    
tile true;
    
visible true;
text=player.shieldimg;

}

}
GraalControl.makefirstresponder(true);
}
else
{
client.tailorx=tailormenu.x;
client.tailory=tailormenu.y;
tailormenu.destroy();
}
}

function 
addcolors(){
this.colors={"white","yellow","orange","pink","red","darkred","lightgreen","green","darkgreen","lightblue","blue","darkblue","brown","cynober","purple","darkpurple","lightgray","gray","black","transparent"};
for (
this.i=0;this.i<this.colors.size();this.i++){
(
"tailor" parts[m]).addrow(this.ithis.colors[this.i]);
(
"tailor" parts[m]).text=this.colors[player.colors[m]];
}
}

function 
updatecolor(temp.part,temp.colnum)
{
player.colors[parts.index(temp.part.substring(6))]=temp.colnum;
}

function 
tailorbody.onAction(temp.body){
player.bodyimg=temp.body;
settimer(.1);
GraalControl.makefirstresponder(true);
}
function 
tailorhead.onAction(temp.body){
player.headimg=temp.body;
settimer(.1);
GraalControl.makefirstresponder(true);
}
function 
tailorsword.onAction(temp.body){
player.swordimg=temp.body;
settimer(.1);
GraalControl.makefirstresponder(true);
}
function 
tailorshield.onAction(temp.body){
player.shieldimg=temp.body;
settimer(.1);
GraalControl.makefirstresponder(true);
}

//File not found check
function ontimeout(){
tailorbody.text=player.bodyimg;
tailorhead.text=player.headimg;
tailorsword.text=player.swordimg;
tailorshield.text=player.shieldimg;


Last edited by Skyld; 07-16-2006 at 02:15 PM.. Reason: Added PHP tags instead of CODE :)
Reply With Quote