示例#1
0
        // FUTURE: Refactor into Core for Hud edits
        private static void Start_On(HooksCore.RoR2.CameraRigController.Start.Orig orig, CameraRigController self)
        {
            orig(self);

            _ = self.sceneCam.gameObject.AddComponent <ScopeOverlayShaderController>();

            if (self.hud == null)
            {
                return;
            }

            GameObject reloadBar = UIModule.GetRelodBar();


            //LogTransform(self.hud.transform, 0);

            Transform par      = self.hud.transform.Find("MainContainer/MainUIArea/SpringCanvas/BottomCenterCluster");
            var       barTrans = reloadBar.transform as RectTransform;

            barTrans.SetParent(par, false);
            barTrans.localPosition = new Vector3(0f, 256f, 0f);
            barTrans.localScale    = new Vector3(0.5f, 0.5f, 1f);

            //LogTransform(self.hud.transform, 0);
        }
示例#2
0
        private void Start_On1(HooksCore.RoR2.CameraRigController.Start.Orig orig, CameraRigController self)
        {
            orig(self);

            if (self.hud != null)
            {
                var par = self.hud.transform.Find("MainContainer/MainUIArea/BottomRightCluster/Scaler");
                if (this.chargeBarEnabled.Value)
                {
                    GameObject    inst     = Instantiate <GameObject>(wispHudPrefab, par);
                    RectTransform bar3Rect = inst.GetComponent <RectTransform>();
                    bar3Rect.anchoredPosition = new Vector2(14f, 140f);
                    bar3Rect.sizeDelta        = new Vector2(310f, 32f);
                    bar3Rect.anchorMin        = new Vector2(0.5f, 0.5f);
                    bar3Rect.anchorMax        = new Vector2(0.5f, 0.5f);
                    bar3Rect.pivot            = new Vector2(0.5f, 0.5f);
                    bar3Rect.localEulerAngles = Vector3.zero;
                    bar3Rect.localScale       = Vector3.one;
                }



                Transform par2 = self.hud.transform.Find("MainContainer/MainUIArea/CrosshairCanvas");

                GameObject cross1 = Instantiate <GameObject>(wispCrossBar1, par2);

                RectTransform bar1Rect = cross1.GetComponent <RectTransform>();

                GameObject cross2 = Instantiate <GameObject>(wispCrossBar2, par2);

                RectTransform bar2Rect = cross2.GetComponent <RectTransform>();


                bar1Rect.anchoredPosition = new Vector2(96f, 0f);
                bar2Rect.anchoredPosition = new Vector2(-96f, 0f);

                bar1Rect.sizeDelta = new Vector2(256f, 128f);
                bar2Rect.sizeDelta = new Vector2(256f, 128f);

                bar1Rect.anchorMin = new Vector2(0.5f, 0.5f);
                bar2Rect.anchorMin = new Vector2(0.5f, 0.5f);

                bar1Rect.anchorMax = new Vector2(0.5f, 0.5f);
                bar2Rect.anchorMax = new Vector2(0.5f, 0.5f);

                bar1Rect.pivot = new Vector2(0.5f, 0.5f);
                bar2Rect.pivot = new Vector2(0.5f, 0.5f);

                bar1Rect.localEulerAngles = new Vector3(0f, 0f, -90f);
                bar2Rect.localEulerAngles = new Vector3(0f, 0f, 90f);

                bar1Rect.localScale = Vector3.one * 0.125f;
                bar2Rect.localScale = Vector3.one * 0.125f;
            }
        }
示例#3
0
 private void Start_On(HooksCore.RoR2.CameraRigController.Start.Orig orig, CameraRigController self)
 {
     orig(self);
     if (self.hud)
     {
         HUDBossHealthBarController oldBoss = self.hud.GetComponentInChildren <HUDBossHealthBarController>();
         if (oldBoss)
         {
             oldBoss.gameObject.AddComponent <ImprovedBossHealthBarController>();
         }
     }
 }