public EntryList(GpdFile parent) { _parent = parent; _entryType = EntryType.Unknown; var type = typeof(T); if (type == typeof(AchievementEntry)) { _entryType = EntryType.Achievement; } else if (type == typeof(AvatarAwardEntry)) { _entryType = EntryType.AvatarAward; } else if (type == typeof(ImageEntry)) { _entryType = EntryType.Image; } else if (type == typeof(SettingEntry)) { _entryType = EntryType.Setting; } else if (type == typeof(StringEntry)) { _entryType = EntryType.String; } else if (type == typeof(TitleEntry)) { _entryType = EntryType.Title; } else { throw new NotSupportedException("Unknown type: " + type.Name); } }
public GpdFileViewModel(GpdFile model) { _model = model; _entries = new List <GpdFileEntryViewModel>(); model.Achievements.ForEach(a => _entries.Add(new GpdFileEntryViewModel(a.Entry.Type, a.Entry.Id, a.Name))); model.Images.ForEach(i => _entries.Add(new GpdFileEntryViewModel(i.Entry.Type, i.Entry.Id, null))); model.Settings.ForEach(s => _entries.Add(new GpdFileEntryViewModel(s.Entry.Type, s.Entry.Id, s.Id.ToString()))); model.Strings.ForEach(s => _entries.Add(new GpdFileEntryViewModel(s.Entry.Type, s.Entry.Id, string.Format("[{0}] {1}", (SettingId)s.Entry.Id, s.Text)))); model.TitlesPlayed.ForEach(t => _entries.Add(new GpdFileEntryViewModel(t.Entry.Type, t.Entry.Id, string.Format("[{0}] {1}", t.TitleCode, t.TitleName)))); model.AvatarAwards.ForEach(a => _entries.Add(new GpdFileEntryViewModel(a.Entry.Type, a.Entry.Id, a.Name))); model.TheUnknowns.ForEach(u => _entries.Add(new GpdFileEntryViewModel(u.Entry.Type, u.Entry.Id, null))); }
private void ExecuteOpenInHexViewerCommand(object cmdParam) { GpdFile gpd = SelectedFile.Name == _profile.TitleId + ".gpd" ? _profile.ProfileInfo as GpdFile : _profile.GetGameFile(SelectedFile.Name); if (gpd != null) { var mli = new ModuleLoadInfo { ModuleName = "HexViewer", Title = SelectedFile.Name, LoadCommand = LoadCommand.Load, LoadParameter = new Tuple <byte[], BinMap>(gpd.Binary.ReadAll(), gpd.BinMap) }; EventAggregator.GetEvent <ModuleOpenEvent>().Publish(new ModuleOpenEventArgs(mli)); } }
public SettingList(GpdFile parent) : base(parent) { }
public void ReplaceFile(FileEntry fileEntry, GpdFile gpd) { ReplaceFile(fileEntry, gpd.Binary.ReadAll()); }