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; }
public UIModeSwitcher(TS1GameScreen screen) { Game = screen; var ui = Content.Get().CustomUI; var btn = new UILiveButton(screen); btn.MotiveLevel = 0.5f; btn.Position = Vector2.Zero; btn.OnButtonClick += (b) => { SwitchMode(UIMainPanelMode.LIVE); }; Add(btn); LiveButton = btn; BuildButton = new UIElasticButton(ui.Get("mode_build.png").Get(GameFacade.GraphicsDevice)); BuildButton.Position = btn.Position; BuildButton.OnButtonClick += (b) => { SwitchMode(UIMainPanelMode.BUILD); }; BuildButton.Opacity = 0; Add(BuildButton); BuyButton = new UIElasticButton(ui.Get("mode_buy.png").Get(GameFacade.GraphicsDevice)); BuyButton.Position = btn.Position; BuyButton.OnButtonClick += (b) => { SwitchMode(UIMainPanelMode.BUY); }; BuyButton.Opacity = 0; Add(BuyButton); OptionButton = new UIElasticButton(ui.Get("mode_options.png").Get(GameFacade.GraphicsDevice)); OptionButton.Position = btn.Position; OptionButton.OnButtonClick += (b) => { SwitchMode(UIMainPanelMode.OPTIONS); }; OptionButton.Opacity = 0; Add(OptionButton); ButtonOrder = new UIButton[] { LiveButton, BuyButton, BuildButton, OptionButton }; UpdateBuildBuy(); }