Added cell labels for showing labels on the minimap, SWGNameGenerator no longer throws an error on null NameFilter, updated city map locations to points provided by Undercova

This commit is contained in:
Waverunner
2015-06-08 17:59:19 -04:00
parent 3f524398fc
commit 4aee40c0fd
3 changed files with 16 additions and 7 deletions
Binary file not shown.
+15 -6
View File
@@ -40,7 +40,10 @@ public class CellObject extends SWGObject {
private boolean isPublic = true;
private int number = 0;
private String label = "";
private float label_x = 0f;
private float label_z = 0f;
public CellObject(long objectId) {
super(objectId, BaselineType.SCLT);
}
@@ -68,7 +71,12 @@ public class CellObject extends SWGObject {
public void setLabel(String label) {
this.label = label;
}
public void setLabelMapPosition(float x, float z) {
this.label_x = x;
this.label_z = z;
}
protected void sendBaselines(Player target) {
BaselineBuilder bb = new BaselineBuilder(this, BaselineType.SCLT, 3);
createBaseline3(target, bb);
@@ -82,16 +90,17 @@ public class CellObject extends SWGObject {
public void createBaseline3(Player target, BaselineBuilder bb) {
super.createBaseline3(target, bb);
bb.addByte(1); // isPublic
bb.addBoolean(isPublic);
bb.addInt(number);
bb.incrementOperandCount(2);
}
public void createBaseline6(Player target, BaselineBuilder bb) {
super.createBaseline6(target, bb);
bb.addLong(0);
bb.addLong(0);
bb.addUnicode(label);
bb.addFloat(label_x);
bb.addFloat((float) 0);
bb.addFloat(label_z);
bb.incrementOperandCount(2);
}
}
+1 -1
View File
@@ -124,7 +124,7 @@ public class SWGNameGenerator {
return "";
String name = null;
while (name == null || !nameFilter.isValid(name)) {
while (name == null || (nameFilter != null && !nameFilter.isValid(name))) {
name = getNameByRule(ruleMap.get(race));
// Some reason a name can be empty, I think it has to do with the removeExcessDuplications check.
if (name.isEmpty())