Exemplo n.º 1
0
 @Override
 public void draw(GOut g) {
   Coord dc = new Coord();
   for (dc.y = 0; dc.y < sz.y; dc.y += texpap.sz().y) {
     for (dc.x = 0; dc.x < sz.x; dc.x += texpap.sz().x) {
       g.image(texpap, dc);
     }
   }
   g.chcolor();
   int y = -cury;
   synchronized (lines) {
     for (Text line : lines) {
       int dy1 = sz.y + y;
       int dy2 = dy1 + line.sz().y;
       if ((dy2 > 0) && (dy1 < sz.y)) {
         g.image(line.tex(), new Coord(margin, dy1));
       }
       y += line.sz().y;
     }
   }
   if (maxy > sz.y) {
     int fx = sz.x - sflarp.sz().x;
     int cx = fx + (sflarp.sz().x / 2) - (schain.sz().x / 2);
     for (y = 0; y < sz.y; y += schain.sz().y - 1) {
       g.image(schain, new Coord(cx, y));
     }
     double a = (double) (cury - sz.y) / (double) (maxy - sz.y);
     int fy = (int) ((sz.y - sflarp.sz().y) * a);
     g.image(sflarp, new Coord(fx, fy));
   }
 }
Exemplo n.º 2
0
 public void draw(GOut g) {
   g.chcolor(0, 0, 0, 160);
   if (ctl == null || csz == null) {
     return;
   }
   g.frect(ctl, csz);
   g.chcolor();
   cdraw(g.reclip(xlate(Coord.z, true), asz));
   if (cap != null) {
     topless.draw(g, new Coord(0, th), sz.sub(0, th));
     g.image(tleft, Coord.z);
     Coord tmul = new Coord(tleft.sz().x, tdh);
     Coord tmbr = new Coord(sz.x - tright.sz().x, th);
     for (int x = tmul.x; x < tmbr.x; x += tmain.sz().x) {
       g.image(tmain, new Coord(x, tdh), tmul, tmbr);
     }
     g.image(tright, new Coord(sz.x - tright.sz().x, tdh));
     g.image(cap.tex(), capc.sub(0, cap.sz().y));
   } else {
     wbox.draw(g, Coord.z, sz);
   }
   /*
   if(cap != null) {
       GOut cg = og.reclip(new Coord(0, -7), sz.add(0, 7));
       int w = cap.tex().sz().x;
       cg.image(cl, new Coord((sz.x / 2) - (w / 2) - cl.sz().x, 0));
       cg.image(cm, new Coord((sz.x / 2) - (w / 2), 0), new Coord(w, cm.sz().y));
       cg.image(cr, new Coord((sz.x / 2) + (w / 2), 0));
       cg.image(cap.tex(), new Coord((sz.x / 2) - (w / 2), 0));
   }
   */
   super.draw(g);
 }
 /*     */ public void draw(GOut g) {
   /*  80 */ g.chcolor(new Color(255, 255, 255, (int) (255.0D * this.a)));
   /*  81 */ g.image(
       FlowerMenu.pbg, new Coord(3, 3), new Coord(3, 3), this.sz.add(new Coord(-6, -6)));
   /*  82 */ FlowerMenu.pbox.draw(g, Coord.z, this.sz);
   /*  83 */ g.image(this.text.tex(), this.sz.div(2).add(this.text.sz().div(2).inv()));
   /*     */ }
Exemplo n.º 4
0
 public void draw(GOut g) {
   Tex at = null;
   if (none) {
   } else if (myown != null) {
     at = myown;
   } else {
     Gob gob = ui.sess.glob.oc.getgob(avagob);
     Avatar ava = null;
     if (gob != null) ava = gob.getattr(Avatar.class);
     if (ava != null) at = ava.rend;
   }
   GOut g2 = g.reclip(Window.wbox.tloff().add(unborder.inv()), asz);
   int yo;
   if (at == null) {
     at = missing;
     yo = 0;
   } else {
     g2.image(Equipory.bg, new Coord(Equipory.bg.sz().x / 2 - asz.x / 2, 20).inv());
     yo = (20 * asz.y) / dasz.y;
   }
   Coord tsz = new Coord((at.sz().x * asz.x) / dasz.x, (at.sz().y * asz.y) / dasz.y);
   g2.image(at, new Coord(tsz.x / 2 - asz.x / 2, yo).inv(), tsz);
   g.chcolor(color);
   Window.wbox.draw(g, Coord.z, asz.add(Window.wbox.bisz()).add(unborder.mul(2).inv()));
 }
Exemplo n.º 5
0
 public void draw(GOut g) {
   try {
     Resource res = item.res.get();
     Tex tex = res.layer(Resource.imgc).tex();
     drawmain(g, tex);
     if (item.num >= 0) {
       g.atext(Integer.toString(item.num), tex.sz(), 1, 1);
     } else if (itemnum.get() != null) {
       g.aimage(itemnum.get(), tex.sz(), 1, 1);
     }
     if (item.meter > 0) {
       double a = ((double) item.meter) / 100.0;
       g.chcolor(255, 255, 255, 64);
       Coord half = Inventory.isqsz.div(2);
       g.prect(half, half.inv(), half, a * Math.PI * 2);
       g.chcolor();
     }
     if (olcol.get() != null) {
       if (cmask != res) {
         mask = null;
         if (tex instanceof TexI) mask = ((TexI) tex).mkmask();
         cmask = res;
       }
       if (mask != null) {
         g.chcolor(olcol.get());
         g.image(mask, Coord.z);
         g.chcolor();
       }
     }
   } catch (Loading e) {
     missing.loadwait();
     g.image(missing.layer(Resource.imgc).tex(), Coord.z, sz);
   }
 }
Exemplo n.º 6
0
 public void draw(GOut g) {
   long now = System.currentTimeMillis();
   for (int y = 0; y < gsz.y; y++) {
     for (int x = 0; x < gsz.x; x++) {
       Coord p = bgsz.mul(new Coord(x, y));
       g.image(bg, p);
       Pagina btn = layout[x][y];
       if (btn != null) {
         Tex btex = btn.img.tex();
         g.image(btex, p.add(1, 1));
         if (btn.meter > 0) {
           double m = btn.meter / 1000.0;
           if (btn.dtime > 0) m += (1 - m) * (double) (now - btn.gettime) / (double) btn.dtime;
           m = Utils.clip(m, 0, 1);
           g.chcolor(255, 255, 255, 128);
           g.fellipse(p.add(bgsz.div(2)), bgsz.div(2), 90, (int) (90 + (360 * m)));
           g.chcolor();
         }
         if (btn.newp != 0) {
           if (btn.fstart == 0) {
             btn.fstart = now;
           } else {
             double ph = ((now - btn.fstart) / 1000.0) - (((x + (y * gsz.x)) * 0.15) % 1.0);
             if (ph < 1.25) {
               g.chcolor(255, 255, 255, (int) (255 * ((Math.cos(ph * Math.PI * 2) * -0.5) + 0.5)));
               g.image(glowmask(btn), p.sub(4, 4));
               g.chcolor();
             } else {
               g.chcolor(255, 255, 255, 128);
               g.image(glowmask(btn), p.sub(4, 4));
               g.chcolor();
             }
           }
         }
         if (btn == pressed) {
           g.chcolor(new Color(0, 0, 0, 128));
           g.frect(p.add(1, 1), btex.sz());
           g.chcolor();
         }
       }
     }
   }
   super.draw(g);
   if (dragging != null) {
     final Tex dt = dragging.img.tex();
     ui.drawafter(
         new UI.AfterDraw() {
           public void draw(GOut g) {
             g.image(dt, ui.mc.add(dt.sz().div(2).inv()));
           }
         });
   }
 }
Exemplo n.º 7
0
 public void drawmain(GOut g, Tex tex) {
   g.image(tex, Coord.z);
   if (tex != ltex) {
     resize(upsize(tex.sz()));
     ltex = tex;
   }
 }
Exemplo n.º 8
0
 public void atext(String text, Coord c, double ax, double ay) {
   Text t = Text.render(text);
   Tex T = t.tex();
   Coord sz = t.sz();
   image(T, c.add((int) ((double) sz.x * -ax), (int) ((double) sz.y * -ay)));
   T.dispose();
   checkerr();
 }
Exemplo n.º 9
0
 public void draw(GOut g) {
   int tn = 0;
   int y = 0;
   int h = Inventory.sqsz.y;
   boolean[] hl = new boolean[mods.size()];
   if (lfood != null) {
     for (int t : lfood.types) hl[t] = true;
   }
   g.aimage(levels, new Coord(sz.x / 2, y), 0.5, 0);
   y += levels.sz().y + 20;
   for (TypeMod m : mods) {
     if (m.rn != null) g.image(hl[tn] ? m.rh : m.rn, new Coord(0, y));
     if (m.ra != null) g.image(m.ra, new Coord(nw + 20, y + ((h - m.ra.sz().y) / 2)));
     tn++;
     y += h + 5;
   }
 }
Exemplo n.º 10
0
  public void draw(GOut g) {
    updatepos();
    double now = System.currentTimeMillis() / 1000.0;

    for (Buff buff : fv.buffs.children(Buff.class))
      buff.draw(
          g.reclip(
              pcc.add(-buff.c.x - Buff.cframe.sz().x - 20, buff.c.y + pho - Buff.cframe.sz().y),
              buff.sz));
    if (fv.current != null) {
      for (Buff buff : fv.current.buffs.children(Buff.class))
        buff.draw(g.reclip(pcc.add(buff.c.x + 20, buff.c.y + pho - Buff.cframe.sz().y), buff.sz));

      g.aimage(ip.get().tex(), pcc.add(-75, 0), 1, 0.5);
      g.aimage(oip.get().tex(), pcc.add(75, 0), 0, 0.5);
    }

    if (now < fv.atkct) {
      int w = (int) ((fv.atkct - now) * 20);
      g.chcolor(255, 0, 128, 255);
      g.frect(pcc.add(-w, 20), new Coord(w * 2, 15));
      g.chcolor();
    }
    Coord ca = pcc.add(-(actions.length * actpitch) / 2, 45);
    for (int i = 0; i < actions.length; i++) {
      Indir<Resource> act = actions[i];
      try {
        if (act != null) {
          Tex img = act.get().layer(Resource.imgc).tex();
          g.image(img, ca);
          g.image(dyn[i] ? lframe : Buff.frame, ca.sub(Buff.imgoff));
          if (i == use) {
            g.chcolor(255, 0, 128, 255);
            Coord cc = ca.add(img.sz().x / 2, img.sz().y + 5);
            g.frect(cc.sub(2, 2), new Coord(5, 5));
            g.chcolor();
          }
        }
      } catch (Loading l) {
      }
      ca.x += actpitch;
    }
  }
Exemplo n.º 11
0
 @Override
 public void draw(GOut g) {
   Equipory e = ui.gui.getEquipory();
   if (e != null) {
     g.rimage(Window.bg, Coord.z, sz);
     g.image(sq, Coord.z);
     WItem w = e.slots[index];
     if (w != null) {
       w.draw(g.reclipl(sq.sz().sub(w.sz).div(2), g.sz));
     }
   }
 }
Exemplo n.º 12
0
 public void draw(GOut g) {
   super.draw(g);
   if (lvlmask != null) {
     long now = System.currentTimeMillis();
     if (now - lvltime > 1000) {
       lvlmask.dispose();
       lvlmask = null;
     } else {
       g.chcolor(255, 255, 255, 255 - (int) ((255 * (now - lvltime)) / 1000));
       g.image(lvlmask, Coord.z);
     }
   }
 }
Exemplo n.º 13
0
  public void draw(GOut g) {
    Coord c = new Coord(xoff, 0);
    for (Spec s : inputs) {
      GOut sg = g.reclip(c, Inventory.invsq.sz());
      sg.image(Inventory.invsq, Coord.z);
      s.draw(sg);
      c = c.add(Inventory.sqsz.x, 0);
    }
    if (qmod != null) {
      g.image(qmodl.tex(), new Coord(0, qmy + 4));
      c = new Coord(xoff, qmy);
      int mx = -1;
      int pw = 0;
      int vl = 1;
      for (Indir<Resource> qm : qmod) {
        try {
          Tex t = qm.get().layer(Resource.imgc).tex();
          g.image(t, c);
          c = c.add(t.sz().x + 1, 0);
          if (c.x > mx) mx = c.x;

          try {
            Glob.CAttr attr = ui.gui.chrwdg.findattr(qm.get().basename());
            if (attr != null) {
              pw++;
              vl *= attr.comp;
              Tex txt = attr.comptex();
              g.image(txt, c);
              c = c.add(txt.sz().x + 8, 0);
            }
          } catch (Exception ignored) {
          }

        } catch (Loading l) {
        }
      }
      if (pw > 0) {
        g.image(
            Text.renderstroked(
                    String.format("Cap: %.0f", Math.floor(Math.pow(vl, 1.0f / pw))),
                    Color.WHITE,
                    Color.BLACK,
                    new Text.Foundry(Text.fraktur, 14).aa(true))
                .tex(),
            new Coord(mx + 30, qmy));
      }
    }
    c = new Coord(xoff, outy);
    for (Spec s : outputs) {
      GOut sg = g.reclip(c, Inventory.invsq.sz());
      sg.image(Inventory.invsq, Coord.z);
      s.draw(sg);
      c = c.add(Inventory.sqsz.x, 0);
    }
    super.draw(g);
  }
Exemplo n.º 14
0
  public void drawsmall(GOut g, Coord br, int h) {
    Coord c;
    if (qline != null) {
      if ((rqline == null) || !rqline.text.equals(qline.line)) {
        String pre = String.format("%s> ", qline.chan.name());
        rqline = qfnd.render(pre + qline.line);
        rqpre = pre.length();
      }
      c = br.sub(0, 20);
      g.chcolor(24, 24, 16, 200);
      g.frect(c, rqline.tex().sz());
      g.chcolor();
      g.image(rqline.tex(), c);
      int lx = rqline.advance(qline.point + rqpre);
      g.line(new Coord(br.x + lx + 1, br.y - 18), new Coord(br.x + lx + 1, br.y - 6), 1);
    } else {
      c = br.sub(0, 5);
    }
    long now = System.currentTimeMillis();
    synchronized (notifs) {
      for (Iterator<Notification> i = notifs.iterator(); i.hasNext(); ) {
        Notification n = i.next();
        if (now - n.time > 5000) {
          i.remove();
          continue;
        }
        if ((c.y -= n.msg.sz().y) < br.y - h) break;

        g.chcolor(24, 24, 16, 200);
        g.frect(c, n.chnm.tex().sz().add(n.msg.tex().sz().x + selw, 0));
        g.chcolor();
        g.image(n.chnm.tex(), c, br.sub(0, h), br.add(selw - 10, 0));
        g.image(n.msg.tex(), c.add(selw, 0));
      }
    }
  }
Exemplo n.º 15
0
 public void drawicons(GOut g) {
   OCache oc = ui.sess.glob.oc;
   synchronized (oc) {
     for (Gob gob : oc) {
       try {
         GobIcon icon = gob.getattr(GobIcon.class);
         if (icon != null) {
           Coord gc = p2c(gob.rc);
           Tex tex = icon.tex();
           g.image(tex, gc.sub(tex.sz().div(2)));
         }
       } catch (Loading l) {
       }
     }
   }
 }
Exemplo n.º 16
0
 public void draw(GOut g) {
   long now = System.currentTimeMillis();
   int t = (int) (now % 1000);
   int b = (int) (255 * ((t < 500) ? (t) : (1000 - t)) / 500.0f);
   Inventory.invsq(g, Coord.z, gsz);
   for (int y = 0; y < gsz.y; y++) {
     for (int x = 0; x < gsz.x; x++) {
       Coord p = Inventory.sqoff(new Coord(x, y));
       Pagina btn = layout[x][y];
       if (btn != null) {
         Tex btex = btn.img.tex();
         if (btn.newp) {
           g.chcolor(b, 255, b, 255);
         }
         g.image(btex, p);
         g.chcolor();
         if (btn.meter > 0) {
           double m = btn.meter / 1000.0;
           if (btn.dtime > 0) m += (1 - m) * (double) (now - btn.gettime) / (double) btn.dtime;
           m = Utils.clip(m, 0, 1);
           g.chcolor(255, 255, 255, 128);
           g.fellipse(
               p.add(Inventory.isqsz.div(2)), Inventory.isqsz.div(2), 90, (int) (90 + (360 * m)));
           g.chcolor();
         }
         if (btn == pressed) {
           g.chcolor(new Color(0, 0, 0, 128));
           g.frect(p, btex.sz());
           g.chcolor();
         }
       }
     }
   }
   super.draw(g);
   if (dragging != null) {
     final Tex dt = dragging.img.tex();
     ui.drawafter(
         new UI.AfterDraw() {
           public void draw(GOut g) {
             g.image(dt, ui.mc.add(dt.sz().div(2).inv()));
           }
         });
   }
 }
Exemplo n.º 17
0
 @Override
 public void draw(GOut g) {
   Equipory e = ui.gui.getEquipory();
   if (e != null) {
     g.rimage(Window.bg, Coord.z, sz);
     g.image(sq, Coord.z);
     if (ui.gui.handSave.size() > 0) {
       for (GameUI.DraggedItem di : ui.gui.handSave) {
         GSprite spr = di.item.spr();
         if (spr != null) {
           int w = Math.min(spr.sz().x, sq.sz().x - 5);
           int h = Math.min(spr.sz().y, sq.sz().y - 5);
           spr.draw(g.reclipl(sq.sz().sub(w, h).div(2), g.sz.sub(5, 5)));
         }
         break;
       }
     }
   }
 }
Exemplo n.º 18
0
 public void draw(GOut g) {
   g.chcolor(24, 24, 16, 200);
   g.frect(Coord.z, sz);
   g.chcolor();
   int y = 0;
   boolean sel = false;
   synchronized (msgs) {
     for (Message msg : msgs) {
       if ((selstart != null) && (msg == selstart.msg)) sel = true;
       int y1 = y - sb.val;
       int y2 = y1 + msg.sz().y;
       if ((y2 > 0) && (y1 < ih())) {
         if (sel) drawsel(g, msg, y1);
         g.image(msg.tex(), new Coord(0, y1));
       }
       if ((selend != null) && (msg == selend.msg)) sel = false;
       y += msg.sz().y;
     }
   }
   sb.max = y - ih();
   super.draw(g);
 }
Exemplo n.º 19
0
 public void aimage(Tex tex, Coord c, double ax, double ay) {
   Coord sz = tex.sz();
   image(tex, c.add((int) ((double) sz.x * -ax), (int) ((double) sz.y * -ay)));
 }
Exemplo n.º 20
0
 public void image(Resource.Image img, Coord c) {
   if (img == null) return;
   image(img.tex(), c.add(img.o));
 }
Exemplo n.º 21
0
 @Override
 protected void drawitem(GOut g, QualityList.SingleType item, int i) {
   g.image(item.tex(), Q_TYPE_PADDING);
 }
Exemplo n.º 22
0
  void rootdraw(GLState.Applier state, UI ui, BGL gl) {
    GLState.Buffer ibuf = new GLState.Buffer(state.cfg);
    gstate.prep(ibuf);
    ostate.prep(ibuf);
    GOut g = new GOut(gl, state.cgl, state.cfg, state, ibuf, new Coord(w, h));
    state.set(ibuf);

    g.state(ostate);
    g.apply();
    gl.glClearColor(0, 0, 0, 1);
    gl.glClear(GL.GL_COLOR_BUFFER_BIT);
    synchronized (ui) {
      ui.draw(g);
    }

    if (Config.dbtext) {
      int y = h - 150;
      FastText.aprintf(
          g,
          new Coord(10, y -= 15),
          0,
          1,
          "FPS: %d (%d%%, %d%% idle)",
          fps,
          (int) (uidle * 100.0),
          (int) (ridle * 100.0));
      Runtime rt = Runtime.getRuntime();
      long free = rt.freeMemory(), total = rt.totalMemory();
      FastText.aprintf(
          g,
          new Coord(10, y -= 15),
          0,
          1,
          "Mem: %,011d/%,011d/%,011d/%,011d",
          free,
          total - free,
          total,
          rt.maxMemory());
      FastText.aprintf(g, new Coord(10, y -= 15), 0, 1, "Tex-current: %d", TexGL.num());
      FastText.aprintf(g, new Coord(10, y -= 15), 0, 1, "GL progs: %d", g.st.numprogs());
      GameUI gi = ui.root.findchild(GameUI.class);
      if ((gi != null) && (gi.map != null)) {
        try {
          FastText.aprintf(
              g, new Coord(10, y -= 15), 0, 1, "MV pos: %s (%s)", gi.map.getcc(), gi.map.camera);
        } catch (Loading e) {
        }
        if (gi.map.rls != null)
          FastText.aprintf(
              g,
              new Coord(10, y -= 15),
              0,
              1,
              "Rendered: %,d+%,d(%,d)",
              gi.map.rls.drawn,
              gi.map.rls.instanced,
              gi.map.rls.instancified);
      }
      if (Resource.remote().qdepth() > 0)
        FastText.aprintf(
            g,
            new Coord(10, y -= 15),
            0,
            1,
            "RQ depth: %d (%d)",
            Resource.remote().qdepth(),
            Resource.remote().numloaded());
    }
    Object tooltip;
    try {
      synchronized (ui) {
        tooltip = ui.root.tooltip(mousepos, ui.root);
      }
    } catch (Loading e) {
      tooltip = "...";
    }
    Tex tt = null;
    if (tooltip != null) {
      if (tooltip instanceof Text) {
        tt = ((Text) tooltip).tex();
      } else if (tooltip instanceof Tex) {
        tt = (Tex) tooltip;
      } else if (tooltip instanceof Indir<?>) {
        Indir<?> t = (Indir<?>) tooltip;
        Object o = t.get();
        if (o instanceof Tex) tt = (Tex) o;
      } else if (tooltip instanceof String) {
        if (((String) tooltip).length() > 0) tt = (Text.render((String) tooltip)).tex();
      }
    }
    if (tt != null) {
      Coord sz = tt.sz();
      Coord pos = mousepos.add(sz.inv());
      if (pos.x < 0) pos.x = 0;
      if (pos.y < 0) pos.y = 0;
      g.chcolor(244, 247, 21, 192);
      g.rect(pos.add(-3, -3), sz.add(6, 6));
      g.chcolor(35, 35, 35, 192);
      g.frect(pos.add(-2, -2), sz.add(4, 4));
      g.chcolor();
      g.image(tt, pos);
    }
    ui.lasttip = tooltip;
    Resource curs = ui.root.getcurs(mousepos);
    if (curs != null) {
      if (cursmode == "awt") {
        if (curs != lastcursor) {
          try {
            setCursor(makeawtcurs(curs.layer(Resource.imgc).img, curs.layer(Resource.negc).cc));
            lastcursor = curs;
          } catch (Exception e) {
            cursmode = "tex";
          }
        }
      } else if (cursmode == "tex") {
        Coord dc = mousepos.add(curs.layer(Resource.negc).cc.inv());
        g.image(curs.layer(Resource.imgc), dc);
      }
    }
    state.clean();
    GLObject.disposeall(state.cgl, gl);
  }
Exemplo n.º 23
0
 public void rimageh(Tex tex, Coord c, int w) {
   Coord cc = new Coord(c);
   Coord sz = new Coord(w, tex.sz().y);
   for (; cc.x < c.x + w; cc.x += tex.sz().x) image(tex, cc, c, sz);
 }
Exemplo n.º 24
0
 public void rimage(Tex tex, Coord c, Coord sz) {
   Coord cc = new Coord();
   for (cc.y = c.y; cc.y < c.y + sz.y; cc.y += tex.sz().y) {
     for (cc.x = c.x; cc.x < c.x + sz.x; cc.x += tex.sz().x) image(tex, cc, c, sz);
   }
 }
Exemplo n.º 25
0
 public void draw(GOut g) {
   super.draw(g);
   btncave.visible = !folded && mm.isCave();
   if (!folded) g.image(grip, sz.sub(gzsz));
 }
Exemplo n.º 26
0
 public void rimagev(Tex tex, Coord c, int h) {
   Coord cc = new Coord(c);
   Coord sz = new Coord(tex.sz().x, h);
   for (; cc.y < c.y + h; cc.y += tex.sz().y) image(tex, cc, c, sz);
 }
Exemplo n.º 27
0
 public void draw(GOut g) {
   if (cc == null) return;
   map:
   {
     final Grid plg;
     try {
       plg = ui.sess.glob.map.getgrid(cc.div(cmaps));
     } catch (Loading l) {
       break map;
     }
     final int seq = plg.seq;
     if ((cur == null) || (plg != cur.grid) || (seq != cur.seq)) {
       Defer.Future<MapTile> f;
       synchronized (cache) {
         f = cache.get(new Pair<Grid, Integer>(plg, seq));
         if (f == null) {
           f =
               Defer.later(
                   new Defer.Callable<MapTile>() {
                     public MapTile call() {
                       Coord ul = plg.ul.sub(cmaps).add(1, 1);
                       return (new MapTile(
                           new TexI(drawmap(ul, cmaps.mul(3).sub(2, 2))), ul, plg, seq));
                     }
                   });
           cache.put(new Pair<Grid, Integer>(plg, seq), f);
         }
       }
       if (f.done()) {
         cur = f.get();
         if (save != null) save.update(ui.sess.glob.map, cur.grid.gc);
       }
     }
   }
   if (cur != null) {
     g.image(MiniMap.bg, Coord.z);
     g.image(cur.img, cur.ul.sub(cc).add(sz.div(2)));
     try {
       synchronized (ui.sess.glob.party.memb) {
         for (Party.Member m : ui.sess.glob.party.memb.values()) {
           Coord ptc;
           try {
             ptc = m.getc();
           } catch (MCache.LoadingMap e) {
             ptc = null;
           }
           if (ptc == null) continue;
           ptc = p2c(ptc);
           g.chcolor(m.col.getRed(), m.col.getGreen(), m.col.getBlue(), 128);
           g.image(
               MiniMap.plx.layer(Resource.imgc).tex(),
               ptc.add(MiniMap.plx.layer(Resource.negc).cc.inv()));
           g.chcolor();
         }
       }
     } catch (Loading l) {
     }
   } else {
     g.image(MiniMap.nomap, Coord.z);
   }
   drawicons(g);
 }
Exemplo n.º 28
0
 public void draw(GOut g) {
   g.chcolor(new Color(255, 255, 255, (int) (255 * a)));
   g.image(pbg, new Coord(3, 3), new Coord(3, 3), sz.add(new Coord(-6, -6)));
   pbox.draw(g, Coord.z, sz);
   g.image(text.tex(), sz.div(2).sub(text.sz().div(2)));
 }
Exemplo n.º 29
0
 public void image(BufferedImage img, Coord c) {
   if (img == null) return;
   Tex tex = new TexI(img);
   image(tex, c);
   tex.dispose();
 }
Exemplo n.º 30
0
 public void image(Indir<Tex> tex, Coord c) {
   image(tex.get(), c);
 }