Skip to content

Commit

Permalink
Added more fields to the stats tab of CRE resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Oct 7, 2014
1 parent 3dd0f23 commit f4339ec
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/infinity/resource/cre/Viewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@ private static JPanel makeMiscPanel(CreResource cre)
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = new JPanel(gbl);

gbc.insets = new Insets(2, 3, 3, 0);
gbc.insets = new Insets(2, 6, 3, 0);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Allegiance"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Alignment"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("General"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Race"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Class"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Gender"), gbl, gbc, true);
if (ResourceFactory.getInstance().resourceExists("KIT.IDS"))
if (ResourceFactory.getInstance().resourceExists("KIT.IDS")) {
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Kit"), gbl, gbc, true);
else
} else {
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Mage type"), gbl, gbc, true);
}
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Racial enemy"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Animation"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Morale"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Morale break"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Morale recovery"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Save vs. death"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Save vs. wand"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Save vs. polymorph"), gbl, gbc, true);
Expand All @@ -73,7 +80,7 @@ private static JPanel makeMiscPanelIWD2(CreResource cre)
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = new JPanel(gbl);

gbc.insets = new Insets(2, 3, 3, 0);
gbc.insets = new Insets(2, 6, 3, 0);

// 22
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Allegiance"), gbl, gbc, true);
Expand Down Expand Up @@ -127,7 +134,7 @@ private JPanel makeFeatsPanel(CreResource cre)
p.add(ViewerUtil.makeCheckPanel((Flag)cre.getAttribute("Feats (3/3)"), 1), BorderLayout.NORTH);
p.add(makeSkillPanelIWD2(cre), BorderLayout.CENTER);

JPanel panel = new JPanel(new GridLayout(1, 3, 6, 0));
JPanel panel = new JPanel(new GridLayout(1, 6, 6, 0));
panel.add(ViewerUtil.makeCheckPanel((Flag)cre.getAttribute("Feats (1/3)"), 1));
panel.add(ViewerUtil.makeCheckPanel((Flag)cre.getAttribute("Feats (2/3)"), 1));
panel.add(p);
Expand Down Expand Up @@ -213,7 +220,8 @@ private JPanel makeSkillPanelIWD2(CreResource cre)
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = new JPanel(gbl);

gbc.insets = new Insets(1, 3, 2, 0);
gbc.insets = new Insets(1, 6, 2, 0);
gbc.anchor = GridBagConstraints.FIRST_LINE_START;
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Alchemy"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Animal empathy"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Bluff"), gbl, gbc, true);
Expand All @@ -240,7 +248,7 @@ private JPanel makeStatsPanel(CreResource cre)
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = new JPanel(gbl);

gbc.insets = new Insets(2, 3, 3, 0);
gbc.insets = new Insets(2, 6, 3, 0);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Name"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP value"), gbl, gbc, true);
Expand Down Expand Up @@ -304,14 +312,14 @@ private JPanel makeStatsPanel(CreResource cre)
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Charisma"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("THAC0"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("# attacks"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Hide in shadows"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Detect illusions"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Set traps"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Lore"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Open locks"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Move silently"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Find/disarm traps"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Pickpockets"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Hide in shadows"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Detect illusions"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Set traps"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Lore"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Open locks"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Move silently"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Find/disarm traps"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Pickpockets"), gbl, gbc, true);
// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Tracking"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Script name"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Override script"), gbl, gbc, true);
Expand All @@ -330,7 +338,7 @@ private JPanel makeStatsPanelIWD2(CreResource cre)
GridBagConstraints gbc = new GridBagConstraints();
JPanel panel = new JPanel(gbl);

gbc.insets = new Insets(2, 3, 3, 0);
gbc.insets = new Insets(2, 6, 3, 0);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Name"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP"), gbl, gbc, true);
ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP value"), gbl, gbc, true);
Expand Down

0 comments on commit f4339ec

Please sign in to comment.