Skip to content

Commit

Permalink
fixes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsLogic committed Sep 11, 2022
1 parent f1873de commit 83841ce
Showing 1 changed file with 58 additions and 31 deletions.
89 changes: 58 additions & 31 deletions AchievementList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ public async void PopulateAchievementList(string AchievementData)
Jsonresponse = (dynamic)JObject.Parse(AchievementData);
var newline = 0;
var backcolour = Color.Silver;
try
if (Jsonresponse.achievements.Count == 0)
{
Close();
MessageBox.Show("this game has no achivements", "fucky wucky");

}
else
{
SCID = Jsonresponse.achievements[0].serviceConfigId.ToString();
TitleID = Jsonresponse.achievements[0].titleAssociations[0].id.ToString();
Expand All @@ -50,42 +56,63 @@ public async void PopulateAchievementList(string AchievementData)
{
if (Jsonresponse.achievements[i].progressState.ToString() == "Achieved")
{
DGV_AchievementList.Rows.Add(2,
Jsonresponse.achievements[i].name.ToString(),
Jsonresponse.achievements[i].description.ToString(),
"Gamerscore: " + Jsonresponse.achievements[i].rewards[0].value.ToString() +
"\nRarity: " + Jsonresponse.achievements[i].rarity.currentCategory.ToString() +
"\nPlayer Percentage: " + Jsonresponse.achievements[i].rarity.currentPercentage.ToString() + "%" +
"\nSecret: " + Jsonresponse.achievements[i].isSecret.ToString() +
"\nProgress State: " + Jsonresponse.achievements[i].progressState.ToString() +
"\nUnlock Time: " + Jsonresponse.achievements[i].progression.timeUnlocked.ToString(),
Jsonresponse.achievements[i].id.ToString()
);
try
{


DGV_AchievementList.Rows.Add(2,
Jsonresponse.achievements[i].name.ToString(),
Jsonresponse.achievements[i].description.ToString(),
"Gamerscore: " + Jsonresponse.achievements[i].rewards[0].value.ToString() +
"\nRarity: " + Jsonresponse.achievements[i].rarity.currentCategory.ToString() +
"\nPlayer Percentage: " +
Jsonresponse.achievements[i].rarity.currentPercentage.ToString() + "%" +
"\nSecret: " + Jsonresponse.achievements[i].isSecret.ToString() +
"\nProgress State: " + Jsonresponse.achievements[i].progressState.ToString() +
"\nUnlock Time: " + Jsonresponse.achievements[i].progression.timeUnlocked.ToString(),
Jsonresponse.achievements[i].id.ToString()
);
}
catch
{
DGV_AchievementList.Rows.Add(0,
Jsonresponse.achievements[i].name.ToString(),
Jsonresponse.achievements[i].description.ToString(),
"There was a problem grabbing stats for this achievement.\n\n\n\n\n",
Jsonresponse.achievements[i].id.ToString()
);
}
}
else
{
DGV_AchievementList.Rows.Add(0,
Jsonresponse.achievements[i].name.ToString(),
Jsonresponse.achievements[i].description.ToString(),
"Gamerscore: " + Jsonresponse.achievements[i].rewards[0].value.ToString() +
"\nRarity: " + Jsonresponse.achievements[i].rarity.currentCategory.ToString() +
"\nPlayer Percentage: " + Jsonresponse.achievements[i].rarity.currentPercentage.ToString() +
"%" +
"\nSecret: " + Jsonresponse.achievements[i].isSecret.ToString() +
"\nProgress State: " + Jsonresponse.achievements[i].progressState.ToString() + "\n",
Jsonresponse.achievements[i].id.ToString()
);
try
{
DGV_AchievementList.Rows.Add(0,
Jsonresponse.achievements[i].name.ToString(),
Jsonresponse.achievements[i].description.ToString(),
"Gamerscore: " + Jsonresponse.achievements[i].rewards[0].value.ToString() +
"\nRarity: " + Jsonresponse.achievements[i].rarity.currentCategory.ToString() +
"\nPlayer Percentage: " +
Jsonresponse.achievements[i].rarity.currentPercentage.ToString() +
"%" +
"\nSecret: " + Jsonresponse.achievements[i].isSecret.ToString() +
"\nProgress State: " + Jsonresponse.achievements[i].progressState.ToString() + "\n",
Jsonresponse.achievements[i].id.ToString()
);
}
catch
{
DGV_AchievementList.Rows.Add(0,
Jsonresponse.achievements[i].name.ToString(),
Jsonresponse.achievements[i].description.ToString(),
"There was a problem grabbing stats for this achievement.\n\n\n\n\n",
Jsonresponse.achievements[i].id.ToString()
);
}

}
}
}
catch
{
MessageBox.Show("this game has no achivements", "fucky wucky");
Close();
}



}
void SelectAchievement(object sender, EventArgs e)
{
Expand Down

3 comments on commit 83841ce

@520299XX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The author Horizon 5 has been updated. When will the whole car software be updated?

@520299XX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

作者怎么能与你联系。

@520299XX
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can the author contact you?

Please sign in to comment.