Skip to content

Commit

Permalink
Removed top/bottom quick panel rows
Browse files Browse the repository at this point in the history
Removed top/bottom quick panel rows
Added default skills
  • Loading branch information
collinsmith committed Apr 18, 2019
1 parent 2fdfd87 commit eca930a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
14 changes: 14 additions & 0 deletions core/src/com/riiablo/CharData.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ public class CharData {
private final IntIntMap skills = new IntIntMap();
private final Attributes stats = new Attributes();

private static final IntIntMap defaultSkills = new IntIntMap();
static {
// TODO: throw skills added dynamically depending on weapon
defaultSkills.put(0, 1); // attack
defaultSkills.put(1, 1); // kick
//defaultSkills.put(2, 1); // throw
defaultSkills.put(3, 1); // unsummon
//defaultSkills.put(4, 1); // left hand throw
defaultSkills.put(5, 1); // left hand swing
}

public CharData() {
for (StoreLoc storeLoc : StoreLoc.values()) store.put(storeLoc, new Array<Item>());
}
Expand Down Expand Up @@ -157,6 +168,7 @@ public void updateD2S(int difficulty) {
stats.update(this); // TODO: this need to be done whenever an item is changed

skills.clear();
skills.putAll(defaultSkills);
for (int spellId = charClass.firstSpell, i = 0; spellId < charClass.lastSpell; spellId++, i++) {
skills.put(spellId, d2s.skills.data[i]);
}
Expand Down Expand Up @@ -185,6 +197,7 @@ private void updateStats() {
stats.reset();
final int alternate = getAlternate();
for (Item item : equipped.values()) {
if (item == null) continue;
item.update();
if (item.bodyLoc == BodyLoc.getAlternate(item.bodyLoc, alternate)) {
stats.add(item.props.remaining());
Expand All @@ -206,6 +219,7 @@ private void updateStats() {
stats.aggregate().get(Stat.armorclass).add(dex / 4);

skills.clear();
skills.putAll(defaultSkills);
for (int spellId = charClass.firstSpell, i = 0; spellId < charClass.lastSpell; spellId++, i++) {
skills.put(spellId, d2s.skills.data[i]);
}
Expand Down
20 changes: 5 additions & 15 deletions core/src/com/riiablo/panel/SpellsQuickPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class SpellsQuickPanel extends Table implements Disposable, CharData.Skil
DC6 CharSkillicon[];

private static int getClassId(String charClass) {
if (charClass.isEmpty()) return -1;
switch (charClass.charAt(0)) {
case 'a': return charClass.charAt(1) == 'm' ? CharacterClass.AMAZON.id : CharacterClass.ASSASSIN.id;
case 'b': return CharacterClass.BARBARIAN.id;
Expand Down Expand Up @@ -87,24 +88,11 @@ public SpellsQuickPanel(final GameScreen gameScreen, final HotkeyButton o, final
ALIGN = leftSkills ? Align.left : Align.right;

keyMappings = new ObjectMap<>(31);
Table top = new Table() {{
add(new HotkeyButton(Skillicon, 14, -1)).size(SIZE);
add(new HotkeyButton(Skillicon, 18, -1)).size(SIZE);
pack();
}};
tables = new Table[5];
for (int i = 0; i < tables.length; i++) tables[i] = new Table();
Table bottom = new Table() {{
add(new HotkeyButton(Skillicon, 4, -1)).size(SIZE);
add(new HotkeyButton(Skillicon, 6, -1)).size(SIZE);
add(new HotkeyButton(Skillicon, 2, -1)).size(SIZE);
pack();
}};
add(top).align(ALIGN).row();
for (int i = tables.length - 1; i >= 0; i--) {
add(tables[i]).align(ALIGN).row();
Table table = tables[i] = new Table();
add(table).align(ALIGN).row();
}
add(bottom).align(ALIGN).row();
pack();
//setDebug(true, true);

Expand Down Expand Up @@ -140,6 +128,8 @@ public void onChanged(CharData client, IntIntMap skills) {
if (skill.passive) continue;

final SkillDesc.Entry desc = Riiablo.files.skilldesc.get(skill.skilldesc);
if (desc.ListRow < 0) continue;

Table table = tables[desc.ListRow];
int iconCel = desc.IconCel;
DC icons = getSkillicon(skill.charclass, iconCel);
Expand Down

0 comments on commit eca930a

Please sign in to comment.