Print Page | Close Window

(Shann’s Version) Show Selected Inventory

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=154
Printed Date: 20 December 2006 at 5:52pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: (Shann’s Version) Show Selected Inventory
Posted By: Sync
Subject: (Shann’s Version) Show Selected Inventory
Date Posted: 11 February 2006 at 3:10pm
I was looking through http://www.miragesource.com/community/viewtopic.php?t=431 - Solosturm's Tutorial for showing Selected Inventory item. ..

Now, normally, I would be happy. But the MS source is riddled with memory bloat, and loading additional item sets from the hard drive instead of the already loaded item set on a DD surface is just a bad idea :) So, my method only use the item set already in memory and ready for use. This method can be used for other editors as well. ....


Create a picture box in the inventory box. I name it picItem. Set the AutoRedraw to true. Set background to pure Black, and set the border to none.

Now add the following code to the frmMirage window....



Private Sub lstInv_Click()
Dim sRECT As RECT
Dim dRECT As RECT

With dRECT
    .top = 0
    .Bottom = PIC_Y
    .Left = 0
    .Right = PIC_X
End With
If DD_ItemSurf Is Nothing Then
Else
    If Player(MyIndex).Inv(lstInv.ListIndex + 1).Num <> 0 Then
        With sRECT
             .top = Item(GetPlayerInvItemNum(MyIndex, lstInv.ListIndex + 1)).Pic * PIC_Y
             .Left = 0
             .Right = PIC_X
             .Bottom = .top + PIC_Y
        End With
        Call DD_ItemSurf.BltToDC(picItem.hdc, sRECT, dRECT)
        picItem.Refresh
    Else
        With sRECT
             .top = 0
             .Left = 0
             .Right = PIC_X
             .Bottom = .top + PIC_Y
        End With
        Call DD_TileSurf.BltToDC(picItem.hdc, sRECT, dRECT)
        picItem.Refresh
    End If
End If
End Sub


And you are all done :D



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info