• Welcome to Valhalla Legends Archive.
 

Channel Display Help.

Started by Jaquio, January 17, 2004, 07:06 PM

Previous topic - Next topic

Jaquio

Ok, I have a problem in order to show game Icons by usernames do you have to have a file on your form for the icons? If so where can I find this file, If not can someone point me in the direction of find out how to make it show the icons.

o.OV

#1
Use the search facility and search for

.bni

That will give you information about the icon file from bnet.

What I did when I first made a chat bot with icon next to username is have an array of imageboxes..

I don't know if that is the best way to go but it is a start.
If the facts don't fit the theory, change the facts. - Albert Einstein

UserLoser.

Assuming you're using Visual Basic, you can just use a ListView along with the ImageList controls, then just have the ListView load images from the ImageList

Jaquio

Ok thank you. I got all that working now I just can't get Warcraft 3:tft to work... How would I do that like I did with these


   If Product = "STAR" Then
       InChannel.ListItems.add , , Username, , 6
   ElseIf Product = "SEXP" Then
       InChannel.ListItems.add , , Username, , 9
   ElseIf Product = "D2DV" Then
       InChannel.ListItems.add , , Username, , 5
   ElseIf Product = "D2XP" Then
       InChannel.ListItems.add , , Username, , 13
   ElseIf Product = "W2BN" Then
       InChannel.ListItems.add , , Username, , 10
   ElseIf Product = "WAR3" Then
       InChannel.ListItems.add , , Username, , 61
   ElseIf Product = "CHAT" Then
       InChannel.ListItems.add , , Username, , 2
   ElseIf Product = "DRTL" Then
       InChannel.ListItems.add , , Username, , 12
   ElseIf Product = "DSHR" Then
       InChannel.ListItems.add , , Username, , 1
   ElseIf Product = "JSTR" Then
       InChannel.ListItems.add , , Username, , 11
   ElseIf Product = "SSHR" Then
       InChannel.ListItems.add , , Username, , 1
   Else
       InChannel.ListItems.add , , Username, , 8
   End If
   lbPing.AddItem Ping


What would the war3:tft be?

UserLoser.

Warcraft III: The Frozen Throne's id would be W3XP - As far as adding the images to the listview, you'll need to find the W3XP icon if you don't already have one

Kp

That code could be improved.  Instead of having each branch invoke add with a common username and an ID# unique to the product, set it up as such:

if product is starcraft, then id = 6
else if product is brood war, then id = 9
etc.  Alternately, you could use a select case statement.  After the branching, id will be set to the number of the icon.  Then you can have InChannel.ListItems.add , , Username, , id.  This has the advantage of (probably) being smaller in code size, and certainly easier to maintain if you change how you add people to the listview.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

hismajesty

#6
 Select Case product
   Case = "STAR"
       InChannel.ListItems.add , , Username, , 6
   Case = "SEXP"
       InChannel.ListItems.add , , Username, , 9
   Case = "D2DV"
       InChannel.ListItems.add , , Username, , 5
   Case = "D2XP"
       InChannel.ListItems.add , , Username, , 13
   Case = "W2BN"
       InChannel.ListItems.add , , Username, , 10
   Case = "WAR3"
       InChannel.ListItems.add , , Username, , 61
   Case = "W3XP"
       InChannel.ListItems.add , , Username, , 62 'Replace with whatever your icon # is
   Case = "DSHR"
       InChannel.ListItems.add , , Username, , 1
   Case = "DRTL"
       InChannel.ListItems.add , , Username, , 12
   Case = "JSTR"
       InChannel.ListItems.add , , Username, , 11
   Case = "SSHR"
       InChannel.ListItems.add , , Username, , 1
   Case = "CHAT"
       InChannel.ListItems.add , , Username, , 2
   Case Else
       InChannel.ListItems.add , , Username, , 8
 End Select
lbPing.AddItem Ping


Change the W3XP image number.

Grok

Kp is correct.  There are multiple ways to implement, each as correct as the others.  They vary in efficiency, readability, and maintainability.

Since you are using an imagelist, you could name each icon the same as the product.  The imagelist image key for "STAR" would be "STAR".  The advantage here being that selecting an image by product is made easier:

   'do this in Form_Load
   InChannel.Icons = ImgLstIcons
   InChannel.SmallIcons = ImgLstSmallIcons
   InChannel.ColumnHeaderIcons = ImgLstSmallIcons
   
   'do this as users are added to the channel list
   InChannel.ListItems.Add , , UserName, Product, Product


This method assumes you associated two imagelists with the listview.

After you get comfortable with this method, you should look at the VB code required to download and parse icons.bni, and use the resulting images to load into the ImageList with ListImages.Add LoadPicture(...)

   'add parsed images to imagelist
   ImageList1.ListImages.Add LoadPicture("STAR.jpg", vbLPSmall, vbLPColor)


Hope this helps.

UserLoser.

Quote from: Grok on January 18, 2004, 02:11 PM
Kp is correct.  There are multiple ways to implement, each as correct as the others.  They vary in efficiency, readability, and maintainability.

Since you are using an imagelist, you could name each icon the same as the product.  The imagelist image key for "STAR" would be "STAR".  The advantage here being that selecting an image by product is made easier:

   'do this in Form_Load
   InChannel.Icons = ImgLstIcons
   InChannel.SmallIcons = ImgLstSmallIcons
   InChannel.ColumnHeaderIcons = ImgLstSmallIcons
   
   'do this as users are added to the channel list
   InChannel.ListItems.Add , , UserName, Product, Product


This method assumes you associated two imagelists with the listview.

After you get comfortable with this method, you should look at the VB code required to download and parse icons.bni, and use the resulting images to load into the ImageList with ListImages.Add LoadPicture(...)

   'add parsed images to imagelist
   ImageList1.ListImages.Add LoadPicture("STAR.jpg", vbLPSmall, vbLPColor)


Hope this helps.

Converting the TGA to a JPG/BMP - isn't that a bit hard to do?

Grok

#9
You can use DirectX to convert Targa to JPG.  There are probably other libraries in Windows which can do it, and if not, it's very likely you can find a public-domain DLL.

I think ReaJpeg 1.1 does it, but I haven't tested it.
http://download.com.com/3001-2192-10194049.html

UserLoser.

Quote from: Grok on January 18, 2004, 02:22 PM
You can use DirectX to convert Targa to JPG.  There are probably other libraries in Windows which can do it, and if not, it's very likely you can find a public-domain DLL.

I can extract the entire list of icons with no problem, separate the flags, product and everything except splitting up each image (so it's just one big list of icons together); perhaps you can show an example? :P

Grok


UserLoser.

#12
Quote from: Grok on January 18, 2004, 02:34 PM
Here is a site with a list of file formats:

http://www.opennet.ru/docs/formats/

Seen that TGA.txt already, but thanks I don't think i've seen any of the other ones ;)

Arta

Converting TGA to BMP isn't particularly difficult. Targa files as used by Battle.net are basically the same as BMPs, except with a different header, a slightly different pixel format and some (trivial) compression. They can vary in their format but for this purpose, it's not complicated.

DarkMinion

Owner drawn listbox > *  ;D