View Single Post
  #10  
Old 09-08-2007, 10:39 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Thanks Chompy...well now I'm having problems with dragging the icon around. Here's what I have:
PHP Code:
function loadPage() {
  for (
a=1a<25a++) {
    
makevar("ItemIcon_" a).destroy();
  }
  
this.itemssize clientr.items.size()-((this.page-1)*24);
  
temp.base = {218+Inv.x53+Inv.y};
  for (
temp.i=0temp.i<this.itemssizetemp.i++) {
    new 
GuiShowImgCtrl("ItemIcon_" temp.i) {
      
temp.base[0] + (32*(temp.i%4));
      
temp.base[1] + (32*int(temp.i/6));
      
image "bcalarmclock.png";
      
this.origin = {this.xthis.y};
      
thiso.catchevent(this.name"onMouseDown""linkItem");
      
thiso.catchevent(this.name"onRightMouseDown""onItemRightClicked");
      
thiso.catchevent(this.name"onMouseUp""unlinkItem");
      
thiso.catchevent(this.name"onMouseDragged""moveItem");
      
InventoryGUI.addControl(this);
    }
  }
}
function 
linkItem(iname) {
  
makevar(iname).zoom 1.2;
  
makevar(iname).width makevar(iname).width*1.2;
  
makevar(iname).height makevar(iname).height*1.2;
  
this.linkeditem makevar(iname);
}
function 
unlinkItem() {
  if (
this.linkeditem != NULL) {
    for (
i=0i<this.slots.size(); i++) {
      if (
this.linkeditem.x in |this.slots[i][0]+Inv.xthis.slots[i][2]+Inv.x| && this.linkeditem.y in |this.slots[i][1]+Inv.ythis.slots[i][3]+Inv.y|) {
        if (
this.slots[i][5] == NULLequipItem(this.slots[i][4], this.linkeditem.name);
        else {
          
unequipItem(this.slots[i][4], this.slots[i][5]);
          
equipItem(this.slots[i][4], this.linkeditem.name);
        }
        
this.slots[i][5] = this.linkeditem.name;
      }
    }
    
with (this.linkeditem) {
      
zoom 1;
      
extent = {32,32};
      
position this.origin;
    }
    
this.linkeditem NULL;
  }
}
function 
moveItem() {
  if (
this.linkeditem != NULL)
    
this.linkeditem.position = {params[2], params[3]};

Which works, except...for some reason I can't drag the icon to the left. o.0 Which is kind of a problem, because the main reason I'm doing this is to drag it to the equip slots, which is to the left of the icons.

By the way, Chompy, where the hell have you been? You haven't been on Maloria in forever. D:
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote