/// <summary> /// Hides the component given from being rendered. /// </summary> /// <param name="comp">The component to hide.</param> public void HideComponent(HudComponent comp) { if (!_hiddenComponents.Contains(comp)) { _hiddenComponents.Add(comp); } }
/// <summary> /// Unhides the component, and will render it again. /// </summary> /// <param name="comp">The component to stop hiding.</param> public void ShowComponent(HudComponent comp) { if (_hiddenComponents.Contains(comp)) { _hiddenComponents.Remove(comp); } }
public RheinwerkGame() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.IsFullScreen = false; // Fenstergrösse festlegen. graphics.PreferredBackBufferHeight = 2000; graphics.PreferredBackBufferWidth = 3000; // Objektinstanzen erzeugen Input = new InputComponent(this); Input.UpdateOrder = 0; Scene = new SceneComponent(this); Scene.UpdateOrder = 2; Scene.DrawOrder = 0; Simulation = new SimulationComponent(this); Simulation.UpdateOrder = 1; // Komponenten hinzufügen Components.Add(Input); Components.Add(Scene); Components.Add(Simulation); // Update Order bestimmt in welcher Reihenfolge die Komponenten gemalt werden Input.UpdateOrder = 0; Simulation.UpdateOrder = 1; Scene.UpdateOrder = 2; Hud = new HudComponent(this); Hud.UpdateOrder = 3; Hud.DrawOrder = 1; Components.Add(Hud); }
/// <summary> /// Unhides the component, and will render it again. /// </summary> /// <param name="comp">The component to stop hiding.</param> public void ShowComponent(HudComponent comp) { Screen.Hud.ShowComponentThisFrame(comp); if (_hiddenComponents.Contains(comp)) { _hiddenComponents.Remove(comp); } }
/// <summary> /// Hides the component given from being rendered. /// </summary> /// <param name="comp">The component to hide.</param> public void HideComponent(HudComponent comp) { Screen.Hud.HideComponentThisFrame(comp); if (!_hiddenComponents.Contains(comp)) { _hiddenComponents.Add(comp); } }
public RheinwerkGame() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; graphics.IsFullScreen = false; IsMouseVisible = true; Input = new InputComponent(this); Input.UpdateOrder = 0; Components.Add(Input); Screen = new ScreenComponent(this); Screen.UpdateOrder = 1; Screen.DrawOrder = 2; Components.Add(Screen); Local = new LocalComponent(this); Local.UpdateOrder = 2; Components.Add(Local); var client = new ClientComponent(this); Client = client; client.UpdateOrder = 3; Components.Add(client); var server = new ServerComponent(this); Server = server; server.UpdateOrder = 4; Components.Add(server); Simulation = new SimulationComponent(this); Simulation.UpdateOrder = 5; Components.Add(Simulation); Scene = new SceneComponent(this); Scene.UpdateOrder = 6; Scene.DrawOrder = 0; Components.Add(Scene); Hud = new HudComponent(this); Hud.UpdateOrder = 7; Hud.DrawOrder = 1; Components.Add(Hud); Music = new MusicComponent(this); Music.UpdateOrder = 8; Components.Add(Music); Sound = new SoundComponent(this); Sound.UpdateOrder = 9; Components.Add(Sound); // Einstellungen laden Settings = Settings.LoadSettings(); }
public void AddHudComponent(HudComponent hudComponent) { if (hudLayer != -1) { hudComponent.setLayer(hudLayer); } hudComponent.hud = this; hudComponent.transform.SetParent(transform, false); hudComponents.Add(hudComponent); }
public override void OnStart() { Unit unit = UnitFactory.CreateUnit(m_Res, m_ID, m_UnitType); unit.gameObject.name = "Unit_" + m_Name; unit.SetName(m_Name); unit.EulerAngles = m_EulerAngles; unit.Position = m_Position; unit.SetAttr(AttrType.Hp, m_Hp); unit.SetAttr(AttrType.HpMax, m_HpMax); HudComponent hudComponent = unit.gameObject.AddComponent <HudComponent>(); hudComponent.SetOwner(unit); Node.Status = ENodeStatus.Succeed; }
public RheinWerkGameWindows() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; Input = new InputComponent(this); Input.UpdateOrder = 0; Components.Add(Input); Simulation = new SimulationComponent(this); Simulation.UpdateOrder = 1; Components.Add(Simulation); Scene = new SceneComponent(this); Scene.UpdateOrder = 2; Components.Add(Scene); Hud = new HudComponent(this); Hud.UpdateOrder = 3; Hud.DrawOrder = 1; Components.Add(Hud); }
// Update is called once per frame void Update() { for (int i = 0; i < 4; i++) { if (i > characters.Count - 1) { huds [i].SetActive(false); } else { huds [i].SetActive(true); RLCharacter c = characters [i]; HudComponent hc = huds [i].GetComponent <HudComponent> (); hc.portrait.GetComponent <SpriteRenderer> ().sprite = GetSprite(c.name); for (int h = 0; h < 4; h++) { if (c.health > h) { hc.hearts [h].GetComponent <SpriteRenderer> ().sprite = GetSprite("health"); } else { hc.hearts [h].GetComponent <SpriteRenderer> ().sprite = GetSprite("health_empty"); } } for (int h = 0; h < 5; h++) { if (c != null && c.GetComponent <ActionCounter>().actionsRemaining > h) { hc.potions [h].GetComponent <SpriteRenderer> ().sprite = GetSprite("action"); } else { hc.potions [h].GetComponent <SpriteRenderer> ().sprite = GetSprite("action_empty"); } } } } }
/// <summary> /// Draws the specified <see cref="HudComponent"/> this frame. /// </summary> /// <param name="component">The <see cref="HudComponent"/></param> ///<remarks>This will only draw the <see cref="HudComponent"/> if the <see cref="HudComponent"/> can be drawn</remarks> public static void ShowComponentThisFrame(HudComponent component) { Function.Call(Hash.SHOW_HUD_COMPONENT_THIS_FRAME, component); }
/// <summary> /// Check if a certain component is visible /// </summary> public bool IsHudComponentVisible(HudComponent component) { return(MtaClient.IsPlayerHudComponentVisible(component.ToString().ToLower())); }
/// <summary> /// Set the visibility of a Hud component /// </summary> public bool SetHudComponentVisible(HudComponent component, bool visible) { return(MtaClient.SetPlayerHudComponentVisible(component.ToString().ToLower(), visible)); }
/// <summary> /// Hides the specified <see cref="HudComponent"/> this frame. /// </summary> /// <param name="component">The <see cref="HudComponent"/> to hide.</param> public static void HideComponentThisFrame(HudComponent component) { NativeFunction.Natives.HIDE_HUD_COMPONENT_THIS_FRAME((int)component); }
public UiElement(HudComponent hud) { Hud = hud; }
public static void HideHudComponentThisFrame(HudComponent component) => Function.Call(Hash.HIDE_HUD_COMPONENT_THIS_FRAME, (InputArgument)(Enum)component);
public PanelControl(HudComponent hud) : base(hud) { Tiles = true; }
public MenuItemHudComponent(Client client, Menu owner, string label, HudComponent comp, bool isChecked = false, int priority = -1) : base(client, owner, label, isChecked, priority) { Component = comp; IsChecked = () => !DisabledComponents.Contains(Component); }
/// <summary> /// Set the visibility of a Hud component /// </summary> public bool SetHudComponentVisible(HudComponent component, bool visible) { return(MtaServer.SetPlayerHudComponentVisible(element, component.ToString().ToLower(), visible)); }
public Control(HudComponent hud) { Hud = hud; Enabled = true; Visible = true; }
public Screen(HudComponent hud) : base(hud) { RequiresPointer = true; }
public MiniMap(HudComponent hud) : base(hud) { }
public static void ShowHudComponentThisFrame(HudComponent component) { InputArgument[] arguments = new InputArgument[] { component }; Function.Call(Hash.SHOW_HUD_COMPONENT_THIS_FRAME, arguments); }
public static bool IsHudComponentActive(HudComponent component) { InputArgument[] arguments = new InputArgument[] { component }; return(Function.Call <bool>(Hash.IS_HUD_COMPONENT_ACTIVE, arguments)); }
protected override void OnUpdate() { base.OnUpdate(); if (!this.m_OrigPosInitialised) { this.StoreControlsOrigPositions(); this.UpdateControlsPosition(); this.m_OrigPosInitialised = true; } float num = TimeManager.TimeSinceLevelLoad(true); bool flag = (this.Last400msUpdate < 1E-05f) || ((num - this.Last400msUpdate) >= 0.4f); int length = this.m_HudComponents.Length; float realDeltaTime = TimeManager.RealDeltaTime; for (int i = 0; i < length; i++) { HudComponent component = this.m_HudComponents[i] as HudComponent; if ((component != null) && component.IsEnabled()) { component.HudUpdate(realDeltaTime); float num5 = num - this.m_Last100msUpdate[i]; bool flag2 = num5 >= 0.1f; if (flag2) { component.HudUpdate100ms(); } if (flag) { component.HudUpdate400ms(); } if (flag2) { num5 -= ((float)Mathf.FloorToInt(num5 * 10f)) / 10f; this.m_Last100msUpdate[i] = num - num5; } } } if (flag) { float num6 = (num - this.Last400msUpdate) - 0.4f; if ((num6 > 0.4f) || (num6 < 0f)) { this.Last400msUpdate = num; } else { this.Last400msUpdate = num - num6; } if (InputManager.IsGamepadConnected) { this.hudActions.Enable(HudComponent.EnableLayer.Gamepad, false); this.hudMoveControl.Enable(HudComponent.EnableLayer.Gamepad, false); } else { this.hudActions.Enable(HudComponent.EnableLayer.Gamepad, true); this.hudMoveControl.Enable(HudComponent.EnableLayer.Gamepad, true); } } if (Game.Instance != null) { if (NvidiaShield.IsShield() || (this.NoTouchForSec(10f) && UnityGpad.IsGamepadConnectedCached())) { this.EnableActionControls(false); } else { this.EnableActionControls(true); } } }
/// <summary> /// Determines whether a given <see cref="HudComponent"/> is active. /// </summary> /// <param name="component">The <see cref="HudComponent"/> to check</param> /// <returns><c>true</c> if the <see cref="HudComponent"/> is active; otherwise, <c>false</c></returns> public static bool IsComponentActive(HudComponent component) { return(Function.Call <bool>(Hash.IS_HUD_COMPONENT_ACTIVE, component)); }
public Toolbar(HudComponent hud) : base(hud) { }
/// <summary> /// Draws the specified <see cref="HudComponent"/> this frame. /// </summary> /// <param name="component">The <see cref="HudComponent"/></param> ///<remarks>This will only draw the <see cref="HudComponent"/> if the <see cref="HudComponent"/> can be drawn</remarks> public static void ShowComponentThisFrame(HudComponent component) { API.ShowHudComponentThisFrame((int)component); }
/// <summary> /// Hides the specified <see cref="HudComponent"/> this frame. /// </summary> /// <param name="component">The <see cref="HudComponent"/> to hide.</param> public static void HideComponentThisFrame(HudComponent component) { Function.Call(Hash.HIDE_HUD_COMPONENT_THIS_FRAME, component); }
public DebugInfos(HudComponent hud) : base(hud) { framebuffer = new float[buffersize]; }
/// <summary> /// Determines whether a given <see cref="HudComponent"/> is Active. /// </summary> /// <param name="component">The <see cref="HudComponent"/> to check</param> /// <returns><c>true</c> if the <see cref="HudComponent"/> is Active; otherwise, <c>false</c></returns> public static bool IsComponentActive(HudComponent component) { return(API.IsHudComponentActive((int)component)); }
public InventoryScreen(HudComponent hud) : base(hud) { }
/// <summary> /// Hides the specified <see cref="HudComponent"/> this frame. /// </summary> /// <param name="component">The <see cref="HudComponent"/> to hide.</param> public static void HideComponentThisFrame(HudComponent component) { API.HideHudComponentThisFrame((int)component); }
public Compass(HudComponent hud) : base(hud) { }
public static bool IsHudComponentActive(HudComponent component) => Function.Call <bool>(Hash.IS_HUD_COMPONENT_ACTIVE, (InputArgument)(Enum)component);
/// <summary> /// Determines whether a given <see cref="HudComponent"/> is active. /// </summary> /// <param name="component">The <see cref="HudComponent"/> to check</param> /// <returns><c>true</c> if the <see cref="HudComponent"/> is active; otherwise, <c>false</c></returns> public static bool IsComponentActive(HudComponent component) { return(NativeFunction.Natives.IS_HUD_COMPONENT_ACTIVE <bool>((int)component)); }
public static HudComponentVisiblePacket CreateShowHudComponentPacket(HudComponent hudComponent, bool show) { return(new HudComponentVisiblePacket((byte)hudComponent, show)); }
public Control(HudComponent hud) : base(hud) { Enabled = true; Visible = true; }