Exemple #1
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);
   }
 }
 public void draw(GOut g) {
   try {
     if (spr == null) spr = GSprite.create(this, res.get(), sdt.clone());
     spr.draw(g);
   } catch (Loading e) {
   }
   if (num != null) g.aimage(num, Inventory.sqsz, 1.0, 1.0);
 }
Exemple #3
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;
   }
 }
Exemple #4
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;
    }
  }
Exemple #5
0
 public void draw(GOut g) {
   g.chcolor(64, 64, 64, 192);
   g.frect(Coord.z, sz);
   int i = s;
   int y = 0;
   synchronized (chls) {
     while (i < chls.size()) {
       DarkChannel ch = chls.get(i);
       if (ch.chan == sel) {
         g.chcolor(128, 128, 192, 255);
         g.frect(new Coord(0, y), new Coord(sz.x, 19));
       }
       g.chcolor(255, 255, 255, 255);
       if ((ch.rname == null) || !ch.rname.text.equals(ch.chan.name()))
         ch.rname = nf.render(ch.chan.name());
       g.aimage(ch.rname.tex(), new Coord(sz.x / 2, y + 10), 0.5, 0.5);
       g.line(new Coord(5, y + 19), new Coord(sz.x - 5, y + 19), 1);
       y += 20;
       if (y >= sz.y) break;
       i++;
     }
   }
   g.chcolor();
 }