Skip to content

Commit

Permalink
fix: remove code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Nov 14, 2022
1 parent ff983f8 commit d8ac9e9
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 135 deletions.
16 changes: 8 additions & 8 deletions MHFZ_Overlay/Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,16 +1234,16 @@ public static class MapAreaList
{327,"Tidal Island - Day" },
{328,"Tidal Island - Day" },
{329,"Tidal Island - Day" },
{330,"Tidal Island - Base Camp - Night)" },
{331,"Tidal Island - Area 1 - Night)" },
{332,"Tidal Island - Area 2 - Night)" },
{333,"Tidal Island - Area 3 - Night)" },
{330,"Tidal Island - Base Camp - Night" },
{331,"Tidal Island - Area 1 - Night" },
{332,"Tidal Island - Area 2 - Night" },
{333,"Tidal Island - Area 3 - Night" },
{334,"Tidal Island - Area 4 - Day" },
{335,"Tidal Island - Area 5 - Day" },
{336,"Tidal Island - Day" },
{337,"Tidal Island (Orange Area 5)" },
{338,"Tidal Island Area 4 - Night" },
{339,"Tidal Island Area 5 - Night" },
{338,"Tidal Island - Area 4 - Night" },
{339,"Tidal Island - Area 5 - Night" },
{340,"SR Room" },
{341,"SR Room" },
{342,"Large Airship - Base Camp - Day" },
Expand Down Expand Up @@ -2122,7 +2122,7 @@ public static class StyleRankSkillList
{42, ""},
{43, ""},
{44, "Fire Res+15"},//start
{45, ""},//TODO
{45, ""},
{46, ""},
{47, ""},
{48, "Fire Res+20"},//after hr6
Expand All @@ -2143,7 +2143,7 @@ public static class StyleRankSkillList
{63, ""},
{64, ""},
{65, "Water Res+20"},//after nosus
{66, "Water Res+22"},//TODO
{66, "Water Res+22"},
{67, "Water Res+24"},
{68, "Water Res+25"},
{69, ""},
Expand Down
42 changes: 21 additions & 21 deletions MHFZ_Overlay/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ the pipe connection.
/// <value>
/// <c>true</c> if [show discord RPC]; otherwise, <c>false</c>.
/// </value>
public bool ShowDiscordRPC
public static bool ShowDiscordRPC
{
get
{
Expand All @@ -156,7 +156,7 @@ public bool ShowDiscordRPC
/// <value>
/// The discord client identifier.
/// </value>
public string GetDiscordClientID
public static string GetDiscordClientID
{
get
{
Expand All @@ -174,7 +174,7 @@ public string GetDiscordClientID
/// <value>
/// The discord server invite.
/// </value>
public string GetDiscordServerInvite
public static string GetDiscordServerInvite
{
get
{
Expand All @@ -192,7 +192,7 @@ public string GetDiscordServerInvite
/// <value>
/// The name of the hunter.
/// </value>
public string GetHunterName
public static string GetHunterName
{
get
{
Expand All @@ -210,7 +210,7 @@ public string GetHunterName
/// <value>
/// The name of the guild.
/// </value>
public string GetGuildName
public static string GetGuildName
{
get
{
Expand Down Expand Up @@ -238,7 +238,7 @@ void Cleanup()
/// <summary>
/// The current presence to send to discord.
/// </summary>
public static RichPresence presenceTemplate = new RichPresence()
public RichPresence presenceTemplate = new RichPresence()
{
Details = "【MHF-Z】Overlay " + CurrentProgramVersion,
State = "Loading...",
Expand All @@ -260,7 +260,7 @@ void Cleanup()
/// <summary>
/// Is the main loop currently running?
/// </summary>
public static bool isDiscordRPCRunning = false;
public bool isDiscordRPCRunning = false;

/// <summary>
/// Initializes the discord RPC.
Expand Down Expand Up @@ -536,7 +536,7 @@ private void CreateDamageNumber()
/// Shows multicolor damage numbers?
/// </summary>
/// <returns></returns>
public bool ShowDamageNumbersMulticolor()
public static bool ShowDamageNumbersMulticolor()
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
if (s.EnableDamageNumbersMulticolor)
Expand Down Expand Up @@ -774,7 +774,7 @@ public string GetCaravanSkills()
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string GetDivaSkillNameFromID(int id)
public static string GetDivaSkillNameFromID(int id)
{
Dictionary.DivaSkillList.DivaSkillID.TryGetValue(id, out string? divaskillaname);
return divaskillaname + "";
Expand All @@ -784,7 +784,7 @@ public string GetDivaSkillNameFromID(int id)
/// Gets the discord timer mode.
/// </summary>
/// <returns></returns>
public string GetDiscordTimerMode()
public static string GetDiscordTimerMode()
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
if (s.DiscordTimerMode == "Time Left")
Expand All @@ -801,7 +801,7 @@ public string GetDiscordTimerMode()
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string GetWeaponStyleFromID(int id)
public static string GetWeaponStyleFromID(int id)
{
return id switch
{
Expand All @@ -818,7 +818,7 @@ public string GetWeaponStyleFromID(int id)
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string getArmorSkill(int id)
public static string getArmorSkill(int id)
{
Dictionary.ArmorSkillList.ArmorSkillID.TryGetValue(id, out string? skillname);
if (skillname == "")
Expand All @@ -832,7 +832,7 @@ public string getArmorSkill(int id)
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string GetItemName(int id)
public static string GetItemName(int id)
{
string itemValue1;
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
Expand Down Expand Up @@ -863,7 +863,7 @@ public string GetQuestNameFromID(int id)
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string getWeaponNameFromID(int id)
public static string getWeaponNameFromID(int id)
{
Dictionary.WeaponList.WeaponID.TryGetValue(id, out string? weaponname);
return weaponname + "";
Expand Down Expand Up @@ -1785,7 +1785,7 @@ public string GetObjectiveNameFromID(int id, bool isLargeImageText = false)
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string GetAreaIconFromID(int id) //TODO: are highlands, tidal island or painted falls icons correct?
public static string GetAreaIconFromID(int id) //TODO: are highlands, tidal island or painted falls icons correct?
{
switch (id)
{
Expand Down Expand Up @@ -2067,7 +2067,7 @@ public string GetAreaIconFromID(int id) //TODO: are highlands, tidal island or p
case 436:
return "https://i.imgur.com/36TTe1a.png";
case 459://Hunter's Road Base Camp
return "https://i.imgur.com/MEPAa5x.png";//TODO test
return "https://i.imgur.com/MEPAa5x.png";
case 288://Gorge areas
case 289:
case 290:
Expand Down Expand Up @@ -2146,7 +2146,7 @@ public string GetAreaIconFromID(int id) //TODO: are highlands, tidal island or p
/// </summary>
/// <param name="isHighGradeEdition">if set to <c>true</c> [is high grade edition].</param>
/// <returns></returns>
public string GetGameMode(bool isHighGradeEdition)
public static string GetGameMode(bool isHighGradeEdition)
{
if (isHighGradeEdition)
return " [High-Grade Edition]";
Expand Down Expand Up @@ -2713,7 +2713,7 @@ public string getMonsterIcon(int id)
/// Shows the current hp percentage.
/// </summary>
/// <returns></returns>
public bool ShowCurrentHPPercentage()
public static bool ShowCurrentHPPercentage()
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
if (s.EnableCurrentHPPercentage)
Expand Down Expand Up @@ -2780,7 +2780,7 @@ public string GetObjective1Name(int id, bool isLargeImageText = false)
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns></returns>
public string GetPoogieClothes(int id)
public static string GetPoogieClothes(int id)
{
string? clothesValue1;
_ = Dictionary.PoogieCostumeList.PoogieCostumeID.TryGetValue(id, out clothesValue1); //returns true
Expand Down Expand Up @@ -3032,7 +3032,7 @@ public bool InArena()
/// <value>
/// <c>true</c> if [show discord quest names]; otherwise, <c>false</c>.
/// </value>
public bool ShowDiscordQuestNames
public static bool ShowDiscordQuestNames
{
get
{
Expand Down Expand Up @@ -3820,7 +3820,7 @@ public void EnableDragAndDrop()

private void ToggleClickThrough()
{
if(ClickThrough == false)
if(!ClickThrough)
{
IsHitTestVisible = false;
Focusable = false;
Expand Down
Loading

0 comments on commit d8ac9e9

Please sign in to comment.