Time for action – completing the editor – part 1
Open the
MapEditor
form in Design mode.Double-click on the
listTiles
ListView
control to automatically generate an event handler for theSelectedIndexChanged
event. Update the event code to read:Private Sub listTiles_SelectedIndexChanged(sender As System.Object,e As System.EventArgs) Handles listTiles.SelectedIndexChanged If listTiles.SelectedIndices.Count > 0 Then game.DrawTile = listTiles.SelectedIndices(0) End If End Sub
Return to the Design view of the
MapEditor
form, and double-click on the radio button labeled Toggle Passable to generate a handler for theCheckChanged
event. Update the event handler to read:Private Sub radioPassable_CheckedChanged(sender As System.Object,e As System.EventArgs) Handles radioPassable.CheckedChanged If Not IsNothing(game) Then If radioPassable.Checked Then game.EditingCode = False Else game.EditingCode = True End If End If End Sub
Return to the Design view, and double...