Mirage Source
Custom 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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Custom Visual Inventory (/showthread.php?tid=1529)



Custom Visual Inventory - Stomach Pulser - 26-01-2008

Hello, I am attempting to code a visual inventory without using any tutorials. So far, I have it blt your items into a visual inventory picture box. But, I can't get it to do it right when you open frmMirage. For some reason, if I add an UpdateInventory into Form_Load, I get an error because the player hasn't been loaded yet. I tried using a timer and such.

Is there a reason that frmMirage would load before the game itself starts? Meaning, when you open up frmMainMenu?

Any help would be appreciated!


Re: Custom Visual Inventory - Dragoons Master - 26-01-2008

Add the UpdateInventory after you login. It's a packet, can't remember exacly now, I think it's "loginok", something like this.


Re: Custom Visual Inventory - Stomach Pulser - 26-01-2008

Tried after the login and the use_char, both gave me the error.

Also, once in-game, if you update inventory with a /inv or getting\dropping an item, the inventory blts properly.


Re: Custom Visual Inventory - Robin - 26-01-2008

Do it before the looping part in GameLoop.

frmMirage is loaded then shut down when you init DX Tongue


Re: Custom Visual Inventory - Stomach Pulser - 26-01-2008

Did that robin, it ended up not blting it.


Re: Custom Visual Inventory - Robin - 26-01-2008

Have you set the box to AutoRedraw, and are you using BltToDC?


Re: Custom Visual Inventory - Stomach Pulser - 26-01-2008

AutoRedraw is yes, but what is BltToDC? I just use Bitblt...

It works now, I added in a picture.refresh and it loads it properly. If anything new arises I'll post it.


Re: Custom Visual Inventory - Robin - 26-01-2008

Eurgh, not wonder it doesn't work.


Re: Custom Visual Inventory - Stomach Pulser - 26-01-2008

What is BltToDC, I know it is a DX7 function, but what makes it different?


Re: Custom Visual Inventory - Robin - 26-01-2008

BitBlt means you're loading all the graphics into memory again (as well as loading them into DX7 surfaces) to just blt them into a different box.

BltToDC means you can use the graphics stored in a surface rather than having to load everything again.

It also doesn't get wiped out like BitBlt.