Exemplo n.º 1
0
        private void Start()
        {
            ModSettings settings = mod.GetSettings();

            encounterAvoidanceSystem = settings.GetValue <bool>("AvoidRandomEncounters", "AvoidRandomEncounters");
            maxSuccessChance         = settings.GetValue <int>("AvoidRandomEncounters", "MaxChanceToAvoidEncounter");

            hudVitals    = DaggerfallUI.Instance.DaggerfallHUD.HUDVitals;
            playerEntity = GameManager.Instance.PlayerEntity;

            TediousData.Instance.LoadPortTowns();
            baseFixedDeltaTime = Time.fixedDeltaTime;
            DaggerfallUI.UIManager.OnWindowChange += travelMapInterceptor;
            travelMap          = new TediousTravelMap(DaggerfallUI.UIManager, this);
            travelUi           = new TediousTravelControllMenu(DaggerfallUI.UIManager, travelMap);
            travelUi.OnCancel += (sender) => {
                destinationName = "";
            };
            travelUi.OnClose += () => {
                InterruptFastTravel();
            };

            travelUi.OnTimeCompressionChanged += (newTimeCompression) => { SetTimeScale(newTimeCompression); };

            ridingAudioSource = GameManager.Instance.TransportManager.GetComponent <AudioSource>();
            Debug.Log("riding audio source: " + ridingAudioSource);

            // Clear destination for new or loaded games.
            SaveLoadManager.OnLoad       += (saveData) => { destinationName = ""; };
            StartGameBehaviour.OnNewGame += () => { destinationName = ""; };
        }
Exemplo n.º 2
0
        private void Start()
        {
            ModSettings settings = mod.GetSettings();

            UseNativeDfShipCalculations = settings.GetValue <bool>(SHIP_TRAVEL_OPTIONS_SETTINGS_SECTION, "EnableDaggerfallNativeShipTravel");
            UseInnsWhenTravelingByShip  = settings.GetValue <bool>(SHIP_TRAVEL_OPTIONS_SETTINGS_SECTION, "UseInnsWhenTravelingByShip");

            int avoidEncounterInt = settings.GetValue <int>(RANDOM_ENCOUNTERS_SETTINGS_SECTION, "AvoidRandomEncounters");

            avoidEncounters  = (AvoidEncounterChoice)Enum.ToObject(typeof(AvoidEncounterChoice), avoidEncounterInt);
            maxSuccessChance = settings.GetValue <int>(RANDOM_ENCOUNTERS_SETTINGS_SECTION, "MaxChanceToAvoidEncounter");

            hudVitals    = DaggerfallUI.Instance.DaggerfallHUD.HUDVitals;
            playerEntity = GameManager.Instance.PlayerEntity;

            TediousData.Instance.LoadPortTowns(mod.PersistentDataDirectory);
            baseFixedDeltaTime = Time.fixedDeltaTime;
            DaggerfallUI.UIManager.OnWindowChange += travelMapInterceptor;
            travelMap          = new TediousTravelMap(DaggerfallUI.UIManager, this);
            travelUi           = new TediousTravelControllMenu(DaggerfallUI.UIManager, travelMap);
            travelUi.OnCancel += (sender) =>
            {
                destinationName = null;
            };
            travelUi.OnClose += () =>
            {
                InterruptFastTravel();
            };

            travelUi.OnTimeCompressionChanged += (newTimeCompression) => { SetTimeScale(newTimeCompression); };

            ridingAudioSource = GameManager.Instance.TransportManager.GetComponent <AudioSource>();
            Debug.Log("riding audio source: " + ridingAudioSource);

            // Clear destination for new or loaded games.
            SaveLoadManager.OnLoad       += (saveData) => { destinationName = null; };
            StartGameBehaviour.OnNewGame += () => { destinationName = null; };
            GameManager.OnEncounter      += GameManager_OnEncounter;

            rain = GameManager.Instance.WeatherManager.PlayerWeather.RainParticles;
            snow = GameManager.Instance.WeatherManager.PlayerWeather.SnowParticles;
        }