Skip to content

Commit

Permalink
Use hero assest url from v2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
ellesde committed Apr 18, 2020
1 parent 9f5a0f4 commit 6326b34
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion E7 Gear Optimizer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</startup>
<appSettings>
<add key="ApiUrl" value="https://api.epicsevendb.com" />
<add key="AssetUrl" value="http://assets.epicsevendb.com" />
<add key="GitHubUrl" value="https://github.com/Zarroc2762/E7-Gear-Optimizer/releases"/>
<add key="GitHubApiUrl" value="https://api.github.com/repos/Zarroc2762/E7-Gear-Optimizer/releases/latest"/>
<add key="Version" value="2.0.2.0"/>
Expand Down
3 changes: 2 additions & 1 deletion E7 Gear Optimizer/Hero.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ private Image getPortrait(string name)
}
else
{
portrait = new Bitmap(Util.client.OpenRead(Util.AssetUrl + "/hero/" + Util.toAPIUrl(Name) + "/icon.png"));
string json = loadJson();
portrait = new Bitmap(Util.client.OpenRead(JObject.Parse(json)["results"][0]["assets"]["icon"].ToString()));
if (Properties.Settings.Default.UseCache)
{
portrait.Save(cacheFileName, ImageFormat.Png);
Expand Down
1 change: 0 additions & 1 deletion E7 Gear Optimizer/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public enum HeroClass
public static class Util
{
public static string ApiUrl = System.Configuration.ConfigurationManager.AppSettings["ApiUrl"];
public static string AssetUrl = System.Configuration.ConfigurationManager.AppSettings["AssetUrl"];
public static string GitHubUrl = System.Configuration.ConfigurationManager.AppSettings["GitHubUrl"];
public static string GitHubApiUrl = System.Configuration.ConfigurationManager.AppSettings["GitHubApiUrl"];
public static string ver = System.Configuration.ConfigurationManager.AppSettings["Version"];
Expand Down

0 comments on commit 6326b34

Please sign in to comment.