Skip to content

Commit

Permalink
3.3v6 pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirroar committed Aug 20, 2010
1 parent a91beb9 commit 3b7615f
Show file tree
Hide file tree
Showing 13 changed files with 1,558 additions and 1,311 deletions.
479 changes: 240 additions & 239 deletions Libs/CallbackHandler-1.0/CallbackHandler-1.0.lua 100755 → 100644

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Libs/CallbackHandler-1.0/CallbackHandler-1.0.xml 100755 → 100644
@@ -1,4 +1,4 @@
<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">
<Script file="CallbackHandler-1.0.lua"/>
<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">
<Script file="CallbackHandler-1.0.lua"/>
</Ui>
7 changes: 6 additions & 1 deletion TopFit.toc
Expand Up @@ -2,7 +2,7 @@
## Author: Mirroar
## Title: TopFit
## Notes: Gear Optimization made easy
## Version: 3.3v5
## Version: 3.3v6
## X-Embeds: AceAddon-3.0, AceConsole-3.0, AceGUI-3.0, AceConfig-3.0, AceDB-3.0, AceDBOptions-3.0, AceLocale-3.0
## X-Category: Inventory
## X-Credits: ckaotik (for adding almost all the gems and enchant info), tekkub, trefane (SmartFitter), vger(Pawn)
Expand All @@ -13,10 +13,15 @@ embeds.xml

core.lua
inventory.lua
tooltip.lua
presets.lua
calculation.lua
options.lua
frame.lua
plugin.lua

plugins\stats.lua
plugins\virtual_items.lua

gem_ids.lua
enchant_ids.lua
10 changes: 8 additions & 2 deletions calculation.lua
Expand Up @@ -63,6 +63,13 @@ function TopFit:CalculateRecommendations()
TopFit.playerCanTitansGrip = true
end

if (TopFit.db.profile.sets[TopFit.setCode].simulateDualWield) then
TopFit.playerCanDualWield = true
end
if (TopFit.db.profile.sets[TopFit.setCode].simulateTitansGrip) then
TopFit.playerCanTitansGrip = true
end

TopFit:InitSemiRecursiveCalculations()
end

Expand Down Expand Up @@ -129,7 +136,6 @@ function TopFit:InitSemiRecursiveCalculations()
TopFit.ProgressFrame:SetSelectedSet(TopFit.setCode)
TopFit.ProgressFrame:SetSetName(TopFit.currentSetName)
TopFit.ProgressFrame:ResetProgress()
TopFit.ProgressFrame:UpdateSetStats()
end

function TopFit:ReduceItemList()
Expand Down Expand Up @@ -652,7 +658,7 @@ function TopFit:CalculateBestInSlot(itemsAlreadyChosen, insert, sID, setCode, as
local itemTable = TopFit:GetCachedItem(locationTable.itemLink)

if (itemTable and ((maxScore == nil) or (maxScore < TopFit:GetItemScore(itemTable.itemLink, setCode, TopFit.ignoreCapsForCalculation))) -- score
and (itemTable.itemMinLevel <= TopFit.characterLevel)) -- character level
and (itemTable.itemMinLevel <= TopFit.characterLevel or locationTable.isVirtual)) -- character level
and (not assertion or assertion(locationTable)) then -- optional assertion is true
-- also check if item has been chosen already (so we don't get the same ring / trinket twice)
local found = false
Expand Down
7 changes: 5 additions & 2 deletions changelog.txt
@@ -1,12 +1,15 @@
Changelog for TopFit
====================

3.3v6 -
3.3v6 - 2010/08/21
- fixed items with the same itemID showing up multiple times in the force item menu
- fixed forced slots not being correctly updated when adding or deleting a set in the options frame
- fixed bug when trying to calculate blood tank preset. Again, if you get an error with it from before this version, click the defense cap value, and overwrite it with <Enter>
- Deathknights can now Dualwield. D'oh

- Added first parts of plugin API. Documentation can be found at http://github.com/Mirroar/TopFit/wiki/API
- Stats / Caps editor and virtual items UI use the new plugin functions.
- Virtual items can now be included in set calculation, to see what would happen if you had a certain item. Items are not sanitized (you can calculate with a level 80 item or a plate item as a level 70 priest) and any calculation including virtual items will result in the set not being equipped.
- Shamans and Warriors can now choose to simulate dual wielding or Titan's Grip for a set, indifferent of their current spec.

3.3v5 - 2010/07/17
- fixed a bug with the preset protection paladin set - if you stil get an error calculating that set, update the defense cap value and it should work
Expand Down
430 changes: 25 additions & 405 deletions core.lua

Large diffs are not rendered by default.

662 changes: 5 additions & 657 deletions frame.lua

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion inventory.lua
Expand Up @@ -436,14 +436,28 @@ function TopFit:GetEquippableItems(requestedSlotID)
tinsert(itemListBySlot[slotID], {
itemLink = itemLink,
isBoE = false, -- it is already equipped
bag = nil,
slot = invSlot
})
end
end
end
end

-- add virtual items
if (TopFit.setCode and TopFit.db.profile.sets[TopFit.setCode].virtualItems and not TopFit.db.profile.sets[TopFit.setCode].skipVirtualItems) then
for _, itemLink in pairs(TopFit.db.profile.sets[TopFit.setCode].virtualItems) do
local item = TopFit:GetCachedItem(itemLink)
local equipSlots = TopFit:GetEquipLocationsByInvType(item.itemEquipLoc)
for _, slotID in pairs(equipSlots) do
tinsert(itemListBySlot[slotID], {
itemLink = itemLink,
isBoE = false, -- if it's in virtual items, we want to include it
isVirtual = true
})
end
end
end

if (requestedSlotID) then
return itemListBySlot[requestedSlotID]
else
Expand Down
65 changes: 65 additions & 0 deletions plugin.lua
@@ -0,0 +1,65 @@

function TopFit:RegisterPlugin(pluginName, tooltipText)
-- create / register plugin-tab
local pluginInfo = {
name = pluginName,
tooltipText = tooltipText,
}

tinsert(TopFit.plugins, pluginInfo)
pluginInfo.id = #(TopFit.plugins)

-- return frame for plugin UI
pluginInfo.frame = CreateFrame("Frame", "TopFit_ProgressFrame_PluginFrame_"..(pluginInfo.id), nil)
if pluginInfo.id > 1 then
pluginInfo.frame:Hide()
end

TopFit:UpdatePlugins()

return pluginInfo.frame, pluginInfo.id
end

function TopFit:UpdatePlugins()
if TopFit.ProgressFrame then
local i
for i = 1, #(TopFit.plugins) do
local pluginInfo = TopFit.plugins[i]
-- update parents and anchors for plugin frames
pluginInfo.frame:SetParent(TopFit.ProgressFrame.pluginContainer)
pluginInfo.frame:SetAllPoints()

-- create tabs if necessary
if not pluginInfo.tabButton then
-- create plugin button and size / anchor it
pluginInfo.tabButton = TopFit.ProgressFrame:CreateHeaderButton(TopFit.ProgressFrame.pluginContainer, "TopFit_ProgressFrame_PluginButton_"..(pluginInfo.id))
pluginInfo.tabButton:SetPoint("BOTTOM", TopFit.ProgressFrame, "TOP", 0, -7)
if (pluginInfo.id == 1) then
pluginInfo.tabButton:SetPoint("LEFT", TopFit.ProgressFrame.pluginContainer, "LEFT")
else
pluginInfo.tabButton:SetPoint("LEFT", TopFit.plugins[pluginInfo.id - 1].tabButton, "RIGHT", 3, 0)
end

-- set event handlers
pluginInfo.tabButton:SetScript("OnClick", function()
TopFit:SelectPluginTab(pluginInfo.id)
end)
end
pluginInfo.tabButton:SetText(pluginInfo.name)
pluginInfo.tabButton:SetWidth(pluginInfo.tabButton:GetFontString():GetStringWidth() + 10)
pluginInfo.tabButton.tipText = pluginInfo.tooltipText
end
end
end

function TopFit:SelectPluginTab(id)
local i
for i = 1, #(TopFit.plugins) do
if i == id then
TopFit.plugins[i].frame:Show()
TopFit.eventHandler:Fire("OnShow", id)
else
TopFit.plugins[i].frame:Hide()
end
end
end

0 comments on commit 3b7615f

Please sign in to comment.