Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

EqColumns (Character window, draw equipment)


Vortigem
 Share

Recommended Posts

This is an unsupported CS:DE based source(DX8), and a learning experience for me.

In ModConstants:

```

Public Const EqTop As Long = 68

Public Const EqLeft As Long = 18

Public Const EqOffsetX As Long = 25

Public Const EqColumns As Long = 4

```

The above says that I have 4 Columns of equipment (Weapons, Chest, Helm, Shield) and they are 25 apart from each other on the X plane.

I'm changing the equipment to display vertically so did the following:

```

Public Const EqTop As Long = 68

Public Const EqLeft As Long = 18

Public Const EqOffsetX As Long = 132

Public Const EqColumns As Long = 2

```

Now I have 2 columns and they are spaced 132 apart, this is great however I believe the images of equipment are now displayed on top of each other and I'm trying to Offset them by Y. Any ideas?
Link to comment
Share on other sites

Hi Vortigem,

I ran into this exact problem. You need to add in EqOffsetY as a variable, and add it into the y calculation line. Here's what I used.

```

y = GUIWindow(GUI_CHARACTER).y + EqTop + EqOffsetY*Int((I-1)/EqColumn)

```

Since int always rounds down, this will place the first EqColumn number of items in the first row, then the next EqColumn number in the next row, and so on. Without the -1 you'd only get EqColumn-1 on the first row, since the last one wouldn't be inclusive (e.g. 1/2 would return 0, but 2/2 would return 1)
Link to comment
Share on other sites

Thanks Zeno!! I appreciate the explanation that came along with it! For everyone in the future, using Zeno's guidance from above I changed the following to make this work:

Change in _Sub DrawEquipment_

```

Y = GUIWindow(GUI_CHARACTER).Y + EqTop + EqOffsetY * Int((I - 1) / EqColumns)

```

Change in _Function IsEqItem_

```

.Top = GUIWindow(GUI_CHARACTER).Y + EqTop + EqOffsetY * Int((I - 1) / EqColumns)

```

Add to _Character consts_:

```

Public Const EqOffsetY As Long = 25

```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...