public void LoadMapArd(int worldIndex, int placeIndex) { _kernel.DataContent .FileOpen($"msg/{_kernel.Language}/{Constants.WorldIds[worldIndex]}.bar") .Using(stream => Bar.Read(stream)) .ForEntry(x => x.Type == Bar.EntryType.List, stream => { _eventMessageProvider.Load(Msg.Read(stream)); return(true); }); string fileName; if (_kernel.IsReMix) { fileName = $"ard/{_kernel.Language}/{Constants.WorldIds[worldIndex]}{placeIndex:D02}.ard"; } else { fileName = $"ard/{Constants.WorldIds[worldIndex]}{placeIndex:D02}.ard"; } _eventPlayer = null; RemoveAllActors(); _binarcArd = _kernel.DataContent.FileOpen(fileName).Using(Bar.Read); Events = _binarcArd .Where(x => x.Type == Bar.EntryType.AnimationLoader) .Select(x => x.Name) .ToList(); RunSpawnScript(_binarcArd, "map", _spawnScriptMap); RunSpawnScript(_binarcArd, "btl", _spawnScriptBtl); RunSpawnScript(_binarcArd, "evt", _spawnScriptEvt); }
private void LoadMsg(int world) => _kernel.DataContent .FileOpen($"msg/{_kernel.Language}/{Constants.WorldIds[world]}.bar") .Using(stream => Bar.Read(stream)) .ForEntry(x => x.Type == Bar.EntryType.List, stream => { _eventMessageProvider.Load(Msg.Read(stream)); return(true); });
public void LoadMapArd(int world, int area) { _kernel.DataContent .FileOpen($"msg/{_kernel.Language}/{Constants.WorldIds[world]}.bar") .Using(stream => Bar.Read(stream)) .ForEntry(x => x.Type == Bar.EntryType.List, stream => { _eventMessageProvider.Load(Msg.Read(stream)); return(true); }); string fileName; if (_kernel.IsReMix) { fileName = $"ard/{_kernel.Language}/{Constants.WorldIds[world]}{area:D02}.ard"; } else { fileName = $"ard/{Constants.WorldIds[world]}{area:D02}.ard"; } _eventPlayer = null; RemoveAllActors(); _binarcArd = _kernel.DataContent.FileOpen(fileName).Using(Bar.Read); Events = _binarcArd .Where(x => x.Type == Bar.EntryType.Event) .Select(x => x.Name) .ToList(); Log.Info($"Loading spawn {_kernel.SpawnName}"); RunSpawnScript(_binarcArd, "map", _spawnScriptMap >= 0 ? _spawnScriptMap : _kernel.SpawnMap); RunSpawnScript(_binarcArd, "btl", _spawnScriptBtl >= 0 ? _spawnScriptBtl : _kernel.SpawnBtl); RunSpawnScript(_binarcArd, "evt", _spawnScriptEvt >= 0 ? _spawnScriptEvt : _kernel.SpawnEvt); }