Example #1
0
 @Override
 public void eventButtonClick() {
   Interface.setSocialFrameStatus(false);
   this.reset();
 }
Example #2
0
 public static boolean mouseEvent() throws FileNotFoundException, SQLException {
   Arrays.fill(slot_hover, false);
   right_arrow = false;
   left_arrow = false;
   hover_button = false;
   int xLeft = -279;
   int xRight = -114;
   int y = -275;
   if (Mideas.mouseX() >= Display.getWidth() / 2 + xRight + 126
       && Mideas.mouseX() <= Display.getWidth() / 2 + xRight + 151
       && Mideas.mouseY() >= Display.getHeight() / 2 + y + 266
       && Mideas.mouseY() <= Display.getHeight() / 2 + y + 292) {
     right_arrow = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + xRight - 161
       && Mideas.mouseX() <= Display.getWidth() / 2 + xRight - 136
       && Mideas.mouseY() >= Display.getHeight() / 2 + y + 266
       && Mideas.mouseY() <= Display.getHeight() / 2 + y + 292) {
     left_arrow = true;
   }
   if (Mideas.mouseX() >= Display.getWidth() / 2 + 27
       && Mideas.mouseX() <= Display.getWidth() / 2 + 46
       && Mideas.mouseY() >= Display.getHeight() / 2 - 337
       && Mideas.mouseY() <= Display.getHeight() / 2 - 319) {
     hover_button = true;
   }
   if (Mouse.getEventButtonState()) {
     if (Mideas.mouseX() >= Display.getWidth() / 2 + 27
         && Mideas.mouseX() <= Display.getWidth() / 2 + 46
         && Mideas.mouseY() >= Display.getHeight() / 2 - 337
         && Mideas.mouseY() <= Display.getHeight() / 2 - 319) {
       Interface.closeShopFrame();
       return true;
     } else if (page == 0 && right_arrow) {
       page++;
       Interface.setIsShopLoaded(false);
     } else if (page == 1 && right_arrow) {
       page++;
       Interface.setIsShopLoaded(false);
     } else if (page == 1 && left_arrow) {
       page--;
       Interface.setIsShopLoaded(false);
     } else if (page == 2 && left_arrow) {
       page--;
       Interface.setIsShopLoaded(false);
     }
   }
   isSlotHover(xLeft, y, 0, 41, 0);
   isSlotHover(xLeft, y, 52, 93, 1);
   isSlotHover(xLeft, y, 104, 145, 2);
   isSlotHover(xLeft, y, 156, 197, 3);
   isSlotHover(xLeft, y, 208, 249, 4);
   isSlotHover(xRight, y, 0, 41, 5);
   isSlotHover(xRight, y, 52, 93, 6);
   isSlotHover(xRight, y, 104, 145, 7);
   isSlotHover(xRight, y, 156, 197, 8);
   isSlotHover(xRight, y, 208, 249, 9);
   int i = 0;
   while (i < 10 && i + 10 * page < shopList.size()) {
     buyItems(slot_hover[i], shopList.get(i + 10 * page));
     i++;
   }
   return false;
 }