Skip to content

Commit

Permalink
Merge pull request #5 from patrickjDE/legion-update
Browse files Browse the repository at this point in the history
7.1 + Fixes
  • Loading branch information
patrickjDE authored Nov 23, 2016
2 parents 2dc4428 + c91f5fc commit d450f99
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Notepad++ backup Files
/nppBackup/

# Zip archives for distribution
*.zip

# Windows image file caches
Thumbs.db
ehthumbs.db
Expand Down
41 changes: 22 additions & 19 deletions OCES.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--[[
OneClickEnchantScroll v7.0.3.0 (r17)
OneClickEnchantScroll v7.1.0.0 (r18)
Copyright (c) 2010-2016, All rights reserved.
Written an maintained by:
Expand Down Expand Up @@ -42,30 +42,33 @@ f:SetScript("OnClick", function()
end);
f:Hide();

local function OCES_OnRecipeButtonClicked(recipeButton, recipeInfo, mouseButton)
local function OCES_RefreshButtons(self)
if C_TradeSkillUI.IsTradeSkillGuild() or C_TradeSkillUI.IsNPCCrafting() or C_TradeSkillUI.IsTradeSkillLinked() then
f:Hide();
elseif recipeInfo.tradeSkillInfo.alternateVerb then
local _, tradeSkillName = C_TradeSkillUI.GetTradeSkillLine();
if tradeSkillName == enchantingTradeSkillName then
f:Show();
local numCreateable = recipeInfo.tradeSkillInfo.numAvailable;
local numScrollsAvailable = GetItemCount(38682);
TradeSkillCreateScrollButton:SetText(scrollText.." ("..numScrollsAvailable..")");
if numScrollsAvailable == 0 then
numCreateable = 0;
end
if numCreateable > 0 then
TradeSkillCreateScrollButton:Enable();
else
local recipeInfo = self.selectedRecipeID and C_TradeSkillUI.GetRecipeInfo(self.selectedRecipeID);
if recipeInfo and recipeInfo.alternateVerb then
local tradeSkillName = select(2, C_TradeSkillUI.GetTradeSkillLine());
if tradeSkillName == enchantingTradeSkillName then
f:Show();
local numCreateable = recipeInfo.numAvailable;
local numScrollsAvailable = GetItemCount(38682);
TradeSkillCreateScrollButton:SetText(scrollText.." ("..numScrollsAvailable..")");
if numScrollsAvailable == 0 then
numCreateable = 0;
end
if numCreateable > 0 then
TradeSkillCreateScrollButton:Enable();
else
TradeSkillCreateScrollButton:Disable();
end
else
TradeSkillCreateScrollButton:Disable();
f:Hide();
end
else
f:Hide();
end
else
f:Hide();
end
end
end

hooksecurefunc(TradeSkillFrame.RecipeList, "OnRecipeButtonClicked", OCES_OnRecipeButtonClicked);
hooksecurefunc(TradeSkillFrame.DetailsFrame, "RefreshButtons", OCES_RefreshButtons);
4 changes: 2 additions & 2 deletions OneClickEnchantScroll.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 70000
## Interface: 70100
## Title: OneClickEnchantScroll
## Notes: Create enchantment scrolls with just one single click
## Notes-deDE: Erstellt mit einem einzigen Klick Verzauberungsrollen
Expand All @@ -10,7 +10,7 @@
## Notes-itIT: Crea pergamene di incantamento con un solo click
## Author: Sará.Festung der Stürme-EU <Sara#2672> <[email protected]>

## Version: 7.0.3.0
## Version: 7.1.0.0
## LoadOnDemand: 1
## LoadWith: Blizzard_TradeSkillUI

Expand Down
10 changes: 10 additions & 0 deletions zipper.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
REM http://ss64.com/nt/for_f.html
for /f "delims=" %%d in ('dir /b *.toc') do set ADDONNAME=%%~nd
for /f "tokens=2,3" %%a in (%ADDONNAME%.toc) do IF "%%a"=="Version:" set VERSION=%%b

REM del %ADDONNAME%-%VERSION%.zip
cd ..

REM https://sevenzip.osdn.jp/chm/cmdline/
7z a -tzip %ADDONNAME%\%ADDONNAME%-%VERSION%.zip %ADDONNAME%\*.lua %ADDONNAME%\*.toc %ADDONNAME%\readme.md
pause

0 comments on commit d450f99

Please sign in to comment.