Parcourir la source

Add option to scale icon size

Dragon il y a 4 ans
Parent
commit
0030a32a8e
2 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 1 0
      Configuration.cs
  2. 2 1
      Interface.cs

+ 1 - 0
Configuration.cs

@@ -12,6 +12,7 @@ namespace HuntBuddy
 		public bool ShowLocalHuntIcons;
 		public bool HideLocalHuntBackground;
 		public bool HideCompletedHunts;
+		public float IconScale = 1f;
 		public Vector4 IconBackgroundColour = new(0.76f, 0.75f, 0.76f, 0.8f);
 
 		[JsonIgnore] public uint IconBackgroundColourU32;

+ 2 - 1
Interface.cs

@@ -244,6 +244,7 @@ namespace HuntBuddy
 				ref this._plugin.Configuration.HideLocalHuntBackground);
 			save |= ImGui.Checkbox("Hide completed targets in local hunts window",
 				ref this._plugin.Configuration.HideCompletedHunts);
+			save |= ImGui.SliderFloat("Hunt icon scale", ref this._plugin.Configuration.IconScale, 0.2f, 2f, "%.2f");
 			if (ImGui.ColorEdit4("Hunt icon background colour", ref this._plugin.Configuration.IconBackgroundColour))
 			{
 				this._plugin.Configuration.IconBackgroundColourU32 =
@@ -281,7 +282,7 @@ namespace HuntBuddy
 		{
 			var cursorPos = ImGui.GetCursorScreenPos();
 			var imageSize = mobHuntEntry.ExpansionId < 3 ? new Vector2(192f, 128f) : new Vector2(210f);
-			imageSize *= ImGui.GetIO().FontGlobalScale;
+			imageSize *= ImGui.GetIO().FontGlobalScale * this._plugin.Configuration.IconScale;
 
 			ImGui.InvisibleButton("canvas", imageSize);