Skip to content

Commit

Permalink
New Feature: Added TypeID column to the materials tool
Browse files Browse the repository at this point in the history
Merge Feature
  • Loading branch information
GoldenGnu committed May 4, 2024
2 parents 6be1dc2 + 1a59591 commit 4c76c02
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public int getNameOrder() {
private final String name;
private final MyLocation location; //New objects are created by updateData() - no need to update
private final Item item;
private final Integer typeID;

private double value = 0;
private long count = 0;
Expand All @@ -85,10 +86,12 @@ public Material(final MaterialType type, final MyAsset asset, final String heade
//Has item
if (type == MaterialType.LOCATIONS || type == MaterialType.SUMMARY) {
this.item = asset.getItem();
this.typeID = asset.getTypeID();
this.price = asset.getDynamicPrice();
} else {
this.item = new Item(0);
this.price = null;
this.typeID = null;
}
//Has location
if (type == MaterialType.LOCATIONS || type == MaterialType.LOCATIONS_TOTAL || type == MaterialType.LOCATIONS_ALL) {
Expand All @@ -100,6 +103,7 @@ public Material(final MaterialType type, final MyAsset asset, final String heade
location = MyLocation.create(0);
this.item = new Item(0);
this.price = null;
this.typeID = null;
}
}

Expand Down Expand Up @@ -131,6 +135,10 @@ public MyLocation getLocation() {
return location;
}

public Integer getTypeID() {
return typeID;
}

public String getGroup() {
return group;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ public String getColumnName() {
public Object getColumnValue(final Material from) {
return new ISK(Formatter.iskFormat(from.getValue()), from.getValue());
}
},
TYPE_ID(ISK.class, GlazedLists.comparableComparator()) {
@Override
public String getColumnName() {
return TabsMaterials.get().columnTypeID();
}
@Override
public Object getColumnValue(final Material from) {
return from.getTypeID();
}

@Override
public boolean isShowDefault() {
return false;
}
};

private final Class<?> type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public TabsMaterials(final Locale locale) {
public abstract String columnName();
public abstract String columnPrice();
public abstract String columnValue();
public abstract String columnTypeID();
public abstract String expand();
public abstract String grandTotal();
public abstract String includeMaterials();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ columnLocation=Location
columnName=Name
columnPrice=Price
columnValue=Value
columnTypeID=TypeID
expand=Expand
grandTotal=Grand Total
includeMaterials=Materials
Expand Down

0 comments on commit 4c76c02

Please sign in to comment.