Пример #1
0
        public UIMotiveSubpanel(TS1GameScreen game) : base(game)
        {
            MotiveDisplays = new UIMotiveBar[8];
            for (int i = 0; i < 8; i++)
            {
                var d = new UIMotiveBar();
                d.Position = new Vector2(17 + (i % 4) * 180, 36 + (i / 4) * 60);
                Add(d);
                MotiveDisplays[i] = d;

                var l = new UILabel();
                l.CaptionStyle       = l.CaptionStyle.Clone();
                l.CaptionStyle.Size  = 15;
                l.CaptionStyle.Color = UIStyle.Current.Text;
                l.Alignment          = FSO.Client.UI.Framework.TextAlignment.Bottom;
                l.Size     = new Vector2(1);
                l.Position = new Vector2(17 + (i % 4) * 180, 30 + (i / 4) * 60);
                l.Caption  = GameFacade.Strings.GetString("f102", (i + 1).ToString());
                Add(l);
            }
        }
Пример #2
0
        public UIRelationshipDisplay(int nidFrom, int nid, VM curVM) : base()
        {
            NameLabel = new UILabel();
            NameLabel.CaptionStyle       = NameLabel.CaptionStyle.Clone();
            NameLabel.CaptionStyle.Color = UIStyle.Current.Text;
            NameLabel.CaptionStyle.Size  = 10;
            NameLabel.Wrapped            = true;
            NameLabel.Size      = new Vector2(80, 33);
            NameLabel.Position  = new Vector2(5, 5);
            NameLabel.Alignment = TextAlignment.Middle | TextAlignment.Center;
            Add(NameLabel);

            Bar1          = new UIMotiveBar();
            Bar1.ScaleX   = Bar1.ScaleY = 0.5f;
            Bar1.Position = new Vector2(8, 94);
            Add(Bar1);

            Bar2          = new UIMotiveBar();
            Bar2.ScaleX   = Bar2.ScaleY = 0.5f;
            Bar2.Position = new Vector2(8, 106);
            Add(Bar2);

            ItemBg = Content.Get().CustomUI.Get("inv_item.png").Get(GameFacade.GraphicsDevice);

            var neighbourhood = Content.Get().Neighborhood;
            var n             = neighbourhood.GetNeighborByID((short)nid);
            var obj           = Content.Get().WorldObjects.Get(n.GUID);

            if (obj != null)
            {
                var aobj = curVM.Context.CreateObjectInstance(n.GUID, LotTilePos.OUT_OF_WORLD, Direction.NORTH, true);
                Item = UIIconCache.GetObject(aobj.BaseObject);
                aobj.Delete(curVM.Context);
                var ctss = obj.Resource.Get <CTSS>(obj.OBJ.CatalogStringsID);
                //todo: family name
                NameLabel.Caption = ctss?.GetString(0) ?? obj.OBJ.ChunkLabel;
            }
            NIDF = nidFrom;
            NID  = nid;
        }
Пример #3
0
        public UIJobSubpanel(TS1GameScreen game) : base(game)
        {
            PerformanceTitle          = new UILabel();
            PerformanceTitle.Caption  = "Performance";
            PerformanceTitle.Position = new Vector2(79, 16);
            InitLabel(PerformanceTitle);

            PerformanceBar          = new UIMotiveBar();
            PerformanceBar.Position = new Vector2(79, 41);
            DynamicOverlay.Add(PerformanceBar);

            JobTitle          = new UILabel();
            JobTitle.Caption  = "Subway Musician";
            JobTitle.Position = new Vector2(18, 71);
            InitLabel(JobTitle);

            SalaryTitle          = new UILabel();
            SalaryTitle.Caption  = "Salary: §90";
            SalaryTitle.Position = new Vector2(18, 94);
            InitLabel(SalaryTitle);
            SalaryTitle.CaptionStyle.Color = UIStyle.Current.BtnActive;

            CareerButton          = new UITwoStateButton(Content.Get().CustomUI.Get("blank_blue.png").Get(GameFacade.GraphicsDevice));
            CareerButton.Position = new Vector2(20, 15);
            Add(CareerButton);

            Skills = new UISkillDisplay[6];
            for (int i = 0; i < 6; i++)
            {
                Skills[i]          = new UISkillDisplay();
                Skills[i].Position = new Vector2(334 + (i % 3) * 140, 35 + 60 * (i / 3));
                Add(Skills[i]);

                var name = new UILabel();
                name.Caption  = SkillNames[i];
                name.Position = new Vector2(332 + (i % 3) * 140, 11 + 60 * (i / 3));
                InitLabel(name);
            }
        }