Quantcast

Main UI list rows dividers added. Highlights hoovered row. ACP.L bugfix

Petr G [06-09-16 - 07:18]
Main UI list rows dividers added. Highlights hoovered row. ACP.L bugfix
Filename
ViragDevTool.lua
ViragDevTool.xml
diff --git a/ViragDevTool.lua b/ViragDevTool.lua
index a87dd14..cc97900 100644
--- a/ViragDevTool.lua
+++ b/ViragDevTool.lua
@@ -1005,11 +1005,24 @@ function ViragDevTool:tablelength(T)
     return count
 end

+function ViragDevTool:printtable(T)
+    print(tostring(T))
+    if type(T) ~= "table" then return end
+    for k, v in pairs(T) do
+        print(tostring(k) .. " => " .. tostring(v))
+    end
+
+end
 function ViragDevTool:GetObjectTypeFromWoWAPI(value)
-    if value.GetObjectType and value.IsForbidden then
+    if ACP and value == ACP.L then return end --todo fix this later throws exception
+
+    if type(value) == "table" and value.GetObjectType and value.IsForbidden  then
+
         local ok, forbidden = pcall(value.IsForbidden, value)
         if ok and not forbidden then
+
             local ok, result = pcall(value.GetObjectType, value)
+
             if ok then
                 return result
             end
diff --git a/ViragDevTool.xml b/ViragDevTool.xml
index 5d4039b..f7d7c17 100644
--- a/ViragDevTool.xml
+++ b/ViragDevTool.xml
@@ -75,17 +75,48 @@
             <Anchor point="BOTTOM"/>
             <Anchor point="LEFT"/>
         </Anchors>
+        <Scripts>
+            <OnLoad>
+                self:EnableMouse()
+            </OnLoad>
+            <OnEnter>
+                self:GetParent():LockHighlight()
+            </OnEnter>
+            <OnLeave>
+                self:GetParent():UnlockHighlight()
+            </OnLeave>
+        </Scripts>
+
         <NormalFont style="GameFontHighlightLeft"/>
     </Button>


-    <Frame name="ViragDevToolEntryTemplate" virtual="true">
+    <Button name="ViragDevToolEntryTemplate" virtual="true">
         <Anchors>
             <Anchor point="TOPLEFT"/>
         </Anchors>
+
         <Size>
             <AbsDimension x="1200" y="13"/>
         </Size>
+        <HighlightTexture  alphaMode="ADD">
+            <Color r="1" g="1" b="1" a="0.2"/>
+        </HighlightTexture>
+        <Layers>
+            <Layer level="OVERLAY">
+
+                <Texture name="$parentHighlight"  >
+                    <Size y="1" />
+                    <Anchors>
+                        <Anchor point="RIGHT" />
+                        <Anchor point="LEFT"  />
+                        <Anchor point="BOTTOM" y="-2"/>
+                    </Anchors>
+                    <Color r="1" g="1" b="1" a="0.1"/>
+                </Texture>
+            </Layer>
+        </Layers>
+
         <Frames>
             <Button text="table" name="$parentRowCellCount" inherits="ViragDevToolRowTemplate"
                     parentKey="rowNumberButton"/>
@@ -116,7 +147,7 @@
             </Button>

         </Frames>
-    </Frame>
+    </Button>

     <Frame name="ViragDevToolFrame" parent="UIParent" enableMouse="true" movable="true" resizable="true">
         <Size>