Ejemplo n.º 1
0
        private void ApplyPressed(object sender, EventArgs e)  //chiudo la personalizzazione e applico le modifiche
        {
            if (normalGPSRadio.IsChecked)
            {
                usingGPS        = true;
                customLatitude  = latitude;
                customLongitude = longitude;
                GPSMode1.FadeTo(1, 200);
                GPSMode2.FadeTo(0, 200);
            }
            else
            {
                usingGPS        = false;
                customLatitude  = float.Parse(latitudeText.Text.Replace('.', ','));
                customLongitude = float.Parse(longitudeText.Text.Replace('.', ','));
                if (customLatitude > 90)
                {
                    customLatitude = 90;
                }
                else if (customLatitude < -90)
                {
                    customLatitude = -90;
                }
                if (customLongitude > 360)
                {
                    customLongitude = 360;
                }
                else if (customLongitude < 0)
                {
                    customLongitude = 0;
                }
                GPSMode1.FadeTo(0, 200);
                GPSMode2.FadeTo(1, 200);
            }

            for (int i = 0; i < planets.Count; i++)
            {
                syncPlanets[i] = (Planet)planets[i].Clone();
            }
            for (int i = 0; i < stars.Count; i++)
            {
                syncStars[i] = (Planet)stars[i].Clone();
            }
            for (int i = 0; i < points.Count; i++)
            {
                syncPoints[i] = (Planet)points[i].Clone();
            }

            syncPlanets        = synchronizePlanets(syncPlanets, customLongitude, customLatitude);
            syncStars          = synchronizePlanets(syncStars, customLongitude, customLatitude);
            syncPoints         = synchronizePlanets(syncPoints, customLongitude, customLatitude);
            syncConstellations = new Constellations(this, syncStars);
            FixNorthSouthPole();

            CloseCustomGPS();
        }
Ejemplo n.º 2
0
        private void loadBottomBarTexture()
        {
            bottombartoggle.Source       = ImageSource.FromResource("Horizon.Assets.BottomBar.uparrow.png", typeof(Camera3D).GetTypeInfo().Assembly);
            ChangeThemeButton1.Source    = ImageSource.FromResource("Horizon.Assets.BottomBar.Theme1.png", typeof(Camera3D).GetTypeInfo().Assembly);
            ChangeThemeButton2.Source    = ImageSource.FromResource("Horizon.Assets.BottomBar.Theme2.png", typeof(Camera3D).GetTypeInfo().Assembly);
            rocketLabelImage.Source      = ImageSource.FromResource("Horizon.Assets.Rocket.rocketLaunch.png", typeof(Camera3D).GetTypeInfo().Assembly);
            SwitchJoystickButton1.Source = ImageSource.FromResource("Horizon.Assets.CustomButton.controllerSwitch.png", typeof(Camera3D).GetTypeInfo().Assembly);
            SwitchJoystickButton2.Source = ImageSource.FromResource("Horizon.Assets.CustomButton.controllerSwitch2.png", typeof(Camera3D).GetTypeInfo().Assembly);
            GPSMode1.Source          = ImageSource.FromResource("Horizon.Assets.BottomBar.gpsEnabled.png", typeof(Camera3D).GetTypeInfo().Assembly);
            GPSMode2.Source          = ImageSource.FromResource("Horizon.Assets.BottomBar.gpsDisabled.png", typeof(Camera3D).GetTypeInfo().Assembly);
            rocketButton.ImageSource = ImageSource.FromResource("Horizon.Assets.BottomBar.earth.png", typeof(Camera3D).GetTypeInfo().Assembly);

            bottombartoggle.ScaleTo(0.7);
            ChangeThemeButton1.ScaleTo(0.7);
            ChangeThemeButton2.ScaleTo(0.7);
            SwitchJoystickButton1.ScaleTo(0.7);
            SwitchJoystickButton2.ScaleTo(0.7);
            GPSMode1.ScaleTo(0.7);
            GPSMode2.ScaleTo(0.7);

            normalGPSRadio.FadeTo(0, 0);
            customGPSRadio.FadeTo(0, 0);

            normalGPSLabel.FadeTo(0, 0);
            customGPSLabel.FadeTo(0, 0);

            latitudeLabel.FadeTo(0, 0);
            longitudeLabel.FadeTo(0, 0);
            latitudeText.FadeTo(0, 0);
            longitudeText.FadeTo(0, 0);

            cancelLabel.FadeTo(0, 0);
            applyLabel.FadeTo(0, 0);

            ChangeThemeButton2.FadeTo(0, 0);
            if (positionLoaded)
            {
                GPSMode2.FadeTo(0, 0);
            }
            else
            {
                GPSMode1.FadeTo(0, 0);
            }
            if (sensorExists)
            {
                SwitchJoystickButton2.FadeTo(0, 0);
            }
            else
            {
                SwitchJoystickButton1.FadeTo(0, 0);
            }
        }