Esempio n. 1
0
        public void SelectItem(int index, int amount, bool update_rotation = false)
        {
            ItemDefinition item = ItemDefinition.GetItem(index);

            properties.SelectedObject = item;
            name_label.Text           = item.Name + " (" + item.ID + ")";
            pic_item_small.Image      = pic_item_large.Image = Cache_Editor_API.Config.ItemDefinition.GetModelSprite(index, amount, 0).GenerateBitmap();

            if (last_item != index || model_viewer.SelectedModel == null || model_viewer.SelectedModel.ID != item.GetModelIndex(amount))
            {
                model_viewer.SelectedModel = item.GetModel(amount);
                if (last_item != index || update_rotation)
                {
                    model_viewer.Yaw   = item.RotationX;
                    model_viewer.Pitch = item.RotationY;
                    model_viewer.Roll  = item.RotationZ;
                    model_viewer.DrawModel();
                }
            }
            last_item = index;
        }