IEnumerator ShowAlertPanel(string title, string message = "") { //Debug.Log ("ShowAlertPanel: " + title); HomeScreenController home = GameObject.FindObjectOfType <HomeScreenController>(); // stage.GetComponent<Canvas>().referencePixelsPerUnit = 326; yield return(new WaitForSeconds(1.0f)); yield return(new WaitForEndOfFrame()); if (String.IsNullOrEmpty(message)) { message = "Your user information is incomplete. Make sure you have your user profile updated.\n\nPlease close window and restart again. "; } GameObject subScreen = (GameObject)Instantiate(Resources.Load("HomeScreen/AlertPanel")); yield return(subScreen); _alertPanel = subScreen.GetComponent <AlertPanel>(); _alertPanel.title.text = title; _alertPanel.description.text = message; _alertPanel.GetComponent <CanvasGroup>().alpha = 0; _alertPanel.gameObject.transform.SetParent(home.transform, false); _alertPanel.GetComponent <FadeMe>().startFadeIn(0.6f); }
private void HideMenus() { questPanel = FindObjectOfType <QuestSystem.QuestPanel>(); inventoryPanels = FindObjectsOfType <UIInventory>(); battleSummaryPanel = FindObjectOfType <BattleSummaryPanel>(); alertPanel = FindObjectOfType <AlertPanel>(); if (questPanel != null) { questPanel.gameObject.SetActive(false); } if (inventoryPanels != null) { foreach (UIInventory panel in inventoryPanels) { panel.gameObject.SetActive(false); } } if (battleSummaryPanel != null) { battleSummaryPanel.gameObject.SetActive(false); } if (alertPanel != null) { alertPanel.gameObject.SetActive(false); } }
protected override void Awake() { //Debug.Log(name + "Awake"); base.Awake(); Instance = this; cancelButton.onClick.AddListener(ClosePanel); }
void HideAlertPanel() { //print("HideAlertPanel ------------------------------------"); DestroyImmediate(_alertPanel.gameObject); _alertPanel = null; }
void initAlerts() { AlertPanel = GameObject.Find("AlertPanel"); alertTitle = GameObject.Find("AlertTitle").GetComponent <Text>(); alertBody = GameObject.Find("AlertBody").GetComponent <Text>(); alertButtonOK = GameObject.Find("AlertButtonOK"); alertButtonCancel = GameObject.Find("AlertButtonCancel"); AlertPanel.SetActive(false); }
public MainGameScreen() { mapPanel = new MapPanel(SizeC(0), SizeC(0), WidthMinus(10), HeightMinus(0)); menuPanel = new MenuPanel(WidthMinus(10), SizeC(0), SizeC(10), HeightMinus(0)); alertPanel = new AlertPanel(HalfWidth(), HalfHeight(), "I'm an overlay! Press a key to toggle me!"); addPanel(mapPanel); addPanel(menuPanel); addPanel(alertPanel); }
public void ACTION_SKIP_ACCOUNT() { ButtonHelper.Clicked(); GameController.disableOnline = true; OnlineManager.UserData.EmailID = "*****@*****.**"; OnlineManager.UserData.Password = "******"; StartCoroutine(onlineManager.Login()); AlertPanel.DismissPanel(); ButtonHelper.ResetClick(); }
// Use this for initialization void Start() { healthBar = transform.Find("HealthPanel/HealthBarBack/HealthBar").GetComponent <RectTransform>(); healthText = transform.Find("HealthPanel/HealthBarBack/HealthText").GetComponent <Text>(); scrapCount = transform.Find("HealthPanel/MaterialsPanel/ScrapCount").GetComponent <Text>(); energyCount = transform.Find("HealthPanel/MaterialsPanel/EnergyCount").GetComponent <Text>(); wireCount = transform.Find("HealthPanel/MaterialsPanel/WireCount").GetComponent <Text>(); itemsPanel = transform.Find("Items").GetComponent <RectTransform>(); scoreText = transform.Find("ScorePanel/Score").GetComponent <Text> (); ammoCount = transform.Find("AmmoCount/AmmoText").GetComponent <Text> (); reloadMask = transform.Find("AmmoCount/ReloadMask").GetComponent <RectTransform> (); craftingMenu = transform.Find("CraftingManager").GetComponent <AssemblyCSharp.CraftingManager> (); craftingMenuOpen = false; alertDisplay = transform.Find("AlertDisplay").GetComponent <AlertPanel>(); isReloading = false; reloadMaskHeight = reloadMask.rect.height; // Find the references for each inventory item panel Transform hotbarParent = transform.Find("Items/Hotbar"); Transform inventoryParent = transform.Find("Items/Inventory"); inventoryItems = new Transform[hotbarParent.childCount + inventoryParent.childCount]; for (int i = 0; i < inventoryItems.Length; i++) { if (i < hotbarParent.childCount) { inventoryItems [i] = hotbarParent.GetChild(i); } else { inventoryItems [i] = inventoryParent.GetChild(i - 6); } UI_Item selectable = inventoryItems [i].GetComponentInChildren <UI_Item>(); selectable.parent = this; selectable.index = i; } tooltipPanel = transform.Find("ItemTooltip").GetComponent <RectTransform>(); tooltip = tooltipPanel.GetComponent <UI_Tooltip> (); tooltipPanel.gameObject.SetActive(false); GameObject playerObj = GameObject.Find("Player"); player = playerObj.GetComponent <PlayerManager>(); playerUse = playerObj.GetComponent <PlayerUse> (); inventory = playerObj.GetComponent <Inventory> (); inventoryOpen = false; inventorySelectedIndex = -1; }
public void UnlockSlot(int index) { if (index == 0) { if (IngameManager.Instance.Data.Money < 100) { AlertPanel.SetActive(true); } else { IngameManager.Instance.Data.Money -= 100; Units[1].Data.Unlocked = true; Units[1].Activate(); AddonSlotPurchased[index].SetActive(true); } } else if (index == 1) { if (IngameManager.Instance.Data.Money < 100) { AlertPanel.SetActive(true); } else { IngameManager.Instance.Data.Money -= 100; Units[2].Data.Unlocked = true; Units[2].Activate(); AddonSlotPurchased[index].SetActive(true); } } else if (index == 2) { if (IngameManager.Instance.Data.Money < 100) { AlertPanel.SetActive(true); } else { IngameManager.Instance.Data.Money -= 100; Units[4].Data.Unlocked = true; Units[4].Activate(); AddonSlotPurchased[index].SetActive(true); } } }
public SongPurchaseState TryPurchase(SongData data) { if (IngameManager.Instance.Data.Money < data.Cost) { AlertPanel.SetActive(true); return(SongPurchaseState.Failed); } else { IngameManager.Instance.Data.Money -= data.Cost; data.Index = IngameManager.Instance.Data.CurrentSongIndex; IngameManager.Instance.Data.Songs.Add(IngameManager.Instance.Data.CurrentSongIndex++, data); data.SetAsEarned(); SongPicker.Instance.LoadCard(IngameManager.Instance.Data.Songs[data.Index]); IngameManager.Instance.SongList.LoadCard(IngameManager.Instance.Data.Songs[data.Index]); return(SongPurchaseState.Succeed); } }
void Awake() { _instance = this; }
void Awake() { _instance = this; this.Hide(); }
private void PopulateLabels() { Title = SiteUtils.FormatPageTitle(siteSettings, Resource.PasswordRecoveryTitle); MetaDescription = Server.HtmlEncode(string.Format(CultureInfo.InvariantCulture, Resource.RecoverPasswordMetaDescriptionFormat, siteSettings.SiteName)); if (Request.IsAuthenticated) { pnlRecoverPassword.Visible = false; AlertPanel alertPanel = new AlertPanel { SkinID = "Error" }; Literal litMessage = new Literal(); litMessage.Text = Resource.PasswordRecoveryNotAllowedWhenAuthenticated; alertPanel.Controls.Add(litMessage); phMessage.Controls.Add(alertPanel); } EnterUserNameLabel = (Label)this.PasswordRecovery1.UserNameTemplateContainer.FindControl("lblEnterUserName"); if (EnterUserNameLabel != null) { if ((siteSettings != null) && (siteSettings.UseEmailForLogin)) { EnterUserNameLabel.Text = Resource.EnterEmailLabel; } else { EnterUserNameLabel.Text = Resource.EnterUserNameLabel; } } // UserName template Button userNameNextButton = (Button)PasswordRecovery1.UserNameTemplateContainer.FindControl("SubmitButton"); if (userNameNextButton != null) { userNameNextButton.Text = Resource.PasswordRecoveryNextButton; SiteUtils.SetButtonAccessKey(userNameNextButton, AccessKeys.PasswordRecoveryAccessKey); } RequiredFieldValidator reqUserName = (RequiredFieldValidator)PasswordRecovery1.UserNameTemplateContainer.FindControl("UserNameRequired"); if (reqUserName != null) { reqUserName.ErrorMessage = Resource.PasswordRecoveryUserNameRequiredWarning; } // Question Template Button questionNextButton = (Button)PasswordRecovery1.QuestionTemplateContainer.FindControl("SubmitButton"); if (questionNextButton != null) { questionNextButton.Text = Resource.PasswordRecoveryNextButton; SiteUtils.SetButtonAccessKey(questionNextButton, AccessKeys.PasswordRecoveryAccessKey); } RequiredFieldValidator reqAnswer = (RequiredFieldValidator)PasswordRecovery1.QuestionTemplateContainer.FindControl("AnswerRequired"); if (reqAnswer != null) { reqAnswer.ErrorMessage = Resource.PasswordRecoveryAnswerRequired; } this.PasswordRecovery1.GeneralFailureText = Resource.PasswordRecoveryGeneralFailureText; this.PasswordRecovery1.QuestionFailureText = Resource.PasswordRecoveryQuestionFailureText; this.PasswordRecovery1.UserNameFailureText = Resource.PasswordRecoveryUserNameFailureText; this.PasswordRecovery1.MailDefinition.From = siteSettings.DefaultEmailFromAddress; this.PasswordRecovery1.MailDefinition.Subject = string.Format(Resource.PasswordRecoveryEmailSubjectFormatString, siteSettings.SiteName); string emailFilename; if (Membership.Provider.PasswordFormat == MembershipPasswordFormat.Hashed) { emailFilename = ResourceHelper.GetFullResourceFilePath( System.Globalization.CultureInfo.CurrentUICulture, this.GetEmailTemplatesFolder(), WebConfigSettings.HashedPasswordRecoveryEmailTemplateFileNamePattern); this.PasswordRecovery1.MailDefinition.BodyFileName = string.IsNullOrEmpty(emailFilename) ? this.PasswordRecovery1.MailDefinition.BodyFileName = Server.MapPath("~/Data/MessageTemplates/" + SiteUtils.GetDefaultUICulture() + "-" + WebConfigSettings.HashedPasswordRecoveryEmailTemplateFileNamePattern) : emailFilename; } else { emailFilename = ResourceHelper.GetFullResourceFilePath( System.Globalization.CultureInfo.CurrentUICulture, this.GetEmailTemplatesFolder(), WebConfigSettings.PasswordRecoveryEmailTemplateFileNamePattern); this.PasswordRecovery1.MailDefinition.BodyFileName = string.IsNullOrEmpty(emailFilename) ? this.PasswordRecovery1.MailDefinition.BodyFileName = Server.MapPath("~/Data/MessageTemplates/" + SiteUtils.GetDefaultUICulture() + "-" + WebConfigSettings.PasswordRecoveryEmailTemplateFileNamePattern) : emailFilename; } this.PasswordRecovery1.MailDefinition.IsBodyHtml = ConfigHelper.GetBoolProperty("UseHtmlBodyInPasswordRecoveryEmail", false); #if !NET35 PasswordRecovery1.RenderOuterTable = false; #endif AddClassToBody("passwordrecovery"); }
public void SHOW_SKIP_ACCOUNT() { ButtonHelper.Clicked(); AlertPanel.ShowError("Skipping Account Sign In/ Sign Up Will disable High Score Tracking.\nAre You Sure you Want to Proceed ?"); ButtonHelper.ResetClick(); }