Skip to content

Commit

Permalink
Implemented entrance location marking on the map.
Browse files Browse the repository at this point in the history
Renamed "Visible item" in code to "Marking" and separated the object from items.
Incremented version from 0.2.2 to 0.3.0 for release.
  • Loading branch information
trippsc2 committed Mar 26, 2020
1 parent 776d047 commit 873b3a9
Show file tree
Hide file tree
Showing 18 changed files with 591 additions and 319 deletions.
2 changes: 2 additions & 0 deletions OpenTracker.Models/BossSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class BossSection : ISection
private readonly Region _region;

public string Name { get => "Boss"; }
public bool HasMarking { get => false; }
public Mode RequiredMode { get; }
public MarkingType? Marking { get => null; set { } }

public Func<AccessibilityLevel> GetAccessibility { get; }

Expand Down
15 changes: 15 additions & 0 deletions OpenTracker.Models/EntranceSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class EntranceSection : ISection
private readonly Item _invertedItemProvided;

public string Name { get; }
public bool HasMarking { get => true; }
public Mode RequiredMode { get; }

public Func<AccessibilityLevel> GetAccessibility { get; }
Expand Down Expand Up @@ -49,6 +50,20 @@ public bool Available
}
}

private MarkingType? _marking;
public MarkingType? Marking
{
get => _marking;
set
{
if (_marking != value)
{
_marking = value;
OnPropertyChanged(nameof(Marking));
}
}
}

public EntranceSection(Game game, LocationID iD)
{
_game = game;
Expand Down
2 changes: 1 addition & 1 deletion OpenTracker.Models/Enums/MarkingType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum MarkingType
Net,
Book,
MoonPearl,
AT,
Aga,
TRBack,
Bottle,
CaneOfSomaria,
Expand Down
2 changes: 2 additions & 0 deletions OpenTracker.Models/Interfaces/ISection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ namespace OpenTracker.Models.Interfaces
public interface ISection : INotifyPropertyChanged
{
string Name { get; }
bool HasMarking { get; }
MarkingType? Marking { get; set; }
AccessibilityLevel Accessibility { get; }
Mode RequiredMode { get; }

Expand Down
50 changes: 27 additions & 23 deletions OpenTracker.Models/ItemSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ItemSection : ISection

public string Name { get; }
public int Total { get; private set; }
public bool HasVisibleItem { get; }
public bool HasMarking { get; }
public Mode RequiredMode { get; }

public event PropertyChangedEventHandler PropertyChanged;
Expand Down Expand Up @@ -52,16 +52,16 @@ public int Available
}
}

private Item _visibleItem;
public Item VisibleItem
private MarkingType? _marking;
public MarkingType? Marking
{
get => _visibleItem;
get => _marking;
set
{
if (_visibleItem != value)
if (_marking != value)
{
_visibleItem = value;
OnPropertyChanged(nameof(VisibleItem));
_marking = value;
OnPropertyChanged(nameof(Marking));
}
}
}
Expand All @@ -83,7 +83,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Pedestal";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -115,7 +115,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Cave";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -350,7 +350,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Take This Trash";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -395,7 +395,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "On The Shelf";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -424,7 +424,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Shroom";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -638,7 +638,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Tablet";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.DarkWorldSouth];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -828,7 +828,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Ledge";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -1029,7 +1029,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Ledge";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -1358,7 +1358,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Island";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.LightWorld];

Expand Down Expand Up @@ -1529,7 +1529,7 @@ public ItemSection(Game game, Location location, int index = 0)
Name = "Up On Top";
_standardRegion = _game.Regions[RegionID.DeathMountainWestBottom];
_invertedRegion = _game.Regions[RegionID.DeathMountainWestTop];
HasVisibleItem = true;
HasMarking = true;

GetAccessibility = () =>
{
Expand All @@ -1552,7 +1552,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Tablet";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.DeathMountainWestTop];
_invertedRegion = _game.Regions[RegionID.DeathMountainWestTop];

Expand Down Expand Up @@ -1798,7 +1798,7 @@ public ItemSection(Game game, Location location, int index = 0)

_baseTotal = 1;
Name = "Island";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.LightWorld];
_invertedRegion = _game.Regions[RegionID.DarkWorldSouth];

Expand Down Expand Up @@ -1971,7 +1971,7 @@ public ItemSection(Game game, Location location, int index = 0)
_bigKey = 1;
_baseTotal = 2;
Name = "Dungeon";
HasVisibleItem = true;
HasMarking = true;
_standardRegion = _game.Regions[RegionID.DesertPalace];
_invertedRegion = _game.Regions[RegionID.DesertPalace];

Expand Down Expand Up @@ -2396,10 +2396,14 @@ public void Clear()
{
Available = 0;

if (VisibleItem != null)
if (Marking != null)
{
VisibleItem.Current = Math.Min(VisibleItem.Maximum, VisibleItem.Current + 1);
VisibleItem = null;
if (Enum.TryParse(Marking.ToString(), out ItemType itemType))
{
Item item = _game.Items[itemType];
item.Current = Math.Max(item.Maximum, item.Current + 1);
Marking = null;
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions OpenTracker.Setup/OpenTracker.Setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:OpenTracker"
"ProductCode" = "8:{FC8917F1-E0AA-4117-B09F-2CF112CEFE8B}"
"PackageCode" = "8:{AE764F26-F917-4437-A62C-D83ADC2D322B}"
"ProductCode" = "8:{A352DD4B-A96F-41D1-9AE8-8345B5BA6DD5}"
"PackageCode" = "8:{C6E5C997-E931-4488-8D94-4B76F0C6B7BB}"
"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.2.2"
"ProductVersion" = "8:0.3.0"
"Manufacturer" = "8:OpenTracker"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down Expand Up @@ -739,7 +739,7 @@
{
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_582274CEB8A7425789CE7B6B45EFE16C"
{
"SourcePath" = "8:..\\OpenTracker\\obj\\Release\\netcoreapp3.1\\OpenTracker.exe"
"SourcePath" = "8:..\\OpenTracker\\obj\\Debug\\netcoreapp3.1\\OpenTracker.exe"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_B21EA2C01C014AC99A33B72F50C26B5D"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace OpenTracker.Interfaces
{
public interface IVisibleItemSelectControlVM
public interface IMarkingSelectControlVM
{
void SelectItem();
}
Expand Down
2 changes: 1 addition & 1 deletion OpenTracker/Interfaces/ISectionControlVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public interface ISectionControlVM
{
void OpenVisibleItemSelect();
void OpenMarkingSelect();
void ChangeAvailable(bool rightClick = false);
}
}
15 changes: 9 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.2.2</Version>
<Version>0.3.0</Version>
<Authors>Tripp</Authors>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<FileVersion>0.2.2.0</FileVersion>
<AssemblyVersion>0.3.0.0</AssemblyVersion>
<FileVersion>0.2.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
Expand All @@ -24,7 +24,7 @@
<AvaloniaResource Remove="Views\ColorPickerControl.xaml" />
<AvaloniaResource Remove="Views\DungeonItemControl.xaml" />
<AvaloniaResource Remove="Views\DungeonPrizeControl.xaml" />
<AvaloniaResource Remove="Views\VisibleItemSelectControl.xaml" />
<AvaloniaResource Remove="Views\MarkingSelectControl.xaml" />
</ItemGroup>
<ItemGroup>
<None Remove="Views\AppSettings.xaml" />
Expand All @@ -33,9 +33,9 @@
<None Remove="Views\DungeonItemControl.xaml" />
<None Remove="Views\DungeonPrizeControl.xaml" />
<None Remove="Views\MapLocationControl.xaml" />
<None Remove="Views\MarkingSelectControl.xaml" />
<None Remove="Views\PinnedLocationControl.xaml" />
<None Remove="Views\SectionControl.xaml" />
<None Remove="Views\VisibleItemSelectControl.xaml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.9.4" />
Expand Down Expand Up @@ -70,7 +70,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Views\VisibleItemSelectControl.xaml">
<EmbeddedResource Include="Views\MarkingSelectControl.xaml">
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
Expand Down Expand Up @@ -107,6 +107,9 @@
<Compile Update="Views\DungeonItemControl.xaml.cs">
<DependentUpon>DungeonItemControl.xaml</DependentUpon>
</Compile>
<Compile Update="Views\MarkingSelectControl.xaml.cs">
<DependentUpon>MarkingSelectControl.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
Expand Down
Loading

0 comments on commit 873b3a9

Please sign in to comment.