public ControlsPanel(Dictionary <string, Sprite> sprites)
        {
            SetAnchor(AnchorX.Right, AnchorY.Top);
            getStandardSprite = true;
            SetFixedWidth(200);
            SetLayoutSize(LayoutSize.FixedSize, LayoutSize.WrapContent);
            Padding = new Point(6, 6);
            Margin  = 6;
            string[] text   = { "explMouseLeft", "explMouseRight", "explMouseMiddle", "explWASD", "explTab", "explEnter" };
            string[] sprite = { "mouseLeft", "mouseRight", "mouseMiddle", "WASD", "tab", "enter" };

            for (int i = 0; i < text.Length; i++)
            {
                HorizontalLayout l = new HorizontalLayout();
                l.layoutFill = LayoutFill.StretchMargin;
                Image im = new Image(sprites[sprite[i]]);
                im.SetFixedSize(32, 32);

                Text te = new Text(text[i]);
                te.SetFontSize(FontSize.Small);

                l.AddChild(im);
                l.AddChild(te);

                AddChild(l);
            }
        }
示例#2
0
        public override void OnLoading()
        {
            base.OnLoading();
            DConsole.WriteLine("OnLoading EventList");

            _tabBarComponent  = new TabBarComponent(this);
            _topInfoComponent = new TopInfoComponent(this)
            {
                LeftButtonControl = new Image {
                    Source = ResourceManager.GetImage("topheading_sync")
                },
                RightButtonControl = new Image {
                    Source = ResourceManager.GetImage("topheading_map")
                },
                Header = Translator.Translate("orders")
            };

            var statistic = DBHelper.GetEventsStatistic();

            var extraHorizontalLayout = new HorizontalLayout {
                CssClass = "ExtraHorizontalLayout"
            };
            var leftExtraLayout = new VerticalLayout {
                CssClass = "ExtraLeftLayoutCss"
            };
            var rightExtraLayout = new VerticalLayout {
                CssClass = "ExtraRightLayoutCss"
            };

            extraHorizontalLayout.AddChild(leftExtraLayout);
            extraHorizontalLayout.AddChild(rightExtraLayout);

            leftExtraLayout.AddChild(
                new TextView($"{statistic.DayCompleteAmout}/{statistic.DayTotalAmount}")
            {
                CssClass = "ExtraInfo"
            });
            leftExtraLayout.AddChild(new TextView(Translator.Translate("today"))
            {
                CssClass = "ButtonExtraInfo"
            });

            rightExtraLayout.AddChild(
                new TextView($"{statistic.MonthCompleteAmout}/{statistic.MonthTotalAmount}")
            {
                CssClass = "ExtraInfo"
            });
            rightExtraLayout.AddChild(new TextView(Translator.Translate("per_month"))
            {
                CssClass = "ButtonExtraInfo"
            });

            _topInfoComponent.ExtraLayout.AddChild(extraHorizontalLayout);
        }
        public override void OnLoading()
        {
            var hl = new HorizontalLayout();

            for (var i = 0; i < 4; i++)
            {
                hl.AddChild(new Button(string.Format("Btn  {0}  ", i), vl_OnClick));
            }
            AddChild(hl);
            hl.AddChild(new Button("Back", Back_OnClick));
        }
示例#4
0
        private void RegenerateTeams()
        {
            Utils.Log(LogSeverity.Info, nameof(TeamSelectionScene), $"Genearting teams of size {_teamSize}.");

            _t1Preview.ClearChildren();
            _t2Preview.ClearChildren();

            var dna = new DNA(_teamSize, 2);

            dna.Randomize();

            var game = GameSetup.GenerateFromDna(dna, dna.Clone(), _map, false);

            foreach (var mobId in game.MobManager.Mobs)
            {
                var mobInfo = game.MobManager.MobInfos[mobId];
                if (mobInfo.Team == TeamColor.Red)
                {
                    _t1Preview.AddChild(BuildMobPreview(game, () => mobId));
                }
                else
                {
                    _t2Preview.AddChild(BuildMobPreview(game, () => mobId));
                }
            }

            _game = game;
        }
示例#5
0
        public override void OnLoading()
        {
            _tabBarComponent  = new TabBarComponent(this);
            _topInfoComponent = new TopInfoComponent(this)
            {
                LeftButtonControl = new Image {
                    Source = ResourceManager.GetImage("topheading_sync")
                },
                Header       = Translator.Translate("tenders"),
                ArrowVisible = false
            };

            var extraHorizontalLayout = new HorizontalLayout {
                CssClass = "ExtraHorizontalLayout"
            };
            var leftExtraLayout = new VerticalLayout {
                CssClass = "ExtraLeftLayoutCss"
            };
            var rightExtraLayout = new VerticalLayout {
                CssClass = "ExtraRightLayoutCss"
            };

            extraHorizontalLayout.AddChild(leftExtraLayout);
            extraHorizontalLayout.AddChild(rightExtraLayout);

            leftExtraLayout.AddChild(
                new TextView($"Новые")
            {
                CssClass = "ExtraInfo"
            });
            leftExtraLayout.AddChild(new TextView(Translator.Translate("new").ToLower())
            {
                CssClass = "ButtonExtraInfo"
            });

            rightExtraLayout.AddChild(
                new TextView($"В работе")
            {
                CssClass = "ExtraInfo"
            });
            rightExtraLayout.AddChild(new TextView(Translator.Translate("in_progress").ToLower())
            {
                CssClass = "ButtonExtraInfo"
            });

            _topInfoComponent.ExtraLayout.AddChild(extraHorizontalLayout);
        }
        private void Initialize()
        {
            var vl = new VerticalLayout();

            AddChild(vl);

            _swipeHorizontalLayout            = new SwipeHorizontalLayout();
            _swipeHorizontalLayout.Visible    = true;
            _swipeHorizontalLayout.CssClass   = "SwipeHorizontalLayout";
            _swipeHorizontalLayout.Scrollable = true;
            _swipeHorizontalLayout.OnSwipe   += SwipeIndex_OnSwipe;


            _horizontalLayout          = new HorizontalLayout();
            _horizontalLayout.CssClass = "HorizontalLayout";

            _image          = new Image();
            _image.Source   = "Image\\cats.jpg";
            _image.Visible  = true;
            _image.CssClass = "ImageForSwipeHorizontal";

            _image2          = new Image();
            _image2.Source   = "Image\\cat2.jpg";
            _image2.Visible  = true;
            _image2.CssClass = "ImageForSwipeHorizontal";

            _image3          = new Image();
            _image3.Source   = "Image\\cat3.jpg";
            _image3.Visible  = true;
            _image3.CssClass = "ImageForSwipeHorizontal";

            _image4          = new Image();
            _image4.Source   = "Image\\cat4.jpg";
            _image4.Visible  = true;
            _image4.CssClass = "ImageForSwipeHorizontal";


            _swipeHorizontalLayout.AddChild(_image);
            _swipeHorizontalLayout.AddChild(_image2);
            _swipeHorizontalLayout.AddChild(_image3);
            _swipeHorizontalLayout.AddChild(_image4);


            _horizontalLayout.AddChild(_swipeHorizontalLayout);


            vl.AddChild(new Button("Default alignment", AlignmentDefault_OnClick));
            vl.AddChild(new Button("Center alignment", AlignmentCenter_OnClick));
            vl.AddChild(new Button("Swipe To Third Image", SwipeToThird_OnClick));
            vl.AddChild(new Button("Back", Back_OnClick));

            vl.AddChild(_horizontalLayout);
        }
        public StoreScreen(Action <Store> HireAgentFunction, Action <Store> FireAgentFunction) : base()
        {
            Layout.PushLayout("storeScreen");
            this.HireAgentFunction = HireAgentFunction;
            this.FireAgentFunction = FireAgentFunction;

            Padding = new Point(10, 10);
            Margin  = 10;
            SetFixedSize(700, 500);

            VerticalLayout leftSide = new VerticalLayout();

            leftSide.SetFixedWidth(300);

            deliveredPizzas        = new KeyValueText("deliveredPizzas", "0");
            outStandingOrders      = new KeyValueText("outstandingOrders", "0");
            avgDeliveryTime        = new KeyValueText("avgDeliveryTime", "5");
            deliveryEmployeesCount = new KeyValueText("deliveryEmployees", "3");

            HorizontalLayout buttonsHor = new HorizontalLayout();
            Button           hireButton = new Button("hireEmployee");
            Button           fireButton = new Button("fireEmployee");

            hireButton.OnMouseClick = () => { HireAgentFunction(store); UpdateTexts(); };
            fireButton.OnMouseClick = () => { FireAgentFunction(store); UpdateTexts(); };
            buttonsHor.AddChild(hireButton, fireButton);

            lastWeeksIncome = new KeyValueText("lastWeekIncome", "0");

            costs              = new Text("costs");
            weeklyRent         = new KeyValueText("rent", "0");
            weeklyEmployeeWage = new KeyValueText("employees", "0");
            weeklyTotalCost    = new KeyValueText("total", "0");


            leftSide.AddChild(deliveryEmployeesCount);
            leftSide.AddChild(deliveredPizzas);
            leftSide.AddChild(outStandingOrders);
            leftSide.AddChild(avgDeliveryTime);
            leftSide.AddChild(buttonsHor);
            leftSide.AddChild(lastWeeksIncome);
            leftSide.AddChild(costs);
            leftSide.AddChild(weeklyRent);
            leftSide.AddChild(weeklyEmployeeWage);
            leftSide.AddChild(weeklyTotalCost);


            AddChild(leftSide);
            Layout.PopLayout("storeScreen");
        }
        private void Initialize()
        {
            var vl = new VerticalLayout();

            AddChild(vl);

            _hl          = new HorizontalLayout();
            _hl.CssClass = "HorizontalLayout";
            _hl.OnClick += Hl_OnClick;
            _hl.Id       = "ID Of Horizontal Layout";

            _textView          = new TextView();
            _textView.Text     = "В онклик лейаута задана функция DoBack";
            _textView.CssClass = "CssTextView";

            vl.AddChild(new Button("Change Visibility Of HL2", ChangeVisibilityOfHL2_OnClick));
            vl.AddChild(new Button("Change CSS Of HL2", ChangeCSSofHL2_OnClick));
            vl.AddChild(_textView);
            vl.AddChild(new Button("Back", Back_OnClick));
            _hl.AddChild(new Button("BackHL", Back_OnClick));
            _hl.AddChild(new Button("BackHL2", Back_OnClick));
            vl.AddChild(_hl);
        }
        Panel CreateTimeControlls()
        {
            Style.PushStyle("timeBar");
            Style.PushStyle("panelSpriteOn");

            Layout.PushLayout("timeBar");
            Layout.PushLayout("timeBarPanel");
            VerticalLayout vertLayout = new VerticalLayout();

            Layout.PopLayout("timeBarPanel");

            Style.PopStyle("panelSpriteOn");

            HorizontalLayout time     = new HorizontalLayout();
            Text             week     = new Text($"Week: 111", false).SetTextUpdateFunction(() => { return($"{Texts.Get("week")}: {simulator.week}"); });
            Text             day      = new Text($"Week: 111", false).SetTextUpdateFunction(() => { return($"{Texts.Get("day")}: {simulator.day}"); });
            Text             progress = new Text($"Week: 111", false).SetTextUpdateFunction(() => { return($"{simulator.GetDayProgress().ToString("p1")}"); });

            time.AddChild(week, day, progress);
            vertLayout.AddChild(time);

            Style.PushStyle("speedControls");

            HorizontalLayout speedControlls = new HorizontalLayout();


            simSpeedButtons = new Button[] { new Button(Style.sprites["speedPaused"]),
                                             new Button(Style.sprites["speedNormalSel"]),
                                             new Button(Style.sprites["speedFast"]),
                                             new Button(Style.sprites["speedFaster"]) };

            for (int i = 0; i < 4; i++)
            {
                SimSpeed speed = (SimSpeed)i;
                simSpeedButtons[i].OnMouseClick = () => ChangeSimSpeed(speed);
                speedControlls.AddChild(simSpeedButtons[i]);
            }

            Layout.PopLayout("timeBar");

            Style.PopStyle("speedControls");
            Style.PopStyle("timeBar");

            vertLayout.AddChild(speedControlls);

            return(vertLayout);
        }
        public CityDetailScreen(CitiesScreen citiesScreen)
        {
            Layout.PushLayout("bottomButtons");
            HorizontalLayout bottomButtons = new HorizontalLayout();

            bottomButtons.SetAnchor(AnchorX.Left, AnchorY.Bottom);
            Button back = new Button("back");

            back.OnMouseClick += this.Close;
            back.OnMouseClick += citiesScreen.Open;

            Button close = new Button("close");

            close.OnMouseClick = this.Close;
            bottomButtons.AddChild(back, close);

            AddChild(bottomButtons);
            Layout.PopLayout("bottomButtons");
        }
示例#11
0
        public UnitPanel(Func <Actor> GetActor, Dictionary <string, Sprite> uiSprites)
        {
            this.uiSprites = uiSprites;
            Padding        = new Point(10, 4);
            this.SetAnchor(AnchorX.Left, AnchorY.Bottom);
            this.SetLayoutSize(LayoutSize.FixedSize, LayoutSize.WrapContent).SetFixedWidth(250);
            getStandardSprite = true;
            this.GetActor     = GetActor;
            movesLeft         = new KeyValueText("movesLeft", "1/1");
            actionsLeft       = new KeyValueText("actionsLeft", "1/1");
            ammo       = new KeyValueText("ammo", "3/4");
            damage     = new KeyValueText("damage", "1");
            health     = new KeyValueText("health", "1");
            moveRange  = new KeyValueText("moveRange", "1");
            skillRange = new KeyValueText("skillRange", "1");

            buttonTooltip = new Text("MOvement");
            buttonTooltip.SetFontSize(FontSize.Small);
            buttonTooltip.SetColor(Color.LightSlateGray);

            HorizontalLayout buttonLayout = new HorizontalLayout();

            buttons = new Button[(int)Skills.Num];
            buttonLayout.Padding = new Point(6, 6);
            buttonLayout.SetMargin(10).SetLayoutSize(LayoutSize.MatchParent, LayoutSize.FixedSize);
            buttonLayout.SetFixedHeight(44);
            for (int i = 1; i < (int)Skills.Num; i++)
            {
                Skills s           = (Skills)i;
                string sprite      = s.ToString();
                string otherSprite = s.ToString() + "Selected";
                Button b           = new Button(uiSprites[sprite]);
                b.OnMouseEnter = () => buttonTooltip.SetText(s.ToString());
                b.OnMouseExit  = () => buttonTooltip.SetText("");
                b.OnMouseClick = () => SelectSkill(s);
                buttons[i]     = b;
                buttonLayout.AddChild(b);
            }
            AddChild(actionsLeft, movesLeft, health, ammo, damage, moveRange, skillRange, buttonTooltip, buttonLayout);
        }
示例#12
0
        private void FillControls()
        {
            _topInfoComponent.Header =
                ((string)_currentEventRecordset["Client_Description"]).CutForUIOutput(13, 2);
            _topInfoComponent.CommentLayout.AddChild(new TextView(
                                                         ((string)_currentEventRecordset["Client_Address"]).CutForUIOutput(17, 2)));

            _topInfoComponent.LeftButtonControl = new Image {
                Source = ResourceManager.GetImage("topheading_back")
            };
            _topInfoComponent.RightButtonControl = new Image {
                Source = ResourceManager.GetImage("tender_chat")
            };

            _taskCommentTextView = (TextView)GetControl("EventCommentTextView", true);
            _wrapUnwrapImage     = (Image)GetControl("WrapUnwrapImage", true);

            var extraHorizontalLayout = new HorizontalLayout {
                CssClass = "ExtraHorizontalLayout"
            };
            var leftExtraLayout = new VerticalLayout {
                CssClass = "ExtraVerticalLayout"
            };
            var rightExtraLayout = new VerticalLayout {
                CssClass = "ExtraVerticalLayout"
            };

            _topInfoComponent.ExtraLayout.AddChild(extraHorizontalLayout);
            extraHorizontalLayout.AddChild(leftExtraLayout);
            extraHorizontalLayout.AddChild(rightExtraLayout);

            leftExtraLayout.AddChild(new Image
            {
                CssClass = "TopInfoSideImage",
                Source   = ResourceManager.GetImage("topinfo_extra_map")
            });
            leftExtraLayout.AddChild(new TextView
            {
                Text     = Translator.Translate("onmap"),
                CssClass = "TopInfoSideText"
            });
            rightExtraLayout.AddChild(new Image
            {
                CssClass = "TopInfoSideImage",
                Source   = ResourceManager.GetImage("topinfo_extra_person")
            });

            var text = (string)_currentEventRecordset["Client_Description"];

            if (string.IsNullOrEmpty(text))
            {
                Translator.Translate("contact_not_present");
            }
            else
            {
                rightExtraLayout.OnClick += RightExtraLayoutOnOnClick;
            }

            rightExtraLayout.AddChild(new TextView
            {
                Text     = text.CutForUIOutput(12, 2),
                CssClass = "TopInfoSideText"
            });
            leftExtraLayout.OnClick += GoToMapScreen_OnClick;
        }
示例#13
0
        public TestScreen(Sprite houseSpr, Sprite frameSpr)
        {
            this.frameSpr = frameSpr;
            Padding       = new Point(10, 10);
            Margin        = 10;
            SetFixedSize(700, 500);

            HorizontalLayout mainHor = new HorizontalLayout();

            mainHor.SetLayoutSizeForBoth(LayoutSize.MatchParent);

            VerticalLayout leftOverview = new VerticalLayout();

            leftOverview.SetFixedSize(200, 300).SetLayoutSize(LayoutSize.FixedSize, LayoutSize.MatchParent);
            leftOverview.AddScrollbar();
            leftOverview.Margin  = 6;
            leftOverview.Padding = new Point(6, 2);

            int buildingsCount = 12;

            buildings = new VerticalLayout[buildingsCount];

            for (int i = 0; i < buildingsCount; i++)
            {
                int            index = i;
                VerticalLayout inner = new VerticalLayout();
                inner.OnMouseEnter = () => { MouseOvered(index); };
                buildings[i]       = inner;
                inner.Padding      = new Point(0, 4);
                inner.SetLayoutSize(LayoutSize.MatchParent, LayoutSize.WrapContent);
                Image im = new Image(houseSpr);
                inner.OnMouseClick = () => { SelectBuilding(index); };
                inner.AddChild(im);
                inner.AddChild(new Text($"Name {i}").SetAllignments(Allignment.Middle, Allignment.Middle));
                leftOverview.AddChild(inner);
            }

            selectedText             = new KeyValueText("Selected Buildings:", selected.ToString());
            selectedText.layoutSizeX = LayoutSize.WrapContent;

            VerticalLayout specifics = new VerticalLayout();

            specifics.overwriteChildLayout = false;
            specifics.SetMargin(6);
            specifics.SetLayoutSizeForBoth(LayoutSize.MatchParent);
            //specifics.SetChildAllignment(Allignment.Bottom);
            specifics.childAllignX = AnchorX.Right;

            VerticalLayout buildingInfos = new VerticalLayout();

            buildingInfos.Padding = new Point(10);
            //buildingInfos.GetStandardSprite(true);
            buildingInfos.SetLayoutSize(LayoutSize.MatchParent, LayoutSize.WrapContent);
            buildingName = new Text("Building Name");
            buildingInfos.AddChild(buildingName);
            buildingStats = new KeyValueText[] { new KeyValueText("building info Test", "12"),
                                                 new KeyValueText("and more", "13"),
                                                 new KeyValueText("even more", "14"),
                                                 new KeyValueText("even more", "15"),
                                                 new KeyValueText("even more", "15") };

            foreach (var el in buildingStats)
            {
                buildingInfos.AddChild(el);
            }

            specifics.AddChild(selectedText);
            specifics.AddChild(buildingInfos);

            mainHor.AddChild(leftOverview);
            mainHor.AddChild(specifics);

            HorizontalLayout buttons = new HorizontalLayout();

            //buttons.SetChildAllignment(Allignment.Right).SetMargin(10);
            buttons.SetLayoutSize(LayoutSize.MatchParent, LayoutSize.WrapContent);

            finishButton = new Button("Finish Selection");
            buttons.AddChild(finishButton);
            buttons.AddChild(new Button("Cancel"));

            specifics.AddChild(buttons);

            AddChild(mainHor);
        }
示例#14
0
        public void Init(IQFrameworkContainer container)
        {
            Container = container;

            PackageManagerApp.Send <PackageManagerInitCommand>();

            mRootLayout = new VerticalLayout();
            var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout);

            var verticalLayout = new VerticalLayout("box");

            treeNode.Add2Spread(verticalLayout);

            var searchView = new HorizontalLayout("box")
                             .AddTo(verticalLayout);

            searchView.AddChild(new LabelView("搜索:")
                                .FontBold()
                                .FontSize(12)
                                .Width(40));

            searchView.AddChild(
                new TextView().Height(20)
                .Do(search =>
            {
                search.Content
                .Bind(key => { PackageManagerApp.Send(new SearchCommand(key)); }).AddTo(mDisposableList);
            })
                );

            mAccessRightView = new ToolbarView()
                               .Menus(new List <string>()
            {
                "all", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString()
            })
                               .AddTo(verticalLayout)
                               .Do(self =>
            {
                self.Index.Bind(value =>
                {
                    PackageManagerState.AccessRightIndex.Value = value;
                    PackageManagerApp.Send(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddTo(mDisposableList);
            });

            mCategoriesSelectorView = new ToolbarView()
                                      .AddTo(verticalLayout)
                                      .Do(self =>
            {
                self.Index.Bind(value =>
                {
                    PackageManagerState.CategoryIndex.Value = value;
                    PackageManagerApp.Send(new SearchCommand(PackageManagerState.SearchKey.Value));
                }).AddTo(mDisposableList);
            });

            new PackageListHeaderView()
            .AddTo(verticalLayout);

            var packageList = new VerticalLayout("box")
                              .AddTo(verticalLayout);

            mRepositoryList = new ScrollLayout()
                              .Height(240)
                              .AddTo(packageList);

            PackageManagerState.Categories.Bind(value => { Categories = value; }).AddTo(mDisposableList);

            PackageManagerState.PackageRepositories
            .Bind(list => { this.PackageRepositories = list; }).AddTo(mDisposableList);
        }
示例#15
0
        public void Init(IQFrameworkContainer container)
        {
            var bindingSet = BindKit.CreateBindingSet(this, new PackageManagerViewModel()
                                                      .InjectSelfWithContainer(mPackageManagerApp.Container)
                                                      .Init());

            mRootLayout = new VerticalLayout();
            var treeNode = new TreeNode(true, LocaleText.FrameworkPackages).AddTo(mRootLayout);

            var verticalLayout = new VerticalLayout("box");

            treeNode.Add2Spread(verticalLayout);


            var searchView = new HorizontalLayout("box")
                             .AddTo(verticalLayout);

            searchView.AddChild(new LabelView("搜索:")
                                .FontBold()
                                .FontSize(12)
                                .Width(40));

            searchView.AddChild(
                new TextView().Height(20)
                .Do(search =>
            {
                bindingSet.Bind(search.Content)
                .For(v => v.OnValueChanged)
                .To(vm => vm.Search)
                .CommandParameter(search.Content);
            })
                );

            mAccessRightView = new ToolbarView()
                               .Menus(new List <string>()
            {
                "all", PackageAccessRight.Public.ToString(), PackageAccessRight.Private.ToString()
            })
                               .AddTo(verticalLayout)
                               .Do(self =>
            {
                bindingSet.Bind(self.Index).For(v => v.Value, v => v.OnValueChanged)
                .To(vm => vm.AccessRightIndex);
            });

            mCategoriesSelectorView = new ToolbarView()
                                      .AddTo(verticalLayout)
                                      .Do(self =>
            {
                bindingSet.Bind(self.Index).For(v => v.Value, v => v.OnValueChanged)
                .To(vm => vm.CategoryIndex);
            });

            new HeaderView()
            .AddTo(verticalLayout);

            var packageList = new VerticalLayout("box")
                              .AddTo(verticalLayout);

            mScrollLayout = new ScrollLayout()
                            .Height(240)
                            .AddTo(packageList);

            // 执行
            TypeEventSystem.Send <IEditorStrangeMVCCommand>(new PackageManagerStartUpCommand());

            bindingSet.Bind().For((v) => v.PackageDatas)
            .To(vm => vm.PackageDatas);

            bindingSet.Bind().For(v => v.Categories)
            .To(vm => vm.Categories);

            bindingSet.Build();
        }
示例#16
0
        private void CreateUI()
        {
            mainMenu = new MainMenu(Content, StartNewGame, game.Exit);
            mainMenuCanvas.AddChild(mainMenu);
            mainMenuCanvas.Finish();

            Dictionary <string, SoundEffect> sounds = new Dictionary <string, SoundEffect>()
            {
                { "level0Intro", Content.Load <SoundEffect>("Sounds/level0Intro") },
                { "level1Intro", Content.Load <SoundEffect>("Sounds/level1Intro") },
                { "level2Intro", Content.Load <SoundEffect>("Sounds/level2Intro") },
                { "gameFinished", Content.Load <SoundEffect>("Sounds/gameFinished") },
                { "gameOver", Content.Load <SoundEffect>("Sounds/gameOver") },
            };

            transitionText = new MapTransitionText(TransitionContinueClicked, BackToMenu, game.Exit, sounds);
            transitionCanvas.AddChild(transitionText);
            transitionCanvas.Finish();


            mapCanvas.AddChild(new UnitPanel(() => { if (currentMap != null)
                                                     {
                                                         return(currentMap.GetSelectedUnit());
                                                     }
                                                     else
                                                     {
                                                         return(null);
                                                     } }, mapCanvas.sprites));
            mapCanvas.AddChild(new EnemyInfoPanel(() => { if (currentMap != null)
                                                          {
                                                              return(currentMap.GetMouseOverEnemy());
                                                          }
                                                          else
                                                          {
                                                              return(null);
                                                          } }));

            damagePopup     = new DamagePopup(camera);
            Map.damagePopup = damagePopup;
            mapCanvas.AddChild(damagePopup);


            HorizontalLayout mainButtons = new HorizontalLayout();

            mainButtons.SetMargin(6).Padding = new Point(6, 6);
            mainButtons.SetLayoutSize(LayoutSize.WrapContent, LayoutSize.FixedSize);
            mainButtons.SetFixedHeight(44);
            mainButtons.SetFixedWidth(270);
            mainButtons.sprite = mapCanvas.sprites["panel"];

            Button menuButton = new Button(mapCanvas.sprites["menu"]);

            menuButton.SetFixedSize(32, 32);

            Button musicButton = new Button(Config.musicPlaying ? mapCanvas.sprites["musicOn"] : mapCanvas.sprites["musicOff"]);

            musicButton.SetFixedSize(32, 32);
            musicButton.OnMouseClick = () => {
                Config.musicPlaying = !Config.musicPlaying;
                if (Config.musicPlaying)
                {
                    musicButton.sprite = mapCanvas.sprites["musicOn"];
                }
                else
                {
                    musicButton.sprite = mapCanvas.sprites["musicOff"];
                }
            };

            Button nextTurnButton = new Button(mapCanvas.sprites["nextTurn"]);

            nextTurnButton.SetFixedSize(32, 32);
            nextTurnButton.OnMouseClick = () => { if (currentMap != null)
                                                  {
                                                      currentMap.EndTurn();
                                                  }
            };

            KeyValueText turnText = new KeyValueText("turns", "12");

            turnText.SetLayoutSizeForBoth(LayoutSize.MatchParent);
            turnText.SetValueTextUpdate(() => { return(currentMap != null ? currentMap.turnCounter.ToString() : ""); });
            mainButtons.AddChild(menuButton, musicButton, nextTurnButton, turnText);

            mapCanvas.AddChild(mainButtons);


            EnemyTurnSign enemyTurnSign = new EnemyTurnSign(() => { return(currentMap); });

            mapCanvas.AddChild(enemyTurnSign);

            ControlsPanel controls = new ControlsPanel(mapCanvas.sprites);

            mapCanvas.AddChild(controls);

            mapCanvas.Finish();
        }