private static void Postfix(uGUI_SceneHUD __instance) { initialized = (bool)SceneHud_initialized.GetValue(__instance); if (!preInitialized && initialized) { Logger.Log("HUD Initialize"); var hudContentRoot = __instance.transform.Find("Content"); if (hudContentRoot == null) { Logger.Error("Could not find HUD Content Root!"); return; } foreach (var entry in Mod.config.HudElements) { var element = hudContentRoot.Find(entry.Name) as RectTransform; if (element == null) { Logger.Error($"Could not find HUD element named ({entry.Name})"); continue; } element.localScale = new Vector3(entry.Scale, entry.Scale); element.anchoredPosition += new Vector2(entry.XOffset, entry.YOffset); } } }
static void Postfix(uGUI_SceneHUD __instance) { sceneHUD = __instance;//keep a reference to the sceneHUD AddHUDElement("BarsPanel"); AddHUDElement("QuickSlots"); AddHUDElement("SunbeamCountdown"); UpdateHUDOpacity(AdditionalVROptions.HUDAlpha); UpdateHUDDistance(AdditionalVROptions.HUD_Distance); UpdateHUDScale(AdditionalVROptions.HUD_Scale); }
public static void SceneHUD_Update_Postfix(uGUI_SceneHUD __instance) { if (MainPatcher.lookDownHUD) { if (Player.main != null && Vector3.Angle(MainCamera.camera.transform.forward, Player.main.transform.up) < 120f) { MainPatcher.ConfigureHUD(0.0f); return; } } MainPatcher.ConfigureHUD(1.0f); }
public static void Player_Awake_Postfix(uGUI_SceneHUD __instance) { foreach (KeyValuePair <string, HUDElementConfig> HUDElement in MainPatcher.HUDElements) { HUDElement.Value.Object = GameObject.Find(HUDElement.Key); if (HUDElement.Value.Object != null) { HUDElement.Value.OriginalLocation = HUDElement.Value.Object.transform.localPosition; } } MainPatcher.ConfigureHUD(1.0f); }
public static void SceneHUD_Update_Postfix(uGUI_SceneHUD __instance) { if (MainPatcher.lookDownHUD && MainPatcher.quickSlots != null && MainPatcher.barsPanel != null) { if (Player.main != null && Vector3.Angle(MainCamera.camera.transform.forward, Player.main.transform.up) < 120f) { MainPatcher.quickSlots.transform.localScale = Vector3.zero; MainPatcher.barsPanel.transform.localScale = Vector3.zero; return; } MainPatcher.quickSlots.transform.localScale = Vector3.one; MainPatcher.barsPanel.transform.localScale = Vector3.one; } }
public static bool GameModeChanged(GameModeOption gameMode, uGUI_SceneHUD __instance) { ResetHUD.Invoke(__instance, EmptyParams); _mode.SetValue(__instance, 2); foreach (var _show in _shows) { _show.SetValue(__instance, true); } UpdateElements.Invoke(__instance, EmptyParams); return(false); }
static void Postfix(uGUI_SceneHUD __instance) { if (AdditionalVROptions.DynamicHUD) { if (MainCamera.camera) { //fades the hud in based on the angle that the player is looking in. Straight up is 270 and forward is 360/0 if (MainCamera.camera.transform.localEulerAngles.x < 180) { UpdateHUDOpacity(Mathf.Clamp((MainCamera.camera.transform.localEulerAngles.x - 30) / 20, 0, 1) * AdditionalVROptions.HUDAlpha); } else { UpdateHUDOpacity(0); } } } }
private static bool Prefix(uGUI_SceneHUD __instance) { preInitialized = (bool)SceneHud_initialized.GetValue(__instance); return(true); }
public static void Player_Awake_Postfix(uGUI_SceneHUD __instance) { MainPatcher.barsPanel = GameObject.Find("BarsPanel"); MainPatcher.quickSlots = GameObject.Find("QuickSlots"); VROptions.disableInputPitch = false; }
// Token: 0x06000010 RID: 16 RVA: 0x00002E9F File Offset: 0x0000109F public static void Player_Awake_Postfix(uGUI_SceneHUD __instance) { MainPatcher.barsPanel = GameObject.Find("BarsPanel"); MainPatcher.quickSlots = GameObject.Find("QuickSlots"); }