コード例 #1
0
        public void Init(GameFileCache gameFileCache, Action <string> updateStatus, Weather weather)
        {
            Weather   = weather;
            Timecycle = weather.Timecycle;
            var rpfman = gameFileCache.RpfMan;

            string filename = "common.rpf\\data\\clouds.xml";

            //TODO: RpfMan should be able to get the right version? or maybe let gameFileCache do it!
            string kffilename = "common.rpf\\data\\cloudkeyframes.xml";

            if (gameFileCache.EnableDlc)
            {
                kffilename = "update\\update.rpf\\common\\data\\cloudkeyframes.xml";
            }

            XmlDocument cloudsxml   = rpfman.GetFileXml(filename);
            XmlDocument cloudskfxml = rpfman.GetFileXml(kffilename);

            HatManager = new CloudHatManager();
            HatManager.Init(cloudsxml.DocumentElement); //CloudHatManager

            SettingsMap = new CloudSettingsMap();
            SettingsMap.Init(cloudskfxml.DocumentElement); //CloudSettingsMap

            Inited = true;
        }
コード例 #2
0
ファイル: Weather.cs プロジェクト: rt-2/CodeWalker
        public void Init(GameFileCache gameFileCache, Action <string> updateStatus, Timecycle timecycle)
        {
            Timecycle = timecycle;
            var rpfman = gameFileCache.RpfMan;

            //TODO: RpfMan should be able to get the right version? or maybe let gameFileCache do it!
            string filename = "common.rpf\\data\\levels\\gta5\\weather.xml";

            if (gameFileCache.EnableDlc)
            {
                filename = "update\\update.rpf\\common\\data\\levels\\gta5\\weather.xml";
            }

            XmlDocument weatherxml = rpfman.GetFileXml(filename);

            XmlElement weather = weatherxml.DocumentElement;

            XmlNodeList weathergpufx = weather.SelectNodes("WeatherGpuFx/Item");

            WeatherGpuFx.Clear();
            for (int i = 0; i < weathergpufx.Count; i++)
            {
                var weathergpufxi = new WeatherGpuFx();
                weathergpufxi.Init(weathergpufx[i]);
                WeatherGpuFx[weathergpufxi.Name] = weathergpufxi;
            }

            XmlNodeList weathertypes = weather.SelectNodes("WeatherTypes/Item");

            WeatherTypes.Clear();
            for (int i = 0; i < weathertypes.Count; i++)
            {
                var weathertype = new WeatherType();
                weathertype.Init(gameFileCache, weathertypes[i]);
                WeatherTypes[weathertype.Name] = weathertype;
            }

            XmlNodeList weathercycles = weather.SelectNodes("WeatherCycles/Item");

            WeatherCycles.Clear();
            for (int i = 0; i < weathercycles.Count; i++)
            {
                var weathercycle = new WeatherCycle();
                weathercycle.Init(weathercycles[i]);
                WeatherCycles.Add(weathercycle);
            }



            if (WeatherTypes.Count > 0)
            {
                CurrentWeatherType   = WeatherTypes.Values.First();
                CurrentWeatherRegion = CurrentWeatherType.GetRegion(Region);
                NextWeatherType      = CurrentWeatherType;
                NextWeatherRegion    = NextWeatherType.GetRegion(Region);
            }


            TimecycleMods = new TimecycleMods();
            TimecycleMods.Init(gameFileCache, updateStatus);


            Inited = true;
        }