static int FindChild(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1);
         string arg1             = ToLua.CheckString(L, 2);
         UnityEngine.Transform o = TransformUtils.FindChild(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Beispiel #2
0
        public static void HudVisibility(HUD.orig_Awake orig, RoR2.UI.HUD self)
        {
            orig(self);

            var parent = self.healthBar.transform.parent;

            var levelDisplayCluster = TransformUtils.FindChild(parent, "LevelDisplayCluster");
            var buffRoot            = TransformUtils.FindChild(levelDisplayCluster, "BuffDisplayRoot");
            var levelRoot           = TransformUtils.FindChild(levelDisplayCluster, "LevelDisplayRoot");
            var expBarRoot          = TransformUtils.FindChild(levelDisplayCluster, "ExpBarRoot");

            var healthBarRoot = TransformUtils.FindChild(parent, "HealthbarRoot");

            if (!PlayerConfiguration.ShowPlayerStats.Value)
            {
                parent.GetComponent <Image>().enabled = false;
                levelRoot.gameObject.SetActive(false);
                expBarRoot.gameObject.SetActive(false);
                healthBarRoot.gameObject.SetActive(false);
            }

            RoR2.UI.BuffDisplay buffDisplay = buffRoot.GetComponent <RoR2.UI.BuffDisplay>();
            buffDisplay.gameObject.SetActive(PlayerConfiguration.ShowBuffs.Value);

            self.itemInventoryDisplay.gameObject.SetActive(PlayerConfiguration.ShowItems.Value);
            self.objectivePanelController.gameObject.SetActive(PlayerConfiguration.ShowObjectives.Value);
            self.lunarCoinContainer.transform.parent.gameObject.SetActive(PlayerConfiguration.ShowMoney.Value);

            if (!PlayerConfiguration.ShowSkills.Value)
            {
                for (int i = 0; i < self.skillIcons.Length; i++)
                {
                    self.skillIcons[i].transform.parent.gameObject.SetActive(false);
                }
            }
        }