Add icons to item data

This commit is contained in:
KingRainbow44 2023-04-08 21:56:51 -04:00
parent a27f7e0373
commit 2a5abc1dcb
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
2 changed files with 162 additions and 156 deletions

View File

@ -38,6 +38,7 @@ public class ItemData extends GameResource {
private int rank; private int rank;
private int weight; private int weight;
private int gadgetId; private int gadgetId;
private String icon;
private int[] destroyReturnMaterial; private int[] destroyReturnMaterial;
private int[] destroyReturnMaterialCount; private int[] destroyReturnMaterialCount;

View File

@ -20,6 +20,8 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public interface Dumpers { public interface Dumpers {
// See `src/handbook/data/README.md` for attributions.
/** /**
* Fetches the description of a command. * Fetches the description of a command.
* *
@ -141,7 +143,8 @@ public interface Dumpers {
var dump = new HashMap<Integer, ItemData>(); var dump = new HashMap<Integer, ItemData>();
GameData.getItemDataMap().forEach((id, item) -> dump.put(id, new ItemData( GameData.getItemDataMap().forEach((id, item) -> dump.put(id, new ItemData(
Language.getTextMapKey(item.getNameTextMapHash()).get(locale), Language.getTextMapKey(item.getNameTextMapHash()).get(locale),
Quality.from(item.getRankLevel()), item.getItemType() Quality.from(item.getRankLevel()), item.getItemType(),
item.getIcon().length() > 0 ? item.getIcon().substring(3) : ""
))); )));
try { try {
@ -185,12 +188,14 @@ public interface Dumpers {
public String name; public String name;
public Quality quality; public Quality quality;
public ItemType type; public ItemType type;
public String icon;
@Override @Override
public String toString() { public String toString() {
return this.name + "," return this.name + ","
+ this.quality + "," + this.quality + ","
+ this.type; + this.type + ","
+ this.icon;
} }
} }