Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Ninja Price/Main/Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,7 @@ private void ProcessAncestorFightRewards()
private void ProcessItemsOnGround()
{
if (!Settings.GroundItemSettings.PriceItemsOnGround && !Settings.UniqueIdentificationSettings.ShowRealUniqueNameOnGround && !Settings.GroundItemSettings.PriceHeistRewards) return;
if (GameController.IngameState.IngameUi.FullscreenPanels.Any(x => x.IsVisible)) return;
//this window allows us to change the size of the text we draw to the background list
//yeah, it's weird
ImGui.Begin("lmao",
Expand Down Expand Up @@ -1216,8 +1217,10 @@ void DrawOnItemLabel(float scale, string text, Color backgroundColor, Color text
ImGui.SetWindowFontScale(scale);
var newTextSize = ImGui.CalcTextSize(text);
var textPosition = box.Center.ToVector2Num() - newTextSize / 2;
var rectPosition = new Vector2(textPosition.X, box.Top + 1);
drawList.AddRectFilled(rectPosition, rectPosition + new Vector2(newTextSize.X, box.Height - 2), backgroundColor.ToImgui());
var (backgroundLeft, backgroundRight) = Settings.UniqueIdentificationSettings.BackgroundCoversWholeLabel
? (box.Left + 1, box.Right - 1)
: (textPosition.X, textPosition.X + newTextSize.X);
drawList.AddRectFilled(new Vector2(backgroundLeft, box.Top + 1), new Vector2(backgroundRight, box.Bottom - 1), backgroundColor.ToImgui());
drawList.AddText(textPosition, textColor.ToImgui(), text);
ImGui.SetWindowFontScale(1);
}
Expand Down
3 changes: 3 additions & 0 deletions Ninja Price/Settings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ public class UniqueIdentificationSettings
public ToggleNode OnlyShowRealUniqueNameForValuableUniques { get; set; } = new(false);
public ToggleNode ShowWarningTextForUnknownUniques { get; set; } = new(true);
public RangeNode<float> UniqueLabelSize { get; set; } = new(0.8f, 0.1f, 1);

[Menu(null, "Draw the name background over the whole item label instead of only behind the text")]
public ToggleNode BackgroundCoversWholeLabel { get; set; } = new(false);
public ColorNode UniqueItemNameTextColor { get; set; } = new(Color.Black);
public ColorNode UniqueItemNameBackgroundColor { get; set; } = new(new Color(175, 96, 37));
public ColorNode ValuableUniqueItemNameTextColor { get; set; } = new(new Color(175, 96, 37));
Expand Down