Skip to content

Commit

Permalink
Fixed several issues with my string to Bitmap value converter, as wel…
Browse files Browse the repository at this point in the history
…l as several ViewModels generating incorrect image strings.

Fixed an issue with certain locations in West Dark World not subscribing to the correct region's events.
Fixed a logic for Escape that incorrectly applied Partial accessibility instead of SequenceBreak when all requirements, except dark room vision were filled.
Incremented version from 0.7.1 to 0.7.2 for release.
  • Loading branch information
trippsc2 committed Apr 11, 2020
1 parent 057f385 commit 02f22f6
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 32 deletions.
16 changes: 9 additions & 7 deletions OpenTracker.Models/ItemSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ItemSection : ISection
public int Total { get; private set; }
public bool HasMarking { get; }
public Mode RequiredMode { get; }
public Func<AccessibilityLevel> GetAccessibility { get; }

public event PropertyChangedEventHandler PropertyChanged;

Expand Down Expand Up @@ -71,8 +72,6 @@ public MarkingType? Marking
}
}

public Func<AccessibilityLevel> GetAccessibility { get; }

public ItemSection(Game game, Location location, int index = 0)
{
_game = game;
Expand Down Expand Up @@ -119,7 +118,7 @@ public ItemSection(Game game, Location location, int index = 0)

_itemSubscriptions.Add(ItemType.GreenPendant, new Mode());
_itemSubscriptions.Add(ItemType.Pendant, new Mode());
_itemSubscriptions.Add(ItemType.Book, new Mode() { ItemPlacement = ItemPlacement.Basic });
_itemSubscriptions.Add(ItemType.Book, new Mode());

break;
case LocationID.LumberjackCave:
Expand Down Expand Up @@ -1230,7 +1229,7 @@ public ItemSection(Game game, Location location, int index = 0)
return AccessibilityLevel.None;
};

_regionSubscriptions.Add(RegionID.LightWorld, new Mode());
_regionSubscriptions.Add(RegionID.DarkWorldWest, new Mode());

_itemSubscriptions.Add(ItemType.MoonPearl, new Mode() { WorldState = WorldState.StandardOpen });

Expand All @@ -1254,7 +1253,7 @@ public ItemSection(Game game, Location location, int index = 0)
return AccessibilityLevel.None;
};

_regionSubscriptions.Add(RegionID.LightWorld, new Mode());
_regionSubscriptions.Add(RegionID.DarkWorldWest, new Mode());

_itemSubscriptions.Add(ItemType.MoonPearl, new Mode() { WorldState = WorldState.StandardOpen });

Expand All @@ -1278,7 +1277,7 @@ public ItemSection(Game game, Location location, int index = 0)
return AccessibilityLevel.None;
};

_regionSubscriptions.Add(RegionID.LightWorld, new Mode());
_regionSubscriptions.Add(RegionID.DarkWorldWest, new Mode());

_itemSubscriptions.Add(ItemType.MoonPearl, new Mode() { WorldState = WorldState.StandardOpen });

Expand Down Expand Up @@ -2204,6 +2203,9 @@ public ItemSection(Game game, Location location, int index = 0)
(_game.Mode.ItemPlacement.Value == ItemPlacement.Advanced &&
_game.Items.Has(ItemType.FireRod)))
return _game.Regions[RegionID.HyruleCastle].Accessibility;
return (AccessibilityLevel)Math.Min((byte)AccessibilityLevel.SequenceBreak,
(byte)_game.Regions[RegionID.HyruleCastle].Accessibility);
}
if (Available > 3)
Expand All @@ -2226,7 +2228,7 @@ public ItemSection(Game game, Location location, int index = 0)
_itemSubscriptions.Add(ItemType.Gloves, new Mode());
_itemSubscriptions.Add(ItemType.HCSmallKey, new Mode() { DungeonItemShuffle = DungeonItemShuffle.MapsCompassesSmallKeys });
_itemSubscriptions.Add(ItemType.Lamp, new Mode());
_itemSubscriptions.Add(ItemType.FireRod, new Mode() { ItemPlacement = ItemPlacement.Basic });
_itemSubscriptions.Add(ItemType.FireRod, new Mode() { ItemPlacement = ItemPlacement.Advanced });

break;
case LocationID.AgahnimTower:
Expand Down
2 changes: 1 addition & 1 deletion OpenTracker.Models/OpenTracker.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>0.7.1</Version>
<Version>0.7.2</Version>
</PropertyGroup>

</Project>
34 changes: 17 additions & 17 deletions OpenTracker.Setup/OpenTracker.Setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
{
"Entry"
{
"MsmKey" = "8:_52B4232ADD464606B80710F676FAD771"
"MsmKey" = "8:_4913C9C404594CDBAE9F3117F7A8A99C"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8BEB0D6860DB4F80B56A45FAD1BDE151"
"MsmKey" = "8:_9E6FFC26C1B94A308AE37383659B05F8"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
Expand Down Expand Up @@ -114,9 +114,9 @@
}
"File"
{
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_52B4232ADD464606B80710F676FAD771"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4913C9C404594CDBAE9F3117F7A8A99C"
{
"SourcePath" = "8:..\\..\\..\\..\\Downloads\\triforce.ico"
"SourcePath" = "8:..\\OpenTracker\\triforce.ico"
"TargetName" = "8:triforce.ico"
"Tag" = "8:"
"Folder" = "8:_B21EA2C01C014AC99A33B72F50C26B5D"
Expand Down Expand Up @@ -274,15 +274,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:OpenTracker"
"ProductCode" = "8:{2D8F6709-1B8C-40AC-8BF6-F5138CFB5B7B}"
"PackageCode" = "8:{4B1C3BF1-9E05-452F-9432-946482E80785}"
"ProductCode" = "8:{A02CCE73-61EE-4761-8014-E2A1881463D5}"
"PackageCode" = "8:{A96899FC-06DE-4BE1-9696-FDC27FE61CBD}"
"UpgradeCode" = "8:{C98C2121-B4C5-473A-9B86-5407FEFFE8F1}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:0.7.1"
"ProductVersion" = "8:0.7.2"
"Manufacturer" = "8:OpenTracker"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand All @@ -292,7 +292,7 @@
"Keywords" = "8:"
"ARPCOMMENTS" = "8:"
"ARPURLINFOABOUT" = "8:"
"ARPPRODUCTICON" = "8:_52B4232ADD464606B80710F676FAD771"
"ARPPRODUCTICON" = "8:_4913C9C404594CDBAE9F3117F7A8A99C"
"ARPIconIndex" = "3:0"
"SearchPath" = "8:"
"UseSystemSearchPath" = "11:TRUE"
Expand Down Expand Up @@ -395,32 +395,32 @@
}
"Shortcut"
{
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_077012C5F76F407DB79E7B88D8ABB09B"
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_4B15CD28972B41629D3F9789E413C9A2"
{
"Name" = "8:OpenTracker"
"Arguments" = "8:"
"Description" = "8:"
"ShowCmd" = "3:1"
"IconIndex" = "3:0"
"Transitive" = "11:FALSE"
"Target" = "8:_8BEB0D6860DB4F80B56A45FAD1BDE151"
"Folder" = "8:_68CF9C3C7353438A9C1B8145DC8FAE43"
"Target" = "8:_9E6FFC26C1B94A308AE37383659B05F8"
"Folder" = "8:_53C29DC8DB594D14845D067B17A97FCE"
"WorkingFolder" = "8:_B21EA2C01C014AC99A33B72F50C26B5D"
"Icon" = "8:_52B4232ADD464606B80710F676FAD771"
"Icon" = "8:_4913C9C404594CDBAE9F3117F7A8A99C"
"Feature" = "8:"
}
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_2E82BC7017114BC3AFA6C98FCBDD9E07"
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_B7AAE68A3C794F61AB9B0362B120C242"
{
"Name" = "8:OpenTracker"
"Arguments" = "8:"
"Description" = "8:"
"ShowCmd" = "3:1"
"IconIndex" = "3:0"
"Transitive" = "11:FALSE"
"Target" = "8:_8BEB0D6860DB4F80B56A45FAD1BDE151"
"Folder" = "8:_53C29DC8DB594D14845D067B17A97FCE"
"Target" = "8:_9E6FFC26C1B94A308AE37383659B05F8"
"Folder" = "8:_68CF9C3C7353438A9C1B8145DC8FAE43"
"WorkingFolder" = "8:_B21EA2C01C014AC99A33B72F50C26B5D"
"Icon" = "8:_52B4232ADD464606B80710F676FAD771"
"Icon" = "8:_4913C9C404594CDBAE9F3117F7A8A99C"
"Feature" = "8:"
}
}
Expand Down Expand Up @@ -822,7 +822,7 @@
}
"ProjectOutput"
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_8BEB0D6860DB4F80B56A45FAD1BDE151"
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_9E6FFC26C1B94A308AE37383659B05F8"
{
"SourcePath" = "8:..\\OpenTracker\\obj\\Release\\netcoreapp3.1\\OpenTracker.exe"
"TargetName" = "8:"
Expand Down
12 changes: 6 additions & 6 deletions OpenTracker/OpenTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<ApplicationIcon>triforce.ico</ApplicationIcon>
<Win32Resource />
<Version>0.7.1</Version>
<Version>0.7.2</Version>
<Authors>Tripp</Authors>
<AssemblyVersion>0.7.1.0</AssemblyVersion>
<FileVersion>0.7.1.0</FileVersion>
<AssemblyVersion>0.7.2.0</AssemblyVersion>
<FileVersion>0.7.2.0</FileVersion>
<RuntimeIdentifiers>osx-x64;linux-x64;debian-x64;rhel-x64;win-x64;win-x86;win7-x64;win7-x86</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -41,9 +41,9 @@
<None Remove="Views\SectionControl.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.9.6" />
<PackageReference Include="Avalonia.Desktop" Version="0.9.6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.6" />
<PackageReference Include="Avalonia" Version="0.9.7" />
<PackageReference Include="Avalonia.Desktop" Version="0.9.7" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.7" />
<PackageReference Include="Dotnet.Bundle" Version="0.9.12" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.9.4" />
Expand Down
3 changes: 3 additions & 0 deletions OpenTracker/ValueConverters/BitmapValueConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public class BitmapValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return null;

if (value is string && targetType == typeof(IBitmap))
{
var uri = new Uri((string)value, UriKind.RelativeOrAbsolute);
Expand Down
2 changes: 1 addition & 1 deletion OpenTracker/ViewModels/DungeonItemControlVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void SetImage()

ImageNumber = _item.Current.ToString();

ImageSource = _imageSourceBase + ImageNumber + ".png";
ImageSource = _imageSourceBase + (_item.Current > 0 ? "1" : "0") + ".png";

if (_item.Current == _item.Maximum)
{
Expand Down
2 changes: 2 additions & 0 deletions OpenTracker/ViewModels/SectionControlVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ private void Update()

if (bossSection.Boss == null)
imageBaseString += "Items/unknown1";
else if (bossSection.Boss.Type == BossType.Aga)
imageBaseString += "Items/aga1";
else
{
imageBaseString += "Bosses/";
Expand Down

0 comments on commit 02f22f6

Please sign in to comment.