public NavigationRoomControl(NavigationRoom viewModel)
        {
            ViewModel = viewModel;

            Content = Factory.StackPanel(new List <IControl>
            {
                Factory.Headline1("NAVIGATION ROOM"),
                Factory.Box(
                    content: Factory.StackPanel(new List <IControl>
                {
                    Factory.DefinitionList(new Dictionary <string, Func <string> >
                    {
                        { "Location:   ", () => ViewModel.CurrentStation?.Name ?? DeepSpaceText },
                        { "Available Fuel:   ", GetAvailableFuelText },
                    }),
                    Factory.Text(() => string.Empty),
                    Factory.Box(
                        content: Factory.Table(
                            () => ViewModel.Targets,
                            new Dictionary <string, Func <StationTarget, string> >
                    {
                        { "Station", target => target.Station.Name },
                        { "Distance", target => $"{target.Distance.InAstronomicUnits().ToStringInvariant()} AU" },
                        { "Req. Delta V", target => $"{target.RequiredDeltaVelocity.InMeterPerSecond().ToStringInvariant()} m/s" },
                        { "Req. Fuel", target => string.Join(", ", target.RequiredFuel.Select(stack => $"{stack.Amount} {stack.Name}")) }
                    },
                            "No destinations in range")
                        )
                })
                    )
            });
        }
Esempio n. 2
0
 public Wishbone(ShipModel model) : base(model)
 {
     WeaponsBay     weaponsBay     = new WeaponsBay(this, Guid.NewGuid());
     NavigationRoom navigation     = new NavigationRoom(this, Guid.NewGuid());
     DroneBay       droneBay       = new DroneBay(this, Guid.NewGuid());
     MaintenanceBay maintenanceBay = new MaintenanceBay(this, Guid.NewGuid());
     ScavengeBay    scavengeBay    = new ScavengeBay(this, Guid.NewGuid());
     SensorRoom     sensorRoom     = new SensorRoom(this, Guid.NewGuid());
     ShieldBay      shieldBay      = new ShieldBay(this, Guid.NewGuid());
     ResearchCenter researchCenter = new ResearchCenter(this, Guid.NewGuid());
 }
    void ChangeUI(GameObject result, GameObject target, string targetName)
    {
        currentButton = result.GetComponent <SampleButtonScript>().GetComponent <Button>();
        foreach (Transform child in contentPanel2.transform)
        {
            GameObject.Destroy(child.gameObject);
        }
        searchview.SetActive(false);
        currentCamera.GetComponent <Lean.Touch.LeanCameraZoomSmooth>().enabled = true;
        MainBuilding[0].GetComponent <Lean.Touch.LeanRotate>().enabled         = false;
        MainBuilding[1].GetComponent <Lean.Touch.LeanRotate>().enabled         = false;
        MainBuilding[2].GetComponent <Lean.Touch.LeanRotate>().enabled         = false;
        MainBuilding[3].GetComponent <Lean.Touch.LeanRotate>().enabled         = false;
        SetDefaultRotation();
        GameObject clone = Instantiate(result, contentPanel2, false) as GameObject;

        Destroy(clone.GetComponent <Button>());
        clone.transform.GetChild(3).gameObject.SetActive(false);
        resultview.SetActive(true);
        NavigationRoom Nav = routeButton.GetComponent <NavigationRoom>();

        Nav.target     = target;
        Nav.targetName = targetName;
        moveView.SetActive(false);
        routeButton.SetActive(true);
        backButton.SetActive(false);
        crossButton.SetActive(true);
        googleButton.SetActive(true);
        backButton.GetComponent <BackStage>().IsResult = true;
        if (currentChar != null)
        {
            Destroy(currentChar);
            currentChar = null;
        }
        currentChar = Instantiate(Char.transform.GetChild(0).gameObject, target.transform.position, Quaternion.Euler(new Vector3(0f, 315f, 0f)), target.transform);
        currentChar.SetActive(true);
    }