private void Select(GamePoleObject obj) { location.UpdateCache(); selected = obj; if (selected != null) { objectInfoLabel.Text = obj.GetType().ToString() + "\n" + obj.Position.ToString() + "\n" + obj.UUID + "\nLayer: " + obj.Layer; objectMovePanel.Show(); if (selected is GamePoleObjectTile) { var o = (GamePoleObjectTile)obj; tilePanel.Show(); tileLabel.Text = "Type: " + o.Type; } else { tilePanel.Hide(); tileLabel.Text = ""; } } else { objectInfoLabel.Text = ""; objectMovePanel.Hide(); tilePanel.Hide(); tileLabel.Text = ""; } Application.DoEvents(); Invalidate(); }
private Image GetObjectTexture(GamePoleObject obj) { if (obj is GamePoleObjectTile) { var t = (GamePoleObjectTile)obj; return(tiles[t.Type]); } if (obj is GamePoleObjectChest) { var t = (GamePoleObjectChest)obj; return(chest[t.Type, t.AnimationFrame]); } return(new Bitmap((int)obj.Size.X, (int)obj.Size.Y)); }