Go to most recent revision |
Compare with Previous |
Blame |
View Log
DirectoryWindow = class(Turbine.UI.Lotro.Window);
function DirectoryWindow:Constructor(manager, optionsPanel)
Turbine.UI.Lotro.Window.Constructor(self);
self.manager = manager;
self.optionsPanel = optionsPanel;
self:SetResizable(true);
self:SetMinimumSize(460, 200);
local left, top = 20, 36;
local label = Turbine.UI.Label();
label:SetParent(self);
label:SetMultiline(true);
label:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
label:SetHeight(32);
label:SetFont(Turbine.UI.Lotro.Font.TrajanPro14);
label:SetForeColor(Turbine.UI.Color.PaleGoldenrod);
label:SetPosition(left, top);
self.instructions = label;
top = top + 32;
self.tabs = Thurallor.UI.TabCardStack();
self.tabs:SetParent(self);
self.tabs:SetPosition(left, top);
self.tab1 = BarsGroupsTab(manager, optionsPanel);
self.tab2 = Thurallor.UI.TabCard(true, true);
self.tabs:AddTabCard(self.tab1);
self.tabs:AddTabCard(self.tab2);
self:Localize();
self.tab1:BringToFront();
-- to do: load saved size / position
self:SetSize(460, 200);
DoCallbacks(self, "SizeChanged");
end
function DirectoryWindow:Localize()
self:SetText(L:GetText("/PluginManager/OptionsTab/Directory"));
local prevContext = L:SetContext("/DirectoryWindow");
self.instructions:SetText(L:GetText("Instructions"));
self.tab1:Localize();
-- self.tab2:Localize();
L:SetContext(prevContext);
self.tab2:SetTabText(L:GetText("/DirectoryWindow/EventHeading"));
self.tabs:RedistributeTabs();
end
function DirectoryWindow:SizeChanged()
local width, height = self:GetSize();
self.instructions:SetWidth(width - 40);
self.tabs:SetSize(width - 40, height - 96);
self.tabs:RedistributeTabs();
end
function DirectoryWindow:Show()
self:SetVisible(true);
end
function DirectoryWindow:Hide()
self:SetVisible(false);
end
function DirectoryWindow:Redraw()
if (self.tab1:IsInFront()) then
self.tab1:Redraw();
else
self.tab2:Redraw();
end
end
function DirectoryWindow:ContentSizeChanged()
self.instructions:SetWidth(self:GetWidth() - 40);
local top = self.barInstructions:GetTop() + self.barInstructions:GetHeight();
self.tree:SetPosition(0, top);
top = top + self.tree:GetHeight();
self.eventHeading:SetTop(top + 15);
top = top + 56;
self.eventInstructions:SetTop(top);
top = top + self.eventInstructions:GetHeight();
self.eventTable:SetPosition(0, top);
top = top + self.eventTable:GetHeight();
DoCallbacks(self, "HeightChanged", top);
end
Go to most recent revision |
Compare with Previous |
Blame
All times are GMT -5. The time now is 01:35 AM.