lotrointerface.com
Search Downloads

LoTROInterface SVN Reminders

[/] [trunk/] [Thurallor/] [Reminders/] [UnexpectedBestowalDialog.lua] - Rev 8

Compare with Previous | Blame | View Log

UnexpectedBestowalDialog = class(Turbine.UI.Lotro.Window);

UnexpectedBestowalDialog.instances = {};

function UnexpectedBestowalDialog.GetInstance(window, questName, questSettings, charSettings, charID)
    if (UnexpectedBestowalDialog.instances[questName]) then
        return UnexpectedBestowalDialog.instances[questName];
    end
    return UnexpectedBestowalDialog(window, questName, questSettings, charSettings, charID);
end

function UnexpectedBestowalDialog:Constructor(window, questName, questSettings, charSettings, charID)
    Turbine.UI.Lotro.Window.Constructor(self);
    UnexpectedBestowalDialog.instances[questName] = self;
    self.questName = questName;
    self:SetVisible(true);
    
    local prevContext = L:SetContext("/UnexpectedBestowalDialog");
    self:SetText(L:GetText("Title"));

    local xmargin = 28;
    self:SetWidth(450);
    local width = self:GetWidth() - 2 * xmargin;
    local top = 39;

    local label = Turbine.UI.Label();
    label:SetFont(Turbine.UI.Lotro.Font.Verdana14);
    label:SetFontStyle(Turbine.UI.FontStyle.Outline);
    label:SetOutlineColor(Turbine.UI.Color.Black);
    label:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
    local text = L:GetText("Warning"):gsub("<quest>", questName);
    label:SetText(text);
    label:SetParent(self);
    label:SetPosition(xmargin, top);
    label:SetSize(width, 14 * L:GetNumber("WarningLines"));
    top = top + label:GetHeight() + 10;

    local buttonContainer = Turbine.UI.Control();
    buttonContainer:SetParent(self);
    buttonContainer:SetTop(top);

    self.settingsButton = Turbine.UI.Lotro.Button();
    self.settingsButton:SetParent(buttonContainer);
    self.settingsButton:SetFont(Turbine.UI.Lotro.Font.Verdana14);
    self.settingsButton:SetText(L:GetText("EditSettings"));
    self.settingsButton:AutoSize();
    local left = self.settingsButton:GetWidth();
    
    self.ignoreButton = Turbine.UI.Lotro.Button();
    self.ignoreButton:SetParent(buttonContainer);
    self.ignoreButton:SetFont(Turbine.UI.Lotro.Font.Verdana14);
    self.ignoreButton:SetText(L:GetText("Ignore"));
    self.ignoreButton:AutoSize();
    left = left + 4;
    self.ignoreButton:SetLeft(left);
    left = left + self.ignoreButton:GetWidth();

    buttonContainer:SetSize(left, self.settingsButton:GetHeight());
    buttonContainer:CenterHorizontally();
    top = top + buttonContainer:GetHeight();

    self:SetHeight(top + 20);
    CenterWindow(self);
    L:SetContext(prevContext);

    self.settingsButton.Click = function()
        local dialog = QuestRepeatedDialog.GetInstance(window, questName, questSettings, charSettings, charID);
        dialog:SetVisible(false);
        self.zoomer = Thurallor.UI.Zoomer(self, dialog);
        AddCallback(self.zoomer, "ZoomComplete", function()
            dialog:SetVisible(true);
            dialog:Activate();
        end);
        self:Close();
    end
    self.ignoreButton.Click = function()
        self:Close();
    end
end

function UnexpectedBestowalDialog:Closing()
    UnexpectedBestowalDialog.instances[self.questName] = nil;
end

Compare with Previous | Blame


All times are GMT -5. The time now is 07:06 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui