Exemplo n.º 1
0
 public boolean mousedown(Coord c, int btn) {
   if (btn == 1) {
     if (ui.modshift) item.wdgmsg("transfer", c);
     else if (ui.modctrl) item.wdgmsg("drop", c);
     else item.wdgmsg("take", c);
     return (true);
   } else if (btn == 3) {
     item.wdgmsg("iact", c);
     return (true);
   }
   return (false);
 }
Exemplo n.º 2
0
 public Object tooltip(Coord c, Widget prev) {
   long now = System.currentTimeMillis();
   if (prev == this) {
   } else if (prev instanceof WItem) {
     long ps = ((WItem) prev).hoverstart;
     if (now - ps < 1000) hoverstart = now;
     else hoverstart = ps;
   } else {
     hoverstart = now;
   }
   try {
     List<ItemInfo> info = item.info();
     if (info.size() < 1) return (null);
     if (info != ttinfo) {
       shorttip = longtip = null;
       ttinfo = info;
     }
     if (now - hoverstart < 1000) {
       if (shorttip == null) shorttip = new ShortTip(info);
       return (shorttip);
     } else {
       if (longtip == null) longtip = new LongTip(info);
       return (longtip);
     }
   } catch (Loading e) {
     return ("...");
   }
 }
Exemplo n.º 3
0
 public boolean iteminteract(Coord cc, Coord ul) {
   item.wdgmsg("itemact", ui.modflags());
   return (true);
 }