// Sets all buttons to false and defaults to controls screen. void Start() { ControlsImage.SetActive(false); MovementImage.GetComponent <MeshRenderer>().enabled = false; ShootingImage.GetComponent <MeshRenderer>().enabled = false; ShieldImage.GetComponent <MeshRenderer>().enabled = false; MeleeImage.GetComponent <MeshRenderer>().enabled = false; FlagImage.GetComponent <MeshRenderer>().enabled = false; TeamAImage.GetComponent <MeshRenderer>().enabled = false; MovementButton.SetActive(false); ShootingButton.SetActive(false); ShieldButton.SetActive(false); MeleeButton.SetActive(false); FlagButton.SetActive(false); TeamAButton.SetActive(false); ModesText.SetActive(false); MovementText.SetActive(false); ShootingText.SetActive(false); ShieldText.SetActive(false); MeleeText.SetActive(false); FlagText.SetActive(false); TeamAText.SetActive(false); ControlsButtonPress(); }
public void MechanicsButtonPress() { MovementImage.GetComponent <MeshRenderer>().enabled = true; MovementImage.GetComponent <MovieScript>().PlayMovie(); ControlsImage.SetActive(false); ModesText.SetActive(false); ShootingImage.GetComponent <MeshRenderer>().enabled = false; ShieldImage.GetComponent <MeshRenderer>().enabled = false; MeleeImage.GetComponent <MeshRenderer>().enabled = false; FlagImage.GetComponent <MeshRenderer>().enabled = false; TeamAImage.GetComponent <MeshRenderer>().enabled = false; MovementButton.SetActive(true); ShootingButton.SetActive(true); ShieldButton.SetActive(true); MeleeButton.SetActive(true); FlagButton.SetActive(true); TeamAButton.SetActive(true); MovementText.SetActive(true); ModesText.SetActive(false); ShootingText.SetActive(false); ShieldText.SetActive(false); MeleeText.SetActive(false); FlagText.SetActive(false); TeamAText.SetActive(false); }
private void ValidateFlagButtonIsInGroup(FlagButton flagButton) { if (flagButton == null || !m_FlagButtons.Contains(flagButton)) { throw new ArgumentException(string.Format("FlagButton {0} is not part of FlagButtonGroup {1}", new object[] { flagButton, this })); } }
/// <summary> /// Register a flagButton with the flagButton group so it is watched for changes and notified if another flagButton in the group changes. /// </summary> /// <param name="flagButton">The flagButton to register with the group.</param> public void RegisterFlagButton(FlagButton flagButton) { if (!m_FlagButtons.Contains(flagButton)) { m_FlagButtons.Add(flagButton); UpdateSelectablesNavigation(); } }
/// <summary> /// Unregister a flagButton from the group. /// </summary> /// <param name="flagButton">The flagButton to remove.</param> public void UnregisterFlagButton(FlagButton flagButton) { if (m_FlagButtons.Contains(flagButton)) { m_FlagButtons.Remove(flagButton); UpdateSelectablesNavigation(); } }
/// <summary> /// Notify the group that the given flagButton is enabled. /// </summary> /// <param name="flagButton">The flagButton that got triggered on.</param> /// <param name="sendCallback">If other flagButtons should send onValueChanged.</param> public void NotifyFlagButtonOn(FlagButton flagButton, bool sendCallback = true) { ValidateFlagButtonIsInGroup(flagButton); // disable all flagButtons in the group for (var i = 0; i < m_FlagButtons.Count; i++) { if (m_FlagButtons[i] == flagButton) { continue; } if (sendCallback) { m_FlagButtons[i].isOn = false; } else { m_FlagButtons[i].SetIsOnWithoutNotify(false); } } }
public static void clear() { m_button = 0; }
public static bool check(FlagButton f) { return((m_button & f) != 0); }
public static void reset(FlagButton f) { m_button &= ~f; }
public static void set(FlagButton f) { m_button |= f; }
public MainScreen(Manager manager) { base.manager = manager; if (Layout.ScreenFormat == ScreenFormat.Format4X3) { flag = new Flag(new Vector3(1, 1, 0.01f), new Vector3(1.2f, 2, 1), EngineContent.GetTextureByName(Game.GameStrings.GetString("Title")), new Rectangle(430, 85, 520, 140)); flag.Create(); Edit edit = new Edit(new Rectangle(690, 660, 120, 40), "edtName", Game.GameStrings.GetString("DefaultName")); Panel panel = new Panel(new Rectangle(0, 0, 1024, 768), "portada", Aligment.Left); Button button = new Button(new Rectangle(830, 660, 100, 40), Game.GameStrings.GetString("Enter"), new MouseClick(base.EnterSetupScreen)); Label textInsertar = new Label(Game.GameStrings.GetString("InsertName"), new Vector2(730, 622), Sprite.SpriteFont); FlagButton languageSpanish = new FlagButton(new Rectangle(80, 642, 100, 50), SelectSpanish, new Vector3(-5.55f, -5.1f, -15), Game.GameStrings.GetString("Spanish"), "espanna"); FlagButton languageEnglish = new FlagButton(new Rectangle(200, 642, 100, 50), SelectEnglish, new Vector3(-3.6f, -5.1f, -15), Game.GameStrings.GetString("English"), "uk"); Label textLanguage = new Label(Game.GameStrings.GetString("SelectLanguage"), new Rectangle(82, 622, 218, 20), Sprite.SpriteFont, Aligment.Center); base.AddControl(panel); base.AddControl(textInsertar); base.AddControl(button); base.AddControl(edit); base.AddControl(languageSpanish); base.AddControl(languageEnglish); base.AddControl(textLanguage); } else { flag = new Flag(new Vector3(1, 1, 0.01f), new Vector3(1.2f, 2, 1), EngineContent.GetTextureByName(Game.GameStrings.GetString("Title")), Layout.CalculateTotalLayout(new Rectangle(538, 79, 520, 140))); flag.Create(); Edit edit = new Edit(Layout.CalculateTotalLayout(new Rectangle(940, 612, 120, 40)), "edtName", Game.GameStrings.GetString("DefaultName")); Panel panel = new Panel(Layout.CalculateTotalLayout(new Rectangle(0, 0, 1280, 720)), "portada", Aligment.Left); Button button = new Button(Layout.CalculateTotalLayout(new Rectangle(1080, 612, 100, 40)), Game.GameStrings.GetString("Enter"), new MouseClick(base.EnterSetupScreen)); Label textInsertar = new Label(Game.GameStrings.GetString("InsertName"), Layout.CalculateLayoutXY(980, 574), Sprite.SpriteFont); FlagButton languageSpanish = new FlagButton(Layout.CalculateTotalLayout(new Rectangle(80, 596, 100, 50)), SelectSpanish, new Vector3(-5.55f, -5.1f, -15), Game.GameStrings.GetString("Spanish"), "espanna"); FlagButton languageEnglish = new FlagButton(Layout.CalculateTotalLayout(new Rectangle(200, 596, 100, 50)), SelectEnglish, new Vector3(-3.6f, -5.1f, -15), Game.GameStrings.GetString("English"), "uk"); Label textLanguage = new Label(Game.GameStrings.GetString("SelectLanguage"), Layout.CalculateTotalLayout(new Rectangle(82, 574, 218, 20)), Sprite.SpriteFont, Aligment.Center); base.AddControl(panel); base.AddControl(textInsertar); base.AddControl(button); base.AddControl(edit); base.AddControl(languageSpanish); base.AddControl(languageEnglish); base.AddControl(textLanguage); } }
public static bool check(FlagButton f) { return ((m_button & f) != 0); }