public MultiplayerServerSelectionState(GuiPanoramaSkyBox skyBox) : base() { _skyBox = skyBox; CancellationTokenSource = new CancellationTokenSource(); _listProvider = GetService <IListStorageProvider <SavedServerEntry> >(); Title = "Multiplayer"; TitleTranslationKey = "multiplayer.title"; Footer.AddRow(row => { row.AddChild(JoinServerButton = new GuiButton("Join Server", OnJoinServerButtonPressed) { TranslationKey = "selectServer.select", Enabled = false }); row.AddChild(DirectConnectButton = new GuiButton("Direct Connect", () => Alex.GameStateManager.SetActiveState <MultiplayerConnectState>()) { TranslationKey = "selectServer.direct", Enabled = false }); row.AddChild(AddServerButton = new GuiButton("Add Server", OnAddItemButtonPressed) { TranslationKey = "selectServer.add" }); }); Footer.AddRow(row => { row.AddChild(EditServerButton = new GuiButton("Edit", OnEditItemButtonPressed) { TranslationKey = "selectServer.edit", Enabled = false }); row.AddChild(DeleteServerButton = new GuiButton("Delete", OnDeleteItemButtonPressed) { TranslationKey = "selectServer.delete", Enabled = false }); row.AddChild(new GuiButton("Refresh", OnRefreshButtonPressed) { TranslationKey = "selectServer.refresh" }); row.AddChild(new GuiBackButton() { TranslationKey = "gui.cancel" }); }); Background = new GuiTexture2D(_skyBox, TextureRepeatMode.Stretch); }
public ProfileSelectionState(GuiPanoramaSkyBox skyBox, Alex alex) { Alex = alex; _skyBox = skyBox; ProfileService = GetService <IPlayerProfileService>(); Title = "Select Profile"; Background = new GuiTexture2D(_skyBox, TextureRepeatMode.Stretch); base.ListContainer.ChildAnchor = Alignment.MiddleCenter; base.ListContainer.Orientation = Orientation.Horizontal; Footer.AddRow(row => { row.AddChild(_addBtn = new GuiButton("Add", AddClicked) { }); row.AddChild(_editBtn = new GuiButton("Edit", EditClicked) { Enabled = false }); row.AddChild(_deleteBtn = new GuiButton("Delete", DeleteClicked) { Enabled = false }); }); Footer.AddRow(row => { // row.ChildAnchor = Alignment.CenterX; row.AddChild(_selectBtn = new GuiButton("Select Profile", OnProfileSelect) { Enabled = false }); row.AddChild(_cancelBtn = new GuiButton("Cancel", OnCancelButtonPressed) { }); }); if (_defaultSkin == null) { Alex.Instance.Resources.ResourcePack.TryGetBitmap("entity/alex", out var rawTexture); _defaultSkin = new Skin() { Slim = true, Texture = TextureUtils.BitmapToTexture2D(Alex.Instance.GraphicsDevice, rawTexture) }; } Reload(); }
public ResourcePackOptionsState(GuiPanoramaSkyBox skyBox) : base(skyBox) { TitleTranslationKey = "resourcePack.title"; Body.BackgroundOverlay = new Color(Color.Black, 0.35f); Body.ChildAnchor = Alignment.FillCenter; AddGuiElement(ListContainer = new GuiSelectionList() { Anchor = Alignment.Fill, ChildAnchor = Alignment.TopFill, }); ListContainer.SelectedItemChanged += HandleSelectedItemChanged; var footerChildren = Footer.ChildElements.ToArray(); foreach (var child in footerChildren) { Footer.RemoveChild(child); } Footer.AddRow(row => { row.AddChild(_loadBtn = new GuiButton(LoadBtnClicked) { Text = "Load Resource pack", Modern = false, Enabled = false }); row.AddChild(new GuiButton(BackButtonPressed) { TranslationKey = "gui.done", Modern = false }); }); Footer.AddRow(row => { row.ChildAnchor = Alignment.BottomCenter; row.AddChild(new GuiButton("resourcePack.openFolder", OpenResourcePackFolderClicked, true) { Modern = false }); }); Reload(); }
public OptionsStateBase(GuiPanoramaSkyBox skyBox) { _skyBox = skyBox; _optionsProvider = GetService <IOptionsProvider>(); var footerRow = Footer.AddRow(BackButton = new GuiBackButton() { TranslationKey = "gui.done", Anchor = Alignment.TopFill, Modern = false }); Footer.ChildAnchor = Alignment.MiddleCenter; Body.ChildAnchor = Alignment.MiddleCenter; Background = new GuiTexture2D(_skyBox, TextureRepeatMode.Stretch); }
public LoadingWorldState() { HeaderTitle.TranslationKey = "menu.loadingLevel"; _textDisplay = new GuiTextElement() { Text = Text, TextColor = TextColor.White, Anchor = Alignment.TopLeft, HasShadow = false }; _percentageDisplay = new GuiTextElement() { Text = Text, TextColor = TextColor.White, Anchor = Alignment.TopRight, HasShadow = false }; _progressBar = new GuiProgressBar() { Width = 300, Height = 9, Anchor = Alignment.BottomFill, }; var progContainer = new GuiContainer() { Width = 300, Height = 25, }; progContainer.AddChild(_textDisplay); progContainer.AddChild(_percentageDisplay); progContainer.AddChild(_progressBar); var progressRow = Footer.AddRow(progContainer); UpdateProgress(LoadingState.ConnectingToServer, 10); }
public SkinSelectionState(GuiPanoramaSkyBox skyBox, Alex alex) { Alex = alex; _skyBox = skyBox; Storage = GetService <IStorageSystem>(); Title = "Select Skin"; Background = new GuiTexture2D(_skyBox, TextureRepeatMode.Stretch); base.ListContainer.ChildAnchor = Alignment.MiddleCenter; base.ListContainer.Orientation = Orientation.Horizontal; Footer.AddRow(row => { // row.ChildAnchor = Alignment.CenterX; row.AddChild(_selectBtn = new GuiButton("Select Skin", OnSkinSelect) { Enabled = false }); row.AddChild(_cancelBtn = new GuiButton("Cancel", OnCancelButtonPressed) { }); }); Footer.AddRow(row => { row.ChildAnchor = Alignment.BottomCenter; row.AddChild(new GuiButton("Open SkinPack folder", OpenSkinPackFOlder, false) { Modern = true }); }); Reload(); }