private void blockTexTable_MouseDoubleClick(object sender, MouseEventArgs e) { if (blockTexTable.SelectedItems.Count == 0) { return; } if (atlas == null) { MessageBox.Show("Sorry, the atlas is not available.", "You know..."); return; } BlockTexItem item = (BlockTexItem)(blockTexTable.SelectedItems[0].Tag); // show block texture viewer BlockTexForm form = new BlockTexForm(atlas, item.Bytes[0], item.Bytes[1], item.Bytes[2], item.Bytes[3], item.Bytes[4], item.Bytes[5] ); form.Show(this); }
private void blockTexTable_SelectedIndexChanged(object sender, EventArgs e) { editBlockTexButton.Enabled = blockTexTable.SelectedItems.Count == 1; if (!editBlockTexButton.Enabled) { cubePreviewBottomPanel.Visible = false; cubePreviewTopPanel.Visible = false; return; } if (atlas == null) { return; } cubePreviewBottomPanel.Visible = true; cubePreviewTopPanel.Visible = true; BlockTexItem item = (BlockTexItem)(blockTexTable.SelectedItems[0].Tag); // show block texture viewer BlockTexForm.TopView(cubePreviewTopPicture, atlas.Get(item.Bytes[0], item.Bytes[6]), atlas.Get(item.Bytes[1], item.Bytes[7]), atlas.Get(item.Bytes[2], item.Bytes[8]), atlas.Get(item.Bytes[3], item.Bytes[9]), atlas.Get(item.Bytes[4], item.Bytes[10]), atlas.Get(item.Bytes[5], item.Bytes[11]) ); BlockTexForm.BottomView(cubePreviewBottomPicture, atlas.Get(item.Bytes[0], item.Bytes[6]), atlas.Get(item.Bytes[1], item.Bytes[7]), atlas.Get(item.Bytes[2], item.Bytes[8]), atlas.Get(item.Bytes[3], item.Bytes[9]), atlas.Get(item.Bytes[4], item.Bytes[10]), atlas.Get(item.Bytes[5], item.Bytes[11]) ); }