예제 #1
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;
    }
  }
예제 #2
0
 public Object tooltip(Coord c, Widget prev) {
   for (Buff buff : fv.buffs.children(Buff.class)) {
     Coord dc = pcc.add(-buff.c.x - Buff.cframe.sz().x - 20, buff.c.y + pho - Buff.cframe.sz().y);
     if (c.isect(dc, buff.sz)) {
       Object ret = buff.tooltip(c.sub(dc), prevtt);
       if (ret != null) {
         prevtt = buff;
         return (ret);
       }
     }
   }
   if (fv.current != null) {
     for (Buff buff : fv.current.buffs.children(Buff.class)) {
       Coord dc = pcc.add(buff.c.x + 20, buff.c.y + pho - Buff.cframe.sz().y);
       if (c.isect(dc, buff.sz)) {
         Object ret = buff.tooltip(c.sub(dc), prevtt);
         if (ret != null) {
           prevtt = buff;
           return (ret);
         }
       }
     }
   }
   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();
         if (c.isect(ca, img.sz())) {
           if (dyn[i]) return ("Combat discovery");
           return (act.get().layer(Resource.tooltip).t);
         }
       }
     } catch (Loading l) {
     }
     ca.x += actpitch;
   }
   return (null);
 }