private void InitUI() { ClearComponents (); MapControl = new UIMapControl(); MapControl.OnSelectedEntitiesChanged += HandleOnSelectedEntitiesChanged; AddComponent (MapControl); EntityControl = new UIEntityControl(LevelGameScreen.Game.UIRace); MinimapControl = new UIMinimapControl(MapControl); LoadUIImage (ref leftSidebarTop, "Sidebar Left Minimap Black (" + LevelGameScreen.Game.UIRace + ")"); LoadUIImage (ref leftSidebar, "Sidebar Left (" + LevelGameScreen.Game.UIRace + ")"); leftSidebar.Y = leftSidebarTop.Height; LoadUIImage (ref topBar, "Topbar (" + LevelGameScreen.Game.UIRace + ")"); LoadUIImage (ref bottomBar, "Lower Bar (" + LevelGameScreen.Game.UIRace + ")"); topBar.X = leftSidebarTop.Width; bottomBar.X = leftSidebar.Width; bottomBar.Y = 200 - bottomBar.Height; LoadUIImage (ref rightBar, "Sidebar Right (" + LevelGameScreen.Game.UIRace + ")"); rightBar.X = 320 - rightBar.Width; MapControl.X = leftSidebarTop.Width; MapControl.Y = topBar.Height; MapControl.Width = rightBar.X - MapControl.X; MapControl.Height = bottomBar.Y - MapControl.Y; MinimapControl.X = 3; MinimapControl.Y = 6; MinimapControl.Width = 64; MinimapControl.Height = 64; MinimapControl.BackgroundColor = Color.AliceBlue; MinimapControl.Init (); menuButton = new UIButton ("", WarFile.KnowledgeBase.IndexByName("Menu Button"), WarFile.KnowledgeBase.IndexByName("Menu Button (Pressed)")); menuButton.X = leftSidebar.Width / 2 - menuButton.Width / 2 - 1; menuButton.Y = leftSidebarTop.Height + leftSidebar.Height - menuButton.Height - 1; menuButton.OnMouseUpInside += menuButton_OnMouseUpInside; AddComponent (menuButton); EntityControl.X = 2; EntityControl.Y = MinimapControl.Y + MinimapControl.Height + 2; EntityControl.Width = 64; EntityControl.Height = MainGame.OriginalAppHeight - EntityControl.Y - menuButton.Height - 2; lumberLabel = new UILabel ("Lumber:"); lumberLabel.X = 95; lumberLabel.Y = 0; lumberLabel.Width = 72; lumberLabel.Height = 10; lumberLabel.TextAlign = TextAlignHorizontal.Left; AddComponent (lumberLabel); lumberValueLabel = new UILabel ("1000"); lumberValueLabel.X = 95; lumberValueLabel.Y = 0; lumberValueLabel.Width = 72; lumberValueLabel.Height = 10; lumberValueLabel.TextAlign = TextAlignHorizontal.Right; AddComponent (lumberValueLabel); goldLabel = new UILabel ("Gold:"); goldLabel.X = 206; goldLabel.Y = 0; goldLabel.Width = 60; goldLabel.Height = 10; goldLabel.TextAlign = TextAlignHorizontal.Left; AddComponent (goldLabel); goldValueLabel = new UILabel ("1000"); goldValueLabel.X = 206; goldValueLabel.Y = 0; goldValueLabel.Width = 60; goldValueLabel.Height = 10; goldValueLabel.TextAlign = TextAlignHorizontal.Right; AddComponent (goldValueLabel); AddComponent (MinimapControl); AddComponent (EntityControl); }
internal UIMinimapControl(UIMapControl setUIMapControl) { isLeftPressed = false; isRightPressed = false; MapControl = setUIMapControl; }