/// <summary> /// Zone List Screen Constructor /// </summary> public ZoneListScreen() : base("ZoneList") { TransOnTime = TimeSpan.FromSeconds(0.5f); TransOffTime = TimeSpan.FromSeconds(0.5f); //Create our button entries ButtonEntry Back = new ButtonEntry("Back", true); ButtonEntry Exit = new ButtonEntry("Exit", true); //Set the hooks Back.Selected += Back_Selected; Exit.Selected += OnExit; //Add the entries to our main list ButtonEntries.Add(Back); ButtonEntries.Add(Exit); //Dont draw the login title DrawTitle = false; //Make our object linker _zonelist = new ZoneList(); _zonelist.Screen = this; }
/// <summary> /// Updates our buttons /// </summary> private void UpdateButtons() { //Add our zone buttons to the main list foreach (string zoneName in Zones.Keys) { ButtonEntry entry = new ButtonEntry(zoneName, true); entry.Selected += EnterZone_Selected; if (!ButtonEntries.Contains(entry)) { ButtonEntries.Add(entry); } } //Remove any buttons that arent active in our zone list foreach (ButtonEntry button in ButtonEntries.ToList()) { if (oldZones.Contains(button.Text)) { ButtonEntries.Remove(button); } } //Clear old list oldZones.Clear(); }
/// <summary> /// The Login Screen is the first screen you see when the app starts /// </summary> public LoginScreen() : base("Login") { //Inherits our login background ScreenManager.AddScreen(new BackgroundScreen()); Settings.UserSetting Settings = GameManager.UserSettings; ButtonEntry play = new ButtonEntry("Play", true); ButtonEntry options = new ButtonEntry("Options", true); ButtonEntry exit = new ButtonEntry("Exit", true); play.Selected += PlaySelected; options.Selected += OptionsSelected; exit.Selected += OnCancel; ButtonEntries.Add(play); ButtonEntries.Add(options); ButtonEntries.Add(exit); CheckBox = new CheckBoxEntry(); CheckBox.Text = "Remember Password"; CheckBox.TextPosition = CheckBoxEntry.TextLocation.Right; CheckBoxEntries.Add(CheckBox); username = new BoxEntry((!String.IsNullOrEmpty(Settings.Username) ? Settings.Username : "******")); if (Settings.PasswordSave && !String.IsNullOrEmpty(Settings.Password)) { //Because our password is already hashed, //lets just make an object show "*" string str = ""; for (int i = 0; i < Settings.PassLength; i++) { str += "*"; } password = new BoxEntry(str); } else { password = new BoxEntry("Password"); } username.Selected += UserSelected; password.Selected += PassSelected; username.InputEnabled = true; password.InputEnabled = true; password.ScrambleInput = true; BoxEntries.Add(username); BoxEntries.Add(password); //Dont draw the login title DrawTitle = false; }