Example #1
0
        public Displayable DoConnectedContent()
        {
            PhiClient     client   = PhiClient.instance;
            ListContainer mainCont = new ListContainer();

            mainCont.spaceBetween = ListContainer.SPACE;

            /**
             * Changing your nickname
             */
            ListContainer changeNickCont = new ListContainer(ListFlow.ROW);

            changeNickCont.spaceBetween = ListContainer.SPACE;
            mainCont.Add(new HeightContainer(changeNickCont, 30f));

            changeNickCont.Add(new TextFieldWidget(wantedNickname, (s) => wantedNickname = OnWantedNicknameChange(s)));
            changeNickCont.Add(new WidthContainer(new ButtonWidget("Change nickname", OnChangeNicknameClick), 140f));

            /**
             * Preferences list
             */
            UserPreferences pref      = client.currentUser.preferences;
            ListContainer   twoColumn = new ListContainer(ListFlow.ROW);

            twoColumn.spaceBetween = ListContainer.SPACE;
            mainCont.Add(twoColumn);

            ListContainer firstColumn = new ListContainer();

            twoColumn.Add(firstColumn);

            firstColumn.Add(new CheckboxLabeledWidget("Allow receiving items", pref.receiveItems, (b) =>
            {
                pref.receiveItems = b;
                client.UpdatePreferences();
            }));

            firstColumn.Add(new CheckboxLabeledWidget("Allow receiving colonists (EXPERIMENTAL)", pref.receiveColonists, (b) =>
            {
                pref.receiveColonists = b;
                client.UpdatePreferences();
            }));

            // Just to take spaces while the column is empty
            ListContainer secondColumn = new ListContainer();

            twoColumn.Add(secondColumn);

            return(mainCont);
        }
Example #2
0
 public override void Apply(User user, RealmData realmData)
 {
     this.user.preferences = preferences;
 }