Graal Pastebin

New Paste
Pasted on January 29, 2012.
View the raw file

// Refactored and Cleaned
with (("ItemWindow_" @ item)) {
  new GuiShowImgCtrl("weaponImg"@temp.v) {
    image = thiso.search_list[temp.v].image;
    x = new_x_position + 15.5;
    y = new_y_position + 35;
    layer = 6;
    mode = 1;
    hint = "loading...";
    this.showhints();
    width = 32;
    height = 32;
    this.wep = thiso.search_list[temp.v].name; // Stores the Weapon Name
    thiso.catchevent(this.name, "onMouseDown", "leftMouse");
    thiso.catchevent(this.name, "onRightMouseUp", "rightMouse"); // Changed it to onRightMouseUp Event
    thiso.catchevent(this.name, "onMouseEnter", "hoverMouseEnter");
    thiso.catchevent(this.name, "onMouseLeave", "hoverMouseLeave");
  }
}
 
// You no longer need the 'this.clicked' check because
// you're relying on mouse up instead of down.
function rightMouse(obj) {
  if (!this.draggingInv) {
 
    new GuiPopUpMenuCtrl("Item_Menu") {
      profile     = "GuiBluePopUpMenuProfile";
      textprofile = "Armageddon_TextList";
      scrollprofile = "Armageddon_Scroll";
      width       = 20;
 
	  // Set the Wep in the Item Menu Object
	  this.wep = obj.wep;
	  echo("Opening Item Menu for " @ this.wep);
 
      clearrows();
      addRow(0, "Sell");
      addRow(1, "Drop");
      open(mousescreenx, mousescreeny);
    }
  }
}
 
function Item_Menu.onSelect(entryid, text) {
  temp.wep = Item_Menu.wep; // Retrieve Weapon Name from Item Menu
  switch (text) {
    case "Sell":
	  findweapon("-Player/Shop").bringInSell(temp.wep);
	  break;
	case "Drop":
	  triggerServer("gui", name, "menuItemDrop", temp.wep);
	  break;
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54