コード例 #1
0
ファイル: GuiControls.java プロジェクト: WhyMeMan/Scarlet
 @Override
 public void mouseMovedOrUp(int x, int y, int button) {
   if (Minecraft.getMinecraft().currentScreen == null) return;
   super.mouseMovedOrUp(x, y, button);
   for (Frame frame : guiManager.getFrames()) {
     if (!frame.isVisible()) continue;
     if (!frame.isMinimized() && !frame.getArea().contains(x, y)) {
       for (Component component : frame.getChildren()) {
         for (Rectangle area :
             component.getTheme().getUIForComponent(component).getInteractableRegions(component)) {
           if (area.contains(
               x - frame.getX() - component.getX(), y - frame.getY() - component.getY())) {
             frame.onMouseRelease(x - frame.getX(), y - frame.getY(), button);
             guiManager.bringForward(frame);
             return;
           }
         }
       }
     }
   }
   for (Frame frame : guiManager.getFrames()) {
     if (!frame.isVisible()) continue;
     if (!frame.isMinimized() && frame.getArea().contains(x, y)) {
       frame.onMouseRelease(x - frame.getX(), y - frame.getY(), button);
       guiManager.bringForward(frame);
       break;
     } else if (frame.isMinimized()) {
       for (Rectangle area :
           frame.getTheme().getUIForComponent(frame).getInteractableRegions(frame)) {
         if (area.contains(x - frame.getX(), y - frame.getY())) {
           frame.onMouseRelease(x - frame.getX(), y - frame.getY(), button);
           guiManager.bringForward(frame);
           return;
         }
       }
     }
   }
 }
コード例 #2
0
 /**
  * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY,
  * which) which==-1 is mouseMove, which==0 or which==1 is mouseUp
  */
 protected void mouseMovedOrUp(int par1, int par2, int par3) {
   super.mouseMovedOrUp(par1, par2, par3);
 }
コード例 #3
0
 protected void mouseMovedOrUp(int i, int j, int k) {
   super.mouseMovedOrUp(i, j, k);
 }