コード例 #1
0
ファイル: GuiTablet.java プロジェクト: gamax92/CCLights2
 @Override
 protected void mouseClicked(int par1, int par2, int par3) {
   if (!nbt.getBoolean("canDisplay")) return;
   par1 = applyXOffset(par1);
   par2 = applyYOffset(par2);
   if (par1 > -1 & par2 > -1 & par1 < mon.getWidth() + 1 & par2 < mon.getHeight() + 1) {
     isMouseDown = true;
     mouseButton = par3;
     mlx = par1;
     mx = par1;
     mly = par2;
     my = par2;
     PacketSenders.mouseEvent(par1, par2, par3, tile);
   }
 }
コード例 #2
0
ファイル: GuiTablet.java プロジェクト: gamax92/CCLights2
 @Override
 public void drawScreen(int x, int y, float par3) {
   x = applyXOffset(x);
   y = applyYOffset(y);
   if (nbt.getBoolean("canDisplay")) {
     int wheel = Mouse.getDWheel();
     if (wheel != 0) {
       PacketSenders.GPUEvent(x, y, tile, wheel);
     }
     if (isMouseDown) {
       if (x > -1 & y > -1 & x < mon.getWidth() + 1 & y < mon.getHeight() + 1) {
         mx = x;
         my = y;
         if (mlx != mx | mly != my) {
           PacketSenders.mouseEventMove(mx, my, tile);
         }
         mlx = mx;
         mly = my;
       } else {
         mouseMovedOrUp(unapplyXOffset(x) / 2, unapplyYOffset(y) / 2, mouseButton);
       }
     }
   }
   drawWorldBackground(0);
   synchronized (tex) {
     try {
       if (tex.renderLock) {
         tex.wait(1L);
       }
     } catch (InterruptedException e) {
       e.printStackTrace();
     }
   }
   TextureUtil.uploadTexture(
       TabletRenderer.dyntex.getGlTextureId(), tex.rgbCache, 16 * 32, 9 * 32);
   drawTexturedModalRect(unapplyXOffset(0), unapplyYOffset(0), tex.getWidth(), tex.getHeight());
   GL11.glDisable(GL11.GL_TEXTURE_2D);
 }