diff --git a/Locales/enUS/base.lua b/Locales/enUS/base.lua
index 066c3d8..5dc7ca4 100644
--- a/Locales/enUS/base.lua
+++ b/Locales/enUS/base.lua
@@ -16,12 +16,42 @@ L["HELP_TEXT_VERSION"] = " version displays version information"
L["HELP_TEXT_HELP"] = " help displays this message"
L["HELP_TEXT_BUGS"] = " Please report bugs at wowinterface.com or WeightsWatcher@gmail.com"
L["config"] = "config"
+L["calculation"] = "calculation"
+L["display"] = "display"
+L["enchants"] = "enchants"
+L["gems"] = "gems"
L["version"] = "version"
L["weights"] = "weights"
-- config.xml
-L["CONFIG_TITLE"] = "WeightsWatcher Configuration"
+L["CONF_WW_VER"] = "WeightsWatcher version: |cffffffff%s|r"
+L["CONF_ACCT_VER"] = " Account data version: |cffffffff%d.%d|r"
+L["CONF_CHAR_VER"] = " Character data version: |cffffffff%d.%d|r"
+L["CONF_CONTACT"] = "Contact: |cffffffff%s|r"
+L["CONF_WEBPAGE"] = "Web page: |cffffffff%s|r"
+L["CONF_DESC"] = "WeightsWatcher provides an easy way to compare items based\non their actual stats, as well as suggesting item enhancements."
+L["CONFIG_WEIGHTS"] = "Configure Weights"
+L["CALC_NAME"] = "Calculation"
L["CALC_OPTS"] = "Calculation Options"
+L["DISPLAY_NAME"] = "Display"
+L["DISPLAY_OPTS"] = "Display Options"
+L["SHOW_WTS"] = "Show weights:"
+L["SHOW_IDEAL_WTS"] = "Show ideally-gemmed weights:"
+L["SHOW_IDEAL_GEMS"] = "Show ideal gems:"
+L["SHOW_ALT_IDEAL_GEMS"] = "Show alternate ideal gems:"
+L["SHOW_IDEAL_GEM_STATS"] = "Show ideal gem stats:"
+L["SHOW_DEBUG"] = "Show parser debug information:"
+L["HIDE_HINTS_TT"] = "Hides modifier key hints in tooltips"
+L["HIDE_HINTS"] = "Hide tooltip hints"
+L["SHOW_CLASS"] = "Show class names:"
+L["SHOW_DIFF"] = "Show differences to current gear"
+L["SHOW_DIFF_TT"] = "Shows the change in score compared to the currently equipped gear"
+L["SHOW_ZEROES"] = "Show zero scores"
+L["SHOW_ZEROES_TT"] = "Shows scores for weights that are zero (or negative)"
+L["NORMALIZE"] = "Normalize weights"
+L["NORMALIZE_TT"] = "Divides item scores by the total of all stats' values in that weight"
+L["IDEAL_GEM_NAME"] = "Ideal Gems"
+L["IDEAL_GEM_OPTS"] = "Ideal Gem Options"
L["USE_UE_GEMS_TT"] = "Consider gems that are Unique-Equipped"
L["USE_UE_GEMS"] = "Use Unique-Equipped Gems"
L["USE_JC_GEMS_TT"] = "Consider gems that are Jewelcrafter-Only"
@@ -43,22 +73,6 @@ L["MATCH_SOCKET"] = "Obey socket colors"
L["MATCH_SOCKET_TT"] = "Chooses ideal gems that obey their socket color (even if that gives a lower overall score)"
L["ALWAYS_MATCH_SOCKET"] = "Even if the socket bonus is worthless"
L["ALWAYS_MATCH_SOCKET_TT"] = "Forces ideal gems to obey their socket color (even if the socket bonus has a 0 or negative score for that weight)"
-L["NORMALIZE"] = "Normalize weights"
-L["NORMALIZE_TT"] = "Divides item scores by the total of all stats' values in that weight"
-L["DISPLAY_OPTS"] = "Display Options"
-L["SHOW_WTS"] = "Show weights:"
-L["SHOW_IDEAL_WTS"] = "Show ideally-gemmed weights:"
-L["SHOW_IDEAL_GEMS"] = "Show ideal gems:"
-L["SHOW_ALT_IDEAL_GEMS"] = "Show alternate ideal gems:"
-L["SHOW_IDEAL_GEM_STATS"] = "Show ideal gem stats:"
-L["SHOW_DEBUG"] = "Show parser debug information:"
-L["HIDE_HINTS_TT"] = "Hides modifier key hints in tooltips"
-L["HIDE_HINTS"] = "Hide tooltip hints"
-L["SHOW_CLASS"] = "Show class names:"
-L["SHOW_DIFF"] = "Show differences to current gear"
-L["SHOW_DIFF_TT"] = "Shows the change in score compared to the currently equipped gear"
-L["SHOW_ZEROES"] = "Show zero scores"
-L["SHOW_ZEROES_TT"] = "Shows scores for weights that are zero (or negative)"
-- weights.xml
L["WEIGHTS_TITLE"] = "WeightsWatcher Weight Values"
diff --git a/config-calculation.xml b/config-calculation.xml
new file mode 100644
index 0000000..3b462e5
--- /dev/null
+++ b/config-calculation.xml
@@ -0,0 +1,132 @@
+<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
+ <Frame name="ww_configCalculationOptions" inherits="ww_borderedFrame" hidden="true">
+ <Anchors>
+ <Anchor point="TOPLEFT"/>
+ <Anchor point="BOTTOMRIGHT"/>
+ </Anchors>
+ <Layers>
+ <Layer level="OVERLAY">
+ <FontString name="$parentTitle" parentKey="title" inherits="GameFontNormalLarge">
+ <Anchors>
+ <Anchor point="TOP">
+ <Offset>
+ <AbsDimension x="0" y="-5"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ </Layer>
+ <Layer level="BACKGROUND">
+ <Texture setAllPoints="true">
+ <!--Plain black background with 80% alpha-->
+ <Color r="0" g="0" b="0" a="0.8"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Frames>
+ <Frame name="$parentUseEffectUptimeRatio" parentKey="useEffectUptimeRatio" inherits="ww_labeledElement">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentTitle">
+ <Offset>
+ <AbsDimension x="0" y="-10"/>
+ </Offset>
+ </Anchor>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="9" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Size>
+ <AbsDimension x="0" y="25"/>
+ </Size>
+ <Frames>
+ <EditBox letters="16" name="$parentRatio" parentKey="ratio" autoFocus="false">
+ <Anchors>
+ <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel">
+ <Offset>
+ <AbsDimension x="5" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Size>
+ <AbsDimension x="50" y="22"/>
+ </Size>
+ <Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
+ <EdgeSize>
+ <AbsValue val="10"/>
+ </EdgeSize>
+ <TileSize>
+ <AbsValue val="10"/>
+ </TileSize>
+ <BackgroundInsets>
+ <AbsInset left="0" right="0" top="5" bottom="5"/>
+ </BackgroundInsets>
+ </Backdrop>
+ <FontString inherits="GameFontNormal">
+ <Anchors>
+ <Anchor point="LEFT"/>
+ </Anchors>
+ </FontString>
+ <Scripts>
+ <OnLoad>
+ self:SetTextInsets(5, 5, 0, 0)
+ </OnLoad>
+ <OnTextChanged>
+ local text = self:GetText()
+ if self:GetNumber() ~= 0 or text:match("^[0.]+$") or text == "" then
+ self.number = text
+ ww_vars.options.useEffects.uptimeRatio = self:GetNumber() / 100
+ ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ end
+ </OnTextChanged>
+ <OnChar>
+ if ww_validateNumber(text, self:GetText()) then
+ self.number = self:GetText()
+ ww_vars.options.useEffects.uptimeRatio = self:GetNumber() / 100
+ ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ else
+ local cursorPosition = self:GetCursorPosition() - 1
+ self:SetText(self.number)
+ self:SetCursorPosition(cursorPosition)
+ end
+ </OnChar>
+ <OnEscapePressed>
+ self:ClearFocus()
+ </OnEscapePressed>
+ </Scripts>
+ </EditBox>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ if ww_cooldownUseEffects then
+ self.label:SetText(ww_localization["IDEAL_USE_UPTIME"])
+ else
+ self:SetParent(nil)
+ self:Hide()
+ end
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ self.title:SetText(ww_localization["CALC_OPTS"])
+ self.name = ww_localization["CALC_NAME"]
+ self.parent = "WeightsWatcher"
+ self.default = function(...)
+ ww_vars.options.calculation = ww_deepTableCopy(ww_defaultVars.options.calculation)
+ ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ end
+ self.refresh = function(...)
+ self.useEffectUptimeRatio.ratio:SetText(ww_vars.options.calculation.useEffectUptimeRatio * 100)
+ end
+ InterfaceOptions_AddCategory(self)
+ </OnLoad>
+ </Scripts>
+ </Frame>
+</Ui>
diff --git a/config-display.xml b/config-display.xml
new file mode 100644
index 0000000..8628a59
--- /dev/null
+++ b/config-display.xml
@@ -0,0 +1,266 @@
+<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
+ <Frame name="ww_configDisplayOptions" inherits="ww_borderedFrame" hidden="true">
+ <Anchors>
+ <Anchor point="TOPLEFT"/>
+ <Anchor point="BOTTOMRIGHT"/>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="$parentHeader" parentKey="header" inherits="ww_headerFont"/>
+ </Layer>
+ <Layer level="BACKGROUND">
+ <Texture setAllPoints="true">
+ <!--Plain black background with 80% alpha-->
+ <Color r="0" g="0" b="0" a="0.8"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Frames>
+ <Frame name="$parentShowWeights" parentKey="showWeights" inherits="ww_modifierKeyDropDown">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHeader">
+ <Offset>
+ <AbsDimension x="0" y="-10"/>
+ </Offset>
+ </Anchor>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="9" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_WTS"])
+ self.dropdown:SetText("showWeights")
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <Frame name="$parentShowIdealWeights" parentKey="showIdealWeights" inherits="ww_modifierKeyDropDown">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowWeights">
+ <Offset>
+ <AbsDimension x="20" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_IDEAL_WTS"])
+ self.dropdown:SetText("showIdealWeights")
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <Frame name="$parentShowIdealGems" parentKey="showIdealGems" inherits="ww_modifierKeyDropDown">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowIdealWeights">
+ <Offset>
+ <AbsDimension x="20" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_IDEAL_GEMS"])
+ self.dropdown:SetText("showIdealGems")
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <Frame name="$parentShowAlternateGems" parentKey="showIdealGemStats" inherits="ww_modifierKeyDropDown">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowIdealGems">
+ <Offset>
+ <AbsDimension x="20" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_ALT_IDEAL_GEMS"])
+ self.dropdown:SetText("showAlternateGems")
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <Frame name="$parentShowIdealGemStats" parentKey="showIdealGemStats" inherits="ww_modifierKeyDropDown">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentShowAlternateGems"/>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_IDEAL_GEM_STATS"])
+ self.dropdown:SetText("showIdealGemStats")
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <Frame name="$parentShowDebugInfo" parentKey="showDebugInfo" inherits="ww_modifierKeyDropDown">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowIdealGemStats"/>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="9" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_DEBUG"])
+ self.dropdown:SetText("showDebugInfo")
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <CheckButton name="$parentHideTooltipHints" parentKey="hideTooltipHints" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowDebugInfo"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.tooltip.hideHints = true
+ else
+ ww_vars.options.tooltip.hideHints = false
+ end
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.tooltip.hideHints end
+ self.ttText = ww_localization["HIDE_HINTS_TT"]
+ self:SetText(ww_localization["HIDE_HINTS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <Frame name="$parentShowClassNames" parentKey="showClassNames" inherits="ww_labeledElement">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHideTooltipHints"/>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="9" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Size>
+ <AbsDimension x="0" y="30"/>
+ </Size>
+ <Frames>
+ <Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
+ <Anchors>
+ <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel">
+ <Offset>
+ <AbsDimension x="-15" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ UIDropDownMenu_JustifyText(self, "LEFT")
+ </OnLoad>
+ <OnShow>
+ UIDropDownMenu_Initialize(self, ww_ShowClassNameDropDownInitialize)
+ UIDropDownMenu_SetSelectedValue(self, ww_vars.options.tooltip.showClassNames)
+ </OnShow>
+ </Scripts>
+ </Button>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["SHOW_CLASS"])
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <CheckButton name="$parentShowZeroScores" parentKey="showZeroScores" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowClassNames"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.tooltip.showZeroScores = true
+ else
+ ww_vars.options.tooltip.showZeroScores = false
+ end
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.tooltip.showZeroScores end
+ self.ttText = ww_localization["SHOW_ZEROES_TT"]
+ self:SetText(ww_localization["SHOW_ZEROES"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentShowDifference" parentKey="showDifference" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowZeroScores"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.tooltip.showDifferences = true
+ else
+ ww_vars.options.tooltip.showDifferences = false
+ end
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.tooltip.showDifferences end
+ self.ttText = ww_localization["SHOW_DIFF_TT"]
+ self:SetText(ww_localization["SHOW_DIFF"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentNormalizeWeights" parentKey="normalizeWeights" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowDifference"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.tooltip.normalizeWeights = true
+ else
+ ww_vars.options.tooltip.normalizeWeights = false
+ end
+ ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.tooltip.normalizeWeights end
+ self.ttText = ww_localization["NORMALIZE_TT"]
+ self:SetText(ww_localization["NORMALIZE"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ self.header:SetText(ww_localization["DISPLAY_OPTS"])
+ self.name = ww_localization["DISPLAY_NAME"]
+ self.parent = "WeightsWatcher"
+ self.default = function()
+ ww_vars.options.tooltip = ww_defaultVars.options.tooltip
+ ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ end
+ local checkBoxes = {
+ "hideHints",
+ "showZeroScores",
+ "showDifferences",
+ "normalizeWeights",
+ hideHints = self.hideTooltipHints,
+ showZeroScores = self.showZeroScores,
+ showDifferences = self.showDifference,
+ normalizeWeights = self.normalizeWeights,
+ }
+ self.refresh = function()
+ for _, option in ipairs(checkBoxes) do
+ local checkBox = checkBoxes[option]
+ checkBox:SetChecked(checkBox.shouldBeChecked())
+ if checkBox.shouldBeEnabled then
+ if checkBox.shouldBeEnabled() then
+ checkBox:Enable()
+ else
+ checkBox:Disable()
+ end
+ end
+ end
+ end
+ InterfaceOptions_AddCategory(self)
+ </OnLoad>
+ </Scripts>
+ </Frame>
+</Ui>
diff --git a/config-enchants.xml b/config-enchants.xml
new file mode 100644
index 0000000..e69de29
diff --git a/config-gems.xml b/config-gems.xml
new file mode 100644
index 0000000..3078f00
--- /dev/null
+++ b/config-gems.xml
@@ -0,0 +1,327 @@
+<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
+ <Frame name="ww_configGemOptions" inherits="ww_borderedFrame" hidden="true">
+ <Anchors>
+ <Anchor point="TOPLEFT"/>
+ <Anchor point="BOTTOMRIGHT"/>
+ </Anchors>
+ <Layers>
+ <Layer level="ARTWORK">
+ <FontString name="$parentHeader" parentKey="header" inherits="ww_headerFont"/>
+ </Layer>
+ <Layer level="BACKGROUND">
+ <Texture setAllPoints="true">
+ <!--Plain black background with 80% alpha-->
+ <Color r="0" g="0" b="0" a="0.8"/>
+ </Texture>
+ </Layer>
+ </Layers>
+ <Frames>
+ <Frame name="$parentGemQuality" parentKey="gemQuality" inherits="ww_labeledElement">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHeader">
+ <Offset>
+ <AbsDimension x="0" y="-10"/>
+ </Offset>
+ </Anchor>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="9" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Size>
+ <AbsDimension x="0" y="30"/>
+ </Size>
+ <Frames>
+ <Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
+ <Anchors>
+ <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel">
+ <Offset>
+ <AbsDimension x="-15" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnLoad>
+ UIDropDownMenu_SetWidth(self, 200, 15)
+ UIDropDownMenu_JustifyText(self, "LEFT")
+ </OnLoad>
+ <OnShow>
+ UIDropDownMenu_Initialize(self, ww_GemQualityDropDownInitialize)
+ UIDropDownMenu_SetSelectedValue(self, ww_vars.options.gems.qualityLimit)
+ </OnShow>
+ </Scripts>
+ </Button>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ self.label:SetText(ww_localization["MAX_GEM_QUAL"])
+ self:SetBackdropColor(1, 0, 0, 0.5)
+ </OnLoad>
+ </Scripts>
+ </Frame>
+ <CheckButton name="$parentUseUEGems" parentKey="useUEGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentGemQuality"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.types["Unique-Equipped"] = true
+ else
+ ww_vars.options.gems.types["Unique-Equipped"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.types["Unique-Equipped"] end
+ self.ttText = ww_localization["USE_UE_GEMS_TT"]
+ self:SetText(ww_localization["USE_UE_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUseJCOnlyGems" parentKey="useJCOnlyGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseUEGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.types["Jewelcrafter-Only"] = true
+ else
+ ww_vars.options.gems.types["Jewelcrafter-Only"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.types["Jewelcrafter-Only"] end
+ self.ttText = ww_localization["USE_JC_GEMS_TT"]
+ self:SetText(ww_localization["USE_JC_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUseVendorGems" parentKey="useVendorGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseJCOnlyGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.sources["Vendor"] = true
+ else
+ ww_vars.options.gems.sources["Vendor"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.sources["Vendor"] end
+ self.ttText = ww_localization["USE_VP_GEMS_TT"]
+ self:SetText(ww_localization["USE_VP_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUsePVPVendorGems" parentKey="usePVPVendorGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseVendorGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.sources["PVP-Vendor"] = true
+ else
+ ww_vars.options.gems.sources["PVP-Vendor"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.sources["PVP-Vendor"] end
+ self.ttText = ww_localization["USE_PVPVP_GEMS_TT"]
+ self:SetText(ww_localization["USE_PVPVP_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUseCraftedGems" parentKey="useCraftedGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUsePVPVendorGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.sources["Crafted"] = true
+ self:GetParent().useProcGems:Enable()
+ else
+ ww_vars.options.gems.sources["Crafted"] = false
+ self:GetParent().useProcGems:Disable()
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.sources["Crafted"] end
+ self.ttText = ww_localization["USE_PC_GEMS_TT"]
+ self:SetText(ww_localization["USE_PC_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUseProcGems" parentKey="useProcGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentUseCraftedGems">
+ <Offset>
+ <AbsDimension x="20" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.sources["Procced"] = true
+ else
+ ww_vars.options.gems.sources["Procced"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.sources["Procced"] end
+ self.shouldBeEnabled = function() return ww_vars.options.gems.sources["Crafted"] end
+ self.ttText = ww_localization["USE_P_GEMS_TT"]
+ self:SetText(ww_localization["USE_P_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUseDropGems" parentKey="useDropGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseProcGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.sources["Drop"] = true
+ else
+ ww_vars.options.gems.sources["Drop"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.sources["Drop"] end
+ self.ttText = ww_localization["USE_D_GEMS_TT"]
+ self:SetText(ww_localization["USE_D_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentUseQuestGems" parentKey="useQuestGems" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseDropGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.sources["Quest"] = true
+ else
+ ww_vars.options.gems.sources["Quest"] = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.sources["Quest"] end
+ self.ttText = ww_localization["USE_QR_GEMS_TT"]
+ self:SetText(ww_localization["USE_QR_GEMS"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentObeySocketColors" parentKey="obeySocketColors" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseQuestGems"/>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.breakSocketColors = false
+ self:GetParent().alwaysObeySocketColors:Enable()
+ else
+ ww_vars.options.gems.breakSocketColors = true
+ self:GetParent().alwaysObeySocketColors:Disable()
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return not ww_vars.options.gems.breakSocketColors end
+ self.ttText = ww_localization["MATCH_SOCKET_TT"]
+ self:SetText(ww_localization["MATCH_SOCKET"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ <CheckButton name="$parentAlwaysObeySocketColors" parentKey="alwaysObeySocketColors" inherits="ww_checkButton">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentObeySocketColors">
+ <Offset>
+ <AbsDimension x="20" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ <Scripts>
+ <OnClick>
+ if self:GetChecked() then
+ ww_vars.options.gems.neverBreakSocketColors = true
+ else
+ ww_vars.options.gems.neverBreakSocketColors = false
+ end
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ </OnClick>
+ <OnLoad>
+ self.shouldBeChecked = function() return ww_vars.options.gems.neverBreakSocketColors end
+ self.shouldBeEnabled = function() return not ww_vars.options.gems.breakSocketColors end
+ self.ttText = ww_localization["ALWAYS_MATCH_SOCKET_TT"]
+ self:SetText(ww_localization["ALWAYS_MATCH_SOCKET"])
+ </OnLoad>
+ </Scripts>
+ </CheckButton>
+ </Frames>
+ <Scripts>
+ <OnLoad>
+ self.header:SetText(ww_localization["IDEAL_GEM_OPTS"])
+ self.name = ww_localization["IDEAL_GEM_NAME"]
+ self.parent = "WeightsWatcher"
+ self.default = function()
+ ww_vars.options.gems = ww_defaultVars.options.gems
+ ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
+ end
+ local checkBoxes = {
+ "Unique-Equipped",
+ "Jewelcrafter-Only",
+ "Vendor",
+ "PVP-Vendor",
+ "Crafted",
+ "Procced",
+ "Drop",
+ "Quest",
+ "obeySocketColors",
+ "alwaysObeySocketColors",
+ ["Unique-Equipped"] = self.useUEGems,
+ ["Jewelcrafter-Only"] = self.useJCOnlyGems,
+ ["Vendor"] = self.useVendorGems,
+ ["PVP-Vendor"] = self.usePVPVendorGems,
+ ["Crafted"] = self.useCraftedGems,
+ ["Procced"] = self.useProcGems,
+ ["Drop"] = self.useDropGems,
+ ["Quest"] = self.useQuestGems,
+ ["obeySocketColors"] = self.obeySocketColors,
+ ["alwaysObeySocketColors"] = self.alwaysObeySocketColors,
+ }
+ self.refresh = function()
+ for _, option in ipairs(checkBoxes) do
+ local checkBox = checkBoxes[option]
+ checkBox:SetChecked(checkBox.shouldBeChecked())
+ if checkBox.shouldBeEnabled then
+ if checkBox.shouldBeEnabled() then
+ checkBox:Enable()
+ else
+ checkBox:Disable()
+ end
+ end
+ end
+ end
+ InterfaceOptions_AddCategory(self)
+ </OnLoad>
+ </Scripts>
+ </Frame>
+</Ui>
diff --git a/config.lua b/config.lua
index 58c3d29..7dfdced 100644
--- a/config.lua
+++ b/config.lua
@@ -10,21 +10,40 @@ local function printHelp()
print(L["HELP_TEXT_BUGS"])
end
+local function showConfig(frame)
+ if frame:IsVisible() then
+ InterfaceOptionsFrameCancel:Click()
+ else
+ -- TODO: make this always open to the right section if possible
+ InterfaceOptionsFrame_OpenToCategory(frame)
+ end
+end
+
function ww_commandHandler(msg)
- if msg == L["config"] then
- ww_weights:Hide()
- -- TODO: make this work better with the confirmDiscardChanges dialog
- if ww_weights:IsShown() then
- return
+ if msg:find("^" .. L["config"]) then
+ local frame = ww_config
+ if msg:find(L["gems"]) then
+ frame = ww_configGemOptions
+ elseif msg:find(L["enchants"]) then
+ frame = ww_configEnchantOptions
+ elseif msg:find(L["display"]) then
+ frame = ww_configDisplayOptions
+ elseif msg:find(L["calculation"]) then
+ frame = ww_configCalculationOptions
end
- if ww_config:IsVisible() then
- ww_config:Hide()
+ if ww_weights:IsVisible() then
+ ww_weights:SmartHide(function()
+ showConfig(frame)
+ end
+ )
else
- ww_config:Show()
+ showConfig(frame)
end
elseif msg == L["weights"] then
- ww_config:Hide()
- if ww_config:IsShown() then
+ if InterfaceOptionsFrame:IsVisible() then
+ InterfaceOptionsFrameCancel:Click()
+ end
+ if InterfaceOptionsFrame:IsVisible() then
return
end
if ww_weights:IsVisible() then
diff --git a/config.xml b/config.xml
index fe1f8b0..adca973 100644
--- a/config.xml
+++ b/config.xml
@@ -2,18 +2,14 @@
xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
<Script file="config.lua"/>
<Include file="widgets.xml"/>
- <Frame name="ww_config" parent="UIParent" hidden="true" frameStrata="HIGH">
- <Size>
- <AbsDimension x="600" y="450"/>
- </Size>
+ <Frame name="ww_config" inherits="ww_borderedFrame" hidden="true">
<Anchors>
- <Anchor point="CENTER">
- <Offset y="50"/>
- </Anchor>
+ <Anchor point="TOPLEFT"/>
+ <Anchor point="BOTTOMRIGHT"/>
</Anchors>
<Layers>
<Layer level="OVERLAY">
- <FontString name="$parentTitle" parentKey="title" inherits="GameFontNormalLarge" text="CONFIG_TITLE">
+ <FontString name="$parentTitle" parentKey="title" inherits="GameFontNormalHuge" text="WeightsWatcher">
<Anchors>
<Anchor point="TOP">
<Offset>
@@ -22,6 +18,62 @@
</Anchor>
</Anchors>
</FontString>
+ <FontString name="$parentVersion" parentKey="version" inherits="GameFontNormal">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentTitle">
+ <Offset>
+ <AbsDimension x="0" y="-10"/>
+ </Offset>
+ </Anchor>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="10" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentAccountVersion" parentKey="accountVersion" inherits="GameFontNormal">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentVersion">
+ <Offset>
+ <AbsDimension x="10" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentCharacterVersion" parentKey="characterVersion" inherits="GameFontNormal">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentAccountVersion"/>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentContact" parentKey="contact" inherits="GameFontNormal">
+ <Anchors>
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentCharacterVersion">
+ <Offset>
+ <AbsDimension x="0" y="-15"/>
+ </Offset>
+ </Anchor>
+ <Anchor point="LEFT">
+ <Offset>
+ <AbsDimension x="10" y="0"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentWebpage" parentKey="webpage" inherits="GameFontNormal">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentContact"/>
+ </Anchors>
+ </FontString>
+ <FontString name="$parentDescription" parentKey="description" inherits="GameFontHighlight">
+ <Anchors>
+ <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentWebpage">
+ <Offset>
+ <AbsDimension x="0" y="-25"/>
+ </Offset>
+ </Anchor>
+ </Anchors>
+ </FontString>
</Layer>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
@@ -31,582 +83,53 @@
</Layer>
</Layers>
<Frames>
- <Button name="$parentCloseButton" parentKey="closeButton" inherits="UIPanelCloseButton">
- <Anchors>
- <Anchor point="TOPRIGHT"/>
- </Anchors>
- </Button>
- <Frame name="$parentCalculationOptions" parentKey="calculationOptions" inherits="ww_borderedFrame">
+ <Button name="$parentWeights" parentKey="weights" inherits="ww_localizedButton" text="CONFIG_WEIGHTS">
+ <Size>
+ <AbsDimension x="150" y="22"/>
+ </Size>
<Anchors>
- <Anchor point="TOPLEFT">
+ <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentDescription">
<Offset>
<AbsDimension x="0" y="-25"/>
</Offset>
</Anchor>
- <Anchor point="BOTTOM"/>
- </Anchors>
- <Size>
- <AbsDimension x="300" y="0"/>
- </Size>
- <Layers>
- <Layer level="ARTWORK">
- <FontString name="$parentHeader" parentKey="header" inherits="ww_headerFont"/>
- </Layer>
- </Layers>
- <Frames>
- <Frame name="$parentGemQuality" parentKey="gemQuality" inherits="ww_labeledElement">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHeader"/>
- </Anchors>
- <Size>
- <AbsDimension x="0" y="45"/>
- </Size>
- <Frames>
- <Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
- <Anchors>
- <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentLabel">
- <Offset>
- <AbsDimension x="-15" y="-3"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- UIDropDownMenu_SetWidth(self, 200, 15)
- UIDropDownMenu_JustifyText(self, "LEFT")
- </OnLoad>
- <OnShow>
- UIDropDownMenu_Initialize(self, ww_GemQualityDropDownInitialize)
- UIDropDownMenu_SetSelectedValue(self, ww_vars.options.gems.qualityLimit)
- </OnShow>
- </Scripts>
- </Button>
- </Frames>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["MAX_GEM_QUAL"])
- self:SetBackdropColor(1, 0, 0, 0.5)
- </OnLoad>
- </Scripts>
- </Frame>
- <CheckButton name="$parentUseUEGems" parentKey="useUEGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentGemQuality"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.types["Unique-Equipped"] = true
- else
- ww_vars.options.gems.types["Unique-Equipped"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.types["Unique-Equipped"] end
- self.ttText = ww_localization["USE_UE_GEMS_TT"]
- self:SetText(ww_localization["USE_UE_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUseJCOnlyGems" parentKey="useJCOnlyGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseUEGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.types["Jewelcrafter-Only"] = true
- else
- ww_vars.options.gems.types["Jewelcrafter-Only"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.types["Jewelcrafter-Only"] end
- self.ttText = ww_localization["USE_JC_GEMS_TT"]
- self:SetText(ww_localization["USE_JC_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUseVendorGems" parentKey="useVendorGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseJCOnlyGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.sources["Vendor"] = true
- else
- ww_vars.options.gems.sources["Vendor"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.sources["Vendor"] end
- self.ttText = ww_localization["USE_VP_GEMS_TT"]
- self:SetText(ww_localization["USE_VP_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUsePVPVendorGems" parentKey="usePVPVendorGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseVendorGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.sources["PVP-Vendor"] = true
- else
- ww_vars.options.gems.sources["PVP-Vendor"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.sources["PVP-Vendor"] end
- self.ttText = ww_localization["USE_PVPVP_GEMS_TT"]
- self:SetText(ww_localization["USE_PVPVP_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUseCraftedGems" parentKey="useCraftedGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUsePVPVendorGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.sources["Crafted"] = true
- self:GetParent().useProcGems:Enable()
- else
- ww_vars.options.gems.sources["Crafted"] = false
- self:GetParent().useProcGems:Disable()
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.sources["Crafted"] end
- self.ttText = ww_localization["USE_PC_GEMS_TT"]
- self:SetText(ww_localization["USE_PC_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUseProcGems" parentKey="useProcGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentUseCraftedGems">
- <Offset>
- <AbsDimension x="20" y="0"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.sources["Procced"] = true
- else
- ww_vars.options.gems.sources["Procced"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.sources["Procced"] end
- self.shouldBeEnabled = function() return ww_vars.options.gems.sources["Crafted"] end
- self.ttText = ww_localization["USE_P_GEMS_TT"]
- self:SetText(ww_localization["USE_P_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUseDropGems" parentKey="useDropGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseProcGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.sources["Drop"] = true
- else
- ww_vars.options.gems.sources["Drop"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.sources["Drop"] end
- self.ttText = ww_localization["USE_D_GEMS_TT"]
- self:SetText(ww_localization["USE_D_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentUseQuestGems" parentKey="useQuestGems" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseDropGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.sources["Quest"] = true
- else
- ww_vars.options.gems.sources["Quest"] = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.sources["Quest"] end
- self.ttText = ww_localization["USE_QR_GEMS_TT"]
- self:SetText(ww_localization["USE_QR_GEMS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentObeySocketColors" parentKey="obeySocketColors" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentUseQuestGems"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.breakSocketColors = false
- self:GetParent().alwaysObeySocketColors:Enable()
- else
- ww_vars.options.gems.breakSocketColors = true
- self:GetParent().alwaysObeySocketColors:Disable()
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return not ww_vars.options.gems.breakSocketColors end
- self.ttText = ww_localization["MATCH_SOCKET_TT"]
- self:SetText(ww_localization["MATCH_SOCKET"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentAlwaysObeySocketColors" parentKey="alwaysObeySocketColors" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentObeySocketColors">
- <Offset>
- <AbsDimension x="20" y="0"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.gems.neverBreakSocketColors = true
- else
- ww_vars.options.gems.neverBreakSocketColors = false
- end
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.gems.neverBreakSocketColors end
- self.shouldBeEnabled = function() return not ww_vars.options.gems.breakSocketColors end
- self.ttText = ww_localization["ALWAYS_MATCH_SOCKET_TT"]
- self:SetText(ww_localization["ALWAYS_MATCH_SOCKET"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentNormalizeWeights" parentKey="normalizeWeights" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentAlwaysObeySocketColors"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.tooltip.normalizeWeights = true
- else
- ww_vars.options.tooltip.normalizeWeights = false
- end
- ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.tooltip.normalizeWeights end
- self.ttText = ww_localization["NORMALIZE_TT"]
- self:SetText(ww_localization["NORMALIZE"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <Frame name="$parentUseEffectUptimeRatio" parentKey="useEffectUptimeRatio" inherits="ww_labeledElement">
- <Anchors>
- <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentNormalizeWeights"/>
- </Anchors>
- <Size>
- <AbsDimension x="0" y="25"/>
- </Size>
- <Frames>
- <EditBox letters="16" name="$parentRatio" parentKey="ratio" autoFocus="false">
- <Anchors>
- <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel"/>
- </Anchors>
- <Size>
- <AbsDimension x="50" y="22"/>
- </Size>
- <Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
- <EdgeSize>
- <AbsValue val="10"/>
- </EdgeSize>
- <TileSize>
- <AbsValue val="10"/>
- </TileSize>
- <BackgroundInsets>
- <AbsInset left="0" right="0" top="5" bottom="5"/>
- </BackgroundInsets>
- </Backdrop>
- <FontString inherits="GameFontNormal">
- <Anchors>
- <Anchor point="LEFT"/>
- </Anchors>
- </FontString>
- <Scripts>
- <OnLoad>
- self:SetTextInsets(5, 5, 0, 0)
- </OnLoad>
- <OnShow>
- self:SetText(ww_vars.options.useEffects.uptimeRatio * 100)
- </OnShow>
- <OnTextChanged>
- local text = self:GetText()
- if self:GetNumber() ~= 0 or text:match("^[0.]+$") or text == "" then
- self.number = text
- ww_vars.options.useEffects.uptimeRatio = self:GetNumber() / 100
- ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- end
- </OnTextChanged>
- <OnChar>
- if ww_validateNumber(text, self:GetText()) then
- self.number = self:GetText()
- ww_vars.options.useEffects.uptimeRatio = self:GetNumber() / 100
- ww_weightCache = setmetatable({}, ww_weightCacheMetatable)
- ww_weightIdealCache = setmetatable({}, ww_weightIdealCacheMetatable)
- else
- local cursorPosition = self:GetCursorPosition() - 1
- self:SetText(self.number)
- self:SetCursorPosition(cursorPosition)
- end
- </OnChar>
- <OnEscapePressed>
- self:ClearFocus()
- </OnEscapePressed>
- </Scripts>
- </EditBox>
- </Frames>
- <Scripts>
- <OnLoad>
- if ww_cooldownUseEffects then
- self.label:SetText(ww_localization["IDEAL_USE_UPTIME"])
- else
- self:SetParent(nil)
- self:Hide()
- end
- </OnLoad>
- </Scripts>
- </Frame>
- </Frames>
- <Scripts>
- <OnLoad>
- self.header:SetText(ww_localization["CALC_OPTS"])
- </OnLoad>
- </Scripts>
- </Frame>
- <Frame name="$parentDisplayOptions" parentKey="displayOptions" inherits="ww_borderedFrame">
- <Anchors>
- <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$parentCalculationOptions"/>
- <Anchor point="BOTTOMRIGHT"/>
</Anchors>
- <Layers>
- <Layer level="ARTWORK">
- <FontString name="$parentHeader" parentKey="header" inherits="ww_headerFont"/>
- </Layer>
- </Layers>
- <Frames>
- <Frame name="$parentShowWeights" parentKey="showWeights" inherits="ww_modifierKeyDropDown">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHeader"/>
- </Anchors>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_WTS"])
- self.dropdown:SetText("showWeights")
- </OnLoad>
- </Scripts>
- </Frame>
- <Frame name="$parentShowIdealWeights" parentKey="showIdealWeights" inherits="ww_modifierKeyDropDown">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowWeights"/>
- <Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentShowWeights">
- <Offset>
- <AbsDimension x="20" y="0"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_IDEAL_WTS"])
- self.dropdown:SetText("showIdealWeights")
- </OnLoad>
- </Scripts>
- </Frame>
- <Frame name="$parentShowIdealGems" parentKey="showIdealGems" inherits="ww_modifierKeyDropDown">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowIdealWeights"/>
- <Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentShowIdealWeights">
- <Offset>
- <AbsDimension x="20" y="0"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_IDEAL_GEMS"])
- self.dropdown:SetText("showIdealGems")
- </OnLoad>
- </Scripts>
- </Frame>
- <Frame name="$parentShowAlternateGems" parentKey="showIdealGemStats" inherits="ww_modifierKeyDropDown">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowIdealGems"/>
- <Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentShowIdealGems">
- <Offset>
- <AbsDimension x="20" y="0"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_ALT_IDEAL_GEMS"])
- self.dropdown:SetText("showAlternateGems")
- </OnLoad>
- </Scripts>
- </Frame>
- <Frame name="$parentShowIdealGemStats" parentKey="showIdealGemStats" inherits="ww_modifierKeyDropDown">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowAlternateGems"/>
- <Anchor point="LEFT" relativePoint="LEFT" relativeTo="$parentShowIdealGems">
- <Offset>
- <AbsDimension x="20" y="0"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_IDEAL_GEM_STATS"])
- self.dropdown:SetText("showIdealGemStats")
- </OnLoad>
- </Scripts>
- </Frame>
- <Frame name="$parentShowDebugInfo" parentKey="showDebugInfo" inherits="ww_modifierKeyDropDown">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowIdealGemStats"/>
- </Anchors>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_DEBUG"])
- self.dropdown:SetText("showDebugInfo")
- </OnLoad>
- </Scripts>
- </Frame>
- <CheckButton name="$parentHideTooltipHints" parentKey="hideTooltipHints" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowDebugInfo"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.tooltip.hideHints = true
- else
- ww_vars.options.tooltip.hideHints = false
- end
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.tooltip.hideHints end
- self.ttText = ww_localization["HIDE_HINTS_TT"]
- self:SetText(ww_localization["HIDE_HINTS"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <Frame name="$parentShowClassNames" parentKey="showClassNames" inherits="ww_labeledElement">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentHideTooltipHints"/>
- </Anchors>
- <Size>
- <AbsDimension x="0" y="45"/>
- </Size>
- <Frames>
- <Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
- <Anchors>
- <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentLabel">
- <Offset>
- <AbsDimension x="-15" y="-3"/>
- </Offset>
- </Anchor>
- </Anchors>
- <Scripts>
- <OnLoad>
- UIDropDownMenu_JustifyText(self, "LEFT")
- </OnLoad>
- <OnShow>
- UIDropDownMenu_Initialize(self, ww_ShowClassNameDropDownInitialize)
- UIDropDownMenu_SetSelectedValue(self, ww_vars.options.tooltip.showClassNames)
- </OnShow>
- </Scripts>
- </Button>
- </Frames>
- <Scripts>
- <OnLoad>
- self.label:SetText(ww_localization["SHOW_CLASS"])
- </OnLoad>
- </Scripts>
- </Frame>
- <CheckButton name="$parentShowZeroScores" parentKey="showZeroScores" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowClassNames"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.tooltip.showZeroScores = true
- else
- ww_vars.options.tooltip.showZeroScores = false
- end
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.tooltip.showZeroScores end
- self.ttText = ww_localization["SHOW_ZEROES_TT"]
- self:SetText(ww_localization["SHOW_ZEROES"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- <CheckButton name="$parentShowDifference" parentKey="showDifference" inherits="ww_checkButton">
- <Anchors>
- <Anchor point="TOP" relativePoint="BOTTOM" relativeTo="$parentShowZeroScores"/>
- </Anchors>
- <Scripts>
- <OnClick>
- if self:GetChecked() then
- ww_vars.options.tooltip.showDifferences = true
- else
- ww_vars.options.tooltip.showDifferences = false
- end
- </OnClick>
- <OnLoad>
- self.shouldBeChecked = function() return ww_vars.options.tooltip.showDifferences end
- self.ttText = ww_localization["SHOW_DIFF_TT"]
- self:SetText(ww_localization["SHOW_DIFF"])
- </OnLoad>
- </Scripts>
- </CheckButton>
- </Frames>
<Scripts>
- <OnLoad>
- self.header:SetText(ww_localization["DISPLAY_OPTS"])
- </OnLoad>
+ <OnClick>
+ ww_commandHandler("weights")
+ </OnClick>
</Scripts>
- </Frame>
+ </Button>
</Frames>
<Scripts>
<OnLoad>
- self.title:SetText(ww_localization[self.title:GetText()])
- table.insert(UISpecialFrames, self:GetName())
+ self.name = "WeightsWatcher"
+ self.okay = function(...)
+ ww_config.originalOpts = nil
+ end
+ self.cancel = function(...)
+ ww_vars.options = ww_config.originalOpts
+ ww_config.originalOpts = nil
+ WeightsWatcher.ResetTables()
+ end
+ self.refresh = function(...)
+ self.version:SetText(string.format(ww_localization["CONF_WW_VER"], GetAddOnMetadata("WeightsWatcher", "Version")))
+ self.accountVersion:SetText(string.format(ww_localization["CONF_ACCT_VER"], ww_vars.dataMajorVersion, ww_vars.dataMinorVersion))
+ self.characterVersion:SetText(string.format(ww_localization["CONF_CHAR_VER"], ww_charVars.dataMajorVersion, ww_charVars.dataMinorVersion))
+ self.contact:SetText(string.format(ww_localization["CONF_CONTACT"], "WeightsWatcher@gmail.com"))
+ self.webpage:SetText(string.format(ww_localization["CONF_WEBPAGE"], "http://wowinterface.com/downloads/\n info15289-WeightsWatcher.html"))
+ self.description:SetText(ww_localization["CONF_DESC"])
+ self.refresh = function(...)
+ ww_config.originalOpts = ww_config.originalOpts or ww_deepTableCopy(ww_vars.options)
+ end
+ self.refresh(...)
+ end
+ InterfaceOptions_AddCategory(self)
</OnLoad>
</Scripts>
</Frame>
+ <Include file="config-calculation.xml"/>
+ <Include file="config-display.xml"/>
+ <Include file="config-gems.xml"/>
+ <Include file="config-enchants.xml"/>
</Ui>
diff --git a/weights.lua b/weights.lua
index 883747d..19d4ee7 100644
--- a/weights.lua
+++ b/weights.lua
@@ -698,7 +698,7 @@ StaticPopupDialogs["WW_CONFIRM_WEIGHT_DELETE"] = {
hideOnEscape = true,
}
-StaticPopupDialogs["WW_CONFIRM_RESTORE_DEFAULTS"] = {
+StaticPopupDialogs["WW_CONFIRM_RESTORE_DEFAULT_WEIGHTS"] = {
text = L["WT_RESTORE_DEFAULTS_CONFIRM"],
button1 = L["Restore Defaults"],
button2 = L["Cancel"],
diff --git a/weights.xml b/weights.xml
index 830f783..546377e 100644
--- a/weights.xml
+++ b/weights.xml
@@ -684,10 +684,10 @@
<Scripts>
<OnClick>
if ww_weights.rightPanel.weightFrame and ww_defaultVars.weightsList[ww_weights.rightPanel.weightFrame.category.class][ww_weights.rightPanel.weightFrame.name] then
- StaticPopup_Show("WW_CONFIRM_RESTORE_DEFAULTS")
+ StaticPopup_Show("WW_CONFIRM_RESTORE_DEFAULT_WEIGHTS")
else
ww_configDiscardChanges(function()
- StaticPopup_Show("WW_CONFIRM_RESTORE_DEFAULTS")
+ StaticPopup_Show("WW_CONFIRM_RESTORE_DEFAULT_WEIGHTS")
end)
end
</OnClick>
diff --git a/widgets.xml b/widgets.xml
index 2bc1038..6476c1e 100644
--- a/widgets.xml
+++ b/widgets.xml
@@ -22,11 +22,7 @@
<Layer level="ARTWORK">
<FontString name="$parentLabel" parentKey="label" inherits="GameFontNormalSmall">
<Anchors>
- <Anchor point="TOPLEFT">
- <Offset>
- <AbsDimension x="5" y="-5"/>
- </Offset>
- </Anchor>
+ <Anchor point="LEFT"/>
</Anchors>
</FontString>
</Layer>
@@ -34,14 +30,14 @@
</Frame>
<Frame name="ww_modifierKeyDropDown" inherits="ww_labeledElement" virtual="true">
<Size>
- <AbsDimension x="0" y="45"/>
+ <AbsDimension x="0" y="30"/>
</Size>
<Frames>
<Button name="$parentDropdown" parentKey="dropdown" inherits="UIDropDownMenuTemplate">
<Anchors>
- <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" relativeTo="$parentLabel">
+ <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parentLabel">
<Offset>
- <AbsDimension x="-15" y="-3"/>
+ <AbsDimension x="-15" y="0"/>
</Offset>
</Anchor>
</Anchors>
@@ -103,14 +99,6 @@
self.text = getglobal(self:GetName() .. "Text")
end
self.text:SetText(self:GetText())
- self:SetChecked(self.shouldBeChecked())
- if self.shouldBeEnabled then
- if self.shouldBeEnabled() then
- self:Enable()
- else
- self:Disable()
- end
- end
</OnShow>
</Scripts>
</CheckButton>