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 void listTiles_SelectedIndexChanged( object sender, EventArgs e) { if (listTiles.SelectedIndices.Count > 0) { game.DrawTile = listTiles.SelectedIndices[0]; } }
Return to the Design view of the MapEditor form and double-click on the radio button labelled Toggle Passable to generate a handler for the
CheckChanged
event. Update the event handler to read:private void radioPassable_CheckedChanged(object sender, EventArgs e) { if (radioPassable.Checked) { game.EditingCode = false; } else { game.EditingCode = true; } }
Return to the Design view and double-click on the Code radio button. Update the
CheckChanged
event handler to read:private void radioCode_CheckedChanged(object...