Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing more forms
#1
The map editor attributes use a lot of forms...we could merge them all into 1 form.

On the form make 3 scroll bars: scrlData(1 To 3), lblData(1 To 3)

Then we make Public MapEditorTileData(1 To 3) save the settings and we make MapEditorDataName(1 to 3) so we can change the label captions.

Now convert all the option buttons to optAttribute(1 To total attributes) and the code would be like this:

(very pseudo code)
Code:
Private Sub optAttribute_Click(Index As Integer)
Select case index
    case TILE_TYPE_ITEM
        With frmAttribute
            MapEditorDataName(1) = "Item: 0"
            MapEditorTileData(1) = 0
            MapEditorTileData(2) = 0
            MapEditorTileData(3) = 0
            lblData(1).Caption = MapEditorDataName(1)
            lblData(2).Visible = False
            lblData(3).Visible = False
            scrlData(1).Max = MAX_ITEMS
            scrlData(2).Visible = False
            scrlData(3).Visible = False
        End With
end select
End Sub

Then on the scrlData(Index) whatever:

lblData(Index).Caption = MapEditorDataName(Index) & ": " & scrlData(Index).Value
MapEditorTileData(Index) = scrlData(Index).Value

Well I hope you get the idea.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)