mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-16 20:17:30 +08:00
PR #182 but slightly nicer
This commit is contained in:
parent
27a07461b1
commit
92bdf65d7f
@ -21,16 +21,30 @@ namespace CodeWalker.World
|
||||
{
|
||||
GameFileCache = gameFileCache;
|
||||
|
||||
var rpfman = gameFileCache.RpfMan;
|
||||
|
||||
string filename = "common.rpf\\data\\levels\\gta5\\water.xml";
|
||||
WaterQuads.Clear();
|
||||
CalmingQuads.Clear();
|
||||
WaveQuads.Clear();
|
||||
|
||||
LoadWaterXml("common.rpf\\data\\levels\\gta5\\water.xml");
|
||||
|
||||
if (GameFileCache.EnableDlc)
|
||||
{
|
||||
LoadWaterXml("update\\update.rpf\\common\\data\\levels\\gta5\\water_heistisland.xml");
|
||||
}
|
||||
|
||||
|
||||
Inited = true;
|
||||
}
|
||||
|
||||
private void LoadWaterXml(string filename)
|
||||
{
|
||||
var rpfman = GameFileCache.RpfMan;
|
||||
XmlDocument waterxml = rpfman.GetFileXml(filename);
|
||||
|
||||
XmlElement waterdata = waterxml.DocumentElement;
|
||||
|
||||
XmlNodeList waterquads = waterdata.SelectNodes("WaterQuads/Item");
|
||||
WaterQuads.Clear();
|
||||
for (int i = 0; i < waterquads.Count; i++)
|
||||
{
|
||||
var waterquad = new WaterQuad();
|
||||
@ -39,7 +53,6 @@ namespace CodeWalker.World
|
||||
}
|
||||
|
||||
XmlNodeList calmingquads = waterdata.SelectNodes("CalmingQuads/Item");
|
||||
CalmingQuads.Clear();
|
||||
for (int i = 0; i < calmingquads.Count; i++)
|
||||
{
|
||||
var calmingquad = new WaterCalmingQuad();
|
||||
@ -48,7 +61,6 @@ namespace CodeWalker.World
|
||||
}
|
||||
|
||||
XmlNodeList wavequads = waterdata.SelectNodes("WaveQuads/Item");
|
||||
WaveQuads.Clear();
|
||||
for (int i = 0; i < wavequads.Count; i++)
|
||||
{
|
||||
var wavequad = new WaterWaveQuad();
|
||||
@ -56,7 +68,6 @@ namespace CodeWalker.World
|
||||
WaveQuads.Add(wavequad);
|
||||
}
|
||||
|
||||
Inited = true;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user