diff --git a/PennyPincher.cs b/PennyPincher.cs index 47ec6e8..597fb04 100644 --- a/PennyPincher.cs +++ b/PennyPincher.cs @@ -30,9 +30,9 @@ public class PennyPincher : IDalamudPlugin private int configMin; private int configMod; private int configDelta; - private bool configAlwaysOn; + + private int configMode; private bool configHq; - private bool configSmart; private bool configVerbose; private bool _config; @@ -99,24 +99,22 @@ private void DrawWindow() { if (!_config) return; - ImGui.SetNextWindowSize(new Num.Vector2(600, 600), ImGuiCond.FirstUseEver); + ImGui.SetNextWindowSize(new Num.Vector2(550, 270), ImGuiCond.FirstUseEver); ImGui.Begin($"{Name} Config", ref _config); - ImGui.InputInt("Delta", ref configDelta); - ImGui.TextWrapped("Sets the undercutting amount to be ."); + ImGui.InputInt("Amount to undercut by", ref configDelta); - ImGui.InputInt("Minimum Price", ref configMin); - ImGui.TextWrapped("Sets a minimum value to be copied. cannot be below 1."); + ImGui.InputInt("Minimum price to copy", ref configMin); - ImGui.InputInt("Mod", ref configMod); - ImGui.TextWrapped("Adjusts base price by subtracting % from before subtracting .\nThis makes the last digits of your posted prices consistent."); + ImGui.InputInt("Modulo*", ref configMod); + ImGui.TextWrapped("*Subtracts an additional [ %% ] from the price (no effect if modulo is 1).\nThis can be used to make the last digits of your copied prices consistent."); ImGui.Separator(); - - ImGui.Checkbox($"Always On: Toggles whether {Name} is always on (supersedes 'Smart Mode')", ref configAlwaysOn); - ImGui.Checkbox($"HQ: Toggles whether {Name} should only undercut HQ items when you're listing an HQ item", ref configHq); - ImGui.Checkbox($"Smart Mode: Toggles whether {Name} should automatically copy when you're using a retainer", ref configSmart); - ImGui.Checkbox($"Verbose: Toggles whether {Name} prints whenever it copies to clipboard", ref configVerbose); + + string[] modes = { "Never", "Only at Retainer", "Always" }; + ImGui.Combo("When to copy", ref configMode, modes, modes.Length); + ImGui.Checkbox($"When listing an item that can be HQ, only undercut HQ items", ref configHq); + ImGui.Checkbox($"Print chat message when prices are copied to clipboard", ref configVerbose); ImGui.Separator(); if (ImGui.Button("Save and Close Config")) @@ -135,9 +133,9 @@ private void LoadConfig() configMin = configuration.min; configMod = configuration.mod; - configAlwaysOn = configuration.alwaysOn; + configMode = configuration.alwaysOn ? 2 : (configuration.smart ? 1 : 0); + configHq = configuration.hq; - configSmart = configuration.smart; configVerbose = configuration.verbose; } @@ -145,17 +143,24 @@ private void SaveConfig() { if (configMin < 1) { - Chat.Print($"{Name}: cannot be lower than 1."); + Chat.Print("Minimum price must be positive."); configMin = 1; } + + if (configMod < 1) + { + Chat.Print("Modulo must be positive."); + configMod = 1; + } configuration.delta = configDelta; configuration.min = configMin; configuration.mod = configMod; - configuration.alwaysOn = configAlwaysOn; + configuration.alwaysOn = configMode == 2; + configuration.smart = configMode == 1; + configuration.hq = configHq; - configuration.smart = configSmart; configuration.verbose = configVerbose; PluginInterface.SavePluginConfig(configuration); diff --git a/PennyPincher.json b/PennyPincher.json index dede6c9..415ab32 100644 --- a/PennyPincher.json +++ b/PennyPincher.json @@ -3,10 +3,7 @@ "Name": "Penny Pincher", "Punchline": "Copies 1 below the cheapest offer to your clipboard when you check marketboard prices", "Description": "Plugin for simplifying \"pennying\" (undercutting current lowest offer by 1).\n\nThe usual workflow for this is the following:\n1. Open up the adjust price menu for the item you're undercutting\n2. Click on the compare prices menu to view the current listings\n3. Take a mental note of what the current lowest offer is\n4. Subtract one from it\n5. Close the current listings window\n6. Update your item's price with the number you noted\n7. Confirm your new price\n\nThis plugin eliminates the mental notekeeping steps in the middle by automatically copying the number you want onto your clipboard when you open the current listings window. \n\nTherefore, your new workflow becomes this:\n1. Open up the adjust price menu for the item you're undercutting\n2. Click on the compare prices menu to view the current listings\n3. Close the current listings window\n4. Paste the undercut value in\n5. Confirm your new price\n\nThis both speeds up the process and reduces room for error from typos.", - "InternalName": "PennyPincher", - "AssemblyVersion": "1.4.0.0", "RepoUrl": "https://github.com/tesu/PennyPincher", - "ApplicableVersion": "any", "Tags": [ "marketboard", "undercut", "penny", "clipboard" ], "ImageUrls": [], "IconUrl": "https://github.com/tesu/PennyPincher/raw/master/images/icon.png", diff --git a/README.md b/README.md index 5a6e8c1..adcdefc 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,6 @@ Therefore, your new workflow becomes this: This both speeds up the process and reduces room for error from typos. -## Commands -| Command                      | Description | Default | -|---------|-------------|---------| -|`/penny`|Toggles whether to always copy prices. Supercedes the `smart` setting.|disabled| -|`/penny delta `|Sets how much to undercut by. A delta of 0 would copy the same price as the lowest offer, and a delta of 100 would copy 100 under the lowest offer. Negative numbers work exactly how you would expect, though it's not obvious to me how this could be useful.|1| -|`/penny hq`|Toggles whether to only undercut HQ items when listing an item that can be HQ.|enabled| -|`/penny mod `|Adjusts base price by subtracting ` % ` from `` before subtracting ``. This makes the last digits of your posted prices consistent.|1| -|`/penny min `|Sets a minimum value that will not go lower than. cannot be below 1.|1| -|`/penny smart`|Toggles whether to always copy prices when accessing the marketboard from a retainer.|enabled| -|`/penny verbose`|Toggles whether to print to chat when a price to copied.|enabled| -|`/penny help`|Displays the list of commands.|| - ## Changelog 1.4.0.0: Configuration via UI instead of slash-commands 1.3.0.0: `/penny min` added, `/penny hq` behavior reverted to the old dumb behavior, updated to dalamud API v4 diff --git a/images/icon.png b/images/icon.png index 80e42dc..1be17ad 100644 Binary files a/images/icon.png and b/images/icon.png differ