public override void CreateUI()
        {
            base.CreateUI();

            this.Title(KKLocalization.StaticsEditor)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <HorizontalSep>("HorizontalSep3").Space(1, 2).Finish()

            .Add <HorizontalLayout>()
            .Add <TabController>(out tabController)
            .Horizontal()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <UIButton>()
            .Text(KKLocalization.EditorExport)
            .OnClick(Export)
            //.ToolTip(KKLocalization.EditorExportTooltip)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.EditorSave)
            .OnClick(Save)
            //.ToolTip()KKLocalization.EditorSaveTooltip
            .Finish()
            .Finish()
            .Add <SpawnView>(out spawnView).Finish()
            .Add <InstanceView>(out instanceView).Finish()
            .Add <MapDecalView>(out mapDecalView).Finish()
            .Add <GroupView>(out groupView).Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(1, 2).Finish()
            .Finish();

            spawnView.SetActive(false);
            instanceView.SetActive(false);
            mapDecalView.SetActive(false);
            groupView.SetActive(false);

            var tabItems = new List <TabController.ITabItem> ()
            {
                spawnView,
                instanceView,
                mapDecalView,
                groupView,
            };

            tabController.Items(tabItems);
            tabController.UpdateTabStates();
            tabController.SelectTab(1);

            UIMain.SetTitlebar(titlebar, Close);
        }
Exemple #2
0
 /// <summary>
 /// Monobehaviour function for drawing.
 /// </summary>
 public void OnGUI()
 {
     GUI.skin = HighLogic.Skin;
     if (!UIMain.layoutIsInitialized)
     {
         UIMain.SetTextures();
         UIMain.SetStyles();
         UIMain.layoutIsInitialized = true;
     }
     draw.Invoke();
 }
Exemple #3
0
        /// <summary>
        /// Monobehaviour function for drawing.
        /// </summary>
        public void OnGUI()
        {
            GUI.skin = HighLogic.Skin;

            if (!KKmain.bStylesSet)
            {
                UIMain.setStyles();
                KKmain.bStylesSet = true;
            }

            draw.Invoke();
        }
        public override void CreateUI()
        {
            GameEvents.onGameSceneSwitchRequested.Add(onGameSceneSwitchRequested);
            base.CreateUI();

            this.Title(KKLocalization.FacilityManager)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Padding(3, 3, 5, 5)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <HorizontalSep>("HorizontalSep3").Space(1, 2).Finish()
            .Add <UIText>(out facilityName)                   //box, yellow
            .Finish()
            .Add <FixedSpace>().Size(5).Finish()
            .Add <PositionLine>(out facilityPosition).Finish()
            .Add <LayoutAnchor>()
            .DoPreferredHeight(true)
            .FlexibleLayout(true, false)
            .Add <UIText>(out facilityPurpose)
            .Anchor(AnchorPresets.StretchAll)
            .SizeDelta(0, 0)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 3).Finish()
            .Add <HorizontalLayout>()
            .Add <UIButton>(out openFacility)
            .OnClick(OpenFacility)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <UIButton>(out closeFacility)
            .OnClick(CloseFacility)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 3).Finish()
            .Add <TrackingStationGUI>(out tractingStation).FlexibleLayout(true, false).Finish()
            .Add <HangarGUI>(out hangar).FlexibleLayout(true, false).Finish()
            .Add <ProductionGUI>(out production).FlexibleLayout(true, false).Finish()
            .Add <MerchantGUI>(out merchant).FlexibleLayout(true, false).Finish()
            .Add <StorageGUI>(out storage).FlexibleLayout(true, false).Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <StaffGUI>(out staff).FlexibleLayout(true, false).Finish()
            .Add <HorizontalSep>("HorizontalSep3").SpaceBelow(3).Finish()
            .Finish();

            UIMain.SetTitlebar(titlebar, Close);
        }
        public override void CreateUI()
        {
            base.CreateUI();

            this.Title(KKLocalization.GroupEditor)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <HorizontalSep>("HorizontalSep2").Space(1, 2).Finish()
            .Add <InputLine>(out groupName)
            .Label(KKLocalization.GroupName)
            .OnSubmit(SetGroupName)
            .OnFocusLost(RestoreGroupName)
            .Finish()
            .Add <IncrementSize>(out increment)
            .Finish()
            .Add <PositionEdit>(out positionEdit)
            .Increment(increment)
            .DoAltitude(true)
            .OnPositionChange(OnPositionChange)
            .Finish()
            .Add <FieldToggle>(out sealevelRef)
            .Text(KKLocalization.SealevelAsReference)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <HorizontalLayout>()
            .Add <UIButton>(out saveClose)
            .Text(KKLocalization.SaveAndClose)
            .OnClick(SaveAndClose)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.DestroyGroup)
            .OnClick(DestroyGroup)
            .Finish()
            .Finish()

            .Add <HorizontalSep>("HorizontalSep2").Space(1, 2).Finish()
            .Finish();

            UIMain.SetTitlebar(titlebar, Close);
        }
        public override void CreateUI()
        {
            base.CreateUI();

            this.Title(KKLocalization.MapDecalEditor)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <InputLine>(out mapDecalName)
            .Label(KKLocalization.MapDecalName)
            .OnSubmit(SetMapDecalName)
            .OnFocusLost(RestoreMapDecalName)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <IncrementSize>(out increment)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <PositionEdit>(out positionEdit)
            .Increment(increment)
            .DoAltitude(false)
            .OnPositionChange(OnPositionChange)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <ValueAdjuster>(out placementOrder)
            .Label(KKLocalization.MapDecalOrder)
            .OnIncrement(OnOrderIncrement)
            .OnDecrement(OnOrderDecrement)
            .OnValueSet(OnOrderSet)
            //.Format("F0")
            .InputWidth(100)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <ValueAdjuster>(out radius)
            .Label(KKLocalization.MapDecalRadius)
            .OnIncrement(OnRadiusIncrement)
            .OnDecrement(OnRadiusDecrement)
            .OnValueSet(OnRadiusSet)
            .InputWidth(100)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <HorizontalLayout>()
            .Add <FieldToggle>(out useAbsolute)
            .Text(KKLocalization.UseAbsolute)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.SnapSurface)
            .OnClick(SnapSurface)
            .Finish()
            .Finish()
            .Add <ValueAdjuster>(out absoluteOffset)
            .Label(KKLocalization.AbsoluteOffset)
            .OnIncrement(OnAbsoluteOffsetIncrement)
            .OnDecrement(OnAbsoluteOffsetDecrement)
            .OnValueSet(OnAbsoluteOffsetSet)
            //.Format("G4")
            .InputWidth(100)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <HorizontalLayout>()
            .ChildAlignment(TextAnchor.MiddleCenter)
            .Add <UIText>()
            .Text(KKLocalization.HeightMap)
            .Finish()
            .Add <UIDropdown>(out heightmapSelector)
            .OnValueChanged(SelectHeightmap)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <ValueAdjuster>(out heighMapDeformity)
            .Label(KKLocalization.HeightMapDeformity)
            .OnIncrement(OnHeightMapDeformityIncrement)
            .OnDecrement(OnHeightMapDeformityDecrement)
            .OnValueSet(OnHeightMapDeformitySet)
            //.Format("F3")
            .InputWidth(100)
            .Finish()
            .Add <ValueAdjuster>(out smoothHeight)
            .Label(KKLocalization.SmoothHeight)
            .OnIncrement(OnSmoothHeightIncrement)
            .OnDecrement(OnSmoothHeightDecrement)
            .OnValueSet(OnSmoothHeightSet)
            //.Format("F3")
            .InputWidth(100)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()
            .Add <HorizontalLayout>()
            .ChildAlignment(TextAnchor.MiddleCenter)
            .Add <UIText>()
            .Text(KKLocalization.ColorMap)
            .Finish()
            .Add <UIDropdown>(out colormapSelector)
            .OnValueChanged(SelectColormap)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <ValueAdjuster>(out smoothColor)
            .Label(KKLocalization.SmoothColor)
            .OnIncrement(OnSmoothColorIncrement)
            .OnDecrement(OnSmoothColorDecrement)
            .OnValueSet(OnSmoothColorSet)
            //.Format("F3")
            .InputWidth(100)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Finish()

            .Add <HorizontalSep>("HorizontalSep2").Space(1, 2).Finish()
            .Add <FieldToggle>(out removeScatter)
            .Text(KKLocalization.RemoveScatter)
            .Finish()
            .Add <FieldToggle>(out useAlphaHeightSmoothing)
            .Text(KKLocalization.UseAlphaHeightSmoothing)
            .Finish()
            .Add <FieldToggle>(out cullBlack)
            .Text(KKLocalization.CullBlack)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep2").Space(1, 2).Finish()
            .Add <InputLine>(out groupName)
            .OnSubmit(SetGroupName)
            .OnFocusLost(RestoreGroupName)
            .Label(KKLocalization.Group)
            .Finish()

            .Add <UIButton>()
            .Text(KKLocalization.EditorSave)
            .OnClick(Save)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.Deselect)
            .OnClick(Deselect)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.DeleteInstance)
            .OnClick(DeleteInstance)
            .Finish()
            .Finish();

            UIMain.SetTitlebar(titlebar, Close);

            heightmapNames = new List <OptionData>();
            colormapNames  = new List <OptionData>();
        }
Exemple #7
0
        public override void CreateUI()
        {
            GameEvents.onGameSceneSwitchRequested.Add(onGameSceneSwitchRequested);
            if (tFolded == null)
            {
                tTitleIcon        = UIMain.MakeSprite("KerbalKonstructs/Assets/titlebaricon");
                tSmallClose       = UIMain.MakeSprite("KerbalKonstructs/Assets/littleclose");
                tSetLaunchsite    = UIMain.MakeSprite("KerbalKonstructs/Assets/setaslaunchsite");
                tOpenedLaunchsite = UIMain.MakeSprite("KerbalKonstructs/Assets/openedlaunchsite");
                tClosedLaunchsite = UIMain.MakeSprite("KerbalKonstructs/Assets/closedlaunchsite");
                tMakeFavourite    = UIMain.MakeSprite("KerbalKonstructs/Assets/makefavourite");
                tVerticalSep      = UIMain.MakeSprite("KerbalKonstructs/Assets/verticalsep");
                tIsFave           = UIMain.MakeSprite("KerbalKonstructs/Assets/isFavourite");
                tFoldOut          = UIMain.MakeSprite("KerbalKonstructs/Assets/foldin");
                tFoldIn           = UIMain.MakeSprite("KerbalKonstructs/Assets/foldout");
                tFolded           = UIMain.MakeSprite("KerbalKonstructs/Assets/foldout");
            }

            ScrollView  siteInfo;
            UIScrollbar info_scrollbar;
            UIScrollbar log_scrollbar;

            //ToggleGroup toggleGroup;

            base.CreateUI();
            Title(KKLocalization.BaseManager)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <HorizontalSep>("HorizontalSep").Space(1, 2).Finish()
            .Add <UIText>(out siteName)                   //yellow text
            .Alignment(TextAlignmentOptions.Center)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <FixedSpace>().Size(5).Finish()
            .Add <VerticalLayout>(out foldGroup)
            .Add <HorizontalLayout>()
            .Add <FixedSpace>().Size(2).Finish()
            .Add <UIImage>()
            .Image(tVerticalSep)
            .FlexibleLayout(false, true)
            .PreferredSize(4, 135)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <UIImage>(out siteLogo)
            .PreferredSize(135, 135)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <UIImage>()
            .Image(tVerticalSep)
            .FlexibleLayout(false, true)
            .PreferredSize(4, 135)
            .Finish()
            .Add <FixedSpace>().Size(2).Finish()
            .Finish()
            .Add <FixedSpace>().Size(3).Finish()
            .Add <ScrollView>(out siteInfo)
            .Horizontal(false)
            .Vertical(true)
            .Horizontal()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, true)
            .FlexibleLayout(true, false)
            .PreferredSize(-1, 120)
            .Add <UIScrollbar>(out info_scrollbar, "Scrollbar")
            .Direction(Scrollbar.Direction.BottomToTop)
            .PreferredWidth(15)
            .Finish()
            .Finish()
            .Finish()
            .Add <FixedSpace>().Size(1).Finish()
            .Add <HorizontalLayout>()
            .ChildAlignment(TextAnchor.MiddleCenter)
            .Add <UIButton>(out showStats)
            .Text(KKLocalization.Stats)
            .OnClick(ShowStats)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <UIButton>(out showLog)
            .Text(KKLocalization.Log)
            .OnClick(ShowLog)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <IconToggle>(out favToggle)
            .OnSprite(tIsFave)
            .OffSprite(tMakeFavourite)
            .OnValueChanged(SetIsFavorite)
            .PreferredSize(23, 23)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <IconToggle>(out foldToggle)
            .OnSprite(tFoldOut)
            .OffSprite(tFoldIn)
            .OnValueChanged(SetIsFolded)
            .PreferredSize(23, 23)
            .Finish()
            .Finish()
            .Add <VerticalLayout>(out statsView)
            .Add <InfoLine>(out altitude).Label(KKLocalization.Altitude).Finish()
            .Add <InfoLine>(out longitude).Label(KKLocalization.Longitude).Finish()
            .Add <InfoLine>(out latitude).Label(KKLocalization.Latitude).Finish()
            .Add <FixedSpace>().Size(3).Finish()
            .Add <InfoLine>(out maxLength).Label(KKLocalization.MaxLength).Finish()
            .Add <InfoLine>(out maxWidth).Label(KKLocalization.MaxWidth).Finish()
            .Add <InfoLine>(out maxHeight).Label(KKLocalization.MaxHeight).Finish()
            .Add <InfoLine>(out maxMass).Label(KKLocalization.MaxMass).Finish()
            .Add <InfoLine>(out maxParts).Label(KKLocalization.MaxParts).Finish()
            .Finish()
            .Add <ScrollView>(out logView)
            .Horizontal(false)
            .Vertical(true)
            .Horizontal()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, true)
            .FlexibleLayout(true, false)
            .PreferredSize(-1, 120)
            .Add <UIScrollbar>(out log_scrollbar, "Scrollbar")
            .Direction(Scrollbar.Direction.BottomToTop)
            .PreferredWidth(15)
            .Finish()
            .Finish()
            .Add <FixedSpace>().Size(1).Finish()
            .Add <UIButton>(out openBase)
            .OnClick(OpenBase)
            .Finish()
            .Add <UIButton>(out closeBase)
            .OnClick(CloseBase)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <HorizontalLayout>(out editorView)
            .Add <UIImage>(out launchsiteStatus)
            .PreferredSize(32, 32)
            .Finish()
            .Add <UIButton>(out setLaunchsite)
            .Text(KKLocalization.SetLaunchsite)
            .OnClick(SetLaunchsite)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <VerticalLayout>(out flightView)
            .Add <UIButton>(out createWaypoint)
            .Text(KKLocalization.CreateWaypoint)
            .OnClick(CreateWaypoint)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <UIButton>(out deleteWaypoint)
            .Text(KKLocalization.DeleteWaypoint)
            .OnClick(DeleteWaypoint)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep").Space(3, 1).Finish()
            .Finish();

            ShowStats();

            siteInfo.VerticalScrollbar = info_scrollbar;
            siteInfo.Viewport.FlexibleLayout(true, true);
            siteInfo.Content
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Anchor(AnchorPresets.HorStretchTop)
            .PreferredSizeFitter(true, false)
            .WidthDelta(0)
            .Add <UIText>(out siteDescription)
            .Alignment(TextAlignmentOptions.TopLeft)
            .Margin(5, 5, 5, 5)
            .FlexibleLayout(true, false)
            .SizeDelta(0, 0)
            .Finish()
            .Finish();

            logView.VerticalScrollbar = log_scrollbar;
            logView.Viewport.FlexibleLayout(true, true);
            logView.Content
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Anchor(AnchorPresets.HorStretchTop)
            .PreferredSizeFitter(true, false)
            .WidthDelta(0)
            .Add <UIText>(out logText)
            .Alignment(TextAlignmentOptions.TopLeft)
            .Margin(5, 5, 5, 5)
            .FlexibleLayout(true, false)
            .SizeDelta(0, 0)
            .Finish()
            .Finish();

            UIMain.SetTitlebar(titlebar, Close);
        }
        public override void CreateUI()
        {
            GameEvents.onGameSceneSwitchRequested.Add(onGameSceneSwitchRequested);
            base.CreateUI();

            gameObject.AddComponent <Touchable>();

            ScrollView  launchsiteList;
            UIScrollbar ls_scrollbar;

            this.Title(KKLocalization.LaunchsiteSelector)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <HorizontalSep>("HorizontalSep").Space(1, 2).Finish()
            .Add <LaunchsiteFilter>(out launchsiteFilter)
            .OnFilterChanged(BuildLaunchsites)
            .Finish()
            .Add <FixedSpace>().Size(10).Finish()
            .Add <ScrollView>(out launchsiteList)
            .Horizontal(false)
            .Vertical(true)
            .Horizontal()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, true)
            .FlexibleLayout(true, false)
            .PreferredSize(-1, 120)
            .Add <UIScrollbar>(out ls_scrollbar, "Scrollbar")
            .Direction(Scrollbar.Direction.BottomToTop)
            .PreferredWidth(15)
            .FlexibleLayout(false, true)
            .Finish()
            .Finish()
            .Add <FixedSpace>().Size(5).Finish()
            .Add <InfoLine> (out currentLaunchsite)
            .Label(KKLocalization.CurrentLaunchsite)
            .Finish()
            .Add <UIButton>(out setLaunchsite)
            .Text(KKLocalization.SetLaunchsite)
            .OnClick(SetLaunchsite)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <HorizontalLayout>()
            .Add <UIButton>(out setDefault)
            .Text(KKLocalization.SetDefault)
            .OnClick(SetDefault)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <UIButton>(out useDefault)
            .Text(KKLocalization.UseDefault)
            .OnClick(UseDefault)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep").SpaceBelow(2).Finish()
            .Finish();

            UIMain.SetTitlebar(titlebar, Close);

            ToggleGroup launchsiteGroup;

            launchsiteList.VerticalScrollbar = ls_scrollbar;
            launchsiteList.Viewport.FlexibleLayout(true, true);
            launchsiteList.Content
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Anchor(AnchorPresets.HorStretchTop)
            .PreferredSizeFitter(true, false)
            .WidthDelta(0)
            .ToggleGroup(out launchsiteGroup)
            .Finish();

            launchsiteItems            = new LaunchsiteItem.List(launchsiteGroup);
            launchsiteItems.Content    = launchsiteList.Content;
            launchsiteItems.onSelected = OnSelected;
        }
        public override void CreateUI()
        {
            GameEvents.onGameSceneSwitchRequested.Add(onGameSceneSwitchRequested);
            base.CreateUI();

            ScrollView  launchsiteList;
            UIScrollbar ls_scrollbar;
            ScrollView  facilityList;
            UIScrollbar f_scrollbar;

            this.Title(KKLocalization.InflightBaseBoss)
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .PreferredSizeFitter(true, true)
            .Anchor(AnchorPresets.TopLeft)
            .Pivot(PivotPresets.TopLeft)
            .SetSkin("KK.Default")

            .Add <FixedSpace>().Size(1).Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <FixedSpace>().Size(5).Finish()
            .Add <UIText>()
            .Text(KKLocalization.FlightTools)
            .Finish()
            .Add <HorizontalLayout>()
            .Add <FixedSpace>().Size(2).Finish()
            .Add <UIText>()
            .Text(KKLocalization.LandingGuide)
            .Finish()
            .Add <IconToggle>(out landingGuide)
            .OnSprite(UIMain.tIconOpen)
            .OffSprite(UIMain.tIconClosed)
            .OnValueChanged(ToggleLandingGuideUI)
            .PreferredSize(56, 18)
            .Finish()
            .Add <FlexibleSpace>().Finish()
            .Add <UIText>()
            .Text(KKLocalization.NGS)
            .Finish()
            .Add <IconToggle>(out navGuidance)
            .OnSprite(UIMain.tIconOpen)
            .OffSprite(UIMain.tIconClosed)
            .OnValueChanged(ToggleNavGuidanceSystem)
            .PreferredSize(18, 18)
            .Finish()
            .Add <FixedSpace>().Size(2).Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <UIText>()
            .Text(KKLocalization.SelectedBase)
            .Finish()
            .Add <UIText>(out noBasesBeacon)
            .Text(KKLocalization.NoBasesBeacon)
            .Finish()
            .Add <UIText>(out noNearestBase)
            .Text(KKLocalization.NoNearestBase)
            .Finish()
            .Add <HorizontalLayout>(out nearestBaseGroup)
            .Add <InfoLine>(out nearestBase)
            .Label(KKLocalization.NearestBase)
            .Finish()
            .Add <FixedSpace>(out ngsFiller).Size(21).Finish()
            .Add <UIButton>(out setNGSTarget)
            .Text(KKLocalization.NGS)
            .OnClick(SetNGSTarget)
            .FlexibleLayout(true, false)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <UIText>()
            .Text(KKLocalization.BaseStatus)
            .Finish()
            .Add <VerticalLayout>(out careerGroup)
            .Add <ScrollView>(out launchsiteList)
            .Horizontal(false)
            .Vertical(true)
            .Horizontal()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, true)
            .FlexibleLayout(true, false)
            .PreferredSize(-1, 120)
            .Add <UIScrollbar>(out ls_scrollbar, "Scrollbar")
            .Direction(Scrollbar.Direction.BottomToTop)
            .PreferredWidth(15)
            .FlexibleLayout(false, true)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <UIButton>(out openSite)
            .OnClick(OpenSite)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <UIText>(out siteIsOpen)
            .Text(KKLocalization.BaseIsOpen)
            .Finish()
            .Add <UIText>(out siteCannoteBeOpened)
            .Text(KKLocalization.BaseCannotBeOpened)
            .Finish()
            .Add <UIText>(out basesCanBeOpened)
            .Text(KKLocalization.BasesCanBeOpened)
            .Finish()
            .Finish()
            .Add <VerticalLayout>(out facilitiesGroup)
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <UIText>()
            .Text(KKLocalization.OperationalFacilities)
            .Finish()
            .Add <UIButton>(out facilityScan)
            .Text(KKLocalization.ScanForFacilities)
            .OnClick(CacheFacilities)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <ScrollView>(out facilityList)
            .Horizontal(false)
            .Vertical(true)
            .Horizontal()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, true)
            .FlexibleLayout(true, false)
            .PreferredSize(-1, 120)
            .Add <UIScrollbar>(out f_scrollbar, "Scrollbar")
            .Direction(Scrollbar.Direction.BottomToTop)
            .PreferredWidth(15)
            .FlexibleLayout(false, true)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <UIText>(out noFacilitiesWithin)
            .Text(KKLocalization.NoFacilitiesWithin)
            .Finish()
            .Add <UIText>(out nearbyFacilities)
            .Text(KKLocalization.NearbyFacilitiesCanBeShown)
            .Finish()
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(2, 2).Finish()
            .Add <UIText>()
            .Text(KKLocalization.OtherFeatures)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.StartAirRacing)
            .OnClick(StartAirRacing)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <UIButton>()
            .Text(KKLocalization.BasicOrbitalData)
            .OnClick(BasicOrbitalData)
            .FlexibleLayout(true, false)
            .Finish()
            .Add <HorizontalSep>("HorizontalSep3").Space(5, 2).Finish()
            .Finish();

            ToggleGroup launchsiteGroup;

            launchsiteList.VerticalScrollbar = ls_scrollbar;
            launchsiteList.Viewport.FlexibleLayout(true, true);
            launchsiteList.Content
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Anchor(AnchorPresets.HorStretchTop)
            .PreferredSizeFitter(true, false)
            .WidthDelta(0)
            .ToggleGroup(out launchsiteGroup)
            .Finish();

            UIMain.SetTitlebar(titlebar, Close);

            launchsiteItems            = new LaunchsiteItem.List(launchsiteGroup);
            launchsiteItems.Content    = launchsiteList.Content;
            launchsiteItems.onSelected = OnLaunchsiteSelected;

            ToggleGroup facilityGroup;

            facilityList.VerticalScrollbar = f_scrollbar;
            facilityList.Viewport.FlexibleLayout(true, true);
            facilityList.Content
            .Vertical()
            .ControlChildSize(true, true)
            .ChildForceExpand(false, false)
            .Anchor(AnchorPresets.HorStretchTop)
            .PreferredSizeFitter(true, false)
            .WidthDelta(0)
            .ToggleGroup(out facilityGroup)
            .Finish();

            facilityItems            = new FacilityItem.List(facilityGroup);
            facilityItems.Content    = facilityList.Content;
            facilityItems.onSelected = OnFacilitySelected;

            rectTransform.anchoredPosition3D = new Vector2(10, -25);

            GameEvents.onVesselSituationChange.Add(onVesselSituationChange);
        }