コード例 #1
0
        public TS1CASScreen()
        {
            var ui = Content.Get().CustomUI;
            var gd = GameFacade.GraphicsDevice;

            CASPanel = new UISimCASPanel();
            CASPanel.OnCollectionChange += CASPanel_OnCollectionChange;
            CASPanel.Position            = new Vector2(0, -400);
            CASPanel.OnRandom           += CASPanel_OnRandom;
            Add(CASPanel);

            FamilyPanel           = new UIFamilyCASPanel(RepresentFamily);
            FamilyPanel.ModifySim = ModifySim;
            Add(FamilyPanel);

            FamiliesPanel              = new UIFamiliesCASPanel();
            FamiliesPanel.OnNewFamily += () => { SetMode(UICASMode.FamilyEdit); };
            Add(FamiliesPanel);

            BackButton          = new UITwoStateButton(ui.Get("btn_back.png").Get(gd));
            BackButton.Position = new Vector2(25, ScreenHeight - 140);
            Add(BackButton);

            AcceptButton          = new UITwoStateButton(ui.Get("btn_accept.png").Get(gd));
            AcceptButton.Position = new Vector2(ScreenWidth - 140, ScreenHeight - 140);
            Add(AcceptButton);

            BackButton.OnButtonClick   += GoBack;
            AcceptButton.OnButtonClick += Accept;
        }
コード例 #2
0
        public UIRelationshipSubpanel(TS1GameScreen game) : base(game)
        {
            var ui = Content.Get().CustomUI;

            ScrollView           = new UITouchScroll(() => { return(Items?.Count ?? 0); }, DisplayProvider);
            ScrollView.X         = 148;
            ScrollView.ItemWidth = 90;
            ScrollView.Size      = new Vector2(582, 128);
            Add(ScrollView);

            FriendButton                = new UITwoStateButton(ui.Get("rel_friend.png").Get(GameFacade.GraphicsDevice));
            FriendButton.Position       = new Vector2(21, 9);
            FriendButton.OnButtonClick += (b) => { ChangeCat(0); };
            Add(FriendButton);
            FamButton                = new UITwoStateButton(ui.Get("rel_fam.png").Get(GameFacade.GraphicsDevice));
            FamButton.Position       = new Vector2(81, 9);
            FamButton.OnButtonClick += (b) => { ChangeCat(1); };
            Add(FamButton);
            AllButton                = new UITwoStateButton(ui.Get("rel_all.png").Get(GameFacade.GraphicsDevice));
            AllButton.Position       = new Vector2(21, 69);
            AllButton.OnButtonClick += (b) => { ChangeCat(-1); };
            Add(AllButton);
            FameButton                = new UITwoStateButton(ui.Get("rel_fame.png").Get(GameFacade.GraphicsDevice));
            FameButton.Position       = new Vector2(81, 69);
            FameButton.OnButtonClick += (b) => { ChangeCat(2); };
            Add(FameButton);

            ChangeCat(-1);
        }
コード例 #3
0
        public UIInventorySubpanel(TS1GameScreen game) : base(game)
        {
            var ui = Content.Get().CustomUI;

            ScrollView           = new UITouchScroll(() => { return(Items?.Count ?? 0); }, DisplayProvider);
            ScrollView.X         = 148;
            ScrollView.ItemWidth = 90;
            ScrollView.Size      = new Vector2(582, 128);
            Add(ScrollView);

            MagicButton                = new UITwoStateButton(ui.Get("inv_mag_btn.png").Get(GameFacade.GraphicsDevice));
            MagicButton.Position       = new Vector2(21, 9);
            MagicButton.OnButtonClick += (b) => { ChangeCat(7); };
            Add(MagicButton);
            IngButton                = new UITwoStateButton(ui.Get("inv_ing_btn.png").Get(GameFacade.GraphicsDevice));
            IngButton.Position       = new Vector2(81, 9);
            IngButton.OnButtonClick += (b) => { ChangeCat(8); };
            Add(IngButton);
            OtherButton                = new UITwoStateButton(ui.Get("inv_other_btn.png").Get(GameFacade.GraphicsDevice));
            OtherButton.Position       = new Vector2(21, 69);
            OtherButton.OnButtonClick += (b) => { ChangeCat(-1); };
            Add(OtherButton);

            ChangeCat(-1);
        }
コード例 #4
0
        public UIArchTouchHelper(UILotControl parent)
        {
            Owner = parent;
            var ui = Content.Get().CustomUI;
            var gd = GameFacade.GraphicsDevice;

            ClickButton = new UITwoStateButton(ui.Get("touch_tool.png").Get(gd));
            Add(ClickButton);
            ClickButton.OnButtonDown  += (b) => Owner.SimulateMD(LastState);
            ClickButton.OnButtonClick += (b) => Owner.SimulateMU(LastState);
            ShiftClickButton           = new UITwoStateButton(ui.Get("touch_tools.png").Get(gd));
            Add(ShiftClickButton);
            ShiftClickButton.OnButtonDown  += (b) => { Owner.AddModifier(UILotControlModifiers.SHIFT); Owner.SimulateMD(LastState); };
            ShiftClickButton.OnButtonClick += (b) => { Owner.SimulateMU(LastState); Owner.RemoveModifier(UILotControlModifiers.SHIFT); };
            CtrlClickButton = new UITwoStateButton(ui.Get("touch_toolc.png").Get(gd));
            Add(CtrlClickButton);
            CtrlClickButton.OnButtonDown  += (b) => { Owner.AddModifier(UILotControlModifiers.CTRL); Owner.SimulateMD(LastState); };
            CtrlClickButton.OnButtonClick += (b) => { Owner.SimulateMU(LastState); Owner.RemoveModifier(UILotControlModifiers.CTRL); };

            RotateCWButton = new UITwoStateButton(ui.Get("touch_rotcw.png").Get(gd));
            Add(RotateCWButton);
            RotateCWButton.OnButtonClick += (b) => { parent.ObjectHolder.RotateObject(2); };
            RotateCCWButton = new UITwoStateButton(ui.Get("touch_rotccw.png").Get(gd));
            RotateCCWButton.OnButtonClick += (b) => { parent.ObjectHolder.RotateObject(-2); };
            Add(RotateCCWButton);

            Cross = ui.Get("touch_cross.png").Get(gd);

            GameResized();
        }
コード例 #5
0
        public UISimitoneFrontend(TS1GameScreen screen)
        {
            var ui = Content.Get().CustomUI;

            CutBtn                = new UITwoStateButton(ui.Get("cut_btn_down.png").Get(GameFacade.GraphicsDevice));
            CutBtn.X              = screen.ScreenWidth - (256 + 15);
            CutBtn.Y              = 15;
            CutBtn.OnButtonClick += CutButton;
            Add(CutBtn);

            Clock   = new UIClockPanel(screen.vm);
            Clock.X = screen.ScreenWidth - (334 + 15);
            Clock.Y = 15;
            Game    = screen;
            Add(Clock);

            Money          = new UIMoneyPanel(screen);
            Money.Position = new Vector2(15, screen.ScreenHeight - 172);
            Add(Money);

            MainPanel              = new UIMainPanel(screen);
            MainPanel.OnEndSelect += OnEndSelect;
            MainPanel.ModeChanged += ModeChanged;
            Add(MainPanel);

            ExtendPanelBtn = new UIStencilButton(ui.Get("panel_expand.png").Get(GameFacade.GraphicsDevice));
            ExtendPanelBtn.OnButtonClick += ExpandClicked;
            Add(ExtendPanelBtn);

            var mode = new UIModeSwitcher(screen);

            mode.Position     = new Vector2(64 + 15, screen.ScreenHeight - (64 + 15));
            mode.OnModeClick += LiveButtonClicked;
            Add(mode);
            ModeSwitcher = mode;

            ExtendPanelBtn.Position = new Vector2(mode.X + 54, mode.Y - 50);

            MainPanel.X       = 64 + 15;
            MainPanel.Y       = mode.Y - 64;
            MainPanel.Visible = false;

            if (Game.vm.GetGlobalValue(32) > 0)
            {
                MainPanel.SetMode(UIMainPanelMode.BUY);
                ModeSwitcher.EndSwitch(MainPanel.Mode);
                MainPanel.Open();
            }
            else
            {
                FSO.HIT.HITVM.Get().PlaySoundEvent(UIMusic.None);
            }
        }
コード例 #6
0
        public UISimitoneFrontend(TS1GameScreen screen)
        {
            var ui = Content.Get().CustomUI;

            CutBtn                = new UITwoStateButton(ui.Get("cut_btn_down.png").Get(GameFacade.GraphicsDevice));
            CutBtn.X              = screen.ScreenWidth - (256 + 15);
            CutBtn.Y              = 15;
            CutBtn.OnButtonClick += CutButton;
            Add(CutBtn);

            Clock   = new UIClockPanel(screen.vm);
            Clock.X = screen.ScreenWidth - (334 + 15);
            Clock.Y = 15;
            Game    = screen;
            Add(Clock);

            Money          = new UIMoneyPanel(screen);
            Money.Position = new Vector2(15, screen.ScreenHeight - 172);
            Add(Money);

            MainPanel = new UIMainPanel(screen);
            Add(MainPanel);

            ExtendPanelBtn = new UIStencilButton(ui.Get("panel_expand.png").Get(GameFacade.GraphicsDevice));
            ExtendPanelBtn.OnButtonClick += ExpandClicked;
            Add(ExtendPanelBtn);

            var btn = new UILiveButton(screen);

            btn.MotiveLevel    = 0.5f;
            btn.Position       = new Vector2(64 + 15, screen.ScreenHeight - (64 + 15));
            btn.OnButtonClick += LiveButtonClicked;
            Add(btn);
            LiveButton = btn;

            ExtendPanelBtn.Position = new Vector2(btn.X + 54, btn.Y - 50);

            MainPanel.X       = 64 + 15;
            MainPanel.Y       = btn.Y - 64;
            MainPanel.Visible = false;
        }
コード例 #7
0
ファイル: UIJobSubpanel.cs プロジェクト: riperiperi/Simitone
        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);
            }
        }
コード例 #8
0
        public UIFamiliesCASPanel()
        {
            var gd = GameFacade.GraphicsDevice;
            var ui = Content.Get().CustomUI;
            var sh = UIScreen.Current.ScreenHeight;
            var sw = UIScreen.Current.ScreenWidth;

            FamilyList = new UITouchScroll(FamilyLength, FamilyProvider);
            FamilyList.VerticalMode = true;
            FamilyList.Size         = new Vector2(810, sh);
            FamilyList.X            = (sw - 810) / 2;
            FamilyList.ItemWidth    = 180;
            FamilyList.Margin       = 90;
            FamilyList.DrawBounds   = false;
            Add(FamilyList);
            WhitePx = TextureGenerator.GetPxWhite(GameFacade.GraphicsDevice);

            Title = new UILabel();
            Title.NewStyle(UIStyle.Current.Text, 37);
            Title.Caption   = "Select a Family";
            Title.Size      = new Vector2(sw, 60);
            Title.Alignment = TextAlignment.Middle | TextAlignment.Center;
            Title.Y         = -85;
            Add(Title);

            DeleteButton          = new UITwoStateButton(ui.Get("btn_deletefam.png").Get(gd));
            DeleteButton.Position = new Vector2(sw - 140, sh - 260);
            Add(DeleteButton);

            NewButton          = new UITwoStateButton(ui.Get("btn_createfam.png").Get(gd));
            NewButton.Position = new Vector2(sw - 140, sh - 380);
            Add(NewButton);
            NewButton.OnButtonClick += (btn) => OnNewFamily?.Invoke();

            TitleI = TitleI;
            SetSelection(-1);
        }