Exemple #1
0
        public void DrawPage()
        {
            Page = Math.Min(Page, (Display.Count / (Columns * Rows)));
            if (Page < 0) Page = 0;
            foreach (var icon in CurrentIcons) Remove(icon);
            CurrentIcons.Clear();
            var startInd = Page * (Columns * Rows);

            for (int x=0; x<Columns; x++)
            {
                for (int y=0; y<Rows; y++)
                {
                    var ind = startInd + x + Columns * y;
                    if (ind < Display.Count) {
                        var icon = new UIPersonIcon(Display.ElementAt(ind), vm, false);
                        CurrentIcons.Add(icon);
                        Add(icon);
                        icon.Position = new Vector2(x*(34+12), y*(34+11));
                    }
                }
            }
        }
Exemple #2
0
        public override void Update(FSO.Common.Rendering.Framework.Model.UpdateState state)
        {
            base.Update(state);
            if (SelectedAvatar != null)
            {
                if (SelectedAvatar != LastSelected)
                {
                    if (Thumb != null) Remove(Thumb);
                    Thumb = new UIPersonIcon(SelectedAvatar, LotController.vm, false);
                    UpdateThumbPosition();
                    Add(Thumb);
                    LastSelected = SelectedAvatar;
                }

                UpdateMotives();
            }

            if (LastEODConfig != LotController.EODs.DisplayMode)
            {
                HideEOD = false;
                SetInEOD(LotController.EODs.DisplayMode, LotController.EODs.ActiveEOD);
            }

            if (LotController.EODs.EODMessage != (string)MsgWinTextEntry.Items[0].Data)
            {
                MsgWinTextEntry.Items[0].Data = LotController.EODs.EODMessage;
                MsgWinTextEntry.Items[0].Columns[0] = LotController.EODs.EODMessage;
            }
            if (LotController.EODs.EODTime != TimerTextEntry.CurrentText)
                TimerTextEntry.CurrentText = LotController.EODs.EODTime;
        }
Exemple #3
0
        public void P_Players(string evt, string txt)
        {
            var split = txt.Split('\n');
            int[] items = new int[4];
            var labels = new UILabel[] { labelStation1, labelStation2, labelStation3, labelStation4 };
            for (int i=0; i<4; i++)
            {
                if (!int.TryParse(split[i], out items[i])) return;
                var avatar = (VMAvatar)Controller.Lot.vm.GetObjectById((short)items[i]);
                if (avatar == null)
                {
                    if (Players[i] != null)
                        Remove(Players[i]);
                    Players[i] = null;
                } else if (Players[i] == null || Players[i].Avatar != avatar)
                {
                    if (Players[i] != null)
                        Remove(Players[i]);
                    Players[i] = new UIPersonIcon((VMAvatar)avatar, Controller.Lot.vm, true);
                    var bgs = new UIImage[] { PersonBG1, PersonBG2, PersonBG3, PersonBG4 };
                    Players[i].Position = bgs[i].Position + new Microsoft.Xna.Framework.Vector2(2, 2);
                    Add(Players[i]);
                }

                string caption = "";
                if (avatar == null)
                    caption = Script.GetString("strNoContributor");
                else
                {
                    if (i == 0) caption = Script.GetString("strBody") + avatar.GetPersonData(VMPersonDataVariable.BodySkill) / 100;
                    else if (i == 2) caption = Script.GetString("strCharisma") + avatar.GetPersonData(VMPersonDataVariable.CharismaSkill) / 100;
                    else caption = Script.GetString("strCooking") + avatar.GetPersonData(VMPersonDataVariable.CookingSkill) / 100;
                }
                labels[i].Caption = caption;
            }
        }