Added coloring to the 'Used in Collection' attribute for collection items

This commit is contained in:
Seefo
2014-06-21 23:03:15 -04:00
parent 6400a7b9b0
commit 0b315503f0
2 changed files with 16 additions and 3 deletions
+14 -2
View File
@@ -28,9 +28,9 @@ import java.util.TreeMap;
import org.apache.mina.core.buffer.SimpleBufferAllocator;
import main.NGECore;
import protocol.swg.AttributeListMessage;
import resources.objects.creature.CreatureObject;
import engine.resources.common.Stf;
import engine.resources.objects.SWGObject;
import engine.resources.service.INetworkDispatch;
import engine.resources.service.INetworkRemoteEvent;
@@ -65,6 +65,18 @@ public class AttributeService implements INetworkDispatch {
if(requester.getClient() == null || requester.getClient().getSession() == null)
return;
// Color collection used in attribute based on whether collection is complete or not
if(target.getAttachment("CollectionItemName") != null)
{
String collectionName = new Stf("@collection_n:" + (String) target.getAttachment("AddToCollection")).getStfValue().replace(":", " -");
if(core.collectionService.isComplete((CreatureObject) requester, (String) target.getAttachment("CollectionItemName")))
{
target.getAttributes().put("@obj_attr_n:collection_name", "\\#FF0000 " + collectionName);
}
else target.getAttributes().put("@obj_attr_n:collection_name", "\\#00FF00 " + collectionName);
}
AttributeListMessage message = new AttributeListMessage(target, bufferPool);
requester.getClient().getSession().write(message.serialize());
}