changed method of moving icon, works always now; also set tooltip so green check/red x have info on what the mean

AssemblerManiac [05-16-18 - 15:30]
changed method of moving icon, works always now; also set tooltip so green check/red x have info on what the mean
Filename
FurCEvents.lua
xml/FurnitureCatalogue.xml
diff --git a/FurCEvents.lua b/FurCEvents.lua
index a84f2da..4a02f8a 100644
--- a/FurCEvents.lua
+++ b/FurCEvents.lua
@@ -11,14 +11,14 @@ local wm = WINDOW_MANAGER

 local function createIcon(control)
 	local icon
+	icon = wm:CreateControlFromVirtual(control:GetName().."FurCIcon", control, "FurC_SlotIconKnownYes")
 	if FurC.settings["showIconOnLeft"] == nil or
 	   FurC.settings["showIconOnLeft"] == true then
-		icon = wm:CreateControlFromVirtual(control:GetName().."FurCIcon", control, "FurC_SlotIconKnownYes")
 		icon:SetAnchor(BOTTOMLEFT, control:GetNamedChild("Button"), BOTTOMLEFT, -15, -10)
-		icon:SetHidden(true)
 	else
-		icon = control:GetNamedChild("TraitInfo")
+		icon:SetAnchor(TOPLEFT, control:GetNamedChild("TraitInfo"), TOPLEFT, 0, 0)
 	end
+	icon:SetHidden(true)
 	control.icon = icon
 	return icon
 end
@@ -54,6 +54,10 @@ local function updateItemInInventory(control)

 	WINDOW_MANAGER:ApplyTemplateToControl(icon, templateName)

+	icon.data = {tooltipText = ((known and "Item is Known") or "Item is UnKnown")}
+    icon:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
+    icon:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
+
 end

 function FurC.SetupInventoryRecipeIcons(calledRecursively)
diff --git a/xml/FurnitureCatalogue.xml b/xml/FurnitureCatalogue.xml
index eb3a9fb..79f723c 100644
--- a/xml/FurnitureCatalogue.xml
+++ b/xml/FurnitureCatalogue.xml
@@ -4,22 +4,22 @@
 			<DimensionConstraints x="800" y="500" minX="850" minY="200" maxY="2000"/>
 			<Anchor point="TOPRIGHT" relativeTo="GUI_ROOT" relativePoint="TOPRIGHT" offsetX="-25" offsetY="40" />
 			<OnMoveStop>FurC.SaveFrameInfo("onMoveStop")</OnMoveStop>
-
-			<OnResizeStop>FurC.SaveFrameInfo("onResizeStop")</OnResizeStop>
+
+			<OnResizeStop>FurC.SaveFrameInfo("onResizeStop")</OnResizeStop>
 			<Controls>
-				<Backdrop name="$(parent)_BG" inherits="ZO_DefaultBackdrop" >
+				<Backdrop name="$(parent)_BG" inherits="ZO_DefaultBackdrop" >
 					<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
 					<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT"/>
 				</Backdrop>
-
+
 				<Control name="$(parent)_Header" resizeToFitDescendents="true" >
 					<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
 					<Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT"/>

 					<Controls>
-						<Control name="$(parent)_Bar1">
+						<Control name="$(parent)_Bar1">
 							<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT"/>
-							<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetY="50"/>
+							<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetY="50"/>
 							<Controls>
 								<Button name="$(parent)_Feedback">
 									<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="20" offsetY="10"/>
@@ -27,7 +27,7 @@
 									<OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit>
 									<OnMouseUp>FurC.Donate(self, button)</OnMouseUp>
 									<Dimensions x="40" y="40" />
-									<Textures
+									<Textures
 										normal		="esoui/art/mail/mail_tabicon_compose_up.dds"
 										pressed		="esoui/art/mail/mail_tabicon_compose_down.dds"
 										mouseOver	="esoui/art/mail/mail_tabicon_compose_over.dds"
@@ -36,18 +36,18 @@
 								<Control name ="FurC_Label" resizeToFitDescendents="true">
 								<Anchor point="TOP" relativeTo="$(parent)" relativePoint="TOP" offsetX="0" offsetY="10" />
 								<Dimensions y="54"/>
-									<Controls>
+									<Controls>
 										<Label name="$(parent)_1" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="-Furniture Catalogue: " >
-											<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="LEFT" offsetX="-40"/>
+											<Anchor point="LEFT" relativeTo="$(parent)" relativePoint="LEFT" offsetX="-40"/>
 										</Label>
 										<Label name="FurC_RecipeCount" font="$(STONE_TABLET_FONT)|24|soft-shadow-thick" mouseEnabled="true" resizeToFitDescendents="true">
 											<Anchor point="LEFT" 	relativeTo="$(parent)_1" relativePoint="RIGHT" offsetX="10" offsetY="1"/>
 											<OnMouseEnter>	FurC.GuiShowTooltip(self, "number of recipes below")</OnMouseEnter>
 											<OnMouseExit>	FurC.GuiHideTooltip(self)</OnMouseExit>
 											<OnMouseUp>FurC.RefreshCounter()</OnMouseUp>
-										</Label>
+										</Label>
 										<Label name="$(parent)_2" font="$(STONE_TABLET_FONT)|26|soft-shadow-thick" text=" entries -" >
-											<Anchor point="LEFT" relativeTo="FurC_RecipeCount" relativePoint="RIGHT" offsetY="-1"  />
+											<Anchor point="LEFT" relativeTo="FurC_RecipeCount" relativePoint="RIGHT" offsetY="-1"  />
 										</Label>
 									</Controls>
 								</Control>
@@ -57,22 +57,22 @@
 									<OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit>
 									<OnMouseUp>FurnitureCatalogue_Toggle()</OnMouseUp>
 									<Dimensions x="25" y="25" />
-									<Textures
+									<Textures
 										normal		="/esoui/art/buttons/decline_up.dds"
 										pressed		="/esoui/art/buttons/decline_down.dds"
 										mouseOver	="/esoui/art/buttons/decline_over.dds"
 									/>
 								</Button>
-
+
 								<Button name="$(parent)_Reload">
 									<Anchor point="TOPRIGHT" relativeTo="$(parent)_Hide" relativePoint="TOPLEFT" offsetX="-25" offsetY="-5"/>
 									<OnMouseEnter>FurC.GuiShowTooltip(self, "Click: Scan character knowledge to database\n\nRight-click: Re-scans data files\n\nMiddle-click: Re-create database (will ask you first)")</OnMouseEnter>
 									<OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit>
 									<OnMouseUp>FurC.GUIButtonRefreshOnMouseUp(self, button)</OnMouseUp>

-
+
 									<Dimensions x="35" y="35" />
-									<Textures
+									<Textures
 										normal		="/esoui/art/help/help_tabicon_feedback_up.dds"
 										pressed		="/esoui/art/help/help_tabicon_feedback_down.dds "
 										mouseOver	="/esoui/art/help/help_tabicon_feedback_over.dds"
@@ -83,89 +83,89 @@
 									<OnMouseEnter>FurC.GuiShowTooltip(self, "change template")</OnMouseEnter>
 									<OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit>
 									<OnMouseUp>FurC.ChangeTemplateFromButton(true)</OnMouseUp>
-
+
 									<Dimensions x="35" y="35" />
-									<Textures
+									<Textures
 										normal		="/esoui/art/buttons/minus_up.dds"
 										pressed		="/esoui/art/buttons/minus_down.dds"
 										mouseOver	="/esoui/art/buttons/minus_over.dds"
 									/>
 								</Button>
-
+
 								<Button name="$(parent)_TemplateLarge" hidden="true">
 									<Anchor point="TOPRIGHT" relativeTo="$(parent)_Reload" relativePoint="TOPLEFT" offsetX="-15" offsetY="-2"/>

 									<OnMouseEnter>FurC.GuiShowTooltip(self, "change template")</OnMouseEnter>
 									<OnMouseExit>FurC.GuiHideTooltip(self)</OnMouseExit>
 									<OnMouseUp>FurC.ChangeTemplateFromButton(false)</OnMouseUp>
-
+
 									<Dimensions x="35" y="35" />
-									<Textures
+									<Textures
 										normal		="/esoui/art/buttons/plus_up.dds"
 										pressed		="/esoui/art/buttons/plus_down.dds"
 										mouseOver	="/esoui/art/buttons/plus_over.dds"
 									/>
 								</Button>
-
+
 							</Controls>
 						</Control>
 						<Control name="$(parent)_Bar2">
 							<Anchor point="TOPLEFT" relativeTo="$(parent)_Bar1" relativePoint="BOTTOMLEFT" offsetX="20"/>
 							<Anchor point="TOPRIGHT" relativeTo="$(parent)_Bar1" relativePoint="BOTTOMRIGHT" offsetX="-20" />
 							<Dimensions y="35" />
-
+
 							<Controls>
 								<Control name="FurC_DropdownSource" inherits="ZO_ComboBox" mouseEnabled="true" >
-									<Anchor point="TOPLEFT" 	relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/>
+									<Anchor point="TOPLEFT" 	relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/>
 									<Dimensions x="230" y="28" />
 									<OnShow>		FurC.GuiSetupDropdown(self)</OnShow>
 									<OnMouseEnter>	FurC.GuiShowTooltip(self, "Filter: Knowledge and source", true)</OnMouseEnter>
 									<OnMouseExit>	FurC.GuiHideTooltip(self)</OnMouseExit>
-								</Control>
-
-								<Control name="FurC_QualityFilter" mouseEnabled="true">
-									<Anchor point="TOPLEFT" 	relativeTo="FurC_DropdownSource" relativePoint="TOPRIGHT" offsetX = "38" offsetY="3"/>
+								</Control>
+
+								<Control name="FurC_QualityFilter" mouseEnabled="true">
+									<Anchor point="TOPLEFT" 	relativeTo="FurC_DropdownSource" relativePoint="TOPRIGHT" offsetX = "38" offsetY="3"/>
 									<Anchor point="BOTTOMRIGHT" relativeTo="FurC_DropdownSource"  relativePoint="BOTTOMRIGHT" offsetX = "300" />
 								</Control>
-
+
 								<Control name="FurC_DropdownVersion" inherits="ZO_ComboBox" mouseEnabled="true" >
-									<Anchor point="TOPLEFT" 	relativeTo="FurC_QualityFilter" relativePoint="TOPRIGHT" offsetX="10"/>
+									<Anchor point="TOPLEFT" 	relativeTo="FurC_QualityFilter" relativePoint="TOPRIGHT" offsetX="10"/>
 									<Dimensions x="235" y="28" />
 									<OnShow>		FurC.GuiSetupDropdown(self)</OnShow>
 									<OnMouseEnter>	FurC.GuiShowTooltip(self, "Filter: game version", true)</OnMouseEnter>
 									<OnMouseExit>	FurC.GuiHideTooltip(self)</OnMouseExit>
-								</Control>
+								</Control>
 							</Controls>
 						</Control>
 						<!-- 3rd bar -->
 						<Control name="$(parent)_Bar3" mouseEnabled="true">
-
+
 							<Dimensions y="55" />
 							<Anchor point="TOPLEFT" relativeTo="$(parent)_Bar2" relativePoint="BOTTOMLEFT" offsetY="10"/>
 							<Anchor point="TOPRIGHT" relativeTo="$(parent)_Bar2" relativePoint="BOTTOMRIGHT"/>
 							<Dimensions y="45" />
 							<Controls>
-								<!-- control above: FurC_DropdownSource -->
+								<!-- control above: FurC_DropdownSource -->
 								<Control name="FurC_DropdownCharacter" inherits="ZO_ComboBox" mouseEnabled="true" >
-									<Anchor point="TOPLEFT" 	relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/>
-									<Dimensions x="230" y="28" />
+									<Anchor point="TOPLEFT" 	relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="9" offsetY="10"/>
+									<Dimensions x="230" y="28" />
 									<OnShow>		FurC.GuiSetupDropdown(self)</OnShow>
 									<OnMouseEnter>	FurC.GuiShowTooltip(self, "Filter: Character", true)</OnMouseEnter>
 									<OnMouseExit>	FurC.GuiHideTooltip(self)</OnMouseExit>
-								</Control>
-
+								</Control>
+
 								<!-- Crafting type filter -->
-								<Control name="FurC_TypeFilter" mouseEnabled="true" resizeToFitDescendents="true">
+								<Control name="FurC_TypeFilter" mouseEnabled="true" resizeToFitDescendents="true">
 									<Anchor point="TOPLEFT" relativeTo="FurC_DropdownCharacter" relativePoint="TOPRIGHT" offsetX="17" offsetY="-5" />
 									<Anchor point="BOTTOMRIGHT" relativeTo="FurC_DropdownCharacter" relativePoint="BOTTOMRIGHT" offsetX="340"/>
-
-								</Control>
-
-								<!-- control above: FurC_DropdownVersion -->
+
+								</Control>
+
+								<!-- control above: FurC_DropdownVersion -->
 								<Control name="FurC_Search" mouseEnabled="true">

-									<Anchor point="TOPLEFT" 	relativeTo="FurC_TypeFilter" relativePoint="TOPRIGHT" offsetX="9" offsetY="10"/>
-									<Anchor point="BOTTOMLEFT" 	relativeTo="FurC_TypeFilter" relativePoint="BOTTOMRIGHT" offsetX="9" />
+									<Anchor point="TOPLEFT" 	relativeTo="FurC_TypeFilter" relativePoint="TOPRIGHT" offsetX="9" offsetY="10"/>
+									<Anchor point="BOTTOMLEFT" 	relativeTo="FurC_TypeFilter" relativePoint="BOTTOMRIGHT" offsetX="9" />
 									<Dimensions x="215" />
 									<Controls>

@@ -178,19 +178,19 @@
 											<OnMouseUp>FurC.GuiOnSearchBoxClick(self, button)</OnMouseUp>
 											<OnMouseDoubleClick>FurC.GuiOnSearchBoxClick(self, nil, true)</OnMouseDoubleClick>
 											<OnFocusLost>FurC.GuiOnSearchBoxFocusOut(self)</OnFocusLost>
-
-										</EditBox>
+
+										</EditBox>
 									</Controls>
 								</Control>
-
-
-
-
-
+
+
+
+
+
 							</Controls>
-						</Control>
-
-
+						</Control>
+
+
 						<!-- #4, sorts the list holder -->
 						<Control name="$(parent)_SortBar" mouseEnabled="true">

@@ -207,14 +207,14 @@
 										<Button name="$(parent)_Button" verticalAlignment="LEFT"  mouseEnabled="true">
 											<Dimensions y="20"  x="20"/>
 											<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-25" />
-											<Textures
+											<Textures
 												normal="esoui/art/miscellaneous/list_sortheader_icon_neutral.dds"
 												mouseOver="esoui/art/miscellaneous/list_sortheader_icon_over.dds"
 											/>
 											</Button>
 									</Controls>
 								</Label>
-
+
 								<Label name="$(parent)_Quality" mouseEnabled="true" font="ZoFontGameSmall" text="Quality" >
 									<Anchor point="TOPLEFT" relativeTo="$(parent)_Name" relativePoint="TOPRIGHT" />
 									<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="BOTTOMRIGHT"/>
@@ -223,36 +223,36 @@
 										<Button name="$(parent)_Button" verticalAlignment="LEFT"  mouseEnabled="true">
 											<Dimensions y="20"  x="20"/>
 											<Anchor point="TOPLEFT" relativeTo="$(parent)" relativePoint="TOPLEFT" offsetX="-25" />
-											<Textures
+											<Textures
 												normal="esoui/art/miscellaneous/list_sortheader_icon_neutral.dds"
 												mouseOver="esoui/art/miscellaneous/list_sortheader_icon_over.dds"
 											/>
 										</Button>
 									</Controls>
-								</Label>
-
-
+								</Label>
+
+
 							</Controls>

 						</Control>

 					</Controls>
 				<!-- $(parent)_Header -->
-				</Control>
-
+				</Control>
+
 				<Label name="$(parent)_Wait" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="Please wait... loading data" >
-					<Anchor point="TOP" 	relativeTo="$(parent)_Header" 	relativePoint="BOTTOM" 	offsetY="35" />
+					<Anchor point="TOP" 	relativeTo="$(parent)_Header" 	relativePoint="BOTTOM" 	offsetY="35" />
 				</Label>
 				<Label name="$(parent)_Empty" font="$(STONE_TABLET_FONT)|28|soft-shadow-thick" text="No results, please check filter" hidden="true" >
-					<Anchor point="TOP" 	relativeTo="$(parent)_Header" 	relativePoint="BOTTOM" 	offsetY="35" />
+					<Anchor point="TOP" 	relativeTo="$(parent)_Header" 	relativePoint="BOTTOM" 	offsetY="35" />
 				</Label>
-
+
 				<Control name="$(parent)_ListHolder" mouseEnabled="true">
-
+
 					<DimensionConstraints  minY="52"/>
 					<Anchor point="TOPLEFT" 	relativeTo="$(parent)_Header" 	relativePoint="BOTTOMLEFT" 	offsetX="25" />
 					<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" 			relativePoint="BOTTOMRIGHT" offsetX="-35" offsetY="-20"/>
-
+
 					<OnMouseWheel>FurC.GuiOnScroll(self, delta)</OnMouseWheel>

 					<Controls>
@@ -270,7 +270,7 @@
 			</Controls>

 		</TopLevelControl>
-
+
 		<Button name="FurC_QualityFilterButton" virtual="true">
 			<Dimensions x="35" y="35" />
 			<OnMouseEnter>	FurC.GuiVirtualMouseOver(self)	</OnMouseEnter>
@@ -288,9 +288,9 @@
 			<Dimensions x="300"/>
 			<OnMouseEnter>			FurC.GuiLineOnMouseEnter(self)				</OnMouseEnter>
 			<OnMouseExit>			FurC.GuiLineOnMouseExit(self)				</OnMouseExit>
-			<OnMouseUp>				FurC.OnControlMouseUp(self, button)			</OnMouseUp>
-			<OnMouseDoubleClick>	FurC.OnControlDoubleClick(self) 			</OnMouseDoubleClick>
-
+			<OnMouseUp>				FurC.OnControlMouseUp(self, button)			</OnMouseUp>
+			<OnMouseDoubleClick>	FurC.OnControlDoubleClick(self) 			</OnMouseDoubleClick>
+
 			<Controls>
 				<Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds" alpha="0.4">
 					<AnchorFill />
@@ -315,14 +315,14 @@

 			</Controls>
 		</Control>
-
+
 		<Control name="FurC_SlotTemplateTiny" inherits="ZO_ListInventorySlotBehavior" virtual="true" mouseEnabled="true">
 			<Dimensions x="300" />
 			<OnMouseEnter>			FurC.GuiLineOnMouseEnter(self)				</OnMouseEnter>
 			<OnMouseExit>			FurC.GuiLineOnMouseExit(self)				</OnMouseExit>
-			<OnMouseUp>				FurC.OnControlMouseUp(self, button)			</OnMouseUp>
+			<OnMouseUp>				FurC.OnControlMouseUp(self, button)			</OnMouseUp>
 			<OnMouseDoubleClick>	FurC.OnControlDoubleClick(self) 			</OnMouseDoubleClick>
-
+
 			<Controls>
 				<Texture name="$(parent)Bg" textureFile="EsoUI/Art/Miscellaneous/listItem_backdrop.dds" alpha="0.4">
 					<AnchorFill />
@@ -346,11 +346,11 @@

 			</Controls>
 		</Control>
-
-		<Texture name="FurC_SlotIconKnownNo" color="FF0000" textureFile="esoui/art/buttons/decline_up.dds" virtual="true">
+
+		<Texture name="FurC_SlotIconKnownNo" color="FF0000" mouseEnabled="true" textureFile="esoui/art/buttons/decline_up.dds" virtual="true">
 			<Dimensions x="24" y="24" />
 		</Texture>
-		<Texture name="FurC_SlotIconKnownYes" color="00FF00" textureFile="esoui/art/cadwell/check.dds" virtual="true">
+		<Texture name="FurC_SlotIconKnownYes" color="00FF00" mouseEnabled="true" textureFile="esoui/art/cadwell/check.dds" virtual="true">
 			<Dimensions x="24" y="24" />
 		</Texture>
 <!--