Beispiel #1
0
 public Channel(Coord c, Coord sz, Widget parent) {
   super(c, sz, parent);
   sb = new Scrollbar(new Coord(sz.x, 0), ih(), this, 0, -ih());
   cbtn = new IButton(Coord.z, this, cbtni[0], cbtni[1], cbtni[2]);
   cbtn.recthit = true;
   cbtn.c = new Coord(sz.x - cbtn.sz.x - sb.sz.x - 3, 0);
 }
Beispiel #2
0
 public void resize(Coord sz) {
   super.resize(sz);
   if (sb != null) {
     sb.resize(ih());
     sb.move(new Coord(sz.x, 0));
     int y = 0;
     for (Message m : msgs) y += m.sz().y;
     boolean b = sb.val >= sb.max;
     sb.max = y - ih();
     if (b) sb.val = sb.max;
   }
   if (cbtn != null) cbtn.c = new Coord(sz.x - cbtn.sz.x - sb.sz.x - 3, 0);
 }
Beispiel #3
0
 public Window(Coord c, Coord sz, Widget parent, String cap) {
   super(c, new Coord(0, 0), parent);
   if (cap != null) {
     this.cap = cf.render(cap);
     name = cap;
   } else {
     this.cap = null;
     name = null;
   }
   resize(sz);
   setfocustab(true);
   parent.setfocus(this);
   cbtn = new IButton(Coord.z, this, cbtni[0], cbtni[1], cbtni[2]);
   cbtn.recthit = true;
   addtwdg(cbtn);
   loadOpts();
 }
Beispiel #4
0
  public MinimapPanel(Coord c, Coord sz, Widget parent) {
    super(c, sz, parent, "Minimap");
    mrgn = Coord.z;
    fbtn.visible = true;
    cbtn.visible = false;
    {
      vcl =
          new IButton(
              new Coord(0, -2),
              this,
              Resource.loadimg("gfx/hud/slen/dispauth"),
              Resource.loadimg("gfx/hud/slen/dispauthd")) {
            private boolean v = false;

            public void click() {
              MapView mv = ui.mapview;
              BufferedImage tmp = down;
              down = up;
              up = tmp;
              hover = tmp;
              if (v) {
                mv.disol(2, 3);
                v = false;
              } else {
                mv.enol(2, 3);
                v = true;
              }
            }
          };
      vcl.tooltip = "Show village authority";
    }
    {
      pcl =
          new IButton(
              new Coord(0, 4),
              this,
              Resource.loadimg("gfx/hud/slen/dispclaim"),
              Resource.loadimg("gfx/hud/slen/dispclaimd")) {
            private boolean v = false;

            public void click() {
              MapView mv = ui.mapview;
              BufferedImage tmp = down;
              down = up;
              up = tmp;
              hover = tmp;
              if (v) {
                mv.disol(0, 1);
                v = false;
              } else {
                mv.enol(0, 1);
                v = true;
              }
            }
          };
      pcl.tooltip = "Show claims";
    }

    ui.minimappanel = this;
    mm = new MiniMap(new Coord(0, 32), minsz, this, ui.mapview);

    /*(new CheckBox(new Coord(110, 15), this, "Use simple map") {
          public void changed(boolean val) {
        Config.useSimpleMap = val;
        this.setfocus(this);
        Config.saveOptions();
    }
       }).a = Config.useSimpleMap;*/

    new IButton(
            new Coord(45, 8),
            this,
            Resource.loadimg("gfx/hud/buttons/gridu"),
            Resource.loadimg("gfx/hud/buttons/gridd")) {
          public void click() {
            BufferedImage tmp = down;
            down = up;
            up = tmp;
            hover = tmp;
            mm.grid = !mm.grid;
          }
        }.tooltip =
        "Show minimap grid";

    new IButton(
            new Coord(65, 8),
            this,
            Resource.loadimg("gfx/hud/buttons/centeru"),
            Resource.loadimg("gfx/hud/buttons/centerd")) {
          public void click() {
            mm.off = new Coord();
            UI.instance.mapview.resetcam(); // Kerrigan
          }
        }.tooltip =
        "Focus minimap and character";

    new IButton(
        new Coord(88, 12),
        this,
        Resource.loadimg("gfx/hud/charsh/plusup"),
        Resource.loadimg("gfx/hud/charsh/plusdown")) {
      public void click() {
        mm.setScale(mm.scale + 1);
      }
    };

    new IButton(
        new Coord(103, 12),
        this,
        Resource.loadimg("gfx/hud/charsh/minusup"),
        Resource.loadimg("gfx/hud/charsh/minusdown")) {
      public void click() {
        mm.setScale(mm.scale - 1);
      }
    };

    btncave =
        new IButton(
            new Coord(121, 8),
            this,
            Resource.loadimg("gfx/hud/buttons/saveu"),
            Resource.loadimg("gfx/hud/buttons/saved")) {
          public void click() {
            mm.saveCaveMaps();
          }
        };

    btncave.tooltip = "Save cave minimaps";

    KerriUtils.makeButtonSC();
    KerriUtils.makeButtonOP();
    KerriUtils.makeButtonVR();
    KerriUtils.makeButtonOH();

    pack();
    this.c = new Coord(MainFrame.getInnerSize().x - this.sz.x, 7);
    loadpos();
  }
Beispiel #5
0
 public void draw(GOut g) {
   super.draw(g);
   btncave.visible = !folded && mm.isCave();
   if (!folded) g.image(grip, sz.sub(gzsz));
 }