[EE 2.7] How to fix Value displaying in shops

Ok, I don’t know if anyone has noticed, but the displaying of values for an item is broken and I found out how to fix it.

For it to work 100% you’ll have to go to frmNewShop.frm and add an new label, under the label that says “Vital mod”.
Call it lblAmount.

Open up the code in the same form and find this piece of code:

    ElseIf Item(itemN).Type >= ITEM_TYPE_POTIONADDHP And Item(itemN).Type <= ITEM_TYPE_POTIONSUBSP Then
        lblVital.Caption = "Value: " & Item(itemN).Data2

Delete it.

Add this code at the end of the same sub:

    lblAmount.Caption = "Amount: " & Amount

Find this:

Private Sub ShowItemInfo(ByVal itemN As Integer)

Replace with this:

Private Sub ShowItemInfo(ByVal itemN As Integer, ByVal Amount As Integer)

Find this:

Call ShowItemInfo(Shop(shopNum).ShopItem(pageIndex * 5 + Index + 1).ItemNum)

Replace with this:

        Call ShowItemInfo(Shop(shopNum).ShopItem(pageIndex * 5 + Index + 1).ItemNum, Shop(shopNum).ShopItem(pageIndex * 5 + Index + 1).Amount)

Hope this is useful 🙂

–AkselJ

Looks good!

Thanks 🙂

Problem:

lblAmount.Caption = "Amount: " & Amount
```Doesn't work. It doesn't like the lblAmount

EDIT: Oh wait, what does labeling mean :huh:
EDIT2: Got it…
EDIT3: Now it wants to blame lblVital  :huh: so do i have to remove```
If Item(itemN).Type = ITEM_TYPE_WEAPON Then
        lblVital.Caption = "Attack: " & Item(itemN).Data2
    ElseIf Item(itemN).Type >= ITEM_TYPE_ARMOR And Item(itemN).Type <= ITEM_TYPE_LEGS Then
        lblVital.Caption = "Defense: " & Item(itemN).Data2
    Else
        lblVital.Caption = vbNullString
    End If

EDIT4:GOT IT!!

Ok, could you tell what the error is so I know if it’s something new or what?

Log in to reply