public Lobby(IDictionary <Type, object> managers) : base(managers) { _background = ResourceManager.GetSprite("mainbg"); _background.Smoothing = Smoothing.Smooth; _mainbg = new SimpleImage { Sprite = "lobby_mainbg" }; _imgStatus = new SimpleImage { Sprite = "lobby_statusbar" }; _lblServer = new Label("SERVER:", "MICROGME", ResourceManager); _lblServer.Text.Color = Color.WhiteSmoke; _serverLabels.Add(_lblServer); _lblServerInfo = new Label("LLJK#1", "MICROGME", ResourceManager); _lblServerInfo.Text.Color = Color.DarkRed; _serverLabels.Add(_lblServerInfo); _lblMode = new Label("GAMEMODE:", "MICROGME", ResourceManager); _lblMode.Text.Color = Color.WhiteSmoke; _serverLabels.Add(_lblMode); _lblModeInfo = new Label("SECRET", "MICROGME", ResourceManager); _lblModeInfo.Text.Color = Color.DarkRed; _serverLabels.Add(_lblModeInfo); _lblPlayers = new Label("PLAYERS:", "MICROGME", ResourceManager); _lblPlayers.Text.Color = Color.WhiteSmoke; _serverLabels.Add(_lblPlayers); _lblPlayersInfo = new Label("17/32", "MICROGME", ResourceManager); _lblPlayersInfo.Text.Color = Color.DarkRed; _serverLabels.Add(_lblPlayersInfo); _lblPort = new Label("PORT:", "MICROGME", ResourceManager); _lblPort.Text.Color = Color.WhiteSmoke; _serverLabels.Add(_lblPort); _lblPortInfo = new Label("1212", "MICROGME", ResourceManager); _lblPortInfo.Text.Color = Color.DarkRed; _serverLabels.Add(_lblPortInfo); _tabs = new TabbedMenu { TopSprite = "lobby_tab_top", MidSprite = "lobby_tab_mid", BotSprite = "lobby_tab_bot", TabOffset = new Point(-8, 300) }; _tabJob = new JobTab("lobbyTabJob", new Size(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_bcase" }; _tabs.AddTab(_tabJob); _tabJob._shwDepa.SelectionChanged += new Showcase.ShowcaseSelectionChangedHandler(_shwDepa_SelectionChanged); _tabJob._shwJobs.SelectionChanged += new Showcase.ShowcaseSelectionChangedHandler(_shwJobs_SelectionChanged); _tabCharacter = new TabContainer("lobbyTabCharacter", new Size(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_person" }; _tabs.AddTab(_tabCharacter); _tabObserve = new TabContainer("lobbyTabObserve", new Size(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_eye" }; _tabs.AddTab(_tabObserve); _tabServer = new PlayerListTab("lobbyTabServer", new Size(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_info" }; _tabs.AddTab(_tabServer); _tabs.SelectTab(_tabJob); _lobbyChat = new Chatbox(ResourceManager, UserInterfaceManager, KeyBindingManager) { Size = new Vector2D(780, 225), }; _lobbyChat.Update(0); _imgChatBg = new SimpleImage() { Sprite = "lobby_chatbg", }; _lobbyChat.TextSubmitted += new Chatbox.TextSubmitHandler(_lobbyChat_TextSubmitted); }
public override void InitializeGUI() { _uiScreen = new Screen(); _uiScreen.BackgroundImage = ResourceCache.GetSprite("ss14_logo_background"); // UI screen is added in startup var imgMainBg = new SimpleImage(); imgMainBg.Sprite = "lobby_mainbg"; imgMainBg.Alignment = ControlAlignments.HCenter | ControlAlignments.VCenter; _uiScreen.AddControl(imgMainBg); var imgStatus = new SimpleImage(); imgStatus.Sprite = "lobby_statusbar"; imgStatus.LocalPosition = new Vector2i(10, 63); imgMainBg.AddControl(imgStatus); var lblServer = new Label("SERVER: ", "MICROGME"); lblServer.ForegroundColor = new Color(245, 245, 245); lblServer.LocalPosition = new Vector2i(5, 2); imgStatus.AddControl(lblServer); _lblServerInfo = new Label("------", "MICROGME"); _lblServerInfo.ForegroundColor = new Color(139, 0, 0); _lblServerInfo.FixedWidth = 100; _lblServerInfo.Alignment = ControlAlignments.Right; lblServer.AddControl(_lblServerInfo); var lblMode = new Label("GAMEMODE: ", "MICROGME"); lblMode.ForegroundColor = new Color(245, 245, 245); lblMode.Alignment = ControlAlignments.Right; lblMode.LocalPosition = new Vector2i(10, 0); _lblServerInfo.AddControl(lblMode); _lblModeInfo = new Label("------", "MICROGME"); _lblModeInfo.ForegroundColor = new Color(139, 0, 0); _lblModeInfo.FixedWidth = 90; _lblModeInfo.Alignment = ControlAlignments.Right; lblMode.AddControl(_lblModeInfo); var lblPlayers = new Label("PLAYERS: ", "MICROGME"); lblPlayers.ForegroundColor = new Color(245, 245, 245); lblPlayers.Alignment = ControlAlignments.Right; lblPlayers.LocalPosition = new Vector2i(10, 0); _lblModeInfo.AddControl(lblPlayers); _lblPlayersInfo = new Label("--/--", "MICROGME"); _lblPlayersInfo.ForegroundColor = new Color(139, 0, 0); _lblPlayersInfo.FixedWidth = 60; _lblPlayersInfo.Alignment = ControlAlignments.Right; lblPlayers.AddControl(_lblPlayersInfo); var lblPort = new Label("PORT: ", "MICROGME"); lblPort.ForegroundColor = new Color(245, 245, 245); lblPort.Alignment = ControlAlignments.Right; lblPort.LocalPosition = new Vector2i(10, 0); _lblPlayersInfo.AddControl(lblPort); _lblPortInfo = new Label("----", "MICROGME"); _lblPortInfo.ForegroundColor = new Color(139, 0, 0); _lblPortInfo.FixedWidth = 50; _lblPortInfo.Alignment = ControlAlignments.Right; lblPort.AddControl(_lblPortInfo); _tabs = new TabbedMenu(); _tabs.TopSprite = "lobby_tab_top"; _tabs.MidSprite = "lobby_tab_mid"; _tabs.BotSprite = "lobby_tab_bot"; _tabs.TabOffset = new Vector2i(-8, 300); _tabs.LocalPosition = new Vector2i(5, 90); imgMainBg.AddControl(_tabs); var tabCharacter = new TabContainer(new Vector2i(793, 350)); tabCharacter.TabSpriteName = "lobby_tab_person"; _tabs.AddTab(tabCharacter); var tabObserve = new TabContainer(new Vector2i(793, 350)); tabObserve.TabSpriteName = "lobby_tab_eye"; _tabs.AddTab(tabObserve); _tabServer = new PlayerListTab(new Vector2i(793, 350)); _tabServer.TabSpriteName = "lobby_tab_info"; _tabs.AddTab(_tabServer); _tabs.SelectTab(_tabServer); var imgChatBg = new SimpleImage(); imgChatBg.Sprite = "lobby_chatbg"; imgChatBg.Alignment = ControlAlignments.HCenter | ControlAlignments.Bottom; imgChatBg.Resize += (sender, args) => { imgChatBg.LocalPosition = new Vector2i(0, -9 + -imgChatBg.Height); }; imgMainBg.AddControl(imgChatBg); _lobbyChat = new Chatbox(new Vector2i(780, 225)); _lobbyChat.Alignment = ControlAlignments.HCenter | ControlAlignments.VCenter; _lobbyChat.DefaultChatFormat = "ooc \"{0}\""; imgChatBg.AddControl(_lobbyChat); var btnReady = new ImageButton(); btnReady.ImageNormal = "lobby_ready"; btnReady.ImageHover = "lobby_ready_green"; btnReady.Alignment = ControlAlignments.Right; btnReady.Resize += (sender, args) => { btnReady.LocalPosition = new Vector2i(-5 + -btnReady.Width, -5 + -btnReady.Height); }; imgChatBg.AddControl(btnReady); btnReady.Clicked += _btnReady_Clicked; var btnBack = new ImageButton(); btnBack.ImageNormal = "lobby_back"; btnBack.ImageHover = "lobby_back_green"; btnBack.Resize += (sender, args) => { btnBack.LocalPosition = new Vector2i(-5 + -btnBack.Width, 0); }; btnReady.AddControl(btnBack); btnBack.Clicked += _btnBack_Clicked; }
public Lobby(IDictionary <Type, object> managers) : base(managers) { _background = ResourceManager.GetSprite("mainbg"); _background.Texture.Smooth = true; _imgMainBg = new SimpleImage { Sprite = "lobby_mainbg" }; _imgStatus = new SimpleImage { Sprite = "lobby_statusbar" }; _lblServer = new Label("SERVER:", "MICROGME", ResourceManager); _lblServer.Text.Color = new SFML.Graphics.Color(245, 245, 245); _serverLabels.Add(_lblServer); _lblServerInfo = new Label("LLJK#1", "MICROGME", ResourceManager); _lblServerInfo.Text.Color = new SFML.Graphics.Color(139, 0, 0); _serverLabels.Add(_lblServerInfo); _lblMode = new Label("GAMEMODE:", "MICROGME", ResourceManager); _lblMode.Text.Color = new SFML.Graphics.Color(245, 245, 245); _serverLabels.Add(_lblMode); _lblModeInfo = new Label("SECRET", "MICROGME", ResourceManager); _lblModeInfo.Text.Color = new SFML.Graphics.Color(139, 0, 0); _serverLabels.Add(_lblModeInfo); _lblPlayers = new Label("PLAYERS:", "MICROGME", ResourceManager); _lblPlayers.Text.Color = new SFML.Graphics.Color(245, 245, 245); _serverLabels.Add(_lblPlayers); _lblPlayersInfo = new Label("17/32", "MICROGME", ResourceManager); _lblPlayersInfo.Text.Color = new SFML.Graphics.Color(139, 0, 0); _serverLabels.Add(_lblPlayersInfo); _lblPort = new Label("PORT:", "MICROGME", ResourceManager); _lblPort.Text.Color = new SFML.Graphics.Color(245, 245, 245); _serverLabels.Add(_lblPort); _lblPortInfo = new Label("1212", "MICROGME", ResourceManager); _lblPortInfo.Text.Color = new SFML.Graphics.Color(139, 0, 0); _serverLabels.Add(_lblPortInfo); _tabs = new TabbedMenu { TopSprite = "lobby_tab_top", MidSprite = "lobby_tab_mid", BotSprite = "lobby_tab_bot", TabOffset = new Vector2i(-8, 300), ZDepth = 2 }; _tabJob = new JobTab("lobbyTabJob", new Vector2i(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_bcase" }; _tabs.AddTab(_tabJob); _tabJob._shwDepa.SelectionChanged += new Showcase.ShowcaseSelectionChangedHandler(_shwDepa_SelectionChanged); _tabJob._shwJobs.SelectionChanged += new Showcase.ShowcaseSelectionChangedHandler(_shwJobs_SelectionChanged); _tabCharacter = new TabContainer("lobbyTabCharacter", new Vector2i(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_person" }; _tabs.AddTab(_tabCharacter); _tabObserve = new TabContainer("lobbyTabObserve", new Vector2i(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_eye" }; _tabs.AddTab(_tabObserve); _tabServer = new PlayerListTab("lobbyTabServer", new Vector2i(793, 450), ResourceManager) { tabSpriteName = "lobby_tab_info" }; _tabs.AddTab(_tabServer); _tabs.SelectTab(_tabJob); _lobbyChat = new Chatbox("lobbychat", new Vector2i(780, 225), ResourceManager); _lobbyChat.Update(0); _imgChatBg = new SimpleImage() { Sprite = "lobby_chatbg", }; _lobbyChat.TextSubmitted += new Chatbox.TextSubmitHandler(_lobbyChat_TextSubmitted); _btnReady = new ImageButton() { ImageNormal = "lobby_ready", ImageHover = "lobby_ready_green", ZDepth = 1 }; _btnReady.Clicked += _btnReady_Clicked; _btnReady.Update(0); _lblServerInfo.FixedWidth = 100; _lblModeInfo.FixedWidth = 90; _lblPlayersInfo.FixedWidth = 60; _lblPortInfo.FixedWidth = 50; UpdateGUIPosition(); }
public MenuItem() { _parent = null; _owner = new TabbedMenu(); }