Skip to content

Commit

Permalink
Changed the colour of the labels in the crafting queue to denote the …
Browse files Browse the repository at this point in the history
…quality rather than whether it is using a mimic stone or not. Instead, items using a mimic stone will have a small mimic stone icon next to them. The tooltip will notify the user the quality, as well as if it is using a mimic stone.

Fixed minor bug where mailed requirements subjects were mis-numbered
API Bump
Increased window size in preparation for adding the ability to also choose an enchantment, a lot of other preliminary work for that. With that, and removing the quality label, there will be enough room to in the future add an enchantment label
  • Loading branch information
Dolgubon committed May 19, 2019
1 parent a6a798c commit d1b8a15
Show file tree
Hide file tree
Showing 14 changed files with 221 additions and 74 deletions.
3 changes: 2 additions & 1 deletion Crafter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
-----------------------------------
--
--local original = d local function d() original(pcall(function() error("There's a d() at this line!") end )) end
DolgubonSetCrafter = DolgubonSetCrafter or {}

function determineLine()
local a, b = pcall( function() local a = nil a = a+ 1 end) return b, tonumber(string.match (b, "^%D*%d+%D*%d+%D*%d+%D*%d+%D*(%d+)" ))
Expand All @@ -17,7 +18,7 @@ local function d(...)
originalD(...)
end
end
DolgubonSetCrafter = DolgubonSetCrafter or {}


local queue

Expand Down
6 changes: 5 additions & 1 deletion DolgubonsLazySetCrafter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## SavedVariables: dolgubonslazysetcraftersavedvars
## DependsOn: LibLazyCrafting LibStub
; This optional depends on is so that in debugging you can use d before chat is loaded.
## OptionalDependsOn: pChat LibAddonMenu-2.0 LibPrice
## OptionalDependsOn: pChat LibAddonMenu-2.0 LibLazyCrafting LibStub LibFeedback LibCustomMenu LibPrice

; Libraries

Expand All @@ -34,6 +34,9 @@ libs\LibAddonMenu-2.0\controls\slider.lua
libs\LibAddonMenu-2.0\controls\texture.lua
libs\LibAddonMenu-2.0\controls\divider.lua

libs\LibPrice\LibPrice.lua
libs\LibPrice\LibPrice_Internal.lua

; Feedback library
libs\LibFeedback\feedback.lua

Expand Down Expand Up @@ -74,3 +77,4 @@ bindings.xml
; Settings menu - does what's on the can
SettingsMenu.lua
Favourites.lua
RightClick.lua
1 change: 1 addition & 0 deletions Lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ DolgubonSetCrafter.localizedStrings.UIStrings.chatRequirements = "Requireme
DolgubonSetCrafter.localizedStrings.UIStrings.defaultUserId = "Enter @UserId"
DolgubonSetCrafter.localizedStrings.UIStrings.noSet = "No Set"
DolgubonSetCrafter.localizedStrings.UIStrings.usesMimicStone = "This item will be made using a Mimic Stone"
DolgubonSetCrafter.localizedStrings.UIStrings.qualityString = "This item will be created with <<1>> quality"


DolgubonSetCrafter.localizedStrings.SettingsStrings = {}
Expand Down
99 changes: 84 additions & 15 deletions Libs/LibCustomTitles/LibCustomTitles.lua

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Libs/LibFeedback/LibFeedback.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
## Version: 1.21
## Description: This is a library which allows Addon Authors to easily add a feedback window to their addon
## DependsOn: LibStub
## IsLibrary: true

## This Add-On is not created by, affiliated with or sponsored by ZeniMax Media Inc. or its affiliates. The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries. All rights reserved.
## This Add-On is not created by, affiliated with or sponsored by ZeniMax Media Inc. or its affiliates.
## The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries. All rights reserved.

libs/LibStub.lua
feedback.lua
2 changes: 2 additions & 0 deletions Libs/LibFeedback/feedback.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ local function SendNote(self)
local p = self.parent
if type(self.amount)=="string" then
RequestOpenUnsafeURL(self.amount)
elseif type(self.amount)=="function" then
self.amount()
else
p.parentControl:SetHidden(true)
p:SetHidden(true)
Expand Down
2 changes: 1 addition & 1 deletion Mail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ local function compileMatText()
end
mailOutputTexts[#mailOutputTexts][2] = text..continueNext
mailOutputTexts[#mailOutputTexts + 1] = {}
mailOutputTexts[#mailOutputTexts][1] = reqSubject.. (#mailOutputTexts + 1)
mailOutputTexts[#mailOutputTexts][1] = reqSubject.. (#mailOutputTexts )
numMails = numMails + 1
--{text.."(continued in next mail)", "Material Requirements ".. numMails}
text = continuedFrom..reqStarter
Expand Down
5 changes: 3 additions & 2 deletions SetCrafter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ function DolgubonSetCrafter:Initialize()

--DolgubonSetCrafter.initializeFeedbackWindow()
LibFeedback = LibStub:GetLibrary("LibFeedback")
LibFeedback:initializeFeedbackWindow(DolgubonSetCrafter, "Dolgubon's Lazy Set Crafter",DolgubonSetCrafterWindow, "@Dolgubon",
local button, window = LibFeedback:initializeFeedbackWindow(DolgubonSetCrafter, "Dolgubon's Lazy Set Crafter",DolgubonSetCrafterWindow, "@Dolgubon",
{TOPLEFT , DolgubonSetCrafterWindow , TOPLEFT , 10, 10},
{0,5000,50000, "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7CZ3LW6E66NAU"},
"If you found a bug, have a request or a suggestion, or wish to donate, you can send me a mail here.")

DolgubonSetCrafterWindowRightMailQueue:SetHidden(true)

local currentAPIVersionOfAddon = 100026
local currentAPIVersionOfAddon = 100027

if GetAPIVersion() > currentAPIVersionOfAddon and GetWorldName()~="PTS" then
d("Update your addons!")
Expand Down
15 changes: 8 additions & 7 deletions SetCrafterUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,10 @@ function DolgubonSetCrafter.onWindowMove(window)
DolgubonSetCrafter.savedvars.xPos = window:GetLeft()
DolgubonSetCrafter.savedvars.yPos = window:GetTop()
end

local totalWindowWidth = 1200
local leftHalfWindowWidth = totalWindowWidth - 250
local function getDividerPosition(window, a)
local DIVIDER_RATIO = 800/1050
local DIVIDER_RATIO = leftHalfWindowWidth/totalWindowWidth
local width = window:GetWidth()
local divider = window:GetNamedChild("Divider")

Expand All @@ -293,11 +294,11 @@ local a = 1
--<DimensionConstraints minX="700" minY="460" />
-- 700
local function SetWindowScale(window, scale)
local LeftRightRatio = 800/1050
local LeftRightRatio = leftHalfWindowWidth/totalWindowWidth
local divider = window:GetNamedChild("divider")
local left = window:GetNamedChild("Left")
local right = window:GetNamedChild("Right")
local newScale = window:GetWidth()/1050
local newScale = window:GetWidth()/totalWindowWidth
newScale = math.min(newScale, 1) -- after 1, don't rescale it anymore
-- Rather than changing the scale of the whole window (which will change the size and call this again)
-- we scale the two main elements of the window so that they match the size
Expand Down Expand Up @@ -325,10 +326,10 @@ function DolgubonSetCrafter.dynamicResize(window)
DolgubonSetCrafter.materialManager:RefreshData()

-- Resize method 2
local newScale = (1050 - window:GetWidth())*(-0.0008) + 1
local scale = math.sqrt(window:GetWidth()/1050)
local newScale = (totalWindowWidth - window:GetWidth())*(-0.0008) + 1
local scale = math.sqrt(window:GetWidth()/totalWindowWidth)
SetWindowScale(window, scale)
if true or window:GetWidth() > 1050 then return end
if true or window:GetWidth() > totalWindowWidth then return end
newScale = math.min(newScale, 1.5)
newScale = math.max(newScale, 0.8)

Expand Down
2 changes: 1 addition & 1 deletion SetCrafterXMLUI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Created by Dolgubon (Joseph Heinzle)
</TopLevelControl>

<TopLevelControl name="DolgubonSetCrafterWindow" clampedToScreen="true" mouseEnabled="true" movable="true" hidden="true" resizeHandleSize="10" >
<Dimensions x="1050" y="650" />
<Dimensions x="1200" y="650" />
<DimensionConstraints minX="740" minY="470" />
<Anchor point="CENTER" relativeTo="GuiRoot" relativePoint="CENTER" offsetX="300" offsetY="-100"/>
<OnResizeStart>
Expand Down
58 changes: 50 additions & 8 deletions SetupDropdowns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function DolgubonSetCrafterWindowComboboxes:anchoruiElements()
for i = 1, #self.elements do
self.elements[i]:ClearAnchors()
end
local minLeftSize = 1000
local minRightSize = 1000
local minLeftSize = 1
local minRightSize = 1
local lastControlRight = nil
local lastControlLeft = nil
for i = 1, #self.elements do
Expand All @@ -27,7 +27,7 @@ function DolgubonSetCrafterWindowComboboxes:anchoruiElements()
self.elements[i]:GetNamedChild("ComboBox"):SetWidth(230)
end
if self.elements[i]:GetNamedChild("Name") then
minLeftSize = math.min(self.elements[i]:GetNamedChild("Name"):GetTextWidth() + 230, minLeftSize)
-- minLeftSize = math.min(self.elements[i]:GetNamedChild("Name"):GetTextWidth() + 230, minLeftSize)

end
else -- RIGHT SIDE
Expand All @@ -42,13 +42,13 @@ function DolgubonSetCrafterWindowComboboxes:anchoruiElements()
self.elements[i]:GetNamedChild("ComboBox"):SetWidth(160)
end
if self.elements[i]:GetNamedChild("Name") then
minRightSize = math.min(self.elements[i]:GetNamedChild("Name"):GetTextWidth() + 130, minRightSize)
-- minRightSize = math.min(self.elements[i]:GetNamedChild("Name"):GetTextWidth() + 130, minRightSize)
end
end
lastControl = self.elements[i]
end

DolgubonSetCrafterWindow.minWidth = ( DolgubonSetCrafterWindow.minWidth or 0) + minRightSize + minLeftSize
-- DolgubonSetCrafterWindow.minWidth = ( DolgubonSetCrafterWindow.minWidth or 0) + minRightSize + minLeftSize
self:SetDimensions(800,math.ceil(#self.elements/2)*vSpacing + 25)
self.height = math.ceil(#self.elements/2)*vSpacing + 25
DolgubonSetCrafterWindowLeftInteractionButtons:ClearAnchors()
Expand Down Expand Up @@ -85,8 +85,8 @@ local function makeDropdownSelections(comboBoxContainer, tableInfo , text , x, y
comboBoxContainer:GetChild((comboBoxLocation+2)%2+1):SetText(text..":")
if not comboBox.m_comboBox then
comboBox.m_comboBox =comboBox.dropdown
comboBox.dropdown.m_container:SetDimensions(200,30)
comboBox.dropdown.m_dropdown:SetDimensions(200,370)
comboBox.dropdown.m_container:SetDimensions(225,30)
comboBox.dropdown.m_dropdown:SetDimensions(225,370)
end
--Function called when an option is selected
function comboBox:setSelected( selectedInfo)
Expand Down Expand Up @@ -175,11 +175,23 @@ function DolgubonSetCrafter.setupComboBoxes()
DolgubonSetCrafter.ComboBox.Jewelry = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_Jewelry_Trait", DolgubonSetCrafterWindowComboboxes, "ComboboxTemplate")
DolgubonSetCrafter.ComboBox.Set = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_Set", DolgubonSetCrafterWindowComboboxes, "ScrollComboboxTemplate")
DolgubonSetCrafter.ComboBox.Style = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_Style", DolgubonSetCrafterWindowComboboxes, "ScrollComboboxTemplate")
if GetDisplayName()=="@Dolgubon" then
DolgubonSetCrafter.ComboBox.WeaponEnchant = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_WeaponEnchant", DolgubonSetCrafterWindowComboboxes, "ComboboxTemplate")
DolgubonSetCrafter.ComboBox.JewelEnchant = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_JewelEnchant", DolgubonSetCrafterWindowComboboxes, "ComboboxTemplate")
DolgubonSetCrafter.ComboBox.ArmourEnchant = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_ArmourEnchant", DolgubonSetCrafterWindowComboboxes, "ComboboxTemplate")
DolgubonSetCrafter.ComboBox.EnchantQuality = WINDOW_MANAGER:CreateControlFromVirtual("Dolgubons_Set_Crafter_EnchantQuality", DolgubonSetCrafterWindowComboboxes, "ComboboxTemplate")
end

for k, v in pairs(DolgubonSetCrafter.ComboBox) do
v.name = k
end

local armourEnchant =
{
{"Frozen Weapon Enchantment","health2"},
{"stsam","Frozen Weapon Enchantment"}
}--GetItemLinkEnchantInfo(string itemLink)


local UIStrings = langStrings.UIStrings
--Three calls to make dropdown selections, as well as further setup the comboboxes.
makeDropdownSelections( DolgubonSetCrafter.ComboBox.Style , DolgubonSetCrafter.styleNames , UIStrings.style , -160, 80, 2, "style")
Expand All @@ -188,9 +200,39 @@ function DolgubonSetCrafter.setupComboBoxes()
makeDropdownSelections( DolgubonSetCrafter.ComboBox.Weapon , DolgubonSetCrafter.weaponTraits , UIStrings.weaponTrait , 240 , 120, 1, "weaponTrait")
makeDropdownSelections( DolgubonSetCrafter.ComboBox.Set , DolgubonSetCrafter.setIndexes , UIStrings.gearSet , 240, 40, 2, "set")
makeDropdownSelections( DolgubonSetCrafter.ComboBox.Jewelry , DolgubonSetCrafter.jewelryTraits, UIStrings.jewelryTrait , -160, 160, 1, "jewelryTraits")
if GetDisplayName()=="@Dolgubon" then
makeDropdownSelections( DolgubonSetCrafter.ComboBox.WeaponEnchant, DolgubonSetCrafter.jewelryTraits, "Weapon Enchant" , -160, 160, 1, "weaponEnchant")
makeDropdownSelections( DolgubonSetCrafter.ComboBox.JewelEnchant, DolgubonSetCrafter.quality, "Jewelry Enchant" , -160, 160, 1, "jewelEnchant")
makeDropdownSelections( DolgubonSetCrafter.ComboBox.ArmourEnchant, armourEnchant, "Armour Enchant" , -160, 160, 1, "armourEnchant")
makeDropdownSelections( DolgubonSetCrafter.ComboBox.EnchantQuality, DolgubonSetCrafter.quality, "Glyph Quality" , -160, 160, 1, "enchantQuality")
end
DolgubonSetCrafter.ComboBox.Armour.isTrait = true
DolgubonSetCrafter.ComboBox.Weapon.isTrait = true
DolgubonSetCrafter.ComboBox.Jewelry.isTrait = true
DolgubonSetCrafter.ComboBox.Style.isStyle = true
--DolgubonSetCrafterWindowComboboxes:anchoruiElements()
end



--[[
Scenario 1:
Game crashes: Too bad. So Sad. You were gonna make it a second time anyway unless you cancel it. You won't make the glyph but eh
Scenario 2:
Glyph made: Well we won't requeue that glyph, but we will make the armour
Scenario 3:
Gear made: We won't requeue anything!
scenario 4:
Nothing made: No issues here
Save unique Item Id!!
On Login:
If it's found at the same place, great
If it's not found at the same place, search bags
If it's in inventory, great
If it's not in inventory, then do not remake item, only queue partially
]]
35 changes: 20 additions & 15 deletions SetupScrollLists.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ end

function FavouriteScroll:SetupEntry(control, data)
--d("Setting up")

control.data = data
control:setCurrent(data[1])
control.label = control:GetNamedChild("Name")
Expand Down Expand Up @@ -219,21 +218,27 @@ end
outputTexts = {}
--@nighn_9, 38

local function OutputNextLine(eventCode, channelType, fromName, text, isCustomerService, fromDisplayName)


local function outputMultipleLinesChat(textToOutput)
StartChatInput(textToOutput[1])
local function OutputNextLine(eventCode, channelType, fromName, text, isCustomerService, fromDisplayName)

if fromDisplayName == GetDisplayName() or channelType == CHAT_CHANNEL_WHISPER_SENT then
testActualOutput = text
testAssume = outputTexts[1]
if text == outputTexts[1] then
table.remove(outputTexts, 1)
if #outputTexts>0 then
StartChatInput(outputTexts[1])
if fromDisplayName == GetDisplayName() or channelType == CHAT_CHANNEL_WHISPER_SENT then
testActualOutput = text
testAssume = textToOutput[1]
if text == textToOutput[1] then
table.remove(textToOutput, 1)
if #textToOutput>0 then
StartChatInput(textToOutput[1])
else
EVENT_MANAGER:UnregisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL)
end
else
EVENT_MANAGER:UnregisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL)
end
else
end
end
EVENT_MANAGER:RegisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL, OutputNextLine)
end

function DolgubonSetCrafter.outputAllMats()
Expand All @@ -260,8 +265,7 @@ function DolgubonSetCrafter.outputAllMats()
text =text.. tostring(tempMatHolder[i]["Amount"]).." "..tempMatHolder[i]["Name"]
end
outputTexts[#outputTexts + 1] = text
StartChatInput(outputTexts[1])
EVENT_MANAGER:RegisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL, OutputNextLine)
outputMultipleLinesChat(outputTexts)
end


Expand All @@ -279,10 +283,11 @@ end
function DolgubonScroll:SetupEntry(control, data)

control.data = data
if data[1].CraftRequestTable[7] ~= 7 then
if data[1].CraftRequestTable[7] ~= CRAFTING_TYPE_JEWELRYCRAFTING then
control.usesMimicStone = data[1].CraftRequestTable[6]
GetControl(control, "MimicStone"):SetHidden(not data[1].CraftRequestTable[6])
end

control.qualityString = zo_strformat(DolgubonSetCrafter.localizedStrings.UIStrings.qualityString, data[1].Quality[2])
for k , v in pairs (data[1]) do
control[k] = GetControl(control, k)

Expand Down
Loading

0 comments on commit d1b8a15

Please sign in to comment.