Quantcast

Merge branch 'release/1.0.0'

Kevin Gilbert [08-26-16 - 17:19]
Merge branch 'release/1.0.0'
Filename
ArtifactMenu.lua
ArtifactMenu.toc
README.md
diff --git a/ArtifactMenu.lua b/ArtifactMenu.lua
index e17d9bc..b418bb5 100644
--- a/ArtifactMenu.lua
+++ b/ArtifactMenu.lua
@@ -1,11 +1,36 @@
 SLASH_ARTIFACTMENU1, SLASH_ARTIFACTMENU2 = '/artifact', '/am';
+SLASH_ARTIFACTMENU3 = "/artifactmenu";

 local function openWeaponSockets()
     SocketInventoryItem(16);
 end

+-- unneeded, because artifacts are "conjoined" items
+local function openOffhandSockets()
+    SocketInventoryItem(17);
+end
+
 function SlashCmdList.ARTIFACTMENU(msg, editBox)
-    openWeaponSockets();
-    print("Opening ArtifactMenu...");
+    -- http://wowprogramming.com/docs/api_types#itemQuality
+    local QUALITY = {}
+    QUALITY.POOR = 0;
+    QUALITY.COMMON = 1;
+    QUALITY.UNCOMMON = 2;
+    QUALITY.RARE = 3;
+    QUALITY.EPIC = 4;
+    QUALITY.LEGENDARY = 5;
+    QUALITY.ARTIFACT = 6;
+    QUALITY.HEIRLOOM = 7;
+    local equippedWeapon = GetInventoryItemID("player", GetInventorySlotInfo("MainHandSlot"));
+    if equippedWeapon == nil then
+        print("You do not have any weapons equipped.");
+        return
+    end
+    name, link, quality, iLvl, reqLvl, class, subclass, maxStack, equipSlot, texture, vendorSellPrice = GetItemInfo(equippedWeapon);
+    if quality == QUALITY["ARTIFACT"] then
+        openWeaponSockets();
+    else
+        print("You do not have an Artifact Weapon equipped yet.");
+    end
 end

diff --git a/ArtifactMenu.toc b/ArtifactMenu.toc
index 087f939..4591fd5 100644
--- a/ArtifactMenu.toc
+++ b/ArtifactMenu.toc
@@ -1,6 +1,6 @@
 ## Interface: 70000
 ## Title: ArtifactMenu
 ## Author: Kevin Gilbert (kaygil)
-## Version: 0.2.0
+## Version: 1.0.0

 ArtifactMenu.lua
diff --git a/README.md b/README.md
index afa957c..1acf1ca 100644
--- a/README.md
+++ b/README.md
@@ -18,5 +18,5 @@ This add-on will simplify all of that to just:
 * [The idea](https://www.reddit.com/r/wow/comments/4ze7uw/psa_macro_to_quickly_open_the_artifact_weapon/) by [/u/HoLeeSchit](https://www.reddit.com/user/HoLeeSchit)
 * [WoW Addon Writing Guide](http://wow.gamepedia.com/User:Cogswobble/Addon_Tutorial/Slash_Commands) by Cogswobble
 * Wowpedia [slash commands reference](http://wow.gamepedia.com/Creating_a_slash_command)
-* The nice people of [#wowuidev](http://us.battle.net/forums/en/wow/topic/1127130079) for helping me debug
-
+* The nice people of [#wowuidev](http://us.battle.net/forums/en/wow/topic/1127130079) for helping me debug, specifically `kd3`, `Nebula`, and `Semlar`
+* [Farrar-Gilneas](http://us.battle.net/wow/en/character/gilneas/Farrar/simple) for testing this add-on in the *Legion* beta.