Explorar el Código

Internal cleanup

Lilith Song hace 3 años
padre
commit
068933098d
Se han modificado 2 ficheros con 18 adiciones y 30 borrados
  1. 6 17
      HuntBuddy/Interface.cs
  2. 12 13
      HuntBuddy/Plugin.cs

+ 6 - 17
HuntBuddy/Interface.cs

@@ -124,23 +124,12 @@ namespace HuntBuddy
 								{
 									includeArea = !includeArea;
 								}
-								if (includeArea)
-								{
-									Location.CreateMapMarker(
-										mobHuntEntry.TerritoryType,
-										mobHuntEntry.MapId,
-										mobHuntEntry.MobHuntId,
-										mobHuntEntry.Name,
-										Location.OpenType.ShowOpen);
-								}
-								else
-								{
-									Location.CreateMapMarker(
-										mobHuntEntry.TerritoryType,
-										mobHuntEntry.MapId,
-										mobHuntEntry.MobHuntId,
-										mobHuntEntry.Name);
-								}
+								Location.CreateMapMarker(
+									mobHuntEntry.TerritoryType,
+									mobHuntEntry.MapId,
+									mobHuntEntry.MobHuntId,
+									mobHuntEntry.Name,
+									includeArea ? Location.OpenType.ShowOpen : Location.OpenType.MarkerOpen);
 							}
 
 							if (ImGui.IsItemHovered())

+ 12 - 13
HuntBuddy/Plugin.cs

@@ -148,19 +148,18 @@ namespace HuntBuddy
 		[HelpMessage("Toggles UI\nArguments:\nreload - Reloads data\nlocal - Toggles the local hunt marks window")]
 		public void PluginCommand(string command, string args)
 		{
-			if (args == "reload")
-			{
-				this.MobHuntEntriesReady = false;
-				Task.Run(this.ReloadData);
-			}
-			else if (args == "local")
-			{
-				this.Configuration.ShowLocalHunts = !this.Configuration.ShowLocalHunts;
-				this.Configuration.Save();
-			}
-			else
-			{
-				this.OpenConfigUi();
+			switch (args.Trim().ToLower()) {
+				case "reload":
+					this.MobHuntEntriesReady = false;
+					Task.Run(this.ReloadData);
+					break;
+				case "local":
+					this.Configuration.ShowLocalHunts = !this.Configuration.ShowLocalHunts;
+					this.Configuration.Save();
+					break;
+				default:
+					this.OpenConfigUi();
+					break;
 			}
 		}