Added Book Count and fixed sort header colours
Jayden Platell [04-13-14 - 21:45]
Added Book Count and fixed sort header colours
diff --git a/Librarian.lua b/Librarian.lua
index 9faa899..2fe654e 100644
--- a/Librarian.lua
+++ b/Librarian.lua
@@ -10,6 +10,8 @@ ZO_CreateStringId("SI_LIBRARIAN_SORT_TYPE_TITLE", "Title")
ZO_CreateStringId("SI_LIBRARIAN_SORT_TYPE_WORD_COUNT", "Words")
ZO_CreateStringId("SI_LIBRARIAN_MARK_UNREAD", "Mark as Unread")
ZO_CreateStringId("SI_LIBRARIAN_MARK_READ", "Mark as Read")
+ZO_CreateStringId("SI_LIBRARIAN_CREDIT", "by Flamage")
+ZO_CreateStringId("SI_LIBRARIAN_BOOK_COUNT", "%d Books")
local SORT_ARROW_UP = "EsoUI/Art/Miscellaneous/list_sortUp.dds"
local SORT_ARROW_DOWN = "EsoUI/Art/Miscellaneous/list_sortDown.dds"
@@ -115,6 +117,9 @@ function Librarian:LayoutBooks()
for i, book in ipairs(self.savedVars.books) do
self:LayoutBook(i, book)
end
+
+ local bookCount = table.getn(self.savedVars.books)
+ LibrarianFrameBookCount:SetText(string.format(GetString(SI_LIBRARIAN_BOOK_COUNT), bookCount))
end
function Librarian:LayoutBook(i, book)
@@ -151,6 +156,7 @@ function Librarian:InitialiseSortHeader(control, name, tag)
control.tag = tag
local nameControl = GetControl(control, "Name")
nameControl:SetFont("ZoFontHeader")
+ nameControl:SetColor(ZO_NORMAL_TEXT:UnpackRGBA())
nameControl:SetText(GetString(name))
nameControl:SetHorizontalAlignment(alignment or TEXT_ALIGN_LEFT)
control.initialDirection = initialDirection or ZO_SORT_ORDER_DOWN
diff --git a/Librarian.xml b/Librarian.xml
index a292123..4ab8bce 100644
--- a/Librarian.xml
+++ b/Librarian.xml
@@ -32,7 +32,7 @@
</Label>
</Controls>
</Button>
- <Button name="SortHeader" virtual="true">
+ <Button name="LibrarianSortHeader" virtual="true">
<OnMouseUp>
Librarian:SortBy(self)
</OnMouseUp>
@@ -54,35 +54,35 @@
</Button>
<TopLevelControl name="LibrarianFrame" inherits="ZO_RightPanelFootPrint" hidden="true">
<Controls>
- <Label text="by Flamage" font="ZoFontGame" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_DISABLED">
- <Anchor point="TOPRIGHT" offsetX="-15" offsetY="-27" />
+ <Label name="$(parent)BookCount" font="ZoFontWindowTitle" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_SELECTED" modifyTextType="UPPERCASE">
+ <Anchor point="TOPRIGHT" offsetX="-15" offsetY="-40" />
</Label>
<Control name="$(parent)SortBy">
<Anchor point="TOPLEFT" relativeTo="$(parent)" offsetY="10" />
<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetY="0" />
<Controls>
- <Button name="$(parent)Unread" inherits="SortHeader">
+ <Button name="$(parent)Unread" inherits="LibrarianSortHeader">
<Dimensions x="90" y="20" />
<Anchor point="TOPLEFT" />
<OnInitialized>
Librarian:InitialiseSortHeader(self, SI_LIBRARIAN_SORT_TYPE_UNREAD, "Unread")
</OnInitialized>
</Button>
- <Button name="$(parent)Time" inherits="SortHeader">
+ <Button name="$(parent)Time" inherits="LibrarianSortHeader">
<Dimensions x="200" y="20" />
<Anchor point="TOPLEFT" offsetX="90" />
<OnInitialized>
Librarian:InitialiseSortHeader(self, SI_LIBRARIAN_SORT_TYPE_FOUND, "Found")
</OnInitialized>
</Button>
- <Button name="$(parent)Title" inherits="SortHeader">
+ <Button name="$(parent)Title" inherits="LibrarianSortHeader">
<Anchor point="TOPLEFT" relativeTo="$(parent)Time" relativePoint="TOPRIGHT" />
<Anchor point="BOTTOMRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetY="20" />
<OnInitialized>
Librarian:InitialiseSortHeader(self, SI_LIBRARIAN_SORT_TYPE_TITLE, "Title")
</OnInitialized>
</Button>
- <Button name="$(parent)WordCount" inherits="SortHeader">
+ <Button name="$(parent)WordCount" inherits="LibrarianSortHeader">
<Dimensions x="80" y="20" />
<Anchor point="TOPRIGHT" relativeTo="$(parent)" relativePoint="TOPRIGHT" offsetX="-10" />
<OnInitialized>
@@ -95,6 +95,12 @@
<Anchor point="TOPLEFT" relativeTo="$(parent)SortBy" relativePoint="BOTTOMLEFT" offsetY="30" />
<Anchor point="BOTTOMRIGHT" offsetX="-12" offsetY="0" />
</Control>
+ <Label name="$(parent)Credit" font="ZoFontGame" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_DISABLED">
+ <Anchor point="BOTTOMRIGHT" offsetX="-15" offsetY="27" />
+ <OnInitialized>
+ self:SetText(GetString(SI_LIBRARIAN_CREDIT))
+ </OnInitialized>
+ </Label>
</Controls>
</TopLevelControl>
</Controls>