Ejemplo n.º 1
0
        private void SubmitClick(UIMouseEvent evt, UIElement listeningElement)
        {
            string password = Password.Input.Value;

            if (RememberPassword.Checkbox.Checked)
            {
                BetterServerList.ActiveServer.Password = password;
                BetterServerList.SaveServers();
            }

            Main.PlaySound(SoundID.MenuTick);
            Netplay.ServerPassword = password;
            NetMessage.SendData(MessageID.SendPassword);
            Main.menuMode = 14;
        }
Ejemplo n.º 2
0
        private void SaveServer()
        {
            BetterServerList.ActiveServer.Name    = Name.Input.Value;
            BetterServerList.ActiveServer.Address = Address.Input.Value;
            try {
                BetterServerList.ActiveServer.Port = int.Parse(Port.Input.Value);
            } catch { }
            BetterServerList.ActiveServer.HideAddress = HideAddress.Checkbox.Checked;

            if (AddServer)
            {
                BetterServerList.SavedServers.Add(BetterServerList.ActiveServer);
            }

            BetterServerList.SaveServers();
        }
Ejemplo n.º 3
0
        private void FavoriteButtonClick(UIMouseEvent evt, UIElement listeningElement)
        {
            Server.IsFavorite = !Server.IsFavorite;

            ((UIImageButton)evt.Target).SetImage(Server.IsFavorite ? _buttonFavoriteActiveTexture : _buttonFavoriteInactiveTexture);
            ((UIImageButton)evt.Target).SetVisibility(1f, Server.IsFavorite ? 0.8f : 0.4f);

            if (Server.IsFavorite)
            {
                primaryButtonLabel.SetText(Language.GetTextValue("UI.Unfavorite"));
                RemoveChild(_deleteButton);
            }
            else
            {
                primaryButtonLabel.SetText(Language.GetTextValue("UI.Favorite"));
                Append(_deleteButton);
            }

            (Parent.Parent as UIList)?.UpdateOrder();
            BetterServerList.SaveServers();
        }
Ejemplo n.º 4
0
 private void DeleteButtonClick(UIMouseEvent evt, UIElement listeningElement)
 {
     BetterServerList.SavedServers.Remove(Server);
     (Parent.Parent as UIList).RemoveChild(this);
     BetterServerList.SaveServers();
 }