//---------------------------------------------------------------------- public MainMenuManager(NuclearSampleGame _game, ContentManager _content) : base(_game, _game.UIStyle, _content) { // Splitter mSplitter = new NuclearUI.Splitter(MenuScreen, NuclearUI.Direction.Left); mSplitter.AnchoredRect = NuclearUI.AnchoredRect.CreateFull(10); MenuScreen.Root.AddChild(mSplitter); mSplitter.Collapsable = true; mSplitter.FirstPaneMinSize = 200; // Demo list var demosBoxGroup = new NuclearUI.BoxGroup(MenuScreen, NuclearUI.Orientation.Vertical, 0, NuclearUI.Anchor.Start); mSplitter.FirstPane = demosBoxGroup; mDemoPanel = new NuclearUI.Panel(MenuScreen, Content.Load <Texture2D>("Sprites/UI/Panel04"), MenuScreen.Style.PanelCornerSize); var basicDemoPane = new Demos.BasicDemoPane(this); mSplitter.SecondPane = mDemoPanel; mDemoPanel.AddChild(basicDemoPane); demosBoxGroup.AddChild(CreateDemoButton("Basic", basicDemoPane), true); demosBoxGroup.AddChild(CreateDemoButton("Notebook", new Demos.NotebookPane(this)), true); demosBoxGroup.AddChild(CreateDemoButton("Text Area", new Demos.TextAreaPane(this)), true); demosBoxGroup.AddChild(CreateDemoButton("Custom Viewport", new Demos.CustomViewportPane(this)), true); }
//---------------------------------------------------------------------- public clsXWCommandPopup(IMenuManager _manager) : base(_manager) { TitleLabel = new Label(Screen, "", Anchor.Start); TitleLabel.Font = Screen.Style.MediumFont; TitleLabel.AnchoredRect = AnchoredRect.CreateTopAnchored(0, 0, 0, Screen.Style.DefaultButtonHeight); AddChild(TitleLabel); { ContentGroup = new Group(Screen); ContentGroup.AnchoredRect = AnchoredRect.CreateFull(0, 60, 0, 80); AddChild(ContentGroup); MessageLabel = new Label(Screen, "MessageLabel", Anchor.Start); MessageLabel.WrapText = true; MessageLabel.Font = Screen.Style.SmallFont; // Actions mActionsGroup = new BoxGroup(Screen, Orientation.Horizontal, 0, Anchor.End); mActionsGroup.AnchoredRect = AnchoredRect.CreateBottomAnchored(0, 0, 0, Screen.Style.DefaultButtonHeight); AddChild(mActionsGroup); // Close / Cancel mCloseButton = new Button(Screen, NuclearWinter.i18n.Common.Close); mCloseButton.ClickHandler = delegate { Dismiss(); }; mCloseButton.BindPadButton(Buttons.A); //*/ } }
//---------------------------------------------------------------------- public MainMenuManager(Game _game, NuclearUI.Style UIstyle, ContentManager _content) : base(_game, UIstyle, _content) { NuclearUI.Button button = new NuclearUI.Button(MenuScreen, "TestButton"); // Splitter mSplitter = new NuclearUI.Splitter(MenuScreen, NuclearUI.Direction.Up); mSplitter.AnchoredRect = NuclearUI.AnchoredRect.CreateCentered(500, 400);// CreateFull(100, 100, 100, 100); MenuScreen.Root.AddChild(mSplitter); mSplitter.Collapsable = true; mSplitter.FirstPaneMinSize = 100; // Demo list var demosBoxGroup = new NuclearUI.BoxGroup(MenuScreen, NuclearUI.Orientation.Horizontal, 0, NuclearUI.Anchor.Start); mSplitter.FirstPane = demosBoxGroup; mDemoPanel = new NuclearUI.Panel( MenuScreen, Content.Load <Texture2D>("Textures/UI/Panel04"), MenuScreen.Style.PanelCornerSize); var basicDemoPane = new DemoMenus.BasicDemoPane(this); mSplitter.SecondPane = mDemoPanel; mDemoPanel.AddChild(basicDemoPane); // Test button var testButton = new NuclearUI.Button(MenuScreen, "Test"); testButton.ClickHandler = delegate { mDemoPanel.Clear(); }; demosBoxGroup.AddChild(CreateDemoButton("Basic", basicDemoPane), true); demosBoxGroup.AddChild(testButton, true); //demosBoxGroup.AddChild( CreateDemoButton( "Notebook", new Demos.NotebookPane( this ) ), true ); //demosBoxGroup.AddChild( CreateDemoButton( "Text Area", new Demos.TextAreaPane( this ) ), true ); //demosBoxGroup.AddChild( CreateDemoButton( "Custom Viewport", new Demos.CustomViewportPane( this ) ), true ); }
//---------------------------------------------------------------------- public MessagePopup(IMenuManager _manager) : base(_manager) { TitleLabel = new Label(Screen, "", Anchor.Start); TitleLabel.Font = Screen.Style.LargeFont; TitleLabel.AnchoredRect = AnchoredRect.CreateTopAnchored(0, 0, 0, Screen.Style.DefaultButtonHeight); AddChild(TitleLabel); { mSpinningWheel = new SpinningWheel(Screen, Screen.Style.SpinningWheel); mSpinningWheel.AnchoredRect = AnchoredRect.CreateCentered(mSpinningWheel.ContentWidth, mSpinningWheel.ContentHeight); // Message label ContentGroup = new Group(Screen); ContentGroup.AnchoredRect = AnchoredRect.CreateFull(0, Screen.Style.DefaultButtonHeight + 10, 0, Screen.Style.DefaultButtonHeight + 10); AddChild(ContentGroup); MessageLabel = new Label(Screen, "", Anchor.Start); MessageLabel.WrapText = true; // Actions mActionsGroup = new BoxGroup(Screen, Orientation.Horizontal, 0, Anchor.End); mActionsGroup.AnchoredRect = AnchoredRect.CreateBottomAnchored(0, 0, 0, Screen.Style.DefaultButtonHeight); AddChild(mActionsGroup); // Close / Cancel mCloseButton = new Button(Screen, i18n.Common.Close); mCloseButton.ClickHandler = delegate { Dismiss(); }; // Confirm mConfirmButton = new Button(Screen, i18n.Common.Confirm); mConfirmButton.ClickHandler = delegate { Confirm(); }; mActionsGroup.AddChild(mConfirmButton); } }
public void Refresh() { mActionsGroup.Clear(); TitleLabel.Text = m_aktUnit.strBez + " ID " + m_aktUnit.Id; ContentGroup.Clear(); List<clsSubUnit> lisSubUnits = m_aktUnit.lisSubUnits; m_gridSubUnitRooster = new GridGroup(Manager.MenuScreen, 5, lisSubUnits.Count, false, 0); ContentGroup.AddChild(m_gridSubUnitRooster); for (int i = 0; i < lisSubUnits.Count; i++) { Image imgBtn = new Image(Manager.MenuScreen, base.Manager.Content.Load<Texture2D>("Sprites/" + lisSubUnits[i].objUnitType.strIconName)); m_gridSubUnitRooster.AddChildAt(imgBtn, 0, i); Label subLabel = new Label(Manager.MenuScreen); subLabel.Font = Screen.Style.SmallFont; subLabel.Text = lisSubUnits[i].objUnitType.strBez; m_gridSubUnitRooster.AddChildAt(subLabel, 1, i); subLabel = new Label(Manager.MenuScreen); subLabel.Font = Screen.Style.SmallFont; subLabel.Text = "Move: " + lisSubUnits[i].objUnitType.intMovement.ToString(); m_gridSubUnitRooster.AddChildAt(subLabel, 2, i); subLabel = new Label(Manager.MenuScreen); subLabel.Font = Screen.Style.SmallFont; subLabel.Text = "See: " + lisSubUnits[i].objUnitType.intSichtweite.ToString(); m_gridSubUnitRooster.AddChildAt(subLabel, 3, i); BoxGroup testGroup = new BoxGroup(Screen, Orientation.Vertical, 0, Anchor.Center); m_gridSubUnitRooster.AddChildAt(testGroup, 4, i); //add Roosterrow Button mCommandButton = new Button(Screen); mCommandButton.Text = "Destroy " + lisSubUnits[i].ID.ToString(); mCommandButton.Tag = lisSubUnits[i]; mCommandButton.ClickHandler = new Action<Button>(entfernen_ClickHandler); testGroup.AddChild(mCommandButton, false); } mCloseButton.Text = "Schließen"; foreach (ICommand aktCommandType in m_objCommandCollection.listRawCommands) { Button mCommandButton = new Button(Screen); mCommandButton.Text = aktCommandType.strTypeName; mCommandButton.Tag = aktCommandType; mCommandButton.ClickHandler = new Action<Button>(imgCommandIcon_ClickHandler); mActionsGroup.AddChild(mCommandButton); } mActionsGroup.AddChild(mCloseButton); }