Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Source/Data/Achievement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public static bool IsValidBadgeName(string badgeName)
public Trigger Trigger { get; internal set; }

/// <summary>
/// Gets the achievement category (3=Core, 5=Unofficial).
/// Gets the achievement category (3=Promoted, 5=Unpromoted).
/// </summary>
public int Category { get; internal set; }

/// <summary>
/// Gets whether or not the achievement is Unofficial.
/// Gets whether or not the achievement is Unpromoted.
/// </summary>
public override bool IsUnofficial
public override bool IsUnpromoted
{
get { return Category == 5; }
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Data/AssetBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class AssetBase
public DateTime LastModified { get; set; }

/// <summary>
/// Gets whether or not the asset has been published but not promoted to Core.
/// Gets whether or not the asset has been published but not promoted.
/// </summary>
public virtual bool IsUnofficial
public virtual bool IsUnpromoted
{
get { return false; }
}
Expand Down
1 change: 1 addition & 0 deletions Source/Parser/PublishedAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private static AchievementSetType ConvertType(string type)
{
case "core": return AchievementSetType.Core;
case "bonus": return AchievementSetType.Bonus;
case "challenge": return AchievementSetType.Challenge;
case "specialty": return AchievementSetType.Specialty;
case "exclusive": return AchievementSetType.Exclusive;
default: return AchievementSetType.None;
Expand Down
16 changes: 8 additions & 8 deletions Source/ViewModels/AchievementsListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ private void CountAchievements(AchievementViewModel[] achievements)
var initialPointsLength = points.Length;
points.Append(" (");

var published = achievements.Where(a => !a.Published?.Asset?.IsUnofficial ?? false);
if (published.Any())
var promoted = achievements.Where(a => !a.Published?.Asset?.IsUnpromoted ?? false);
if (promoted.Any())
{
description.AppendFormat("{0} published, ", published.Count());
points.AppendFormat("{0} published, ", published.Sum(a => a.Points));
description.AppendFormat("{0} promoted, ", promoted.Count());
points.AppendFormat("{0} promoted, ", promoted.Sum(a => a.Points));
}

var unpublished = achievements.Where(a => a.Published?.Asset?.IsUnofficial ?? false);
if (unpublished.Any())
var unpromoted = achievements.Where(a => a.Published?.Asset?.IsUnpromoted ?? false);
if (unpromoted.Any())
{
description.AppendFormat("{0} unpublished, ", unpublished.Count());
points.AppendFormat("{0} unpublished, ", unpublished.Sum(a => a.Points));
description.AppendFormat("{0} unpromoted, ", unpromoted.Count());
points.AppendFormat("{0} unpromoted, ", unpromoted.Sum(a => a.Points));
}

var local = achievements.Where(a => a.Published?.Asset == null);
Expand Down
4 changes: 2 additions & 2 deletions Source/ViewModels/AssetSourceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public AssetSourceViewModel(AssetViewModelBase owner, string source)

protected readonly AssetViewModelBase _owner;

internal AssetBase Asset
public AssetBase Asset
{
get { return _asset; }
set
internal set
{
bool hadAsset = _asset != null;
if (hadAsset && value == null)
Expand Down
51 changes: 26 additions & 25 deletions Source/ViewModels/AssetViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public bool IsPointsModified

private void UpdateModified()
{
var coreAsset = Published.Asset;
var publishedAsset = Published.Asset;

if (!IsGenerated || Generated.Asset.IsInvalid)
{
Expand All @@ -200,13 +200,14 @@ private void UpdateModified()
ModificationMessage = "Generation failed";
}

if (coreAsset != null)
if (publishedAsset != null)
{
Triggers = Published.TriggerList;
if (coreAsset.IsUnofficial)
TriggerSource = String.Format("Unpublished ({0})", ModificationMessage);

if (publishedAsset.IsUnpromoted)
TriggerSource = String.Format("Unpromoted ({0})", ModificationMessage);
else
TriggerSource = String.Format("Core ({0})", ModificationMessage);
TriggerSource = String.Format("Promoted ({0})", ModificationMessage);
}
else if (Local.Asset != null)
{
Expand All @@ -221,17 +222,17 @@ private void UpdateModified()
{
TriggerSource = "Generated";

if (coreAsset != null)
if (publishedAsset != null)
{
bool differsFromPublished = !IsModified(Published, false);
UpdateModifiedProperties(Local); // reset title/description modified properties

if (differsFromPublished)
{
if (coreAsset.IsUnofficial)
TriggerSource = "Generated (Same as Unpublished)";
if (publishedAsset.IsUnpromoted)
TriggerSource = "Generated (Same as Unpromoted)";
else
TriggerSource = "Generated (Same as Core)";
TriggerSource = "Generated (Same as Promoted)";
}
}

Expand All @@ -240,7 +241,7 @@ private void UpdateModified()
CompareState = GeneratedCompareState.LocalDiffers;
CanUpdate = true;
}
else if (coreAsset != null && IsModified(Published, true))
else if (publishedAsset != null && IsModified(Published, true))
{
if (Local.Asset != null)
{
Expand All @@ -253,10 +254,10 @@ private void UpdateModified()
CanUpdate = true;
}

if (coreAsset.IsUnofficial)
ModificationMessage = "Unpublished differs from generated";
if (publishedAsset.IsUnpromoted)
ModificationMessage = "Unpromoted differs from generated";
else
ModificationMessage = "Core differs from generated";
ModificationMessage = "Promoted differs from generated";

Other = Published;
CompareState = (Local.Asset != null) ? GeneratedCompareState.PublishedDiffers : GeneratedCompareState.LocalDiffers;
Expand All @@ -265,18 +266,18 @@ private void UpdateModified()
{
if (Local.Asset == null && IsGenerated)
{
if (coreAsset == null)
if (publishedAsset == null)
{
TriggerSource = "Generated (Not in Local)";
ModificationMessage = "Local " + ViewerType + " does not exist";
CompareState = GeneratedCompareState.GeneratedOnly;
}
else
{
if (coreAsset.IsUnofficial)
TriggerSource = "Generated (Same as Unpublished, not in Local)";
if (publishedAsset.IsUnpromoted)
TriggerSource = "Generated (Same as Unpromoted, not in Local)";
else
TriggerSource = "Generated (Same as Core, not in Local)";
TriggerSource = "Generated (Same as Promoted, not in Local)";

ModificationMessage = null;
CompareState = GeneratedCompareState.Same;
Expand All @@ -287,12 +288,12 @@ private void UpdateModified()
}
else
{
if (coreAsset == null)
if (publishedAsset == null)
TriggerSource = "Generated (Same as Local)";
else if (coreAsset.IsUnofficial)
TriggerSource = "Generated (Same as Unpublished and Local)";
else if (publishedAsset.IsUnpromoted)
TriggerSource = "Generated (Same as Unpromoted and Local)";
else
TriggerSource = "Generated (Same as Core and Local)";
TriggerSource = "Generated (Same as Promoted and Local)";

ModificationMessage = null;
CompareState = GeneratedCompareState.Same;
Expand Down Expand Up @@ -456,10 +457,10 @@ public override void Refresh()
{
var generatedAsset = Generated.Asset;
var localAsset = Local.Asset;
var coreAsset = Published.Asset;
var publishedAsset = Published.Asset;

Published.Source = (coreAsset == null) ? "Published" :
coreAsset.IsUnofficial ? "Published (Unofficial)" : "Published (Core)";
Published.Source = (publishedAsset == null) ? "Published" :
publishedAsset.IsUnpromoted ? "Published (Unpromoted)" : "Published (Promoted)";

if (generatedAsset != null)
{
Expand All @@ -468,7 +469,7 @@ public override void Refresh()
else
{
ClearBindings();
if (coreAsset != null)
if (publishedAsset != null)
LoadViewModel(Published);
else if (localAsset != null)
LoadViewModel(Local);
Expand Down
28 changes: 14 additions & 14 deletions Source/ViewModels/ConditionsAnalyzerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public class Result
public int AchievementId { get; internal set; }
public int LeaderboardId { get; internal set; }
public string Details { get; internal set; }
public bool IsUnofficial { get; internal set; }
public bool IsUnpromoted { get; internal set; }
}

public ObservableCollection<Result> Results { get; private set; }
Expand Down Expand Up @@ -245,18 +245,18 @@ private void OnDialogResultPropertyChanged(object sender, ModelPropertyChangedEv
Progress.IsEnabled = false;
}

public static readonly ModelProperty IsCoreAchievementsScannedProperty = ModelProperty.Register(typeof(ConditionsAnalyzerViewModel), "IsAchievementsScanned", typeof(bool), true);
public bool IsCoreAchievementsScanned
public static readonly ModelProperty IsPromotedAchievementsScannedProperty = ModelProperty.Register(typeof(ConditionsAnalyzerViewModel), "IsPromotedAchievementsScanned", typeof(bool), true);
public bool IsPromotedAchievementsScanned
{
get { return (bool)GetValue(IsCoreAchievementsScannedProperty); }
set { SetValue(IsCoreAchievementsScannedProperty, value); }
get { return (bool)GetValue(IsPromotedAchievementsScannedProperty); }
set { SetValue(IsPromotedAchievementsScannedProperty, value); }
}

public static readonly ModelProperty IsNonCoreAchievementsScannedProperty = ModelProperty.Register(typeof(ConditionsAnalyzerViewModel), "IsAchievementsScanned", typeof(bool), true);
public bool IsNonCoreAchievementsScanned
public static readonly ModelProperty IsUnpromotedAchievementsScannedProperty = ModelProperty.Register(typeof(ConditionsAnalyzerViewModel), "IsUnpromotedAchievementsScanned", typeof(bool), true);
public bool IsUnpromotedAchievementsScanned
{
get { return (bool)GetValue(IsNonCoreAchievementsScannedProperty); }
set { SetValue(IsNonCoreAchievementsScannedProperty, value); }
get { return (bool)GetValue(IsUnpromotedAchievementsScannedProperty); }
set { SetValue(IsUnpromotedAchievementsScannedProperty, value); }
}

public static readonly ModelProperty IsLeaderboardStartScannedProperty = ModelProperty.Register(typeof(ConditionsAnalyzerViewModel), "IsLeaderboardStartScanned", typeof(bool), true);
Expand Down Expand Up @@ -329,7 +329,7 @@ private void DoSearch()
var directory = _settings.DumpDirectory;

var filesToRead = 0;
if (IsCoreAchievementsScanned || IsNonCoreAchievementsScanned)
if (IsPromotedAchievementsScanned || IsUnpromotedAchievementsScanned)
filesToRead += Snapshot.AchievementGameCount;
if (IsLeaderboardCancelScanned || IsLeaderboardStartScanned || IsLeaderboardSubmitScanned)
filesToRead += Snapshot.LeaderboardGameCount;
Expand All @@ -341,7 +341,7 @@ private void DoSearch()

var results = new List<Result>();

if (IsCoreAchievementsScanned || IsNonCoreAchievementsScanned)
if (IsPromotedAchievementsScanned || IsUnpromotedAchievementsScanned)
{
Progress.Label = "Processing Achievements...";

Expand All @@ -365,12 +365,12 @@ private void DoSearch()
foreach (var achievement in achievements)
{
var flags = achievement.GetField("Flags").IntegerValue;
if (!IsCoreAchievementsScanned)
if (!IsPromotedAchievementsScanned)
{
if (flags == 3)
continue;
}
else if (!IsNonCoreAchievementsScanned)
else if (!IsUnpromotedAchievementsScanned)
{
if (flags != 3)
continue;
Expand All @@ -386,7 +386,7 @@ private void DoSearch()
AchievementId = achievement.GetField("ID").IntegerValue.GetValueOrDefault(),
ItemName = achievement.GetField("Title").StringValue,
Details = memAddr,
IsUnofficial = flags == 5
IsUnpromoted = flags == 5
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ViewModels/GameBadgesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private bool LoadGameFromCache()
var badgeDirectory = Path.Combine(directory, "RACache", "Badge");
foreach (var achievement in publishedAssets.Achievements)
{
if (achievement.IsUnofficial)
if (achievement.IsUnpromoted)
continue;

var path = Path.Combine(badgeDirectory, achievement.BadgeName);
Expand Down
Loading
Loading