示例#1
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);
 }