Skip to content

Commit

Permalink
Furniture multiplier
Browse files Browse the repository at this point in the history
Show unknown recipes
Furniture tree list now with async loading and un enabled during loading
Fixed bug with normal enchants in request to mail/chat
Add message when chat sending is complete
  • Loading branch information
Dolgubon committed Jan 19, 2024
1 parent 3333692 commit f0a7d8d
Show file tree
Hide file tree
Showing 24 changed files with 391 additions and 193 deletions.
8 changes: 5 additions & 3 deletions Crafter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,12 @@ function DolgubonSetCrafter.addFurniture()
requestTableCopy = {}
requestTableCopy["Reference"] = DolgubonSetCrafter.savedvars.counter
DolgubonSetCrafter.savedvars.counter = DolgubonSetCrafter.savedvars.counter + 1
local craftMultiplier = DolgubonSetCrafter:GetMultiplier()
requestTableCopy["Quantity"] = {craftMultiplier, tostring(craftMultiplier).."x"}

local requestParameters =
{
DolgubonSetCrafter.selectedFurniture, 1, DolgubonSetCrafter:GetAutocraft(), requestTableCopy["Reference"]
DolgubonSetCrafter.selectedFurniture, requestTableCopy["Quantity"][1], DolgubonSetCrafter:GetAutocraft(), requestTableCopy["Reference"]
}
local returnedTable = LazyCrafter:CraftProvisioningItemByResultItemId(unpack(requestParameters))
requestTableCopy["CraftRequestTable"] = requestParameters
Expand All @@ -743,8 +746,7 @@ function DolgubonSetCrafter.addFurniture()
addRequirements(returnedTable, true)
end
local _,_,_,_,_,_, station = GetRecipeInfo(DolgubonSetCrafter.selectedRecipeListIndex, DolgubonSetCrafter.selectedRecipeIndex)

requestTableCopy["Quantity"] = {1, "1x"}

requestTableCopy["Quality"] = DolgubonSetCrafter.quality[GetItemLinkQuality(DolgubonSetCrafter.selectedFurnitureLink)]
requestTableCopy["Name"] = {GetItemLinkName(DolgubonSetCrafter.selectedFurnitureLink), GetItemLinkName(DolgubonSetCrafter.selectedFurnitureLink)}
requestTableCopy["Station"] = {station, GetCraftingSkillName(station)}
Expand Down
8 changes: 3 additions & 5 deletions DolgubonsLazySetCrafter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
; States and/or other countries. All rights reserved.
; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms

## Title: Dolgubon's Lazy Set Crafter v2.8.7
## Title: Dolgubon's Lazy Set Crafter v3.0.1
## APIVersion: 101040
## Author: Dolgubon
## Version: 2.8.7
## Version: 3.0.1
## SavedVariables: dolgubonslazysetcraftersavedvars
## DependsOn: LibLazyCrafting>=3086 LibAddonMenu-2.0 LibStub
## DependsOn: LibLazyCrafting>=4000 LibAddonMenu-2.0 LibStub
## OptionalDependsOn: pChat LibFeedback LibCustomMenu LibPrice

; Libraries

; LibCustomTitles
Libs\LibCustomTitles\LibCustomTitles.lua
; Feedback library
libs\LibFeedback\feedback.lua

Expand Down
455 changes: 320 additions & 135 deletions FurnitureUI.lua

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ DolgubonSetCrafter.localizedStrings.UIStrings.loadQueueAsIs = "Load with saved
DolgubonSetCrafter.localizedStrings.UIStrings.loadQueueCurrentLevel = "Load with currently selected level"
DolgubonSetCrafter.localizedStrings.UIStrings.resetPatterns = "Reset Patterns"
DolgubonSetCrafter.localizedStrings.UIStrings.totalCostTitle = "Total Cost"
DolgubonSetCrafter.localizedStrings.UIStrings.onlyKnownRecipes = "Only Known Recipes"

DolgubonSetCrafter.localizedStrings.SettingsStrings = {}

Expand Down
4 changes: 3 additions & 1 deletion Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
------------------------------------------------------------------


local MAJOR, MINOR = "LibAddonMenu-2.0", 34
local MAJOR, MINOR = "LibAddonMenu-2.0", 35

local lam
if(not LibStub) then
Expand Down Expand Up @@ -916,6 +916,8 @@ local function CreateOptionsControls(panel)

err, anchorOffset, lastAddedControl, wasHalf = CreateAndAnchorWidget(parent, widgetData, offsetX, anchorOffset, lastAddedControl, wasHalf)
if err then
d(GetStringFromValue(widgetData.name or "unnamed"))
d(widgetData)
PrintLater(("Could not create %s '%s' of %s."):format(widgetData.type, GetStringFromValue(widgetData.name or "unnamed"), addonID))
logger:Error(err)
end
Expand Down
6 changes: 3 additions & 3 deletions Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## APIVersion: 101033 101034
## APIVersion: 101040
## Title: LibAddonMenu-2.0
## Version: 2.0 r34
## AddOnVersion: 34
## Version: 2.0 r35
## AddOnVersion: 35
## IsLibrary: true
## OptionalDependsOn: LibStub LibDebugLogger
## Author: Seerah, sirinsidiator, et al.
Expand Down
1 change: 1 addition & 0 deletions Libs/LibAddonMenu-2.0/controls/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
warning = "Will need to reload the UI.", -- (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonButton", -- unique global reference to control (optional)
resetFunc = function(buttonControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]

local widgetVersion = 12
Expand Down
1 change: 1 addition & 0 deletions Libs/LibAddonMenu-2.0/controls/checkbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
default = defaults.var, -- a boolean or function that returns a boolean (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonCheckbox", -- unique global reference to control (optional)
resetFunc = function(checkboxControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]


Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/colorpicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
default = {r = defaults.r, g = defaults.g, b = defaults.b, a = defaults.a}, -- (optional) table of default color values (or default = defaultColor, where defaultColor is a table with keys of r, g, b[, a]) or a function that returns the color
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonColorpicker" -- unique global reference to control (optional)
reference = "MyAddonColorpicker", -- unique global reference to control (optional)
resetFunc = function(colorpickerControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]


Expand Down
1 change: 1 addition & 0 deletions Libs/LibAddonMenu-2.0/controls/custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
width = "full", -- or "half" (optional)
minHeight = function() return db.minHeightNumber end, --or number for the minimum height of this control. Default: 26 (optional)
maxHeight = function() return db.maxHeightNumber end, --or number for the maximum height of this control. Default: 4 * minHeight (optional)
resetFunc = function(customControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]

local widgetVersion = 8
Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/description.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
enableLinks = nil, -- or true for default tooltips, or function OnLinkClicked handler (optional)
-- see: https://wiki.esoui.com/UI_XML#OnLinkClicked
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonDescription" -- unique global reference to control (optional)
reference = "MyAddonDescription", -- unique global reference to control (optional)
resetFunc = function(descriptionControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]


Expand Down
6 changes: 4 additions & 2 deletions Libs/LibAddonMenu-2.0/controls/dropdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
default = defaults.var, -- default value or function that returns the default value (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonDropdown" -- unique global reference to control (optional)
reference = "MyAddonDropdown", -- unique global reference to control (optional)
resetFunc = function(dropdownControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]


local widgetVersion = 23
local widgetVersion = 24
local LAM = LibAddonMenu2
if not LAM:RegisterWidget("dropdown", widgetVersion) then return end

Expand Down Expand Up @@ -392,6 +393,7 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName)
control.dropdown = ZO_ComboBox_ObjectFromContainer(combobox)
local dropdown = control.dropdown
dropdown:SetSortsItems(false) -- need to sort ourselves in order to be able to sort by value
dropdown.m_dropdown:SetParent(combobox:GetOwningWindow()) -- TODO remove workaround once the problem is fixed in the game

if dropdownData.scrollable then
local visibleRows = type(dropdownData.scrollable) == "number" and dropdownData.scrollable or DEFAULT_VISIBLE_ROWS
Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/editbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
default = defaults.text, -- default value or function that returns the default value (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonEditbox" -- unique global reference to control (optional)
reference = "MyAddonEditbox", -- unique global reference to control (optional)
resetFunc = function(editboxControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]


Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/header.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
tooltip = "My Tooltip", -- or string id or function returning a string (optional)
width = "full", -- or "half" (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonHeader" -- unique global reference to control (optional)
reference = "MyAddonHeader", -- unique global reference to control (optional)
resetFunc = function(headerControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]


Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/iconpicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
default = defaults.var, -- default value or function that returns the default value (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonIconPicker" -- unique global reference to control (optional)
reference = "MyAddonIconPicker", -- unique global reference to control (optional)
resetFunc = function(iconpickerControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]

local widgetVersion = 11
Expand Down
12 changes: 8 additions & 4 deletions Libs/LibAddonMenu-2.0/controls/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
keywords = "settings", -- additional keywords for search filter (it looks for matches in name..keywords..author) (optional)
slashCommand = "/myaddon", -- will register a keybind to open to this panel (don't forget to include the slash!) (optional)
registerForRefresh = true, -- boolean will refresh all options controls when a setting is changed and when the panel is shown (optional)
registerForDefaults = true, -- boolean will set all options controls back to default values (optional)
resetFunc = function() print("defaults reset") end, -- custom function to run after settings are reset to defaults (optional)
registerForDefaults = true, -- boolean will set all options controls back to default values (optional),
resetFunc = function(panel) d("defaults reset") end, -- custom function to run after the panel is reset to defaults (optional)
} ]]


Expand Down Expand Up @@ -48,13 +48,17 @@ local function ForceDefaults(panel)

for i = 1, #panelControls do
local updateControl = panelControls[i]
if updateControl.UpdateValue and updateControl.data.default ~= nil then
local updateControlData = updateControl.data
if updateControl.UpdateValue and updateControlData.default ~= nil then
updateControl:UpdateValue(true)
end
if updateControlData.resetFunc then
updateControlData.resetFunc(updateControl)
end
end

if panel.data.resetFunc then
panel.data.resetFunc()
panel.data.resetFunc(panel)
end

cm:FireCallbacks("LAM-RefreshPanel", panel)
Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/slider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
requiresReload = false, -- boolean, if set to true, the warning text will contain a notice that changes are only applied after an UI reload and any change to the value will make the "Apply Settings" button appear on the panel which will reload the UI when pressed (optional)
default = defaults.var, -- default value or function that returns the default value (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonSlider" -- unique global reference to control (optional)
reference = "MyAddonSlider", -- unique global reference to control (optional)
resetFunc = function(sliderControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]

local widgetVersion = 16
Expand Down
3 changes: 2 additions & 1 deletion Libs/LibAddonMenu-2.0/controls/submenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
disabled = function() return db.someBooleanSetting end, -- or boolean (optional)
disabledLabel = function() return db.someBooleanSetting end, -- or boolean (optional)
helpUrl = "https://www.esoui.com/portal.php?id=218&a=faq", -- a string URL or a function that returns the string URL (optional)
reference = "MyAddonSubmenu" -- unique global reference to control (optional)
reference = "MyAddonSubmenu", -- unique global reference to control (optional)
resetFunc = function(submenuControl) d("defaults reset") end, -- custom function to run after the control is reset to defaults (optional)
} ]]

local widgetVersion = 15
Expand Down
2 changes: 1 addition & 1 deletion Mail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function DolgubonSetCrafter.convertRequestToText(curReq)
else
text= itemLink..", "..level..", "..style..", "..trait..", "..quality
end
if enchant then
if enchant and enchant ~= "" then
text = text.." with "..enchantQuality.." "..enchant.." enchant"
end
return text
Expand Down
20 changes: 0 additions & 20 deletions SetCrafterUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,26 +262,6 @@ end
---------------------
--- OTHER

function DolgubonSetCrafter.isCurrentlyInFurniture()
return DolgubonSetCrafterWindowToggleFurniture.isCurrentUIFurniture
end

function DolgubonSetCrafter.toggleFurnitureUI(toggleButton)
toggleButton.isCurrentUIFurniture = not toggleButton.isCurrentUIFurniture
local newHidden = toggleButton.isCurrentUIFurniture
DolgubonSetCrafterWindowFavourites:SetHidden(newHidden)
DolgubonSetCrafterWindowPatternInput:SetHidden(newHidden)
DolgubonSetCrafterWindowComboboxes:SetHidden(newHidden)
DolgubonSetCrafterWindowInput:SetHidden(newHidden)
DolgubonSetCrafterWindowMultiplierInput:SetHidden(newHidden)
DolgubonSetCrafterWindowFurniture:SetHidden(not newHidden)
DolgubonSetCrafter:GetSettings().initialFurniture = toggleButton.isCurrentUIFurniture
if toggleButton.isCurrentUIFurniture then
out("Please select a recipe to craft")
else
out(DolgubonSetCrafter.localizedStrings.UIStrings.patternHeader)
end
end

function DolgubonSetCrafter.resetChoices()

Expand Down
22 changes: 13 additions & 9 deletions SetCrafterXMLUI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,12 @@ Created by Dolgubon (Joseph Heinzle)
<Control name="$(grandparent)Furniture" hidden="true" mouseEnabled="true" clampedToScreen="true" movable="false" inherits="ZO_ScrollContainer">
<Dimensions x="450" y="400" />
<DimensionConstraints minY="80" minX="380" />
<Anchor point="TOP" relativeTo="$(grandparent)Title" relativePoint="BOTTOM" offsetX="-200" offsetY="35" />
<Anchor point="BOTTOM" relativeTo="$(parent)Add" relativePoint="BOTTOM" offsetX="-200" offsetY="-35" />
<Anchor point="TOP" relativeTo="$(grandparent)Title" relativePoint="BOTTOM" offsetX="-220" offsetY="35" />
<Anchor point="BOTTOM" relativeTo="$(parent)Add" relativePoint="BOTTOM" offsetX="-220" offsetY="-35" />
<Controls>
<Label name="$(parent)Test" font="ZoFontWinH4" horizontalAlignment="CENTER" text="Furniture currently in Beta. More features will be added later!">
<Label name="$(parent)Test" font="ZoFontWinH4" horizontalAlignment="CENTER" text="Furniture crafting is still new to this addon. More furniture features will be added later!">
<Dimensions x="350" />
<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="RIGHT" offsetX="20" offsetY="20" />
</Label>
<Label name="$(parent)SelectedItem" font="ZoFontWinH4" horizontalAlignment="LEFT" text="">
<Dimensions x="350" />
<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="20" offsetY="75" />
<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="RIGHT" offsetX="40" offsetY="20" />
</Label>
<Button name="$(parent)Food" inherits="PieceButtonTemplate">
<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="30" offsetY="40" />
Expand All @@ -414,11 +410,19 @@ Created by Dolgubon (Joseph Heinzle)
<Button name="$(parent)Furniture" inherits="PieceButtonTemplate">
<Anchor point="LEFT" relativeTo="$(parent)Drinks" relativePoint="RIGHT" offsetX="10" offsetY="0" />
</Button>
<Label name="$(parent)SelectedItem" font="ZoFontWinH4" horizontalAlignment="LEFT" text="" inherits="DSC_ItemLinkMouseOverLabel">
<Dimensions x="350" />
<Anchor point="TOPLEFT" relativeTo="$(parent)Food" relativePoint="BOTTOMLEFT" offsetX="0" offsetY="0" />
</Label>
<Control name="$(parent)IsKnown" inherits="BehaviourToggleTemplate">
<Anchor point="TOPLEFT" relativeTo="$(parent)Food" relativePoint="BOTTOMLEFT" offsetX="0" offsetY="20" />

</Control>
<!-- <Tooltip name="$(parent)Tooltip" inherits="ZO_CraftingTooltip" hidden="false" >
<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="RIGHT" offsetX="20" offsetY="0" />
</Tooltip> -->
<Backdrop name="$(parent)Input" inherits="ZO_EditBackdrop">
<Anchor point="RIGHT" relativeTo="$(parent)" relativePoint="RIGHT" offsetX="175" offsetY="-30" />
<Anchor point="LEFT" relativeTo="$(parent)Furniture" relativePoint="RIGHT" offsetX="10" offsetY="0" />
<Dimensions x="150"/>
<Controls>
<EditBox name="$(parent)Box" inherits="ZO_DefaultEditForBackdrop ZO_EditDefaultText" textType="TEXT_TYPE_ALL" text="" mouseEnabled="true">
Expand Down
2 changes: 1 addition & 1 deletion SettingsMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ local options =

function DolgubonSetCrafter.initializeFunctions.initializeSettingsMenu()

local LAM = LibStub:GetLibrary("LibAddonMenu-2.0")
local LAM = LibAddonMenu2 or LibStub:GetLibrary("LibAddonMenu-2.0")
LAM:RegisterAddonPanel("DolgubonsSetCrafter", panel)

LAM:RegisterOptionControls("DolgubonsSetCrafter", options)
Expand Down
4 changes: 2 additions & 2 deletions SetupScrollLists.lua
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,19 @@ local function outputMultipleLinesChat(textToOutput)
local function OutputNextLine(eventCode, channelType, fromName, text, isCustomerService, fromDisplayName)

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
d("Chat sending complete!")
EVENT_MANAGER:UnregisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL)
end
else
end
end
end
EVENT_MANAGER:UnregisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL)
EVENT_MANAGER:RegisterForEvent(DolgubonSetCrafter.name,EVENT_CHAT_MESSAGE_CHANNEL, OutputNextLine)
end

Expand Down
Loading

0 comments on commit f0a7d8d

Please sign in to comment.