Mirage Source
http://miragesource.net/forums/

Removing more forms
http://miragesource.net/forums/viewtopic.php?f=193&t=5358
Page 1 of 1

Author:  GIAKEN [ Thu Apr 02, 2009 3:11 pm ]
Post subject:  Removing more forms

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/