Skip to content

Commit

Permalink
Start putting charwnd contents into tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dolda2000 committed Jan 28, 2015
1 parent f844957 commit 0dde7db
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions src/haven/CharWnd.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ public class Attr extends Widget {
private Text ct;
private int cv;

private Attr(String attr, String rnm, Coord c, Color bg) {
super(c, new Coord(attrw, attrf.height() + 2), CharWnd.this);
private Attr(String attr, String rnm, Coord c, Widget parent, Color bg) {
super(c, new Coord(attrw, attrf.height() + 2), parent);
this.nm = attr;
this.img = Resource.load("gfx/hud/chr/" + attr).loadwait().layer(Resource.imgc).tex();
this.rnm = attrf.render(rnm);
Expand Down Expand Up @@ -343,27 +343,33 @@ public Widget create(Coord c, Widget parent, Object[] args) {
public CharWnd(Coord pc, Widget parent) {
super(pc, new Coord(300, 290), parent, "Character Sheet");

int x = 15, y = 10;
new Img(new Coord(x - 5, y), catf.render("Base Attributes").tex(), this); y += 35;
base = new ArrayList<Attr>();
Attr aw;
base.add(aw = new Attr("str", "Strength", wbox.btloff().add(x, y), every)); y += aw.sz.y;
base.add(aw = new Attr("agi", "Agility", wbox.btloff().add(x, y), other)); y += aw.sz.y;
base.add(aw = new Attr("int", "Intelligence", wbox.btloff().add(x, y), every)); y += aw.sz.y;
base.add(aw = new Attr("con", "Constitution", wbox.btloff().add(x, y), other)); y += aw.sz.y;
base.add(aw = new Attr("prc", "Perception", wbox.btloff().add(x, y), every)); y += aw.sz.y;
base.add(aw = new Attr("csm", "Charisma", wbox.btloff().add(x, y), other)); y += aw.sz.y;
base.add(aw = new Attr("dex", "Dexterity", wbox.btloff().add(x, y), every)); y += aw.sz.y;
base.add(aw = new Attr("psy", "Psyche", wbox.btloff().add(x, y), other)); y += aw.sz.y;
Frame.around(this, base);
y += 20;
new Img(new Coord(x - 5, y), catf.render("Food Event Points").tex(), this); y += 35;
feps = new FoodMeter(new Coord(x, y), this);

x = 275; y = 10;
new Img(new Coord(x - 5, y), catf.render("Food Satiations").tex(), this); y += 35;
cons = new Constipations(wbox.btloff().add(x, y), this, attrw, base.size());
Frame.around(this, Collections.singletonList(cons));
final Tabs tabs = new Tabs(new Coord(15, 10), Coord.z, this);
Tabs.Tab battr;
{
int x = 5, y = 0;

battr = tabs.new Tab();
new Img(new Coord(x - 5, y), catf.render("Base Attributes").tex(), battr); y += 35;
base = new ArrayList<Attr>();
Attr aw;
base.add(aw = new Attr("str", "Strength", wbox.btloff().add(x, y), battr, every)); y += aw.sz.y;
base.add(aw = new Attr("agi", "Agility", wbox.btloff().add(x, y), battr, other)); y += aw.sz.y;
base.add(aw = new Attr("int", "Intelligence", wbox.btloff().add(x, y), battr, every)); y += aw.sz.y;
base.add(aw = new Attr("con", "Constitution", wbox.btloff().add(x, y), battr, other)); y += aw.sz.y;
base.add(aw = new Attr("prc", "Perception", wbox.btloff().add(x, y), battr, every)); y += aw.sz.y;
base.add(aw = new Attr("csm", "Charisma", wbox.btloff().add(x, y), battr, other)); y += aw.sz.y;
base.add(aw = new Attr("dex", "Dexterity", wbox.btloff().add(x, y), battr, every)); y += aw.sz.y;
base.add(aw = new Attr("psy", "Psyche", wbox.btloff().add(x, y), battr, other)); y += aw.sz.y;
Frame.around(battr, base);
y += 20;
new Img(new Coord(x - 5, y), catf.render("Food Event Points").tex(), battr); y += 35;
feps = new FoodMeter(new Coord(x, y), battr);

x = 260; y = 0;
new Img(new Coord(x - 5, y), catf.render("Food Satiations").tex(), battr); y += 35;
cons = new Constipations(wbox.btloff().add(x, y), battr, attrw, base.size());
Frame.around(battr, Collections.singletonList(cons));
}

resize(contentsz().add(15, 10));
}
Expand Down

0 comments on commit 0dde7db

Please sign in to comment.