Mirage Source
[Feature] Visual Inventory - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51)
+----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44)
+------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13)
+------ Thread: [Feature] Visual Inventory (/showthread.php?tid=2128)

Pages: 1 2


[Feature] Visual Inventory - Jacob - 19-09-2008

This Visual Inventory uses BltToDc to draw your inventory instead of picture boxes.

All Client Side

frmMirage
Add a Picture Box
Name it picVisInv
Set AutoRedraw to True

modConstants
Add the following:
Code:
' Visual Inventory
Public Const InvX As Byte = 30
Public Const InvY As Byte = 11
Public Const InvOffsetX As Byte = 17
Public Const InvOffsetY As Byte = 16

InvX and InvY are where the first item will be drawn within the picVisInv
InvOffsetX and InvOffsetY are the offsets in between the items

modDirectDraw7
Add the following sub:
[code]Public Sub BltInventory()
Dim i As Long
Dim rec As DxVBLib.RECT
Dim rec_pos As DxVBLib.RECT

If frmMirage.picVisInv.Visible Then
frmMirage.picVisInv.Cls

For i = 1 To MAX_INV
If GetPlayerInvItemNum(MyIndex, i) > 0 And GetPlayerInvItemNum(MyIndex, i) 0 And GetPlayerInvItemNum(MyIndex, i) = tempRec.Left And X = tempRec.Top And Y


Re: [Feature] Visual Inventory - Jacob - 19-09-2008

To be fair... It's still very good as is.


Re: [Feature] Visual Inventory - Jacob - 20-09-2008

How would you improve this?


Re: [Feature] Visual Inventory - Jacob - 20-09-2008

That's not helping to improve my code haha.

You're using a custom DX8 engine you made. I'm giving people a basic visual inventory they can expand. The base code for that is very good imho.


Re: [Feature] Visual Inventory - Egon - 20-09-2008

There really isn't much more Dugor can do to improve on it. It's kickass as is.


Re: [Feature] Visual Inventory - skillzalot - 20-09-2008

I want to add this but my frmMIrage cant go any bigger to allow for this any ideas.


Re: [Feature] Visual Inventory - Robin - 20-09-2008

Oh dear God, just stop posting.


Re: [Feature] Visual Inventory - skillzalot - 20-09-2008

? My frmMirage wont go bigger. At all


Re: [Feature] Visual Inventory - Robin - 20-09-2008

Awww. The fucking IDE isn't letting you drag it bigger? BAAAAAAAAAAAAW.

frmMirage.width = 9001

HOLY SHIT

THAT WAS FUCKING HARD WASNT IT.


Re: [Feature] Visual Inventory - DarkC - 20-09-2008

lol Robin, that was hilarious.

Try getting messages on MSN from him, that are ALL like that. =.= I've just blocked him now.


Re: [Feature] Visual Inventory - Robin - 20-09-2008

Of course I get them. I'm always the first person to get all the retards adding me on msn.

Being so godly is more of a curse than anything ;-;


Re: [Feature] Visual Inventory - Mattyw - 20-09-2008

Robin Wrote:Of course I get them. I'm always the first person to get all the retards adding me on msn.

Being so godly is more of a curse than anything ;-;

Doom said add you. Blame him. XD


Re: [Feature] Visual Inventory - Nean - 20-09-2008

Yeah, I was thinking of adding Giaken, and Robin, and all the other 1337 programmers to MSN, but I know what'll happen...


Re: [Feature] Visual Inventory - Mattyw - 20-09-2008

Well I got DFA & Robin. But Robin doesn't talk. =-p


Re: [Feature] Visual Inventory - Robin - 20-09-2008

Nean Wrote:Yeah, I was thinking of adding Giaken, and Robin, and all the other 1337 programmers to MSN, but I know what'll happen...

Go ahead. I don't mind talking to people trying to learn.

I do care when idiots ask me retarded shit, or just don't learn at all. I've had one guy who's asked me how to add 'the way megalith does its chat box so its like over the game sorta' 3 times now.


Re: [Feature] Visual Inventory - Dane - 16-10-2008

Does this work for MS4? Because everytime I try to do this tutorial I get errors...Am i suppost to make pictures boxes 32x32 auto redraw and name it picVisInv and then picVisInv1 and so on? Or do the other option (I forgot) that names them picVisInv(0) / picVisInv(1) ...


Re: [Feature] Visual Inventory - Dane - 16-10-2008

Sorry for double post but -

Even when I compile without errors the pictures dont show up.


Re: [Feature] Visual Inventory - Anthony - 16-10-2008

You don't need to make any picture boxes. Re read the tutorial.

And if I remember correctly the inventory won't update properly by just opening it. You will have to open it and then pick up or drop an item for it to blt everything.


Re: [Feature] Visual Inventory - Dane - 16-10-2008

frmMirage
Add a Picture Box
Name it picVisInv
Set AutoRedraw to True

and I already tried to pick up an item and it still didnt update.


Re: [Feature] Visual Inventory - Ramsey - 16-10-2008

Quote:Add a Picture Box

You only need one.


Re: [Feature] Visual Inventory - Anthony - 17-10-2008

Meh, when I did this I just used the existing picInv. My mistake.


Re: [Feature] Visual Inventory - Dane - 21-10-2008

What do I do with the existing Inventory? The text one?


Re: [Feature] Visual Inventory - Dane - 21-10-2008

The item doesnt show up in the picture box. picVisInv AutoRedraw = True 32x32 but nothing changed../

Im going to ask again.
Does this work with MS4?


Re: [Feature] Visual Inventory - Rian - 21-10-2008

It's made specifically for MS4. That's why it's in the MS4 Tutorials section of the forums.


Re: [Feature] Visual Inventory - Rian - 21-10-2008

As far as I can tell, picVisInv needs to be larger than 32x32. picVisInv is not a box that displays an inventory item, picVisInv is THE box that displays ALL of your inventory items.