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; } } } }
void OnClicked(int posX, int posY) { int x = (posX - XOffset) / TileWidth; int y = (posY - YOffset) / TileHeight; if (!ViewObjects) { if (!IsInBounds(posX, posY)) { return; } room.SetTile(x, y, client.SelectedIndex); this.QueueDrawArea(x * TileWidth + XOffset, y * TileWidth + YOffset, 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; } } } }