Skip to content

Commit

Permalink
Add "Progression" items, add Anguish detection
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSav committed May 31, 2024
1 parent 046b3be commit 332e739
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 45 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.0.13 (31 May 2023)
- Added an option to World Analyzer to display items not bound to a particular location
- Added Anguish detection

Here is how Anguish detection works. If you have not started the Anguish quest and you do not have Ethereal Manor, Anguish will not appear in World Analyzer. If you have not started the Anguish quest, but do have Ethereal Manor in the save, Anguish will appear in Ethereal Manor loot group. From this point on, it will move to the location where the next Dran is.

It will disappear from World Analyzer again, once you get the Dran Dream item. (There is an [issue](https://github.com/AndrewSav/Remnant2SaveAnalyzer/issues/6) to improve this part)

## 0.0.12 (28 May 2023)
- All items except for Anguish should be correctly detected now, if available (Crimson Guard armor set, Quilted Heart, Ripened Heart, Profane Heart, Downgraded Ring, Band of the Fanatic, Trinity Crossbow, Echo of the Forest, Crescent Moon)

Expand All @@ -9,9 +17,9 @@
- Added an option to hide empty lines in World Analyzer

## 0.0.10 (11 May 2023)
- Add ability to display in italic items that cannot be obtained in the current save, because they depend on something else not avialable in the current save that the character does not currently have
- Add ability to display in italic items that cannot be obtained in the current save, because they depend on something else not available in the current save that the character does not currently have
- Changed to file-scoped namespaces
- Add setings path tooltip to the settings page about button
- Add settings path tooltip to the settings page about button

## 0.0.9 (10 May 2023)
- Small fix for adventure panel not updating
Expand All @@ -20,7 +28,7 @@
- Nothing user facing - reworked internal logging system for easier integrations with the dependencies

## 0.0.7 (9 May 2024)
- Detect Resolute trait aquisition
- Detect Resolute trait acquisition
- Fix rare crashes with backups pane

## 0.0.6 (8 May 2024)
Expand Down
1 change: 1 addition & 0 deletions Remnant2SaveAnalyzer-dev.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Charnel/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=dlcs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dran/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dranception/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Drzyr/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Erud/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Faelin/@EntryIndexedValue">True</s:Boolean>
Expand Down
3 changes: 3 additions & 0 deletions Remnant2SaveAnalyzer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
<setting name="ShowLinesWithNoItems" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowNoLocation" serializeAs="String">
<value>False</value>
</setting>
</Remnant2SaveAnalyzer.Properties.Settings>
</userSettings>
</configuration>
14 changes: 13 additions & 1 deletion Remnant2SaveAnalyzer/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Remnant2SaveAnalyzer/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,8 @@
<Setting Name="ShowLinesWithNoItems" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="ShowNoLocation" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion Remnant2SaveAnalyzer/Remnant2SaveAnalyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="lib.remnant2.analyzer" Version="0.0.12" />
<PackageReference Include="lib.remnant2.analyzer" Version="0.0.13" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Expressions" Version="4.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion Remnant2SaveAnalyzer/Views/Pages/BackupsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ private void DataBackups_Drop(object sender, DragEventArgs e)

private void RefreshBackups()
{
SortDescription sorting = dataBackups.Items.SortDescriptions.First();
SortDescription sorting = dataBackups.Items.SortDescriptions.FirstOrDefault();
dataBackups.ItemsSource = null;
dataBackups.ItemsSource = _listBackups;
dataBackups.Items.SortDescriptions.Add(sorting);
Expand Down
3 changes: 3 additions & 0 deletions Remnant2SaveAnalyzer/Views/Pages/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
<WrapPanel Margin="0,16,0,0">
<ui:ToggleSwitch Name="chkShowRootEarth" IsChecked="{Binding ShowRootEarth}" Content="{lex:Loc}" />
</WrapPanel>
<WrapPanel Margin="0,16,0,0">
<ui:ToggleSwitch Name="chkShowNoLocation" IsChecked="{Binding ShowNoLocation}" Content="{lex:Loc}" />
</WrapPanel>
<WrapPanel Margin="0,16,0,0">
<ui:ToggleSwitch Name="chkShowConnections" IsChecked="{Binding ShowConnections}" Content="{lex:Loc}" />
</WrapPanel>
Expand Down
92 changes: 53 additions & 39 deletions Remnant2SaveAnalyzer/Views/Pages/WorldAnalyzerPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ private void Default_PropertyChanged(object? sender, System.ComponentModel.Prope
|| e.PropertyName == "ShowItemsWithNoPrerequisites"
|| e.PropertyName == "ShowLootedItems"
|| e.PropertyName == "ShowLinesWithNoItems"
|| e.PropertyName == "ShowNoLocation"
)
{
Dispatcher.Invoke(() =>
Expand Down Expand Up @@ -660,12 +661,12 @@ private List<WorldAnalyzerGridData> FilterGridData(Profile profile, RolledWorld?
if (!Properties.Settings.Default.ShowRootEarth && zone.Name == "Root Earth") continue;
foreach (Location location in zone.Locations)
{
string l = location.World == "Ward 13" ? Loc.GameT(location.World) : $"{Loc.GameT(location.World)}: {Loc.GameT(location.Name)}";
string locationName = location.World == "Ward 13" ? Loc.GameT(location.World) : $"{Loc.GameT(location.World)}: {Loc.GameT(location.Name)}";

if (Properties.Settings.Default.ShowConnections && location.Connections is { Count: > 0 })
{
WorldAnalyzerGridData newItem = new(
location: l,
location: locationName,
missingItems: [],
possibleItems: [],
name: string.Join('\n', location.Connections.Select(Loc.GameT)),
Expand All @@ -679,7 +680,7 @@ private List<WorldAnalyzerGridData> FilterGridData(Profile profile, RolledWorld?
if (Properties.Settings.Default.ShowWorldStones && location.WorldStones is { Count: > 0 })
{
WorldAnalyzerGridData newItem = new(
location: l,
location: locationName,
missingItems: [],
possibleItems: [],
name: string.Join('\n', location.WorldStones.Select(Loc.GameT)),
Expand All @@ -694,7 +695,7 @@ private List<WorldAnalyzerGridData> FilterGridData(Profile profile, RolledWorld?
{
//List<LocalisedLootItem> ll = new() { new LocalisedLootItem(new() { Item = new() { { "Name", Loc.GameT("TraitBook") } } }) };
WorldAnalyzerGridData newItem = new(
location: l,
location: locationName,
missingItems: [],
possibleItems:

Expand All @@ -717,7 +718,7 @@ private List<WorldAnalyzerGridData> FilterGridData(Profile profile, RolledWorld?
if (Properties.Settings.Default.ShowSimulacrums && location.Simulacrum && (Properties.Settings.Default.ShowLootedItems || !location.SimulacrumLooted))
{
WorldAnalyzerGridData newItem = new(
location: l,
location: locationName,
missingItems: [],
possibleItems:
[
Expand All @@ -735,46 +736,20 @@ private List<WorldAnalyzerGridData> FilterGridData(Profile profile, RolledWorld?
result.Add(newItem);
}
}

foreach (LootGroup lg in location.LootGroups)
{

List<LootItem> items = lg.Items;
if (!Properties.Settings.Default.ShowCoopItems)
{
items = items.Where(x => x.Properties.ContainsKey("Coop") && x.Properties["Coop"] == "True").ToList();
}
if (!Properties.Settings.Default.ShowLootedItems)
{
items = items.Where(x => !x.IsLooted).ToList();
}
if (!Properties.Settings.Default.ShowItemsWithNoPrerequisites)
{
items = items.Where(x => !x.IsPrerequisiteMissing).ToList();
}

WorldAnalyzerGridData newItem = new(
location: l,
missingItems: FilterAllDlcItems(items
.Where(x => missingIds.Contains(x.Id)),
x=>x.Properties).Select(x => new LocalisedLootItem(x, this)).ToList(),
possibleItems: FilterAllDlcItems(items,
x=>x.Properties).Select(x => new LocalisedLootItem(x, this)).ToList(),
name: Loc.GameT(lg.Name ?? ""),
type: Loc.T(Capitalize().Replace(lg.Type, m => m.Value.ToUpper()))
){Unknown = lg.UnknownMarker};
if (newItem.Type == "Dungeon" || newItem.Type == "Location")
{
newItem.Name = Loc.GameT(location.Name);
}
if (EventPassesFilter(newItem))
{
result.Add(newItem);
}
result.AddRange(AddLootGroup(lg, locationName, missingIds));
}
}
}

if (Properties.Settings.Default.ShowNoLocation)
{
result.AddRange(AddLootGroup(world.ProgressionItems!, "Other", missingIds));
}


if (!Properties.Settings.Default.ShowLinesWithNoItems)
{
result = result.Where(x => x.Type == "Connections"
Expand All @@ -787,6 +762,45 @@ private List<WorldAnalyzerGridData> FilterGridData(Profile profile, RolledWorld?
return result;
}

private List<WorldAnalyzerGridData> AddLootGroup(LootGroup lg, string locationName, List<string> missingIds)
{
List<WorldAnalyzerGridData> result = new();
List<LootItem> items = lg.Items;
if (!Properties.Settings.Default.ShowCoopItems)
{
items = items.Where(x => x.Properties.ContainsKey("Coop") && x.Properties["Coop"] == "True").ToList();
}
if (!Properties.Settings.Default.ShowLootedItems)
{
items = items.Where(x => !x.IsLooted).ToList();
}
if (!Properties.Settings.Default.ShowItemsWithNoPrerequisites)
{
items = items.Where(x => !x.IsPrerequisiteMissing).ToList();
}

WorldAnalyzerGridData newItem = new(
location: locationName,
missingItems: FilterAllDlcItems(items
.Where(x => missingIds.Contains(x.Id)),
x=>x.Properties).Select(x => new LocalisedLootItem(x, this)).ToList(),
possibleItems: FilterAllDlcItems(items,
x=>x.Properties).Select(x => new LocalisedLootItem(x, this)).ToList(),
name: Loc.GameT(lg.Name ?? ""),
type: Loc.T(Capitalize().Replace(lg.Type, m => m.Value.ToUpper()))
){Unknown = lg.UnknownMarker};
if (newItem.Type == "Dungeon" || newItem.Type == "Location")
{
newItem.Name = locationName;
}
if (EventPassesFilter(newItem))
{
result.Add(newItem);
}

return result;
}

public class LocalisedLootItem : LootItem
{
private readonly WorldAnalyzerPage _parent;
Expand Down
9 changes: 9 additions & 0 deletions Remnant2SaveAnalyzer/locales/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Remnant2SaveAnalyzer/locales/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -606,4 +606,7 @@
<data name="chkShowLinesWithNoItems_ToolTip" xml:space="preserve">
<value>World Stones and Connections are always shown if enabled</value>
</data>
<data name="chkShowNoLocation_Content" xml:space="preserve">
<value>Show items not tied to a location</value>
</data>
</root>

0 comments on commit 332e739

Please sign in to comment.