Example #1
0
 public void MakeVisible()
 {
     visible = true;
     geometry.MakeVisible(Level.renderer);
     foreach (Object obj in objects)
     {
         obj.MakeVisible();
     }
     ToolBox.instance.warpControl.SetWarps(warps.ToArray());
 }
Example #2
0
        public ModelBrowser(DeviceWrapper device)
        {
            this.device  = device;
            FormClosing += (_, __) => { __.Cancel = true; Hide(); };
            InitializeComponent();
            Shown += (_, __) =>
            {
                RunLoop();
                Render();
            };

            MouseWheel += (_, __) =>
            {
                if (Level.modelIDs.Count == 0)
                {
                    return;
                }
                if (current != null)
                {
                    current.MakeInvisible(renderer);
                }
                if (__.Delta > 0)
                {
                    while (!Level.modelIDs.TryGetValue((byte)(currentIndex = (currentIndex + 1) % 256), out current))
                    {
                        ;
                    }
                }
                else
                {
                    while (!Level.modelIDs.TryGetValue((byte)(currentIndex = (currentIndex + 255) % 256), out current))
                    {
                        ;
                    }
                }
                current.MakeVisible(renderer);
                lblModelID.Text = "Model ID: 0x" + currentIndex.ToString("X2") + " (" + currentIndex.ToString() + ")";
                needsRefresh    = true;
            };
        }