Skip to content

Commit

Permalink
Add an icon over the rat's head showing why it might not be going whe…
Browse files Browse the repository at this point in the history
…re you think it logically would.

Related: #88
  • Loading branch information
airbreather committed Nov 25, 2024
1 parent 0b678a7 commit 07e297e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/Autopelago/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ private set
}
}

public FrozenDictionary<LocationDefinitionModel, ArchipelagoItemFlags> SpoilerData
{
get
{
EnsureStarted();
return _spoilerData!;
}
}

public int FoodFactor { get; private set; }

public int LuckFactor { get; private set; }
Expand Down
8 changes: 8 additions & 0 deletions src/Autopelago/ViewModels/GameStateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ where tt.Model is RatCountRequirement
.Select(g => g.StartledCounter);
HasConfidence = provider.CurrentGameState
.Select(g => g.HasConfidence);
MovingToSmart = provider.CurrentGameState
.Select(g => g.TargetLocationReason == TargetLocationReason.PriorityPriority && g.SpoilerData[g.TargetLocation] == ArchipelagoItemFlags.LogicalAdvancement);
MovingToConspiratorial = provider.CurrentGameState
.Select(g => g.TargetLocationReason == TargetLocationReason.PriorityPriority && g.SpoilerData[g.TargetLocation] == ArchipelagoItemFlags.Trap);

CurrentLocation = provider.CurrentGameState
.Select(v => v.CurrentLocation);
Expand Down Expand Up @@ -275,6 +279,10 @@ public void Dispose()

public IObservable<bool> HasConfidence { get; }

public IObservable<bool> MovingToSmart { get; }

public IObservable<bool> MovingToConspiratorial { get; }

public required ReactiveCommand<Unit, Unit> BackToMainMenuCommand { get; init; }

public ReactiveCommand<Unit, Unit> PlayPauseCommand { get; }
Expand Down
4 changes: 1 addition & 3 deletions src/Autopelago/ViewModels/SettingsSelectionViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Globalization;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Text.RegularExpressions;

using ReactiveUI;
Expand All @@ -23,8 +22,7 @@ public SettingsSelectionViewModel()
portValue - decimal.Round(portValue) == 0 &&
!string.IsNullOrWhiteSpace(slot) &&
minStepSeconds > 0 &&
maxStepSeconds >= minStepSeconds)
.DistinctUntilChanged();
maxStepSeconds >= minStepSeconds);
ConnectCommand = ReactiveCommand.Create(() => SettingsModel, canConnect);

_subscriptions.Add(this
Expand Down
14 changes: 14 additions & 0 deletions src/Autopelago/Views/GameStateView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,20 @@
Canvas.Left="{Binding CurrentPoint^.X, Mode=OneWay}"
Canvas.Top="{Binding CurrentPoint^.Y, Mode=OneWay}"
RenderTransform="translate(2px, -3px)" />
<materialIcons:MaterialIcon Kind="Antenna"
Width="6"
Height="6"
IsVisible="{Binding MovingToConspiratorial^}"
Canvas.Left="{Binding CurrentPoint^.X, Mode=OneWay}"
Canvas.Top="{Binding CurrentPoint^.Y, Mode=OneWay}"
RenderTransform="translate(5px, -3px)" />
<materialIcons:MaterialIcon Kind="LightbulbDimmer10"
Width="6"
Height="6"
IsVisible="{Binding MovingToSmart^}"
Canvas.Left="{Binding CurrentPoint^.X, Mode=OneWay}"
Canvas.Top="{Binding CurrentPoint^.Y, Mode=OneWay}"
RenderTransform="translate(5px, -3px)" />
</Canvas>
</Panel>
</Viewbox>
Expand Down

0 comments on commit 07e297e

Please sign in to comment.