Added spell tree names and fixed label layouts

This commit is contained in:
Collin Smith 2019-03-15 22:24:14 -07:00
parent 45b67e6cb8
commit 61c94795ee
2 changed files with 64 additions and 3 deletions

View File

@ -10,6 +10,11 @@ public enum CharacterClass {
description = 5128; description = 5128;
spellsBackground = "skltree_a_back"; spellsBackground = "skltree_a_back";
spellIcons = "AmSkillicon"; spellIcons = "AmSkillicon";
spellTree = new String[][]{
{"StrSklTree10", "StrSklTree11", "StrSklTree4"},
{"StrSklTree8", "StrSklTree9", "StrSklTree4"},
{"StrSklTree6", "StrSklTree7", "StrSklTree4"},
};
firstSpell = 6; firstSpell = 6;
lastSpell = 36; lastSpell = 36;
}}, }},
@ -18,6 +23,11 @@ public enum CharacterClass {
description = 5131; description = 5131;
spellsBackground = "skltree_s_back"; spellsBackground = "skltree_s_back";
spellIcons = "SoSkillicon"; spellIcons = "SoSkillicon";
spellTree = new String[][] {
{"StrSklTree25", "StrSklTree5"},
{"StrSklTree24", "StrSklTree5"},
{"StrSklTree23", "StrSklTree5"},
};
firstSpell = 36; firstSpell = 36;
lastSpell = 66; lastSpell = 66;
fws = bws = nu3s = true; fws = bws = nu3s = true;
@ -28,6 +38,11 @@ public enum CharacterClass {
description = 5129; description = 5129;
spellsBackground = "skltree_n_back"; spellsBackground = "skltree_n_back";
spellIcons = "NeSkillicon"; spellIcons = "NeSkillicon";
spellTree = new String[][]{
{"StrSklTree10", "StrSklTree5"},
{"StrSklTree17", "StrSklTree18", "StrSklTree5"},
{"StrSklTree19"},
};
firstSpell = 66; firstSpell = 66;
lastSpell = 96; lastSpell = 96;
fws = bws = nu3s = true; fws = bws = nu3s = true;
@ -38,6 +53,11 @@ public enum CharacterClass {
description = 5132; description = 5132;
spellsBackground = "skltree_p_back"; spellsBackground = "skltree_p_back";
spellIcons = "PaSkillicon"; spellIcons = "PaSkillicon";
spellTree = new String[][]{
{"StrSklTree15", "StrSklTree4"},
{"StrSklTree14", "StrSklTree13"},
{"StrSklTree12", "StrSklTree13"},
};
firstSpell = 96; firstSpell = 96;
lastSpell = 126; lastSpell = 126;
fws = true; fws = true;
@ -48,6 +68,11 @@ public enum CharacterClass {
description = 5130; description = 5130;
spellsBackground = "skltree_b_back"; spellsBackground = "skltree_b_back";
spellIcons = "BaSkillicon"; spellIcons = "BaSkillicon";
spellTree = new String[][]{
{"StrSklTree21", "StrSklTree4"},
{"StrSklTree21", "StrSklTree22"},
{"StrSklTree20"},
};
firstSpell = 126; firstSpell = 126;
lastSpell = 156; lastSpell = 156;
fws = true; fws = true;
@ -58,6 +83,11 @@ public enum CharacterClass {
description = 22518; description = 22518;
spellsBackground = "skltree_d_back"; spellsBackground = "skltree_d_back";
spellIcons = "DrSkillicon"; spellIcons = "DrSkillicon";
spellTree = new String[][]{
{"StrSklTree26", "StrSklTree4"},
{"StrSklTree27", "StrSklTree28", "StrSklTree4"},
{"StrSklTree29", "StrSklTree4"},
};
firstSpell = 221; firstSpell = 221;
lastSpell = 251; lastSpell = 251;
}}, }},
@ -66,6 +96,11 @@ public enum CharacterClass {
description = 22519; description = 22519;
spellsBackground = "skltree_i_back"; spellsBackground = "skltree_i_back";
spellIcons = "AsSkillicon"; spellIcons = "AsSkillicon";
spellTree = new String[][]{
{"StrSklTree30"},
{"StrSklTree31", "StrSklTree32"},
{"StrSklTree33", "StrSklTree34"},
};
firstSpell = 251; firstSpell = 251;
lastSpell = 281; lastSpell = 281;
}}, }},
@ -78,6 +113,7 @@ public enum CharacterClass {
public int blendSpecial = BlendMode.NONE; public int blendSpecial = BlendMode.NONE;
public String spellsBackground; public String spellsBackground;
public String spellIcons; public String spellIcons;
public String spellTree[][];
public int firstSpell, lastSpell; public int firstSpell, lastSpell;
CharacterClass(String shortName, int id) { CharacterClass(String shortName, int id) {

View File

@ -3,12 +3,12 @@ package com.riiablo.panel;
import com.badlogic.gdx.assets.AssetDescriptor; import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.Touchable;
import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable; import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.Align;
import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.Disposable;
import com.riiablo.CharacterClass; import com.riiablo.CharacterClass;
import com.riiablo.Riiablo; import com.riiablo.Riiablo;
@ -18,6 +18,8 @@ import com.riiablo.codec.excel.Skills;
import com.riiablo.loader.DC6Loader; import com.riiablo.loader.DC6Loader;
import com.riiablo.screen.GameScreen; import com.riiablo.screen.GameScreen;
import com.riiablo.widget.Button; import com.riiablo.widget.Button;
import com.riiablo.widget.Label;
import com.riiablo.widget.LabelButton;
public class SpellsPanel extends WidgetGroup implements Disposable { public class SpellsPanel extends WidgetGroup implements Disposable {
private static final String TAG = "SpellsPanel"; private static final String TAG = "SpellsPanel";
@ -58,10 +60,21 @@ public class SpellsPanel extends WidgetGroup implements Disposable {
addActor(tab); addActor(tab);
} }
StringBuilder builder = new StringBuilder(32);
float x = getWidth() - 90, y = 0; float x = getWidth() - 90, y = 0;
Actor[] actors = new Actor[3]; LabelButton[] actors = new LabelButton[3];
for (int i = 0; i < actors.length; i++) { for (int i = 0; i < actors.length; i++) {
final Actor actor = actors[i] = new Actor(); String[] spellTree = charClass.spellTree[i];
builder.setLength(0);
for (int j = 0; j < spellTree.length; j++) {
builder
.append(Riiablo.string.lookup(spellTree[j]))
.append('\n');
}
builder.setLength(builder.length() - 1);
final LabelButton actor = actors[i] = new LabelButton(builder.toString(), Riiablo.fonts.font16);
actor.setWrap(true);
actor.setAlignment(Align.center);
actor.setPosition(x, y); actor.setPosition(x, y);
actor.setSize(90, getHeight() / 4); actor.setSize(90, getHeight() / 4);
actor.setUserObject(tabs[i + 1]); actor.setUserObject(tabs[i + 1]);
@ -77,6 +90,17 @@ public class SpellsPanel extends WidgetGroup implements Disposable {
y += actor.getHeight(); y += actor.getHeight();
} }
Label header = new Label(
Riiablo.string.lookup("StrSklTree1") + " "
+ Riiablo.string.lookup("StrSklTree2") + " "
+ Riiablo.string.lookup("StrSklTree3"),
Riiablo.fonts.font16);
header.setWrap(true);
header.setAlignment(Align.center);
header.setSize(90, getHeight() / 8);
header.setPosition(x, y + header.getHeight());
addActor(header);
float[] X = { 0, 15, 84, 153 }; float[] X = { 0, 15, 84, 153 };
float[] Y = { 0, 370, 302, 234, 166, 98, 30 }; float[] Y = { 0, 370, 302, 234, 166, 98, 30 };
for (int i = charClass.firstSpell; i < charClass.lastSpell; i++) { for (int i = charClass.firstSpell; i < charClass.lastSpell; i++) {
@ -92,6 +116,7 @@ public class SpellsPanel extends WidgetGroup implements Disposable {
tab.addActor(button); tab.addActor(button);
} }
tabs[1].setVisible(true);
setDebug(true, true); setDebug(true, true);
} }