示例#1
0
        public override void Init(HUDCenterController Controller)
        {
            base.Init(Controller);

            EVROverlayError overlayError;

            if (this.IsDashboardWidget)
            {
                //If this is a Dashboard Widget, Create a Thumbnail item
                Thumbnail = new Handlable(this.Key + this.Name + "_Thumbnail");

                if (this.ThumbnailPath.Exists)
                {
                    OpenVR.Overlay.SetOverlayFromFile(Thumbnail.Handle, ThumbnailPath.FullName);
                }
                else
                {
                    OpenVR.Overlay.SetOverlayFromFile(Thumbnail.Handle, null);
                }

                overlayError = OpenVR.Overlay.CreateDashboardOverlay(this.Key, this.Name, ref this.Handle, ref this.Thumbnail.Handle);
            }
            else
            {
                overlayError = OpenVR.Overlay.CreateOverlay(this.Key, this.Name, ref this.Handle);
            }

            //Check if there's any error while initializing the overlay
            if (overlayError != EVROverlayError.None)
            {
                throw new Exception(overlayError.ToString());
            }

            SetOverlaySize(Width);
            SetOverlayInputMethod(InputMethod);
            Start();
        }
示例#2
0
 public bool Equals(Handlable item)
 {
     return(this.Key.Equals(item.Key));
 }