void OnClicked(int x, int y)
{
x /= TileWidth;
y /= TileHeight;
if (!ViewObjects) {
room.SetTile(x, y, client.SelectedIndex);
this.QueueDrawArea(x * TileWidth, y * TileWidth, TileWidth - 1, TileHeight - 1);
}
else {
if (objectEditor != null) {
ObjectGroupEditor editor = objectEditor;
while (hoveringObjectIndices.Count > 1) {
editor.SelectedIndex = hoveringObjectIndices[0];
hoveringObjectIndices.RemoveAt(0);
editor = editor.SubEditor;
}
if (hoveringObjectIndices.Count == 1) {
editor.SelectedIndex = hoveringObjectIndices[0];
draggingObject = true;
}
}
}
}