Fixed TangibleObject.getTrueName()

This commit is contained in:
Seefo
2014-05-06 17:20:51 -04:00
parent cfe65a9613
commit fcd155e100
@@ -51,7 +51,9 @@ import com.sleepycat.persist.model.NotPersistent;
import com.sleepycat.persist.model.Persistent;
import engine.clientdata.ClientFileManager;
import engine.clientdata.StfTable;
import engine.clients.Client;
import engine.resources.common.CRC;
import engine.resources.objects.SWGObject;
import engine.resources.scene.Planet;
import engine.resources.scene.Point3D;
@@ -512,24 +514,41 @@ public class TangibleObject extends SWGObject implements Serializable {
}
}
// Returns the STF-based name
// Returns the full STF-based name filepath
public String getProperName()
{
return "@" + getStfFilename() + ":" + getStfName();
}
// Returns the current, true name of the Object
public String getTrueName()
{
return getCustomName() != null ? getCustomName() : getProperName();
}
// Returns the STF-based description
// Returns the STF-based description filepath
public String getProperDescription()
{
return "@" + getDetailFilename() + ":" + getDetailName();
}
// Returns the current, true name of the Object
public String getTrueName()
{
return getCustomName() != null ? getCustomName() : getTrueStfName();
}
// Returns the true STF-based name
public String getTrueStfName()
{
String name = null;
try
{
StfTable stf = new StfTable("clientdata/string/en/" + getStfFilename() + ".stf");
for (int s = 1; s < stf.getRowCount(); s++)
{
if(stf.getStringById(s).getKey().equals(getStfName())) name = stf.getStringById(s).getValue();
}
}
catch (Exception e) { }
return name;
}
public List<LootGroup> getLootGroups() {
return lootGroups;
}