Jump to content
  • 0

Java : Item Icon Inside Html (Pref With .xml Path)


Question

Posted (edited)

Hello guys :)

 

I have end my "Shift Click Action" but i dont know how to link (Item Icon)

 

If somebody can help me :)

 

Preview :
 

zjU8qdj.png

 

//EDIT

 

Source : l2jaCis

Edited by T9Text

Recommended Posts

  • 0
Posted

Told you to create a static map (put it on Item or ItemTable no importance) and populate it. It's similar to what absolutepower tried to do, except it's even easier to handle it.

  • 0
Posted

Told you to create a static map (put it on Item or ItemTable no importance) and populate it. It's similar to what absolutepower tried to do, except it's even easier to handle it.

 

XML is not better way ? 

  • 0
Posted (edited)

XML is not better way ? 

If you don't reuse existing items, nope. It's fat for what it is. And guess where your XML will load its data...? In a Map. As a temporary solution, use a Map. You won't have to recode a lot if you decide to stick to latest aCis (would probably be in the 350 cycle if the work goes on).

Edited by Tryskell
  • 0
Posted (edited)

You can add custom xml file what will be contains all necessary icons for important items. First, you need add logger for all itemId's how addition to the droplist - NpcDataTable.java. Then you must create parser for xml file with names as icons.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<list>
	<item id="57" icon="icon.adena"/>
</list>

For all missed icons you need add default return value like "icon.noimage".

 

And as result, you can uses is as

IconTable.getIcon(item.getItemId());

Profit.

 

BUT, you can use it as part of Item data. In this case you need add to item properties new variable - _icon with default parser statement "icon.noimage" and add called method getIcon(). So, by default, getIcon() method will be return "icon.noimage". And you need add to XML file with items new property:

<name="icon" val="icon.adena" />

Like L2J style.

Edited by Rootware
  • 0
Posted (edited)
 

You can add custom xml file what will be contains all necessary icons for important items. First, you need add logger for all itemId's how addition to the droplist - NpcDataTable.java. Then you must create parser for xml file with names as icons.xml:

<?xml version="1.0" encoding="UTF-8"?>
<list>
    <item id="57" icon="icon.adena"/>
</list>

For all missed icons you need add default return value like "icon.noimage".

 

And as result, you can uses is as

IconTable.getIcon(item.getItemId());

Profit.

 

BUT, you can use it as part of Item data. In this case you need add to item properties new variable - _icon with default parser statement "icon.noimage" and add called method getIcon(). So, by default, getIcon() method will be return "icon.noimage". And you need add to XML file with items new property:

<name="icon" val="icon.adena" />

Like L2J style.

 

I make the java...

i have this error...

ItemTable: Highest used itemID : 9208
TeleportLocationTable: Error while creating tablejava.lang.NullPointerException
Exception in thread "main" java.lang.ExceptionInInitializerError
        at net.sf.l2j.gameserver.datatables.IconList.getInstance(IconList.java:2
5)
        at net.sf.l2j.gameserver.GameServer.<init>(GameServer.java:169)
        at net.sf.l2j.gameserver.GameServer.main(GameServer.java:404)
Caused by: java.lang.NullPointerException
        at net.sf.l2j.gameserver.datatables.IconList.load(IconList.java:65)
        at net.sf.l2j.gameserver.datatables.IconList.<init>(IconList.java:30)
        at net.sf.l2j.gameserver.datatables.IconList$SingletonHolder.<clinit>(Ic
onList.java:77)
        ... 3 more
Edited by T9Text
Guest
This topic is now closed to further replies.


×
×
  • Create New...