patch-ruRU-5 обновленный логин скрин и создание персонажа

This commit is contained in:
2026-03-15 16:26:18 +04:00
parent 2ae4f23a03
commit 0251953122
385 changed files with 24869 additions and 0 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,417 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
ADDON_BUTTON_HEIGHT = 16;
MAX_ADDONS_DISPLAYED = 19;
function UpdateAddonButton()
if ( GetNumAddOns() > 0 ) then
-- Check to see if any of them are out of date and not disabled
if ( IsAddonVersionCheckEnabled() and AddonList_HasOutOfDate() and not HasShownAddonOutOfDateDialog ) then
AddonDialog_Show("ADDONS_OUT_OF_DATE");
HasShownAddonOutOfDateDialog = true;
end
if ( AddonList_HasNewVersion() ) then
CharacterSelectAddonsButtonGlow:Show();
else
CharacterSelectAddonsButtonGlow:Hide();
end
CharacterSelectAddonsButton:Show();
else
CharacterSelectAddonsButton:Hide();
end
end
function AddonList_OnLoad(self)
-- Asegurarse de que offset se inicialice correctamente
if not self.offset then
self.offset = 0
end
end
function AddonList_Update()
local numEntrys = GetNumAddOns();
local name, title, notes, url, loadable, reason, security, newVersion;
local addonIndex;
local entry, checkbox, string, status, urlButton, securityIcon, versionButton;
-- Verificar que numEntrys sea un número válido
if not numEntrys then
numEntrys = 0
end
-- Get the character from the current list (nil is all characters)
local character = GlueDropDownMenu_GetSelectedValue(AddonCharacterDropDown);
if ( character == ALL ) then
character = nil;
end
local enabled, checkboxState;
for i=1, MAX_ADDONS_DISPLAYED do
addonIndex = AddonList.offset + i;
-- Verificar que addonIndex sea válido
if not addonIndex then
addonIndex = 0
end
entry = _G["AddonListEntry"..i];
if ( addonIndex > numEntrys ) then
entry:Hide();
else
name, title, notes, url, loadable, reason, security, newVersion = GetAddOnInfo(addonIndex);
-- Verificar que GetAddOnEnableState no retorne nil
checkboxState = GetAddOnEnableState(character, addonIndex);
if not checkboxState then
checkboxState = 0
end
enabled = (checkboxState > 0);
-- GetAddOnEnableState() returns 0, 1, 2 (disabled, enabled for some, enabled for all)
checkboxState = GetAddOnEnableState(character, addonIndex);
enabled = (checkboxState > 0);
checkbox = _G["AddonListEntry"..i.."Enabled"];
-- If some are enabled then set the checkbox to be gray
TriStateCheckbox_SetState(checkboxState, checkbox);
if ( checkboxState == 1 ) then
checkbox.tooltip = ENABLED_FOR_SOME;
else
checkbox.tooltip = nil;
end
string = _G["AddonListEntry"..i.."Title"];
if ( loadable or ( enabled and (reason == "DEP_DEMAND_LOADED" or reason == "DEMAND_LOADED") ) ) then
string:SetTextColor(1.0, 0.78, 0.0);
elseif ( enabled and reason ~= "DEP_DISABLED" ) then
string:SetTextColor(1.0, 0.1, 0.1);
else
string:SetTextColor(0.5, 0.5, 0.5);
end
if ( title ) then
string:SetText(title);
else
string:SetText(name);
end
urlButton = _G["AddonListEntry"..i.."URL"];
versionButton = _G["AddonListEntry"..i.."Update"];
if ( url ) then
if ( newVersion ) then
versionButton.tooltip = ADDON_UPDATE_AVAILABLE..CLICK_TO_LAUNCH_ADDON_URL..url;
versionButton.url = url;
versionButton:Show();
urlButton:Hide();
else
versionButton:Hide();
urlButton.tooltip = CLICK_TO_LAUNCH_ADDON_URL..url;
urlButton.url = url;
urlButton:Show();
end
else
versionButton:Hide();
urlButton:Hide();
end
securityIcon = _G["AddonListEntry"..i.."SecurityIcon"];
if ( security == "SECURE" ) then
AddonList_SetSecurityIcon(securityIcon, 1);
elseif ( security == "INSECURE" ) then
AddonList_SetSecurityIcon(securityIcon, 2);
elseif ( security == "BANNED" ) then
AddonList_SetSecurityIcon(securityIcon, 3);
end
_G["AddonListEntry"..i.."Security"].tooltip = _G["ADDON_"..security];
string = _G["AddonListEntry"..i.."Status"];
if ( reason ) then
string:SetText(_G["ADDON_"..reason]);
else
string:SetText("");
end
entry:SetID(addonIndex);
entry:Show();
end
end
-- ScrollFrame stuff
GlueScrollFrame_Update(AddonListScrollFrame, numEntrys, MAX_ADDONS_DISPLAYED, ADDON_BUTTON_HEIGHT);
end
function AddonTooltip_BuildDeps(...)
local deps = "";
for i=1, select("#", ...) do
if ( i == 1 ) then
deps = ADDON_DEPENDENCIES .. select(i, ...);
else
deps = deps..", "..select(i, ...);
end
end
return deps;
end
function AddonTooltip_Update(owner)
AddonTooltip.owner = owner;
local name, title, notes,_,_,_, security = GetAddOnInfo(owner:GetID());
if ( security == "BANNED" ) then
AddonTooltipTitle:SetText(ADDON_BANNED_TOOLTIP);
AddonTooltipNotes:SetText("");
AddonTooltipDeps:SetText("");
else
if ( title ) then
AddonTooltipTitle:SetText(title);
else
AddonTooltipTitle:SetText(name);
end
AddonTooltipNotes:SetText(notes);
AddonTooltipDeps:SetText(AddonTooltip_BuildDeps(GetAddOnDependencies(owner:GetID())));
end
local titleHeight = AddonTooltipTitle:GetHeight();
local notesHeight = AddonTooltipNotes:GetHeight();
local depsHeight = AddonTooltipDeps:GetHeight();
AddonTooltip:SetHeight(10+titleHeight+2+notesHeight+2+depsHeight+10);
end
function AddonList_OnKeyDown(key)
if ( key == "ESCAPE" ) then
AddonList_OnCancel();
elseif ( key == "ENTER" ) then
AddonList_OnOk();
elseif ( key == "PRINTSCREEN" ) then
Screenshot();
end
end
function AddonList_Enable(index, enabled)
local character = GlueDropDownMenu_GetSelectedValue(AddonCharacterDropDown);
if ( character == ALL ) then
character = nil;
end
if ( enabled ) then
EnableAddOn(character, index);
else
DisableAddOn(character, index);
end
AddonList_Update();
end
function AddonList_OnOk()
PlaySound("gsLoginChangeRealmOK");
SaveAddOns();
AddonList:Hide();
end
function AddonList_OnCancel()
PlaySound("gsLoginChangeRealmCancel");
ResetAddOns();
AddonList:Hide();
end
function AddonListScrollFrame_OnVerticalScroll(self, offset)
local scrollbar = _G[self:GetName().."ScrollBar"];
-- Verificar que offset no sea nil
if not offset then
offset = 0
end
scrollbar:SetValue(offset);
AddonList.offset = floor((offset / ADDON_BUTTON_HEIGHT) + 0.5);
-- Verificar que AddonList.offset no sea nil
if not AddonList.offset then
AddonList.offset = 0
end
AddonList_Update();
if ( AddonTooltip:IsShown() ) then
AddonTooltip_Update(AddonTooltip.owner);
end
end
function AddonList_OnShow()
AddonList_Update();
end
function AddonList_HasOutOfDate()
local hasOutOfDate = false;
for i=1, GetNumAddOns() do
local name, title, notes, url, loadable, reason = GetAddOnInfo(i);
if ( enabled and not loadable and reason == "INTERFACE_VERSION" ) then
hasOutOfDate = true;
break;
end
end
return hasOutOfDate;
end
function AddonList_SetSecurityIcon(texture, index)
local width = 64;
local height = 16;
local iconWidth = 16;
local increment = iconWidth/width;
local left = (index - 1) * increment;
local right = index * increment;
texture:SetTexCoord( left, right, 0, 1.0);
end
function AddonList_DisableOutOfDate()
for i=1, GetNumAddOns() do
local name, title, notes, url, loadable, reason = GetAddOnInfo(i);
if ( enabled and not loadable and reason == "INTERFACE_VERSION" ) then
DisableAddOn(i);
end
end
end
function AddonList_HasNewVersion()
local hasNewVersion = false;
for i=1, GetNumAddOns() do
local name, title, notes, url, loadable, reason, security, newVersion = GetAddOnInfo(i);
if ( newVersion ) then
hasNewVersion = true;
break;
end
end
return hasNewVersion;
end
AddonDialogTypes = { };
AddonDialogTypes["ADDONS_OUT_OF_DATE"] = {
text = ADDONS_OUT_OF_DATE,
button1 = DISABLE_ADDONS,
button2 = LOAD_ADDONS,
OnAccept = function()
AddonDialog_Show("CONFIRM_DISABLE_ADDONS");
end,
OnCancel = function()
AddonDialog_Show("CONFIRM_LOAD_ADDONS");
end,
}
AddonDialogTypes["CONFIRM_LOAD_ADDONS"] = {
text = CONFIRM_LOAD_ADDONS,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function()
SetAddonVersionCheck(0);
end,
OnCancel = function()
AddonDialog_Show("ADDONS_OUT_OF_DATE");
end,
}
AddonDialogTypes["CONFIRM_DISABLE_ADDONS"] = {
text = CONFIRM_DISABLE_ADDONS,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function()
AddonList_DisableOutOfDate();
end,
OnCancel = function()
AddonDialog_Show("ADDONS_OUT_OF_DATE");
end,
}
AddonDialogTypes["CONFIRM_LAUNCH_ADDON_URL"] = {
text = CONFIRM_LAUNCH_ADDON_URL,
button1 = OKAY,
button2 = CANCEL,
OnAccept = function()
LaunchAddOnURL(AddonList.selectedID);
end
}
function AddonDialog_Show(which, arg1)
-- Set the text of the dialog
if ( arg1 ) then
AddonDialogText:SetFormattedText(AddonDialogTypes[which].text, arg1);
else
AddonDialogText:SetText(AddonDialogTypes[which].text);
end
-- Set the buttons of the dialog
if ( AddonDialogTypes[which].button2 ) then
AddonDialogButton1:ClearAllPoints();
AddonDialogButton1:SetPoint("BOTTOMRIGHT", "AddonDialogBackground", "BOTTOM", -6, 16);
AddonDialogButton2:ClearAllPoints();
AddonDialogButton2:SetPoint("LEFT", "AddonDialogButton1", "RIGHT", 13, 0);
AddonDialogButton2:SetText(AddonDialogTypes[which].button2);
AddonDialogButton2:Show();
else
AddonDialogButton1:ClearAllPoints();
AddonDialogButton1:SetPoint("BOTTOM", "AddonDialogBackground", "BOTTOM", 0, 16);
AddonDialogButton2:Hide();
end
AddonDialogButton1:SetText(AddonDialogTypes[which].button1);
-- Set the miscellaneous variables for the dialog
AddonDialog.which = which;
-- Finally size and show the dialog
AddonDialogBackground:SetHeight(16 + AddonDialogText:GetHeight() + 8 + AddonDialogButton1:GetHeight() + 16);
AddonDialog:Show();
end
function AddonDialog_OnClick(index)
AddonDialog:Hide();
if ( index == 1 ) then
local OnAccept = AddonDialogTypes[AddonDialog.which].OnAccept;
if ( OnAccept ) then
OnAccept();
end
else
local OnCancel = AddonDialogTypes[AddonDialog.which].OnCancel;
if ( OnCancel ) then
OnCancel();
end
end
end
function AddonDialog_OnKeyDown(key)
if ( key == "PRINTSCREEN" ) then
Screenshot();
return;
end
if ( key == "ESCAPE" ) then
if ( AddonDialogButton2:IsShown() ) then
AddonDialogButton2:Click();
else
AddonDialogButton1:Click();
end
elseif (key == "ENTER" ) then
AddonDialogButton1:Click();
end
end
function AddonListCharacterDropDown_OnClick(self)
GlueDropDownMenu_SetSelectedValue(AddonCharacterDropDown, self.value);
AddonList_Update();
end
function AddonListCharacterDropDown_Initialize()
local selectedValue = GlueDropDownMenu_GetSelectedValue(AddonCharacterDropDown);
local info = GlueDropDownMenu_CreateInfo();
info.text = ALL;
info.value = ALL;
info.func = AddonListCharacterDropDown_OnClick;
if ( not selectedValue ) then
info.checked = 1;
end
GlueDropDownMenu_AddButton(info);
for i=1, GetNumCharacters() do
info.text = GetCharacterInfo(i);
info.value = GetCharacterInfo(i);
info.func = AddonListCharacterDropDown_OnClick;
if ( selectedValue == info.value ) then
info.checked = 1;
else
info.checked = nil;
end
GlueDropDownMenu_AddButton(info);
end
end
@@ -0,0 +1,831 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="AddonList.lua"/>
<Button name="AddonListButtonTemplate" virtual="true">
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<NormalTexture inherits="GluePanelButtonUpTexture">
<TexCoords left="0.025" right="0.535" top="0" bottom="0.75"/>
</NormalTexture>
<PushedTexture inherits="GluePanelButtonDownTexture">
<TexCoords left="0.025" right="0.535" top="0" bottom="0.75"/>
</PushedTexture>
<HighlightTexture inherits="GluePanelButtonHighlightTexture">
<TexCoords left="0.025" right="0.535" top="0" bottom="0.75"/>
</HighlightTexture>
</Button>
<Button name="AddonListEntryTemplate" virtual="true">
<Size>
<AbsDimension x="520" y="16"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTitle" inherits="GlueFontNormal" justifyH="LEFT">
<Size>
<AbsDimension x="220" y="12"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="42" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentStatus" inherits="GlueFontNormalSmall" justifyH="LEFT">
<Size>
<AbsDimension x="220" y="12"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTitle" relativePoint="RIGHT">
<Offset>
<AbsDimension x="30" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentSecurity" hidden="true">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="LEFT">
<Offset>
<AbsDimension x="2" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnEnter>
GlueTooltip_SetOwner(self);
GlueTooltip_SetText(self.tooltip);
</OnEnter>
<OnLeave>
GlueTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentIcon" file="Interface\Glues\CharacterSelect\Glues-AddOn-Icons"/>
</Button>
<CheckButton name="$parentEnabled">
<Size>
<AbsDimension x="22" y="22"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="8"/>
</HitRectInsets>
<Scripts>
<OnClick>
AddonList_Enable(self:GetParent():GetID(), self:GetChecked());
</OnClick>
<OnEnter>
if ( self.tooltip ) then
GlueTooltip_SetOwner(self);
GlueTooltip_SetText(self.tooltip);
end
</OnEnter>
<OnLeave>
GlueTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
<CheckedTexture name="$parentCheckedTexture" file="Interface\Buttons\UI-CheckBox-Check"/>
<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>
<Button name="$parentURL">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentTitle" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddonList.selectedID = AddonList.offset + self:GetID();
AddonDialog_Show("CONFIRM_LAUNCH_ADDON_URL", self.url);
</OnClick>
<OnEnter>
GlueTooltip_SetOwner(self);
GlueTooltip_SetText(self.tooltip);
</OnEnter>
<OnLeave>
GlueTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-GuildButton-PublicNote-Up"/>
<HighlightTexture name="$parentHighlightTexture" file="Interface\Buttons\UI-GuildButton-PublicNote-Up" alphaMode="ADD"/>
</Button>
<Button name="$parentUpdate">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentURL" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddonList.selectedID = AddonList.offset + self:GetParent():GetID();
AddonDialog_Show("CONFIRM_LAUNCH_ADDON_URL", self.url);
</OnClick>
<OnEnter>
GlueTooltip_SetOwner(self);
GlueTooltip_SetText(self.tooltip);
</OnEnter>
<OnLeave>
GlueTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentIcon" file="Interface\Glues\CharacterSelect\Glues-AddOn-Icons"/>
<HighlightTexture name="$parentIconHighlight" file="Interface\Glues\CharacterSelect\Glues-AddOn-Icons" alphaMode="ADD"/>
</Button>
</Frames>
<Scripts>
<OnLoad>
AddonList_SetSecurityIcon(_G[self:GetName().."UpdateIcon"], 4);
AddonList_SetSecurityIcon(_G[self:GetName().."UpdateIconHighlight"], 4);
</OnLoad>
<OnEnter>
AddonTooltip:SetPoint("TOPRIGHT", self, "TOPLEFT", -14, 0);
AddonTooltip_Update(self);
AddonTooltip:Show();
</OnEnter>
<OnLeave>
AddonTooltip:Hide();
</OnLeave>
</Scripts>
</Button>
<Frame name="AddonList" toplevel="true" parent="GlueParent" setAllPoints="true" enableMouse="true" enableKeyboard="true" frameStrata="DIALOG" hidden="true">
<Layers>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
<Color a="0.75" r="0" g="0" b="0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="AddonListBackground">
<Size>
<AbsDimension x="640" y="512"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="24" y="0"/>
</Offset>
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="44" top="0" bottom="13"/>
</HitRectInsets>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\tooltips\ui-tooltip-border-maw" tile="true">
<BackgroundInsets left="4" right="4" top="4" bottom="4"/>
<TileSize val="16"/>
<EdgeSize val="16"/>
<Color r="0" g="0" b="0" a="1"/>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<Texture name="AddonListHeader" file="Interface\DialogFrame\UI-DialogBox-Header" hidden="true">
<Size>
<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="-22" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString inherits="GlueFontNormalSmall" text="ADDON_LIST">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="AddonCharacterDropDown" inherits="GlueDropDownMenuTemplate">
<Size x="150" y="24"/>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background"
edgeFile="Interface\Tooltips\ui-tooltip-border-mawBlack"
tile="true">
<EdgeSize val="12"/>
<BackgroundInsets left="3" right="3" top="3" bottom="3"/>
<Color r="0" g="0" b="0" a="1"/>
</Backdrop>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="30" y="-38"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<FontString inherits="GlueFontNormalSmall" text="CONFIGURE_MODS_FOR">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="-4" y="25"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
GlueDropDownMenu_Initialize(self, AddonListCharacterDropDown_Initialize);
GlueDropDownMenu_SetSelectedValue(self, ALL);
local btn = _G[self:GetName().."Button"];
btn:ClearAllPoints();
btn:SetPoint("RIGHT", self, "RIGHT", -40, 0);
btn:SetSize(14, 14);
btn:SetNormalTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Up");
local text = _G[self:GetName().."Text"];
text:ClearAllPoints();
text:SetPoint("LEFT", self, "LEFT", 8, 1);
text:SetPoint("RIGHT", btn, "LEFT", -15, -2);
_G[self:GetName().."Left"]:Hide();
_G[self:GetName().."Middle"]:Hide();
_G[self:GetName().."Right"]:Hide();
</OnLoad>
</Scripts>
</Frame>
<Button name="AddonListCloseButton" inherits="GlueCloseButton">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-15" y="-15"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddonList_OnCancel();
</OnClick>
</Scripts>
</Button>
<CheckButton name="AddonListForceLoad">
<Size>
<AbsDimension x="22" y="22"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="50" y="-42"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<FontString inherits="GlueFontNormalSmall" text="ADDON_FORCE_LOAD">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="36" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnShow>
if ( IsAddonVersionCheckEnabled() ) then
self:SetChecked(0);
else
self:SetChecked(1);
end
</OnShow>
<OnClick>
if ( self:GetChecked() ) then
SetAddonVersionCheck(0);
else
SetAddonVersionCheck(1);
end
AddonList_Update();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>
<Button name="AddonListEntry1" inherits="AddonListEntryTemplate" id="1">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="37" y="-80"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry2" inherits="AddonListEntryTemplate" id="2">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry1" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry3" inherits="AddonListEntryTemplate" id="3">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry2" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry4" inherits="AddonListEntryTemplate" id="4">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry3" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry5" inherits="AddonListEntryTemplate" id="5">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry4" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry6" inherits="AddonListEntryTemplate" id="6">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry5" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry7" inherits="AddonListEntryTemplate" id="7">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry6" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry8" inherits="AddonListEntryTemplate" id="8">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry7" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry9" inherits="AddonListEntryTemplate" id="9">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry8" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry10" inherits="AddonListEntryTemplate" id="10">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry9" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry11" inherits="AddonListEntryTemplate" id="11">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry10" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry12" inherits="AddonListEntryTemplate" id="12">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry11" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry13" inherits="AddonListEntryTemplate" id="13">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry12" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry14" inherits="AddonListEntryTemplate" id="14">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry13" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry15" inherits="AddonListEntryTemplate" id="15">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry14" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry16" inherits="AddonListEntryTemplate" id="16">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry15" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry17" inherits="AddonListEntryTemplate" id="17">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry16" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry18" inherits="AddonListEntryTemplate" id="18">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry17" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<Button name="AddonListEntry19" inherits="AddonListEntryTemplate" id="19">
<Anchors>
<Anchor point="TOP" relativeTo="AddonListEntry18" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="0" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</Button>
<ScrollFrame name="AddonListScrollFrame" inherits="GlueScrollFrameTemplate">
<Size>
<AbsDimension x="510" y="390"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="49" y="-73"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentScrollBarTop" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="256"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-2" y="5"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.484375" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentScrollBarBottom" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="106"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-2" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.515625" right="1.0" top="0" bottom="0.4140625"/>
</Texture>
<Texture name="$parentScrollBarMiddle" file="Interface\PaperDollInfoFrame\UI-Character-ScrollBar">
<Size>
<AbsDimension x="31" y="60"/>
</Size>
<Anchors>
<Anchor point="TOP" relativeTo="$parentScrollBarTop" relativePoint="BOTTOM"/>
<Anchor point="BOTTOM" relativeTo="$parentScrollBarBottom" relativePoint="TOP"/>
</Anchors>
<TexCoords left="0" right="0.484375" top=".75" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnVerticalScroll>
AddonListScrollFrame_OnVerticalScroll(self, offset);
</OnVerticalScroll>
</Scripts>
<ScrollChild>
<Frame name="AddonListScrollFrameScrollChildFrame">
<Size>
<AbsDimension x="510" y="395"/>
</Size>
</Frame>
</ScrollChild>
</ScrollFrame>
<Button name="AddonListDisableAllButton" inherits="AddonListButtonTemplate" text="DISABLE_ALL_ADDONS">
<Size>
<AbsDimension x="160" y="45"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="16" y="13"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local character = GlueDropDownMenu_GetSelectedValue(AddonCharacterDropDown);
if ( character == ALL ) then
character = nil;
end
DisableAllAddOns(character);
AddonList_Update();
</OnClick>
</Scripts>
</Button>
<Button name="AddonListEnableAllButton" inherits="AddonListButtonTemplate" text="ENABLE_ALL_ADDONS">
<Size>
<AbsDimension x="160" y="45"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="AddonListDisableAllButton" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
local character = GlueDropDownMenu_GetSelectedValue(AddonCharacterDropDown);
if ( character == ALL ) then
character = nil;
end
EnableAllAddOns(character);
AddonList_Update();
</OnClick>
</Scripts>
</Button>
<Button name="AddonListCancelButton" inherits="GlueDialogButtonTemplate" text="CANCEL">
<Size>
<AbsDimension x="125" y="45"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-10" y="13"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddonList_OnCancel();
</OnClick>
</Scripts>
</Button>
<Button name="AddonListOkButton" inherits="GlueDialogButtonTemplate" text="OKAY">
<Size>
<AbsDimension x="125" y="45"/>
</Size>
<Anchors>
<Anchor point="RIGHT" relativeTo="AddonListCancelButton" relativePoint="LEFT">
<Offset>
<AbsDimension x="8" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
AddonList_OnOk();
</OnClick>
</Scripts>
</Button>
</Frames>
</Frame>
</Frames>
<Scripts>
<OnLoad>
AddonList_OnLoad(self);
</OnLoad>
<OnKeyDown>
AddonList_OnKeyDown(key);
</OnKeyDown>
<OnShow>
AddonList_OnShow();
</OnShow>
</Scripts>
</Frame>
<Frame name="AddonTooltip" frameStrata="TOOLTIP" hidden="true">
<Size>
<AbsDimension x="220" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="AddonListBackground" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="6" y="-4"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\tooltips\ui-tooltip-border-maw" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentTitle" inherits="GlueFontNormal" justifyH="LEFT">
<Size>
<AbsDimension x="200" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-10"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentNotes" inherits="GlueFontNormalSmall" justifyH="LEFT">
<Size>
<AbsDimension x="200" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<Color r="1.0" g="1.0" b="1.0"/>
</FontString>
<FontString name="$parentDeps" inherits="GlueFontNormalSmall" justifyH="LEFT">
<Size>
<AbsDimension x="200" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentNotes" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(1.0, 1.0, 1.0);
self:SetBackdropColor(0.09, 0.09, 0.19 );
</OnLoad>
</Scripts>
</Frame>
<Button name="AddonDialogButtonTemplate" virtual="true">
<Size>
<AbsDimension x="200" y="40"/>
</Size>
<Scripts>
<OnClick>
AddonDialog_OnClick(self:GetID());
</OnClick>
</Scripts>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<NormalTexture inherits="GluePanelButtonUpTexture"/>
<PushedTexture inherits="GluePanelButtonDownTexture"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTexture"/>
</Button>
<Frame name="AddonDialog" toplevel="true" parent="GlueParent" setAllPoints="true" enableMouse="true" enableKeyboard="true" frameStrata="DIALOG" hidden="true">
<Frames>
<Frame name="AddonDialogBackground">
<Size>
<AbsDimension x="512" y="256"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\tooltips\ui-tooltip-border-maw" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="32"/>
</TileSize>
<EdgeSize>
<AbsValue val="32"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="AddonDialogText" inherits="GlueFontNormalLarge">
<Size>
<AbsDimension x="440" y="0"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-16"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="AddonDialogButton1" inherits="AddonDialogButtonTemplate" id="1"/>
<Button name="AddonDialogButton2" inherits="AddonDialogButtonTemplate" id="2"/>
</Frames>
</Frame>
</Frames>
<Scripts>
<OnShow>
self:Raise();
</OnShow>
<OnKeyDown>
AddonDialog_OnKeyDown(key);
</OnKeyDown>
</Scripts>
</Frame>
</Ui>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,792 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="CharacterCreate.lua"/>
<Frame name="CharacterCreateTooltip" frameStrata="TOOLTIP" hidden="true" parent="GlueParent" inherits="GlueTooltipTemplate">
<Scripts>
<OnLoad>
GlueTooltip_SetFont(self, CharacterCreateTooltipFont);
self:SetBackdropBorderColor(1.0, 1.0, 1.0);
self:SetBackdropColor(0.09, 0.09, 0.19 );
</OnLoad>
</Scripts>
</Frame>
<CheckButton name="CharacterCreateIconButtonTemplate" virtual="true" motionScriptsWhileDisabled="true">
<Size x="38" y="38"/>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentDisableTexture" hidden="true">
<Size x="38" y="38"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
</Scripts>
</CheckButton>
<CheckButton name="CharacterCreateRaceButtonTemplate" inherits="CharacterCreateIconButtonTemplate" virtual="true">
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GlueFontNormalSmall">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP" x="0" y="2"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnClick>
if( self.enable ) then
CharacterRace_OnClick(self, self:GetID());
CharacterCreateTooltip:Hide();
end
</OnClick>
<OnEnter>
-- GlueTooltip_SetOwner(self, CharacterCreateTooltip, -3, -5);
-- GlueTooltip_SetText(self.tooltip, CharacterCreateTooltip);
</OnEnter>
<OnLeave>
-- CharacterCreateTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Glues\CharacterCreate\UI-CHARACTERCREATE-RACES-ClASS">
<Size x="50" y="50"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</NormalTexture>
<PushedTexture name="$parentPushedTexture" file="Interface\Glues\CharacterCreate\UI-CHARACTERCREATE-RACES-ClASS">
<Size x="50" y="50"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</PushedTexture>
</CheckButton>
<CheckButton name="CharacterCreateClassButtonTemplate" inherits="CharacterCreateIconButtonTemplate" virtual="true">
<Scripts>
<OnClick>
if( self.enable ) then
CharacterClass_OnClick(self:GetID());
CharacterCreateTooltip:Hide();
end
</OnClick>
<OnEnter>
-- GlueTooltip_SetOwner(self, CharacterCreateTooltip, -3, -5);
-- GlueTooltip_SetText(self.tooltip, CharacterCreateTooltip);
</OnEnter>
<OnLeave>
-- CharacterCreateTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Glues\CharacterCreate\UI-CHARACTERCREATE-RACES-ClASS">
<Size x="52" y="52"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</NormalTexture>
<PushedTexture name="$parentPushedTexture" file="Interface\Glues\CharacterCreate\UI-CHARACTERCREATE-RACES-ClASS">
<Size x="52" y="52"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</PushedTexture>
</CheckButton>
<CheckButton name="CharacterCreateGenderButtonTemplate" inherits="CharacterCreateIconButtonTemplate" virtual="true">
<Scripts>
<OnEnter>
-- GlueTooltip_SetOwner(self, CharacterCreateTooltip, -3, -5);
-- GlueTooltip_SetText(MALE, CharacterCreateTooltip);
</OnEnter>
<OnLeave>
-- CharacterCreateTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Glues\CharacterCreate\UI-CharacterCreate-Gender_Round">
<Size x="38" y="38"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</NormalTexture>
<PushedTexture name="$parentPushedTexture" file="Interface\Glues\CharacterCreate\UI-CharacterCreate-Gender_Round">
<Size x="38" y="38"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</PushedTexture>
</CheckButton>
<Frame name="CharacterCustomizationFrameTemplate" virtual="true">
<Size>
<AbsDimension x="230" y="32"/>
</Size>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentBackground" file="Interface\Glues\CharacterCreate\charactercreate">
<Size>
<AbsDimension x="150" y="34"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<TexCoords left="0.508300781" right="0.656738281" top="0.244140625" bottom="0.279296875"/>
</Texture>
<FontString name="$parentText" inherits="GlueFontHighlightSmall">
<Anchors>
<Anchor point="CENTER" x="0" y="2"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="$parentRightButton">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="RIGHT" x="0" y="0"/>
</Anchors>
<Scripts>
<OnLoad>
self:GetNormalTexture():SetTexCoord(0.937500000, 0.976562500, 0.445312500, 0.462890625);
self:GetPushedTexture():SetTexCoord(0.716796875, 0.755859375, 0.537109375, 0.554687500);
</OnLoad>
<OnClick>
CharacterCustomization_Right(self:GetParent():GetID());
</OnClick>
</Scripts>
<NormalTexture file="Interface\Glues\Common\perks"/>
<PushedTexture file="Interface\Glues\Common\perks"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
<Button name="$parentLeftButton">
<Size x="24" y="24"/>
<Anchors>
<Anchor point="LEFT" x="0" y="0"/>
</Anchors>
<Scripts>
<OnLoad>
self:GetNormalTexture():SetTexCoord(0.936523438, 0.975585938, 0.200195313, 0.217773438);
self:GetPushedTexture():SetTexCoord(0.934570313, 0.973632813, 0.375000000, 0.392578125);
</OnLoad>
<OnClick>
CharacterCustomization_Left(self:GetParent():GetID());
</OnClick>
</Scripts>
<NormalTexture file="Interface\Glues\Common\perks"/>
<PushedTexture file="Interface\Glues\Common\perks"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD"/>
</Button>
</Frames>
</Frame>
<ModelFFX name="CharacterCreate" toplevel="true" parent="GlueParent" setAllPoints="true" enableKeyboard="true" hidden="true">
<Frames>
<Frame name="CharacterCreateFrame" setAllPoints="true" enableMouse="true">
<Frames>
<Frame name="CharacterCreateWoWLogo" hidden="true">
<Size x="256" y="128"/>
<Anchors>
<Anchor point="TOPRIGHT" x="-9" y="0"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="CharacterCreateLogo" file="Interface\Glues\Common\Glues-WoW-WotLKLogo" hidden="true">
<Size x="256" y="128"/>
<Anchors>
<Anchor point="TOP" relativePoint="TOPLEFT" x="128" y="0"/>
</Anchors>
</Texture>
</Layer>
</Layers>
</Frame>
<Frame name="CharacterCreateCharacterRace" hidden="true">
<Size x="267" y="287"/>
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateWoWLogo" relativePoint="BOTTOM" x="-5" y="5"/>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="CharacterCreateRaceIcon" file="Interface\Glues\CharacterCreate\UI-CharacterCreate-RacesRound">
<Size x="48" y="48"/>
<Anchors>
<Anchor point="TOPLEFT" x="4" y="-4"/>
</Anchors>
<TexCoords left="0" right="0.375" top="0" bottom="0.75"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture file="Interface\Glues\CharacterCreate\UI-CharacterCreate-InfoBox" setAllPoints="true">
<TexCoords left="0.005859375" right="0.52734375" top="0.005859375" bottom="0.56640625"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="CharacterCreateRaceLabel" inherits="FactionName_Shadow_Huge" justifyH="LEFT" text="RACE">
<Size x="220" y="0"/>
<Anchors>
<Anchor point="TOP" x="40" y="-10"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background">
<BackgroundInsets>
<AbsInset left="12" right="3" top="20" bottom="6"/>
</BackgroundInsets>
</Backdrop>
<Frames>
<ScrollFrame name="CharacterCreateRaceScrollFrame" inherits="GlueScrollFrameTemplate">
<Size x="220" y="220"/>
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-55"/>
</Anchors>
<Scripts>
<OnLoad>
CharacterCreateRaceScrollFrameScrollBar:ClearAllPoints();
CharacterCreateRaceScrollFrameScrollBar:SetPoint("TOPLEFT", CharacterCreateRaceScrollFrame, "TOPRIGHT", 7, 4);
CharacterCreateRaceScrollFrameScrollBar:SetPoint("BOTTOMLEFT", CharacterCreateRaceScrollFrame, "BOTTOMRIGHT", 7, 12);
GlueScrollFrame_OnScrollRangeChanged(self, yrange);
</OnLoad>
<OnScrollRangeChanged>
GlueScrollFrame_OnScrollRangeChanged(self, yrange);
</OnScrollRangeChanged>
</Scripts>
<ScrollChild>
<Frame name="CharacterCreateRaceScrollChild">
<Size x="220" y="10"/>
<Layers>
<Layer level="BACKGROUND">
<FontString name="CharacterCreateRaceAbilityText" inherits="GlueFontNormalSmall" justifyH="LEFT">
<Size x="220" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" x="0" y="0"/>
</Anchors>
</FontString>
<FontString name="CharacterCreateRaceText" inherits="GlueFontCharacterCreate" justifyH="LEFT">
<Size x="220" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CharacterCreateRaceAbilityText" relativePoint="BOTTOMLEFT" x="0" y="-2"/>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
</ScrollChild>
</ScrollFrame>
</Frames>
</Frame>
<Frame name="CharacterCreateCharacterClass" hidden="true">
<Size x="267" y="287"/>
<Anchors>
<Anchor point="TOP" relativeTo="CharacterCreateCharacterRace" relativePoint="BOTTOM" x="-5" y="-5"/>
</Anchors>
<Layers>
<Layer level="BORDER">
<Texture name="CharacterCreateClassIcon" file="Interface\TargetingFrame\UI-Classes-Circles" hidden="">
<Size x="48" y="48"/>
<Anchors>
<Anchor point="TOPLEFT" x="4" y="-4"/>
</Anchors>
<TexCoords left="0" right="0.375" top="0" bottom="0.75"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<Texture file="Interface\Glues\CharacterCreate\UI-CharacterCreate-InfoBox" setAllPoints="true">
<TexCoords left="0.005859375" right="0.52734375" top="0.005859375" bottom="0.56640625"/>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="CharacterCreateClassLabel" inherits="FactionName_Shadow_Huge" justifyH="LEFT" text="RACE">
<Size x="220" y="0"/>
<Anchors>
<Anchor point="TOP" x="40" y="-10"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background">
<BackgroundInsets>
<AbsInset left="12" right="3" top="20" bottom="6"/>
</BackgroundInsets>
</Backdrop>
<Frames>
<ScrollFrame name="CharacterCreateClassScrollFrame" inherits="GlueScrollFrameTemplate">
<Size x="220" y="220"/>
<Anchors>
<Anchor point="TOPLEFT" x="20" y="-55"/>
</Anchors>
<Scripts>
<OnLoad>
CharacterCreateClassScrollFrameScrollBar:ClearAllPoints();
CharacterCreateClassScrollFrameScrollBar:SetPoint("TOPLEFT", CharacterCreateClassScrollFrame, "TOPRIGHT", 7, 4);
CharacterCreateClassScrollFrameScrollBar:SetPoint("BOTTOMLEFT", CharacterCreateClassScrollFrame, "BOTTOMRIGHT", 7, 12);
GlueScrollFrame_OnScrollRangeChanged(self, yrange);
</OnLoad>
<OnScrollRangeChanged>
GlueScrollFrame_OnScrollRangeChanged(self, yrange);
</OnScrollRangeChanged>
</Scripts>
<ScrollChild>
<Frame name="CharacterCreateClassScrollChild">
<Size x="220" y="10"/>
<Layers>
<Layer level="BACKGROUND">
<FontString name="CharacterCreateClassRolesText" inherits="GlueFontNormalSmall" justifyH="LEFT">
<Size x="220" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" x="0" y="0"/>
</Anchors>
</FontString>
<FontString name="CharacterCreateClassText" inherits="GlueFontCharacterCreate" justifyH="LEFT">
<Size x="220" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CharacterCreateClassRolesText" relativePoint="BOTTOMLEFT" x="0" y="-2"/>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
</ScrollChild>
</ScrollFrame>
</Frames>
</Frame>
<Frame name="CharacterCreateConfigurationFrame">
<Size x="256" y="758"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CharacterCreateFrame" relativePoint="TOPLEFT" x="9" y="-5"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="CharacterCreateConfigurationBackground" file="Interface\Tooltips\UI-Tooltip-Background" hidden="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="CharacterCreateOuterBorder1" relativePoint="TOPLEFT" x="10" y="-8"/>
<Anchor point="BOTTOMRIGHT" relativeTo="CharacterCreateOuterBorder3" relativePoint="BOTTOMRIGHT" x="-10" y="8"/>
</Anchors>
</Texture>
</Layer>
<Layer level="OVERLAY">
<FontString name="CharacterCreateGender" inherits="CharacterCreateTooltipFont" hidden="true">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP" x="0" y="-388"/>
</Anchors>
<Color r="1.0" g="0.78" b="0"/>
</FontString>
<FontString name="CharacterCreateClassName" inherits="CharacterCreateTooltipFont" hidden="true">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP" x="0" y="-456"/>
</Anchors>
<Color r="1.0" g="0.78" b="0"/>
</FontString>
</Layer>
</Layers>
<Frames>
<!-- Frame contenedor para botones de raza -->
<Frame name="CharacterCreateRaceButtonsContainer">
<Size x="1000" y="600"/>
<Anchors>
<Anchor point="CENTER" relativePoint="CENTER" x="0" y="0"/>
</Anchors>
<Frames>
<CheckButton name="CharacterCreateRaceButton1" inherits="CharacterCreateRaceButtonTemplate" id="1"/>
<CheckButton name="CharacterCreateRaceButton2" inherits="CharacterCreateRaceButtonTemplate" id="2"/>
<CheckButton name="CharacterCreateRaceButton3" inherits="CharacterCreateRaceButtonTemplate" id="3"/>
<CheckButton name="CharacterCreateRaceButton4" inherits="CharacterCreateRaceButtonTemplate" id="4"/>
<CheckButton name="CharacterCreateRaceButton5" inherits="CharacterCreateRaceButtonTemplate" id="5"/>
<CheckButton name="CharacterCreateRaceButton6" inherits="CharacterCreateRaceButtonTemplate" id="6"/>
<CheckButton name="CharacterCreateRaceButton7" inherits="CharacterCreateRaceButtonTemplate" id="7"/>
<CheckButton name="CharacterCreateRaceButton8" inherits="CharacterCreateRaceButtonTemplate" id="8"/>
<CheckButton name="CharacterCreateRaceButton9" inherits="CharacterCreateRaceButtonTemplate" id="9"/>
<CheckButton name="CharacterCreateRaceButton10" inherits="CharacterCreateRaceButtonTemplate" id="10"/>
</Frames>
</Frame>
<!-- Frame contenedor para botones de género -->
<Frame name="CharacterCreateGenderButtonsContainer">
<Size x="200" y="50"/>
<Anchors>
<Anchor point="CENTER" relativePoint="CENTER" x="0" y="-250"/>
</Anchors>
<Frames>
<CheckButton name="CharacterCreateGenderButtonMale" inherits="CharacterCreateGenderButtonTemplate">
<Scripts>
<OnLoad>
_G[self:GetName().."NormalTexture"]:SetTexCoord(0, 0.5, 0, 1.0);
_G[self:GetName().."PushedTexture"]:SetTexCoord(0, 0.5, 0, 1.0);
</OnLoad>
<OnClick>
PlaySound("gsCharacterCreationClass");
if ( GetSelectedSex() ~= SEX_MALE ) then
SetCharacterGender(SEX_MALE);
end
</OnClick>
<OnEnter>
GlueTooltip_SetOwner(self, CharacterCreateTooltip, -70, 5);
GlueTooltip_SetText(MALE, CharacterCreateTooltip);
</OnEnter>
<OnLeave>
CharacterCreateTooltip:Hide();
</OnLeave>
</Scripts>
</CheckButton>
<CheckButton name="CharacterCreateGenderButtonFemale" inherits="CharacterCreateGenderButtonTemplate">
<Scripts>
<OnLoad>
_G[self:GetName().."NormalTexture"]:SetTexCoord(0.5, 1.0, 0, 1.0);
_G[self:GetName().."PushedTexture"]:SetTexCoord(0.5, 1.0, 0, 1.0);
</OnLoad>
<OnClick>
PlaySound("gsCharacterCreationClass");
if ( GetSelectedSex() ~= SEX_FEMALE ) then
SetCharacterGender(SEX_FEMALE);
end
</OnClick>
<OnEnter>
GlueTooltip_SetOwner(self, CharacterCreateTooltip, -70, 5);
GlueTooltip_SetText(FEMALE, CharacterCreateTooltip);
</OnEnter>
<OnLeave>
CharacterCreateTooltip:Hide();
</OnLeave>
</Scripts>
</CheckButton>
</Frames>
</Frame>
<!-- Frame contenedor para botones de clase -->
<Frame name="CharacterCreateClassButtonsContainer">
<Size x="900" y="100"/>
<Anchors>
<Anchor point="BOTTOM" relativePoint="BOTTOM" x="0" y="50"/>
</Anchors>
<Frames>
<CheckButton name="CharacterCreateClassButton1" inherits="CharacterCreateClassButtonTemplate" id="1"/>
<CheckButton name="CharacterCreateClassButton2" inherits="CharacterCreateClassButtonTemplate" id="2"/>
<CheckButton name="CharacterCreateClassButton3" inherits="CharacterCreateClassButtonTemplate" id="3"/>
<CheckButton name="CharacterCreateClassButton4" inherits="CharacterCreateClassButtonTemplate" id="4"/>
<CheckButton name="CharacterCreateClassButton5" inherits="CharacterCreateClassButtonTemplate" id="5"/>
<CheckButton name="CharacterCreateClassButton6" inherits="CharacterCreateClassButtonTemplate" id="6"/>
<CheckButton name="CharacterCreateClassButton7" inherits="CharacterCreateClassButtonTemplate" id="7"/>
<CheckButton name="CharacterCreateClassButton8" inherits="CharacterCreateClassButtonTemplate" id="8"/>
<CheckButton name="CharacterCreateClassButton9" inherits="CharacterCreateClassButtonTemplate" id="9"/>
<CheckButton name="CharacterCreateClassButton10" inherits="CharacterCreateClassButtonTemplate" id="10"/>
</Frames>
</Frame>
<!-- Frames de personalización independientes -->
<Frame name="CharacterCustomizationButtonFrame1" inherits="CharacterCustomizationFrameTemplate" id="1">
<Anchors>
<Anchor point="CENTER" x="900" y="150"/>
</Anchors>
</Frame>
<Frame name="CharacterCustomizationButtonFrame2" inherits="CharacterCustomizationFrameTemplate" id="2">
<Anchors>
<Anchor point="CENTER" x="900" y="100"/>
</Anchors>
</Frame>
<Frame name="CharacterCustomizationButtonFrame3" inherits="CharacterCustomizationFrameTemplate" id="3">
<Anchors>
<Anchor point="CENTER" x="900" y="50"/>
</Anchors>
</Frame>
<Frame name="CharacterCustomizationButtonFrame4" inherits="CharacterCustomizationFrameTemplate" id="4">
<Anchors>
<Anchor point="CENTER" x="900" y="00"/>
</Anchors>
</Frame>
<Frame name="CharacterCustomizationButtonFrame5" inherits="CharacterCustomizationFrameTemplate" id="5">
<Anchors>
<Anchor point="CENTER" x="900" y="-50"/>
</Anchors>
</Frame>
</Frames>
</Frame>
<EditBox name="CharacterCreateNameEdit" inherits="GlueDark_EditBoxTemplate" letters="12">
<Size x="156" y="40"/>
<Anchors>
<Anchor point="BOTTOM" x="0" y="55"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString inherits="GlueFontNormalLarge" text="NAME">
<Size x="256" y="64"/>
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP" x="0" y="-13"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEscapePressed>
CharacterCreate_Back();
</OnEscapePressed>
<OnEnterPressed>
CharacterCreate_Okay();
</OnEnterPressed>
</Scripts>
<TextInsets>
<AbsInset left="15" right="12" top="8" bottom="8"/>
</TextInsets>
</EditBox>
<Button name="CharacterCreateRandomName" inherits="GlueButtonSmallTemplate" text="RANDOMIZE" hidden="true">
<Size x="146" y="30"/>
<Anchors>
<Anchor point="LEFT" relativeTo="CharacterCreateNameEdit" relativePoint="RIGHT" x="-30" y="35"/>
</Anchors>
<Scripts>
<OnLoad>
self:SetWidth(self:GetTextWidth() + 50);
</OnLoad>
<OnClick>
CharacterCreateNameEdit:SetText(GetRandomName());
PlaySound("gsCharacterCreationLook");
</OnClick>
</Scripts>
</Button>
<Button name="CharCreateRandomizeButton" inherits="GlueButtonSmallTemplate" text="RANDOMIZE" hidden="true">
<Size x="146" y="30"/>
<Anchors>
<Anchor point="CENTER" x="280" y="-100"/>
</Anchors>
<Scripts>
<OnClick>
CharacterCreate_Randomize();
</OnClick>
<OnUpdate>
CharacterCreate_DeathKnightSwap(self);
</OnUpdate>
</Scripts>
</Button>
<Button name="CharacterCreateRotateLeft">
<Size x="36" y="36"/>
<Anchors>
<Anchor point="CENTER" x="250" y="200"/>
</Anchors>
<HitRectInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</HitRectInsets>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp");
</OnLoad>
<OnClick>
PlaySound("igInventoryRotateCharacter");
</OnClick>
<OnUpdate>
CharacterCreateRotateLeft_OnUpdate(self);
</OnUpdate>
</Scripts>
<NormalTexture file="Interface\Glues\CharacterCreate\UI-RotationRight-Big-Up">
<TexCoords left="1.0" right="0" top="0" bottom="1.0"/>
</NormalTexture>
<PushedTexture file="Interface\Glues\CharacterCreate\UI-RotationRight-Big-Down">
<TexCoords left="1.0" right="0" top="0" bottom="1.0"/>
</PushedTexture>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
<Size x="30" y="30"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</HighlightTexture>
</Button>
<Button name="CharacterCreateRotateRight">
<Size x="36" y="36"/>
<Anchors>
<Anchor point="CENTER" x="300" y="200"/>
</Anchors>
<HitRectInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</HitRectInsets>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown", "LeftButtonUp");
</OnLoad>
<OnClick>
PlaySound("igInventoryRotateCharacter");
</OnClick>
<OnUpdate>
CharacterCreateRotateRight_OnUpdate(self);
</OnUpdate>
</Scripts>
<NormalTexture file="Interface\Glues\CharacterCreate\UI-RotationRight-Big-Up"/>
<PushedTexture file="Interface\Glues\CharacterCreate\UI-RotationRight-Big-Down"/>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
<Size x="30" y="30"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</HighlightTexture>
</Button>
<Button name="CharacterCreateRotateLeft30">
<Size x="28" y="28"/>
<Anchors>
<Anchor point="CENTER" x="350" y="200"/>
</Anchors>
<HitRectInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</HitRectInsets>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown");
</OnLoad>
<OnClick>
PlaySound("igInventoryRotateCharacter");
CharacterCreate_RotateLeft30();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Glues\CharacterCreate\charactercreate">
<TexCoords left="0.256347656" right="0.294921875" top="0.921386719" bottom="0.956542969"/>
</NormalTexture>
<PushedTexture file="Interface\Glues\CharacterCreate\charactercreate">
<TexCoords left="0.218261719" right="0.256835938" top="0.921386719" bottom="0.957031250"/>
</PushedTexture>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
<Size x="30" y="30"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</HighlightTexture>
</Button>
<Button name="CharacterCreateRotateRight30">
<Size x="28" y="28"/>
<Anchors>
<Anchor point="CENTER" x="400" y="200"/>
</Anchors>
<HitRectInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</HitRectInsets>
<Scripts>
<OnLoad>
self:RegisterForClicks("LeftButtonDown");
</OnLoad>
<OnClick>
PlaySound("igInventoryRotateCharacter");
CharacterCreate_RotateRight30();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Glues\CharacterCreate\charactercreate">
<TexCoords left="0.256835938" right="0.295410156" top="0.958007813" bottom="0.994140625"/>
</NormalTexture>
<PushedTexture file="Interface\Glues\CharacterCreate\charactercreate">
<TexCoords left="0.218750000" right="0.257324219" top="0.958007813" bottom="0.994140625"/>
</PushedTexture>
<HighlightTexture file="Interface\Buttons\UI-Common-MouseHilight" alphaMode="ADD">
<Size x="30" y="30"/>
<Anchors>
<Anchor point="CENTER" x="0" y="0"/>
</Anchors>
</HighlightTexture>
</Button>
<Button name="CharCreatePersonalizeButton" inherits="GlueButtonTemplate" text="CHARACTER_CREATE_CUSTOMIZE">
<Anchors>
<Anchor point="BOTTOMRIGHT" x="-40" y="20"/>
</Anchors>
<Size x="150" y="50"/>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentIcon" file="Interface\Glues\Common\Arrow">
<Size x="20" y="20"/>
<Anchors>
<Anchor point="RIGHT" x="-13" y="2"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
CharacterCreate_TogglePersonalization();
</OnClick>
</Scripts>
</Button>
<Button name="CharCreateOkayButton" inherits="GlueButtonTemplate" text="CHARACTER_CREATE_ACCEPT" hidden="true">
<Size x="150" y="50"/>
<Anchors>
<Anchor point="BOTTOMRIGHT" x="-40" y="20"/>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentIcon" file="Interface\Glues\Common\Arrow">
<Size x="20" y="20"/>
<Anchors>
<Anchor point="RIGHT" x="-30" y="2"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
CharacterCreate_Okay();
</OnClick>
</Scripts>
</Button>
<Button name="CharCreateBackButton" inherits="GlueButtonTemplate" text="BACK">
<Size x="150" y="50"/>
<Anchors>
<Anchor point="BOTTOMLEFT" x="40" y="20"/>
</Anchors>
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentIcon" file="Interface\Glues\Common\Arrow">
<Size x="20" y="20"/>
<Anchors>
<Anchor point="LEFT" x="38" y="2"/>
</Anchors>
<TexCoords left="1.0" right="0.0" top="0.0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
CharacterCreate_Back();
</OnClick>
<OnUpdate>
CharacterCreate_DeathKnightSwap(self);
</OnUpdate>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnMouseDown>
CharacterCreateFrame_OnMouseDown(button);
</OnMouseDown>
<OnMouseUp>
CharacterCreateFrame_OnMouseUp(button);
</OnMouseUp>
<OnUpdate>
CharacterCreateFrame_OnUpdate();
</OnUpdate>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad>
CharacterCreate_OnLoad(self);
</OnLoad>
<OnShow>
CharacterCreate_OnShow();
CharacterCreateRandomName:Show();
</OnShow>
<OnHide>
CharacterCreate_OnHide();
</OnHide>
<OnChar>
CharacterCreate_OnChar();
</OnChar>
<OnKeyDown>
CharacterCreate_OnKeyDown(key);
</OnKeyDown>
<OnUpdateModel>
CharacterCreate_UpdateModel(self);
</OnUpdateModel>
</Scripts>
</ModelFFX>
</Ui>
@@ -0,0 +1,375 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
-- Contiene las estructuras de datos para las razas y clases del juego
--ES
local Races_Informations = {
[1] = {
Name = "Humano",
Description = "Los humanos son una raza joven y, por lo tanto, muy versátil. Dominan las artes del combate, la artesanía y la magia con una eficacia sorprendente. Su valor y optimismo los han llevado a levantar algunos de los reinos más espléndidos del mundo. En esta turbulenta era, tras generaciones de conflictos, los humanos quieren recuperar la gloria que los distinguió otrora y forjarse un nuevo y brillante futuro.",
Spell_1 = {name = "Cada Hombre por Sí Mismo", icon = "spell_shadow_charm", description = "Elimina todos los efectos que impiden el movimiento y todos los efectos que provocan pérdida de control de tu personaje."},
Spell_2 = {name = "Especialización con Espadas", icon = "ability_meleedamage", description = "La pericia con Espadas y Espadas de Dos Manos aumenta en 3."},
Spell_3 = {name = "Especialización con Mazas", icon = "inv_hammer_05", description = "La pericia con Mazas y Mazas de Dos Manos aumenta en 3."},
Spell_4 = {name = "El Espíritu Humano", icon = "inv_enchant_shardbrilliantsmall", description = "Espíritu aumentado en un 3%."},
Spell_5 = {name = "Percepción", icon = "spell_nature_sleep", description = "Aumenta tu detección de Sigilo."},
Spell_6 = {name = "Diplomacia", icon = "inv_misc_note_02", description = "La ganancia de reputación aumenta en un 10%."},
},
[2] = {
Name = "Enano",
Description = "En el pasado, los enanos solo se preocupaban por las riquezas extraídas de las entrañas de la tierra. Fue así como hallaron vestigios de una raza divina que, según parece, les dio vida... y derecho de nacimiento encantado. Impulsados a aprender más por este descubrimiento, los enanos se consagraron a la búsqueda de artefactos perdidos y el conocimiento arcano. Hoy en día, hay arqueólogos enanos repartidos por todo el mundo.",
Spell_1 = {name = "Especialización con Mazas", icon = "inv_hammer_05", description = "La pericia con Mazas y Mazas de Dos Manos aumenta en 5."},
Spell_2 = {name = "Forma de Piedra", icon = "spell_shadow_unholystrength", description = "Elimina todos los efectos de veneno, enfermedad y sangrado, además aumenta tu armadura en un 10% durante 0.1 segundos."},
Spell_3 = {name = "Especialización con Armas de Fuego", icon = "inv_musket_03", description = "Tu probabilidad de golpe crítico con Armas de Fuego aumenta en un 1%."},
Spell_4 = {name = "Resistencia a la Escarcha", icon = "spell_frost_wizardmark", description = "Reduce la probabilidad de ser alcanzado por hechizos de Escarcha en un 2%."},
Spell_5 = {name = "Detectar Tesoro", icon = "racial_dwarf_findtreasure", description = "Permite al enano percibir tesoros cercanos, mostrándolos en el minimapa. Dura hasta cancelación."},
},
[3] = {
Name = "Elfo de la Noche",
Description = "Hace diez mil años, los elfos de la noche fundaron un vasto imperio, pero el uso imprudente de la magia primaria los llevó a la ruina. Consternados, se retiraron a los bosques donde se aislaron hasta el regreso de su antiguo enemigo: la Legión Ardiente. Entonces no tuvieron más opción que abandonar su reclusión y luchar por su lugar en el nuevo mundo.",
Spell_1 = {name = "Fusión en las Sombras", icon = "ability_ambush", description = "Actívalo para deslizarte en las sombras, reduciendo la probabilidad de ser detectado por los enemigos. Dura hasta ser cancelado o al moverte. Al cancelarse, toda la amenaza se restaura contra enemigos aún en combate."},
Spell_2 = {name = "Elusividad", icon = "ability_racial_ultravision", description = "Reduce la probabilidad de ser detectado mientras estás en Sigilo o en Fusión en las Sombras."},
Spell_3 = {name = "Resistencia a la Naturaleza", icon = "spell_nature_spiritarmor", description = "Reduce la probabilidad de ser alcanzado por hechizos de Naturaleza en un 2%."},
Spell_4 = {name = "Presteza", icon = "ability_racial_shadowmeld", description = "Reduce en un 2% la probabilidad de ser alcanzado por ataques cuerpo a cuerpo y a distancia."},
Spell_5 = {name = "Espíritu de Fuego Fatuo", icon = "spell_nature_wispsplode", description = "Te transformas en un fuego fatuo al morir, aumentando tu velocidad en un 75%."},
},
[4] = {
Name = "Gnomo",
Description = "A pesar de su baja estatura, los gnomos de Khaz Modan usaron su prodigioso intelecto para asegurarse un lugar en la Historia. Sin ninguna duda, su reino subterráneo, Gnomeregan, era una maravilla de la tecnología a vapor. Pero así y todo, perdieron la ciudad durante una invasión masiva de troggs. Ahora, los creadores de esta maravilla vagan por las tierras de los enanos, ayudándoles lo mejor que pueden.",
Spell_1 = {name = "Artista del Escape", icon = "ability_rogue_trip", description = "Escapas de cualquier efecto que te inmovilice o reduzca tu velocidad de movimiento."},
Spell_2 = {name = "Resistencia Arcana", icon = "spell_nature_wispsplode", description = "Reduce la probabilidad de ser alcanzado por hechizos Arcanos en un 2%."},
Spell_3 = {name = "Mente Expansiva", icon = "inv_enchant_essenceeternallarge", description = "Intelecto aumentado en un 5%."},
Spell_4 = {name = "Especialización en Ingeniería", icon = "inv_misc_gear_01", description = "Habilidad en Ingeniería aumentada en 15."},
},
[5] = {
Name = "Draenei",
Description = "Lejos de su hogar, Argus, los honorables draenei huyeron de la Legión Ardiente durante eones antes de encontrar un planeta remoto donde asentarse. Compartieron ese mundo con los chamanísticos orcos y lo llamaron Draenor. Con el tiempo, la Legión corrompió a los orcos, quienes hicieron la guerra y casi exterminaron a los pacíficos draenei. Unos pocos afortunados escaparon y llegaron a Azeroth donde ahora buscan aliados en su batalla contra la Legión Ardiente.",
Spell_1 = {name = "Don de los Naaru", icon = "spell_holy_holyprotection", description = "Sana al objetivo durante 15 seg. La cantidad de sanación aumenta con tu poder de ataque."},
Spell_2 = {name = "Tallado de Gemas", icon = "spell_misc_conjuremanajewel", description = "Habilidad en Joyería aumentada en 5."},
Spell_3 = {name = "Presencia Heroica", icon = "inv_helmet_21", description = "Aumenta la probabilidad de acierto con todos los ataques y hechizos en un 1% para ti y todos los miembros de tu grupo en un radio de 30 m."},
Spell_4 = {name = "Resistencia a las Sombras", icon = "spell_shadow_detectinvisibility", description = "Reduce la probabilidad de ser alcanzado por hechizos de Sombras en un 2%."},
},
[6] = {
Name = "Orco",
Description = "La raza de los orcos es originaria del planeta Draenor. Este pueblo pacífico, de creencias chamánicas, fue esclavizado por la Legión Ardiente y forzado a participar en la guerra contra los humanos de Azeroth. Aunque tuvieron que pasar muchos años, al final escaparon de la corrupción de los demonios y recuperaron su libertad. A día de hoy, luchan por su honor en un mundo que los odia y desprecia.",
Spell_1 = {name = "Furia Sangrienta", icon = "racial_orc_berserkerstrength", description = "Aumenta el poder de ataque en un 6%. Dura 15 seg."},
Spell_2 = {name = "Mando", icon = "ability_warrior_warcry", description = "El daño infligido por las mascotas aumenta en un 5%."},
Spell_3 = {name = "Dureza", icon = "inv_helmet_23", description = "La duración de los aturdimientos se reduce un 15% adicional."},
Spell_4 = {name = "Especialización con Hachas", icon = "inv_axe_02", description = "La pericia con Armas de Puño, Hachas y Hachas de Dos Manos aumenta en 5."},
},
[7] = {
Name = "No Muerto",
Description = "Fuera del alcance del Rey Exánime, los Renegados buscan la manera de derrocarlo. El alma en pena Sylvanas lidera su sed de venganza contra la Plaga. Los humanos ahora también son el enemigo, implacables en su intento de purgar de no-muertos el mundo. A los Renegados les importan poco incluso sus aliados; para ellos, la Horda no es más que una herramienta para promover sus oscuros planes.",
Spell_1 = {name = "Canibalismo", icon = "ability_racial_cannibalize", description = "Al activarse, regenera un 7% de la salud total cada 2 seg durante 10 seg. Solo funciona con cadáveres humanoides o no muertos a 5 m."},
Spell_2 = {name = "Voluntad de los Renegados", icon = "spell_shadow_raisedead", description = "Elimina cualquier efecto de Encantamiento, Miedo o Sueño. Este efecto comparte un tiempo de reutilización de 45 seg con otros similares."},
Spell_3 = {name = "Resistencia a las Sombras", icon = "spell_shadow_detectinvisibility", description = "Reduce la probabilidad de ser alcanzado por hechizos de Sombras en un 2%."},
Spell_4 = {name = "Respiración Subacuática", icon = "spell_shadow_demonbreath", description = "La duración de la respiración bajo el agua aumenta un 233%."},
},
[8] = {
Name = "Tauren",
Description = "Los tauren se esfuerzan continuamente para preservar el equilibrio de la Naturaleza y respetar los deseos de la diosa que veneran, la Madre Tierra. Hace poco fueron atacados por mortíferos centauros y habrían sido aniquilados si no hubiese sido por un encuentro fortuito con los orcos, que les ayudaron a derrotar a los intrusos. Para hacer honor a esta deuda de sangre, los tauren se unieron a la Horda, afianzando la amistad de ambas razas.",
Spell_1 = {name = "Pisotón de Guerra", icon = "ability_warstomp", description = "Aturde hasta 5 enemigos en un radio de 8 m durante 2 seg."},
Spell_2 = {name = "Resistencia", icon = "spell_nature_unyeildingstamina", description = "La salud base aumenta en un 5%."},
Spell_3 = {name = "Resistencia a la Naturaleza", icon = "spell_nature_spiritarmor", description = "Reduce la probabilidad de ser alcanzado por hechizos de Naturaleza en un 2%."},
Spell_4 = {name = "Cultivo", icon = "inv_misc_flower_01", description = "Habilidad en Herboristería aumentada en 15."},
},
[9] = {
Name = "Trol",
Description = "Los fieros trols de la tribu Lanza Negra habitaban las junglas de la Vega de Tuercespina hasta que facciones guerreras los expulsaron de allí. Con el tiempo, los trols entablaron amistad con la Horda de los orcos y Thrall, el joven Jefe de Guerra orco, los convenció para que viajasen con él a Kalimdor. A pesar de su inherente herencia oscura, los trols de la tribu Lanza Negra ocupan un lugar privilegiado en la Horda.",
Spell_1 = {name = "Rabiar", icon = "racial_troll_berserk", description = "Aumenta tu velocidad de ataque y lanzamiento en un 20% durante 10 seg."},
Spell_2 = {name = "Regeneración", icon = "spell_nature_regenerate", description = "La tasa de regeneración de salud aumenta en un 10%. El 10% de la regeneración total continúa durante el combate."},
Spell_3 = {name = "Asesino de Bestias", icon = "inv_misc_pelt_bear_ruin_02", description = "El daño infligido contra Bestias aumenta en un 5%."},
Spell_4 = {name = "Especialización en Armas Arrojadizas", icon = "inv_throwingaxe_03", description = "Tu probabilidad de golpe crítico con armas arrojadizas aumenta en un 1%."},
Spell_5 = {name = "Especialización con Arcos", icon = "inv_weapon_bow_12", description = "Tu probabilidad de golpe crítico con Arcos aumenta en un 1%."},
Spell_6 = {name = "El Vudú Zalamero", icon = "inv_misc_idol_02", description = "Reduce la duración de todos los efectos que impiden el movimiento en un 15%. ¡Los trolls siempre se escapan, mon!"},
},
[10] = {
Name = "Elfo de Sangre",
Description = "Hace mucho tiempo, los elfos nobles exiliados fundaron Quel'Thalas y allí crearon una fuente mágica, La Fuente del Sol. A pesar de que sus poderes los fortalecieron, desarrollaron una fuerte adicción a ellos.\n\nAños más tarde, la Plaga de los no-muertos destruyó La Fuente del Sol y casi la totalidad de la población de elfos nobles. Ahora, conocidos como los elfos de sangre, estos refugiados dispersos intentan reconstruir Quel'Thalas a la par que buscan una nueva fuente mágica que calme su dolorosa adicción.",
Spell_1 = {name = "Torrente Arcano", icon = "spell_shadow_teleport", description = "Silencia a todos los enemigos en un radio de 8 m durante 2 seg y restaura un 6% de tu maná. Además, interrumpe el lanzamiento de hechizos de objetivos que no sean jugadores durante 3 seg."},
Spell_2 = {name = "Afinidad Arcana", icon = "inv_enchant_shardglimmeringlarge", description = "Habilidad en Encantamiento aumentada en 10."},
Spell_3 = {name = "Resistencia Mágica", icon = "spell_shadow_antimagicshell", description = "Reduce la probabilidad de ser alcanzado por hechizos en un 2%."},
},
}
local Class_Informations = {
[1] = {
Name = "Guerrero",
Description = "Los guerreros son los maestros del combate cuerpo a cuerpo, capaces de usar una gran variedad de armas y armaduras. Su fuerza y resistencia los convierten en tanques formidables, capaces de proteger a sus aliados mientras infligen daño devastador a sus enemigos.",
Roles = "Daño cuerpo a cuerpo, Tanque.",
},
[2] = {
Name = "Paladín",
Description = "Los paladines son guerreros sagrados que combinan el combate cuerpo a cuerpo con la magia divina. Dedicados a la justicia y la protección de los inocentes, pueden sanar aliados, protegerlos con bendiciones y castigar a los malvados con poder sagrado.",
Roles = "Daño cuerpo a cuerpo, Tanque, Sanador.",
},
[3] = {
Name = "Cazador",
Description = "Los cazadores son maestros del combate a distancia y la supervivencia en la naturaleza. Acompañados por sus fieles compañeros animales, pueden rastrear enemigos, tender trampas y atacar desde la distancia con arcos y armas de fuego.",
Roles = "Daño a distancia.",
},
[4] = {
Name = "Pícaro",
Description = "Los pícaros son maestros del sigilo y el engaño, capaces de moverse sin ser detectados y atacar desde las sombras. Su agilidad y destreza les permiten infligir daño crítico letal, mientras evitan los ataques enemigos con movimientos ágiles.",
Roles = "Daño cuerpo a cuerpo.",
},
[5] = {
Name = "Sacerdote",
Description = "Los sacerdotes son maestros de la magia divina, dedicados a sanar y proteger a sus aliados. Aunque también pueden canalizar poderes sombríos, su verdadera fuerza radica en su capacidad para restaurar la vida y brindar protección espiritual.",
Roles = "Daño a distancia, Sanador.",
},
[6] = {
Name = "Caballero de la Muerte",
Description = "Los caballeros de la muerte son guerreros no muertos que han dominado las artes necrománticas. Una vez sirvientes del Rey Exánime, ahora luchan con su propia voluntad, combinando habilidades marciales con magia sombría y poderes sobre la muerte.",
Roles = "Daño cuerpo a cuerpo, Tanque.",
},
[7] = {
Name = "Chamán",
Description = "Los chamanes son intermediarios entre el mundo espiritual y el físico, capaces de canalizar los elementos y comunicarse con los espíritus. Pueden sanar a sus aliados, invocar tótems poderosos y desatar la furia de los elementos sobre sus enemigos.",
Roles = "Daño cuerpo a cuerpo, Daño a distancia, Sanador.",
},
[8] = {
Name = "Mago",
Description = "Los magos son maestros de las artes arcanas, capaces de canalizar poderosos hechizos elementales. Aunque frágiles físicamente, su dominio de la magia los convierte en una fuerza devastadora en el campo de batalla, capaces de controlar el hielo, el fuego y las fuerzas arcanas.",
Roles = "Daño a distancia.",
},
[9] = {
Name = "Brujo",
Description = "Los brujos han hecho pactos con fuerzas demoníacas para obtener poder. Maestros de la magia sombría y vil, pueden invocar demonios, drenar la vida de sus enemigos y canalizar energías corruptoras para devastar el campo de batalla.",
Roles = "Daño a distancia.",
},
[10] = {
Name = "Druida",
Description = "Los druidas son guardianes de la naturaleza, capaces de transformarse en diferentes formas animales. Su versatilidad les permite cumplir múltiples roles: pueden sanar como sacerdotes, tanquear como guerreros, o infligir daño como magos, todo mientras mantienen su conexión con el mundo natural.",
Roles = "Daño cuerpo a cuerpo, Daño a distancia, Tanque, Sanador.",
},
};
local RaceTooltipPositions = {
Alliance = {
[1] = { -- Humano
high = {point = "TOPLEFT", relPoint = "TOPRIGHT", x = 20, y = 20},
low = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -80},
veryLow = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -180},
default = {point = "LEFT", relPoint = "RIGHT", x = 20, y = 0}
},
[2] = { -- Enano
high = {point = "TOPLEFT", relPoint = "TOPRIGHT", x = 20, y = 40},
low = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -60},
veryLow = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -140},
default = {point = "LEFT", relPoint = "RIGHT", x = 20, y = 20}
},
[3] = { -- Elfo de la noche
high = {point = "TOPLEFT", relPoint = "TOPRIGHT", x = 20, y = 20},
low = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -80},
veryLow = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -180},
default = {point = "LEFT", relPoint = "RIGHT", x = 20, y = 0}
},
[4] = { -- Gnomo
high = {point = "TOPLEFT", relPoint = "TOPRIGHT", x = 20, y = 40},
low = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -60},
veryLow = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -140},
default = {point = "LEFT", relPoint = "RIGHT", x = 20, y = 20}
},
[5] = { -- Draenei
high = {point = "TOPLEFT", relPoint = "TOPRIGHT", x = 20, y = 20},
low = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -80},
veryLow = {point = "BOTTOMLEFT", relPoint = "TOPRIGHT", x = 20, y = -180},
default = {point = "LEFT", relPoint = "RIGHT", x = 20, y = 0}
}
},
Horde = {
[6] = { -- Orco
high = {point = "TOPRIGHT", relPoint = "TOPLEFT", x = -20, y = 20},
veryLow = {point = "BOTTOMRIGHT", relPoint = "TOPLEFT", x = -20, y = -120},
default = {point = "RIGHT", relPoint = "LEFT", x = -20, y = 0}
},
[7] = { -- No-muerto
high = {point = "TOPRIGHT", relPoint = "TOPLEFT", x = -20, y = 40},
veryLow = {point = "BOTTOMRIGHT", relPoint = "TOPLEFT", x = -20, y = -80},
default = {point = "RIGHT", relPoint = "LEFT", x = -20, y = 20}
},
[8] = { -- Tauren
high = {point = "TOPRIGHT", relPoint = "TOPLEFT", x = -20, y = 20},
veryLow = {point = "BOTTOMRIGHT", relPoint = "TOPLEFT", x = -20, y = -120},
default = {point = "RIGHT", relPoint = "LEFT", x = -20, y = 0}
},
[9] = { -- Trol
high = {point = "TOPRIGHT", relPoint = "TOPLEFT", x = -20, y = 40},
veryLow = {point = "BOTTOMRIGHT", relPoint = "TOPLEFT", x = -20, y = -80},
default = {point = "RIGHT", relPoint = "LEFT", x = -20, y = 20}
},
[10] = { -- Elfo de sangre
high = {point = "TOPRIGHT", relPoint = "TOPLEFT", x = -20, y = 20},
veryLow = {point = "BOTTOMRIGHT", relPoint = "TOPLEFT", x = -20, y = -120},
default = {point = "RIGHT", relPoint = "LEFT", x = -20, y = 0}
}
}
}
function GetRaceTooltipPosition(raceID, button)
local screenHeight = GetScreenHeight()
local buttonTop = button:GetTop()
local buttonBottom = button:GetBottom()
local faction = raceID <= 5 and "Alliance" or "Horde"
local positions = RaceTooltipPositions[faction][raceID]
if not positions then
return {point = "CENTER", relPoint = "CENTER", x = 0, y = 0}
end
if buttonTop > screenHeight * 0.66 then
return positions.high
elseif buttonBottom < screenHeight * 0.44 and positions.low then
return positions.low
elseif buttonBottom < screenHeight * 0.33 and positions.veryLow then
return positions.veryLow
else
return positions.default
end
end
local RACE_DATA = {
[1] = { glueString = "HUMAN", faction = "Alliance" },
[2] = { glueString = "DWARF", faction = "Alliance" },
[3] = { glueString = "NIGHT_ELF", faction = "Alliance" },
[4] = { glueString = "GNOME", faction = "Alliance" },
[5] = { glueString = "DRAENEI", faction = "Alliance" },
[6] = { glueString = "ORC", faction = "Horde" },
[7] = { glueString = "UNDEAD", faction = "Horde" },
[8] = { glueString = "TAUREN", faction = "Horde" },
[9] = { glueString = "TROLL", faction = "Horde" },
[10] = { glueString = "BLOOD_ELF", faction = "Horde" },
}
local ALLIANCE_RACES = {1, 2, 3, 4, 5}
local HORDE_RACES = {6, 7, 8, 9, 10}
local function GetRaceName(raceID)
local raceData = RACE_DATA[raceID]
if not raceData then
return "Human"
end
return _G[raceData.glueString] or raceData.glueString
end
local function GetFactionForRaceID(raceID)
local raceData = RACE_DATA[raceID]
return raceData and raceData.faction or "Alliance"
end
local function GetRaceNamesByFaction(faction)
local names = {}
local raceList = (faction == "Alliance") and ALLIANCE_RACES or HORDE_RACES
for _, raceID in ipairs(raceList) do
table.insert(names, GetRaceName(raceID))
end
return names
end
local AllianceRaces = GetRaceNamesByFaction("Alliance")
local HordeRaces = GetRaceNamesByFaction("Horde")
local function GetCurrentRaceName()
local raceID = GetSelectedRace()
return GetRaceName(raceID)
end
local function GetRacesByFaction(allowedRaces)
local allianceList = {}
local hordeList = {}
for _, race in ipairs(allowedRaces) do
local isAlliance = false
for _, allianceRace in ipairs(AllianceRaces) do
if race == allianceRace then
table.insert(allianceList, race)
isAlliance = true
break
end
end
if not isAlliance then
for _, hordeRace in ipairs(HordeRaces) do
if race == hordeRace then
table.insert(hordeList, race)
break
end
end
end
end
return allianceList, hordeList
end
local RACE_NAME_CACHE = {}
local function GetFactionForRaceName(raceName)
if not raceName then return "Horde" end
if RACE_NAME_CACHE[raceName] then
return RACE_NAME_CACHE[raceName]
end
local currentLocale = GetLocale()
local faction = nil
for _, raceData in pairs(RACE_DATA) do
local baseKey = raceData.glueString
for _, genderKey in ipairs({"_MALE", "_FEMALE"}) do
local fullKey = baseKey .. genderKey
local localizedName = _G[fullKey]
if localizedName and localizedName == raceName then
faction = raceData.faction
break
end
end
if faction then
break
end
end
if not faction then
faction = "Horde"
end
RACE_NAME_CACHE[raceName] = faction
return faction
end
_G.RACE_1 = "Humano"
_G.RACE_2 = "Enano"
_G.RACE_3 = "Elfo de la noche"
_G.RACE_4 = "Gnomo"
_G.RACE_5 = "Draenei"
_G.RACE_6 = "Orco"
_G.RACE_7 = "No-muerto"
_G.RACE_8 = "Tauren"
_G.RACE_9 = "Trol"
_G.RACE_10 = "Elfo de sangre"
_G.Races_Informations = Races_Informations
_G.Class_Informations = Class_Informations
_G.ClassRaces = ClassRaces or {}
_G.GetRaceTooltipPosition = GetRaceTooltipPosition
_G.GetRaceName = GetRaceName
_G.GetFactionForRaceID = GetFactionForRaceID
_G.GetRaceNamesByFaction = GetRaceNamesByFaction
_G.GetCurrentRaceName = GetCurrentRaceName
_G.GetRacesByFaction = GetRacesByFaction
_G.ALLIANCE_RACES = ALLIANCE_RACES
_G.HORDE_RACES = HORDE_RACES
_G.RACE_DATA = RACE_DATA
_G.AllianceRaces = AllianceRaces
_G.HordeRaces = HordeRaces
_G.GetFactionForRaceName = GetFactionForRaceName
@@ -0,0 +1,998 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
CHARACTER_SELECT_ROTATION_START_X = nil;
CHARACTER_SELECT_INITIAL_FACING = nil;
CHARACTER_ROTATION_CONSTANT = 0.6;
MAX_CHARACTERS_DISPLAYED = 8;
MAX_CHARACTERS_PER_REALM = 8;
function CharacterSelect_OnLoad(self)
REALM_SIRION = GetServerName();
self:SetSequence(0);
self:SetCamera(0);
self.createIndex = 0;
self.selectedIndex = 0;
self.selectLast = 0;
self.currentModel = nil;
self:RegisterEvent("ADDON_LIST_UPDATE");
self:RegisterEvent("CHARACTER_LIST_UPDATE");
self:RegisterEvent("UPDATE_SELECTED_CHARACTER");
self:RegisterEvent("SELECT_LAST_CHARACTER");
self:RegisterEvent("SELECT_FIRST_CHARACTER");
self:RegisterEvent("SUGGEST_REALM");
self:RegisterEvent("FORCE_RENAME_CHARACTER");
SetCharSelectModelFrame("CharacterSelect");
CharacterSelectCharacterFrame:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
tile = true,
tileSize = 16,
edgeSize = 16,
insets = { left = 3, right = 3, top = 3, bottom = 3 }
});
CharacterSelectCharacterFrame:SetBackdropColor(0, 0, 0)
SelectBorroso = 1;
CharacterSelect_OnEventO();
if CharSelectTooltip then
CharSelectTooltipText:SetFont("Fonts\\FRIZQT__.TTF", 14, "OUTLINE")
CharSelectTooltipText:SetTextColor(1, 1, 1)
CharSelectTooltip:SetBackdropColor(0, 0, 0, 0.9)
CharSelectTooltip:SetBackdropBorderColor(0.4, 0.4, 0.4, 1)
end
end
function CharacterSelect_OnShow()
-- request account data times from the server (so we know if we should refresh keybindings, etc...)
ReadyForAccountDataTimes()
local CurrentModel = CharacterSelect.currentModel;
if ( CurrentModel ) then
PlayGlueAmbience(GlueAmbienceTracks[strupper(CurrentModel)], 4.0);
end
UpdateAddonButton();
local serverName, isPVP, isRP = GetServerName();
local connected = IsConnectedToServer();
local serverType = "";
if ( serverName ) then
if( not connected ) then
serverName = serverName.."\n("..SERVER_DOWN..")";
end
if ( isPVP ) then
if ( isRP ) then
serverType = RPPVP_PARENTHESES;
else
serverType = PVP_PARENTHESES;
end
elseif ( isRP ) then
serverType = RP_PARENTHESES;
end
CharSelectRealmName:SetText(serverName.." "..serverType);
CharSelectRealmName:Show();
else
CharSelectRealmName:Hide();
end
if ( connected ) then
GetCharacterListUpdate();
else
UpdateCharacterList();
end
-- Gameroom billing stuff (For Korea and China only)
if ( SHOW_GAMEROOM_BILLING_FRAME ) then
local paymentPlan, hasFallBackBillingMethod, isGameRoom = GetBillingPlan();
if ( paymentPlan == 0 ) then
-- No payment plan
GameRoomBillingFrame:Hide();
CharacterSelectRealmSplitButton:ClearAllPoints();
CharacterSelectRealmSplitButton:SetPoint("TOP", CharacterSelectLogo, "BOTTOM", 0, -5);
else
local billingTimeLeft = GetBillingTimeRemaining();
-- Set default text for the payment plan
local billingText = _G["BILLING_TEXT"..paymentPlan];
if ( paymentPlan == 1 ) then
-- Recurring account
billingTimeLeft = ceil(billingTimeLeft/(60 * 24));
if ( billingTimeLeft == 1 ) then
billingText = BILLING_TIME_LEFT_LAST_DAY;
end
elseif ( paymentPlan == 2 ) then
-- Free account
if ( billingTimeLeft < (24 * 60) ) then
billingText = format(BILLING_FREE_TIME_EXPIRE, billingTimeLeft.." "..MINUTES_ABBR);
end
elseif ( paymentPlan == 3 ) then
-- Fixed but not recurring
if ( isGameRoom == 1 ) then
if ( billingTimeLeft <= 30 ) then
billingText = BILLING_GAMEROOM_EXPIRE;
else
billingText = format(BILLING_FIXED_IGR, MinutesToTime(billingTimeLeft, 1));
end
else
-- personal fixed plan
if ( billingTimeLeft < (24 * 60) ) then
billingText = BILLING_FIXED_LASTDAY;
else
billingText = format(billingText, MinutesToTime(billingTimeLeft));
end
end
elseif ( paymentPlan == 4 ) then
-- Usage plan
if ( isGameRoom == 1 ) then
-- game room usage plan
if ( billingTimeLeft <= 600 ) then
billingText = BILLING_GAMEROOM_EXPIRE;
else
billingText = BILLING_IGR_USAGE;
end
else
-- personal usage plan
if ( billingTimeLeft <= 30 ) then
billingText = BILLING_TIME_LEFT_30_MINS;
else
billingText = format(billingText, billingTimeLeft);
end
end
end
-- If fallback payment method add a note that says so
if ( hasFallBackBillingMethod == 1 ) then
billingText = billingText.."\n\n"..BILLING_HAS_FALLBACK_PAYMENT;
end
GameRoomBillingFrameText:SetText(billingText);
GameRoomBillingFrame:SetHeight(GameRoomBillingFrameText:GetHeight() + 26);
GameRoomBillingFrame:Show();
CharacterSelectRealmSplitButton:ClearAllPoints();
CharacterSelectRealmSplitButton:SetPoint("TOP", GameRoomBillingFrame, "BOTTOM", 0, -10);
end
end
if( IsTrialAccount() ) then
CharacterSelectUpgradeAccountButton:Show();
else
CharacterSelectUpgradeAccountButton:Hide();
end
-- fadein the character select ui
GlueFrameFadeIn(CharacterSelectUI, CHARACTER_SELECT_FADE_IN)
RealmSplitCurrentChoice:Hide();
RequestRealmSplitInfo();
--Clear out the addons selected item
GlueDropDownMenu_SetSelectedValue(AddonCharacterDropDown, ALL);
end
function CharacterSelect_OnHide()
CharacterDeleteDialog:Hide();
CharacterRenameDialog:Hide();
if ( DeclensionFrame ) then
DeclensionFrame:Hide();
end
SERVER_SPLIT_STATE_PENDING = -1;
end
function CharacterSelect_OnUpdate(elapsed)
if ( SERVER_SPLIT_STATE_PENDING > 0 ) then
CharacterSelectRealmSplitButton:Show();
if ( SERVER_SPLIT_CLIENT_STATE > 0 ) then
RealmSplit_SetChoiceText();
RealmSplitPending:SetPoint("TOP", RealmSplitCurrentChoice, "BOTTOM", 0, -10);
else
RealmSplitPending:SetPoint("TOP", CharacterSelectRealmSplitButton, "BOTTOM", 0, 0);
RealmSplitCurrentChoice:Hide();
end
if ( SERVER_SPLIT_STATE_PENDING > 1 ) then
CharacterSelectRealmSplitButton:Disable();
CharacterSelectRealmSplitButtonGlow:Hide();
RealmSplitPending:SetText( SERVER_SPLIT_PENDING );
else
CharacterSelectRealmSplitButton:Enable();
CharacterSelectRealmSplitButtonGlow:Show();
local datetext = SERVER_SPLIT_CHOOSE_BY.."\n"..SERVER_SPLIT_DATE;
RealmSplitPending:SetText( datetext );
end
if ( SERVER_SPLIT_SHOW_DIALOG and not GlueDialog:IsShown() ) then
SERVER_SPLIT_SHOW_DIALOG = false;
local dialogString = format(SERVER_SPLIT,SERVER_SPLIT_DATE);
if ( SERVER_SPLIT_CLIENT_STATE > 0 ) then
local serverChoice = RealmSplit_GetFormatedChoice(SERVER_SPLIT_REALM_CHOICE);
local stringWithDate = format(SERVER_SPLIT,SERVER_SPLIT_DATE);
dialogString = stringWithDate.."\n\n"..serverChoice;
GlueDialog_Show("SERVER_SPLIT_WITH_CHOICE", dialogString);
else
GlueDialog_Show("SERVER_SPLIT", dialogString);
end
end
else
CharacterSelectRealmSplitButton:Hide();
end
-- Account Msg stuff
if ( (ACCOUNT_MSG_NUM_AVAILABLE > 0) and not GlueDialog:IsShown() ) then
if ( ACCOUNT_MSG_HEADERS_LOADED ) then
if ( ACCOUNT_MSG_BODY_LOADED ) then
local dialogString = AccountMsg_GetHeaderSubject( ACCOUNT_MSG_CURRENT_INDEX ).."\n\n"..AccountMsg_GetBody();
GlueDialog_Show("ACCOUNT_MSG", dialogString);
end
end
end
end
function CharacterSelect_OnKeyDown(self,key)
if ( key == "ESCAPE" ) then
CharacterSelect_Exit();
elseif ( key == "ENTER" ) then
CharacterSelect_EnterWorld();
elseif ( key == "PRINTSCREEN" ) then
Screenshot();
elseif ( key == "UP" or key == "LEFT" ) then
local numChars = GetNumCharacters();
if ( numChars > 1 ) then
if ( self.selectedIndex > 1 ) then
CharacterSelect_SelectCharacter(self.selectedIndex - 1);
else
CharacterSelect_SelectCharacter(numChars);
end
end
elseif ( arg1 == "DOWN" or arg1 == "RIGHT" ) then
local numChars = GetNumCharacters();
if ( numChars > 1 ) then
if ( self.selectedIndex < GetNumCharacters() ) then
CharacterSelect_SelectCharacter(self.selectedIndex + 1);
else
CharacterSelect_SelectCharacter(1);
end
end
end
end
function CharacterSelect_OnEventO()
local numChars = GetNumCharacters();
local index = 1;
local coords;
if ( SelectBorroso == 0 ) then
CharSelectCharacterName:SetAlpha(0);
CharacterSelectCharacterFrame:SetAlpha(0);
CharacterSelectCharacterFrame:SetPoint("TOPRIGHT", 5000, -8);
CharSelectCharacterName2:SetPoint("CENTER", 330, 100);
CharSelectCharacterName2:SetAlpha(1);
CharSelectCharacterName2:SetFont("Fonts\\FRIZQT__.ttf", 43, "OUTLINE");
CharSelectCharacterName2:Show();
CharSelectCharacterName3:SetPoint("TOP", "CharSelectCharacterName2", 0, 120);
CharSelectCharacterName3:SetFont("Fonts\\FRIZQT__.ttf", 83, "OUTLINE");
CharSelectCharacterName3:Show();
CharacterSelectRotateLeft:SetAlpha(0);
CharacterSelectRotateRight:SetAlpha(0);
CharacterSelectAddonsButton:SetAlpha(0);
CharSelectEnterWorldButton:SetAlpha(0);
CharacterSelectBackButton:SetAlpha(0);
CharacterSelectAddonsButton:Disable();
CharacterSelectBackButton:Disable();
DesenfoBoton:SetText(" ");
DesenfoBoton2:Hide();
OptionsButton2:Hide();
CharSelectChangeRealmButton:Hide();
CharacterSelectDeleteButton:Hide();
elseif ( SelectBorroso == 1 ) then
CharSelectCharacterName:SetAlpha(1);
CharacterSelectCharacterFrame:SetAlpha(1);
CharacterSelectCharacterFrame:SetPoint("TOPRIGHT", -5, -42);
CharSelectCharacterName2:SetPoint("CENTER", 330, 100);
CharSelectCharacterName2:SetFont("Fonts\\FRIZQT__.ttf", 43, "OUTLINE");
CharSelectCharacterName2:SetAlpha(0);
CharSelectCharacterName2:Hide();
CharSelectCharacterName3:SetPoint("TOP", "CharSelectCharacterName2", 0, 120);
CharSelectCharacterName3:SetFont("Fonts\\FRIZQT__.ttf", 83, "OUTLINE");
CharSelectCharacterName3:Hide();
CharacterSelectRotateLeft:SetAlpha(1);
CharacterSelectRotateRight:SetAlpha(1);
CharacterSelectAddonsButton:SetAlpha(1);
CharSelectEnterWorldButton:SetAlpha(1);
CharacterSelectBackButton:SetAlpha(1);
CharacterSelectAddonsButton:Enable();
CharacterSelectBackButton:Enable();
DesenfoBoton:SetText(" ");
DesenfoBoton2:Show();
OptionsButton2:Show();
CharSelectChangeRealmButton:Show();
CharacterSelectDeleteButton:Show();
end
PlaySound("igMainMenuOptionCheckBoxOn")
end
function CharacterSelect_OnEventO2()
if (SelectBorroso2 == 0) then
CharacterSelectCharacterFrame:Hide();
if CharacterSelectDeleteButton then
CharacterSelectDeleteButton:Hide();
end
elseif (SelectBorroso2 == 1) then
CharacterSelectCharacterFrame:Show();
if CharacterSelectDeleteButton then
CharacterSelectDeleteButton:Show();
end
end
PlaySound("igMainMenuOptionCheckBoxOn");
end
function CharacterSelect_OnEvent(self, event, ...)
if ( event == "ADDON_LIST_UPDATE" ) then
UpdateAddonButton();
elseif ( event == "CHARACTER_LIST_UPDATE" ) then
UpdateCharacterList();
CharSelectCharacterName:SetText(GetCharacterInfo(self.selectedIndex));
elseif ( event == "UPDATE_SELECTED_CHARACTER" ) then
local index = ...;
if ( index == 0 ) then
CharSelectCharacterName:SetText("");
else
CharSelectCharacterName:SetText(GetCharacterInfo(index));
self.selectedIndex = index;
end
UpdateCharacterSelection(self);
elseif ( event == "SELECT_LAST_CHARACTER" ) then
self.selectLast = 1;
elseif ( event == "SELECT_FIRST_CHARACTER" ) then
CharacterSelect_SelectCharacter(1, 1);
elseif ( event == "SUGGEST_REALM" ) then
local category, id = ...;
local name = GetRealmInfo(category, id);
if ( name ) then
SetGlueScreen("charselect");
ChangeRealm(category, id);
else
if ( RealmList:IsShown() ) then
RealmListUpdate();
else
RealmList:Show();
end
end
elseif ( event == "FORCE_RENAME_CHARACTER" ) then
local message = ...;
CharacterRenameDialog:Show();
CharacterRenameText1:SetText(_G[message]);
end
end
function CharacterSelect_UpdateModel(self)
UpdateSelectionCustomizationScene();
self:AdvanceTime();
end
function UpdateCharacterSelection(self)
for i=1, MAX_CHARACTERS_DISPLAYED, 1 do
_G["CharSelectCharacterButton"..i]:UnlockHighlight();
end
local index = self.selectedIndex;
if ( (index > 0) and (index <= MAX_CHARACTERS_DISPLAYED) )then
_G["CharSelectCharacterButton"..index]:LockHighlight();
end
end
function UpdateCharacterList()
local numChars = GetNumCharacters();
local index = 1;
local coords;
for i = 1, MAX_CHARACTERS_DISPLAYED do
local button = _G["CharSelectCharacterButton"..i];
button:Show();
end
_G["CharacterSelectCharacterFrame"]:SetHeight(620);
local GENERAL_BACKGROUND = {
texture = "Interface\\Glues\\CharacterSelect\\uicharacterselectglues2x",
coords = {0.656250000, 0.965820313, 0.123046875, 0.217285156}
};
for i = 1, MAX_CHARACTERS_DISPLAYED do
local button = _G["CharSelectCharacterButton"..i];
local generalBg = _G["CharSelectCharacterButton"..i.."GeneralBackground"];
if generalBg then generalBg:Hide(); end
local background = _G["CharSelectCharacterButton"..i.."Background"];
if background then background:Hide(); end
local factionIcon = _G["CharSelectCharacterButton"..i.."FactionIcon"];
if factionIcon then factionIcon:Hide(); end
local nameText = _G["CharSelectCharacterButton"..i.."ButtonTextName"];
if nameText then nameText:SetText(""); end
local levelText = _G["CharSelectCharacterButton"..i.."ButtonTextLevel"];
if levelText then levelText:SetText(""); end
local classText = _G["CharSelectCharacterButton"..i.."ButtonTextClass"];
if classText then classText:SetText(""); end
local zoneText = _G["CharSelectCharacterButton"..i.."ButtonTextZone"];
if zoneText then zoneText:SetText(""); end
local statusText = _G["CharSelectCharacterButton"..i.."ButtonTextStatus"];
if statusText then statusText:SetText(""); end
local defaultBg = _G["CharSelectCharacterButton"..i.."DefaultBackground"];
if defaultBg then defaultBg:Hide(); end
end
local CLASS_COLORS = {
-- Español
["GUERRERO"]="|cffC79C6E",["GUERRERA"]="|cffC79C6E",
["PALADIN"]="|cffF58CBA",
["CAZADOR"]="|cffABD473",["CAZADORA"]="|cffABD473",
["PICARO"]="|cffFFF569",["PICARA"]="|cffFFF569",
["SACERDOTE"]="|cffFFFFFF",["SACERDOTISA"]="|cffFFFFFF",
["CABALLERO DE LA MUERTE"]="|cffC41F3B",
["CHAMÃN"]="|cff0070DE",
["MAGO"]="|cff69CCF0",["MAGA"]="|cff69CCF0",
["BRUJO"]="|cff9482C9",["BRUJA"]="|cff9482C9",
["DRUIDA"]="|cffFF7D0A",
-- English
["WARRIOR"]="|cffC79C6E",
["PALADIN"]="|cffF58CBA",
["HUNTER"]="|cffABD473",
["ROGUE"]="|cffFFF569",
["PRIEST"]="|cffFFFFFF",
["DEATHKNIGHT"]="|cffC41F3B",
["SHAMAN"]="|cff0070DE",
["MAGE"]="|cff69CCF0",
["WARLOCK"]="|cff9482C9",
["DRUID"]="|cffFF7D0A"
};
local function GetCharacterFaction(race)
return GetFactionForRaceName(race)
end
local FACTION_ICONS = {
["Alliance"] = "Interface\\Glues\\CharacterSelect\\AllianceLogo",
["Horde"] = "Interface\\Glues\\CharacterSelect\\HordeLogo"
};
for i=1, numChars, 1 do
local name, race, class, level, zone, sex, ghost, PCC, PRC, PFC = GetCharacterInfo(i);
local button = _G["CharSelectCharacterButton"..index];
if ( not name ) then
button:SetText("ERROR - Contact Admin");
else
if ( not zone ) then
zone = "";
end
local faction = GetCharacterFaction(race);
local defaultBg = _G["CharSelectCharacterButton"..index.."DefaultBackground"];
if defaultBg then defaultBg:Hide(); end
local generalBg = _G["CharSelectCharacterButton"..index.."GeneralBackground"];
if not generalBg then
generalBg = button:CreateTexture("CharSelectCharacterButton"..index.."GeneralBackground", "BACKGROUND", nil, 1);
end
generalBg:ClearAllPoints();
generalBg:SetPoint("CENTER", button, "CENTER", -22, 1);
generalBg:SetSize(243, 62);
generalBg:SetTexture(GENERAL_BACKGROUND.texture);
generalBg:SetTexCoord(unpack(GENERAL_BACKGROUND.coords));
generalBg:Show();
local background = _G["CharSelectCharacterButton"..index.."Background"];
if not background then
background = button:CreateTexture("CharSelectCharacterButton"..index.."Background", "OVERLAY", nil, 2);
end
background:ClearAllPoints();
background:SetPoint("CENTER", button, "CENTER", -35, 0);
background:SetSize(205, 55);
background:Show();
local factionIcon = _G["CharSelectCharacterButton"..index.."FactionIcon"];
if not factionIcon then
factionIcon = button:CreateTexture("CharSelectCharacterButton"..index.."FactionIcon", "OVERLAY", nil, 3);
end
factionIcon:ClearAllPoints();
factionIcon:SetPoint("TOPLEFT", button, "TOPLEFT", 170, -5);
factionIcon:SetSize(60, 60);
if faction == "Alliance" then
factionIcon:SetTexture(FACTION_ICONS["Alliance"]);
else
factionIcon:SetTexture(FACTION_ICONS["Horde"]);
end
factionIcon:Show();
-- Nombre
local nameText = _G["CharSelectCharacterButton"..index.."ButtonTextName"];
if not nameText then
nameText = button:CreateFontString("CharSelectCharacterButton"..index.."ButtonTextName", "OVERLAY", "GlueFontNormal");
end
nameText:ClearAllPoints();
nameText:SetPoint("TOPLEFT", button, "TOPLEFT", 0, -8);
nameText:SetText(name);
-- Nivel
local levelText = _G["CharSelectCharacterButton"..index.."ButtonTextLevel"];
if not levelText then
levelText = button:CreateFontString("CharSelectCharacterButton"..index.."ButtonTextLevel", "OVERLAY", "GlueFontNormalSmall");
end
levelText:ClearAllPoints();
-- Separador entre nivel y clase
local separatorText = _G["CharSelectCharacterButton"..index.."ButtonTextSeparator"];
if not separatorText then
separatorText = button:CreateFontString("CharSelectCharacterButton"..index.."ButtonTextSeparator", "OVERLAY", "GlueFontNormalSmall");
end
separatorText:ClearAllPoints();
separatorText:SetPoint("TOPLEFT", button, "TOPLEFT", 20, -25);
separatorText:SetText("|cffffffff-|r");
if level < 10 then
levelText:SetPoint("TOPLEFT", button, "TOPLEFT", 5, -25);
levelText:SetText("|cffffffff"..level.."|r");
else
levelText:SetPoint("TOPLEFT", button, "TOPLEFT", 0, -25);
levelText:SetText("|cffffffff"..level.."|r");
end
-- Clase
local classText = _G["CharSelectCharacterButton"..index.."ButtonTextClass"];
if not classText then
classText = button:CreateFontString("CharSelectCharacterButton"..index.."ButtonTextClass", "OVERLAY", "GlueFontNormalSmall");
end
classText:ClearAllPoints();
classText:SetPoint("TOPLEFT", button, "TOPLEFT", 30, -25);
classText:SetWidth(150);
classText:SetJustifyH("LEFT");
classText:SetWordWrap(false);
local classColor = CLASS_COLORS[strupper(class)] or "|cffFFFFFF";
classText:SetText(classColor..class.."|r");
-- Zona
local zoneText = _G["CharSelectCharacterButton"..index.."ButtonTextZone"];
if not zoneText then
zoneText = button:CreateFontString("CharSelectCharacterButton"..index.."ButtonTextZone", "OVERLAY", "GlueFontNormalSmall");
end
zoneText:ClearAllPoints();
zoneText:SetPoint("TOPLEFT", button, "TOPLEFT", 0, -40);
zoneText:SetWidth(180);
zoneText:SetJustifyH("LEFT");
zoneText:SetWordWrap(false);
zoneText:SetText(zone);
zoneText:SetTextColor(0.3, 0.3, 0.3);
-- Estado: Vivo/Muerto
local statusText = _G["CharSelectCharacterButton"..index.."ButtonTextStatus"];
if not statusText then
statusText = button:CreateFontString("CharSelectCharacterButton"..index.."ButtonTextStatus", "OVERLAY", "GlueFontNormalSmall");
end
statusText:ClearAllPoints();
if ghost then
statusText:SetPoint("TOPLEFT", button, "TOPLEFT", 170, -5);
statusText:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE");
statusText:SetTextColor(1, 0.2, 0.2);
local deadText = _G["DEAD_INF"] or
(_G["GlueStrings"] and _G["GlueStrings"]["DEAD_INF"] and
_G["GlueStrings"]["DEAD_INF"][GetLocale()]);
statusText:SetText(deadText);
else
statusText:SetPoint("TOPLEFT", button, "TOPLEFT", 182, -5);
statusText:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE");
statusText:SetTextColor(0.2, 1, 0.2);
local aliveText = _G["LIFE_INF"] or
(_G["GlueStrings"] and _G["GlueStrings"]["LIFE_INF"] and
_G["GlueStrings"]["LIFE_INF"][GetLocale()]);
statusText:SetText(aliveText);
end
end
button:Show();
_G["CharSelectCharacterCustomize"..index]:Hide();
_G["CharSelectRaceChange"..index]:Hide();
_G["CharSelectFactionChange"..index]:Hide();
if (PFC) then
_G["CharSelectFactionChange"..index]:Show();
elseif (PRC) then
_G["CharSelectRaceChange"..index]:Show();
elseif (PCC) then
_G["CharSelectCharacterCustomize"..index]:Show();
end
index = index + 1;
if (index > MAX_CHARACTERS_DISPLAYED) then
break;
end
end
for i = index, MAX_CHARACTERS_DISPLAYED do
local button = _G["CharSelectCharacterButton"..i];
local defaultBg = _G["CharSelectCharacterButton"..i.."DefaultBackground"];
if not defaultBg then
defaultBg = button:CreateTexture("CharSelectCharacterButton"..i.."DefaultBackground", "BACKGROUND");
end
defaultBg:ClearAllPoints();
defaultBg:SetPoint("CENTER", button, "CENTER", -22, 1);
defaultBg:SetSize(242, 61);
defaultBg:SetTexture("Interface\\Glues\\CharacterSelect\\uicharacterselectglues2x");
defaultBg:SetTexCoord(0.619628906, 0.929199219, 0.242675781, 0.336425781);
defaultBg:Show();
local generalBg = _G["CharSelectCharacterButton"..i.."GeneralBackground"];
if generalBg then generalBg:Hide(); end
local background = _G["CharSelectCharacterButton"..i.."Background"];
if background then background:Hide(); end
local factionIcon = _G["CharSelectCharacterButton"..i.."FactionIcon"];
if factionIcon then factionIcon:Hide(); end
local nameText = _G["CharSelectCharacterButton"..i.."ButtonTextName"];
if nameText then nameText:SetText(""); end
local levelText = _G["CharSelectCharacterButton"..i.."ButtonTextLevel"];
if levelText then levelText:SetText(""); end
local separatorText = _G["CharSelectCharacterButton"..i.."ButtonTextSeparator"];
if separatorText then separatorText:Hide(); end
local classText = _G["CharSelectCharacterButton"..i.."ButtonTextClass"];
if classText then classText:SetText(""); end
local zoneText = _G["CharSelectCharacterButton"..i.."ButtonTextZone"];
if zoneText then zoneText:SetText(""); end
local statusText = _G["CharSelectCharacterButton"..i.."ButtonTextStatus"];
if statusText then statusText:SetText(""); end
_G["CharSelectCharacterCustomize"..i]:Hide();
_G["CharSelectRaceChange"..i]:Hide();
_G["CharSelectFactionChange"..i]:Hide();
button:Show();
end
if ( numChars == 0 ) then
CharacterSelect.selectedIndex = 0;
CharacterSelect_SelectCharacter(CharacterSelect.selectedIndex, 1);
CharacterSelectDeleteButton:Disable();
CharSelectEnterWorldButton:Disable();
else
CharacterSelectDeleteButton:Enable();
CharSelectEnterWorldButton:Enable();
end
CharacterSelect.createIndex = 0;
local connected = IsConnectedToServer();
if (numChars < MAX_CHARACTERS_PER_REALM and connected) then
CharacterSelect.createIndex = numChars + 1;
CharSelectCreateCharacterButton:SetID(CharacterSelect.createIndex);
CharSelectCreateCharacterButton:Show();
else
CharSelectCreateCharacterButton:Hide();
end
if ( CharacterSelect.selectLast == 1 ) then
CharacterSelect.selectLast = 0;
CharacterSelect_SelectCharacter(numChars, 1);
return;
end
if ( (CharacterSelect.selectedIndex == 0) or (CharacterSelect.selectedIndex > numChars) ) then
CharacterSelect.selectedIndex = 1;
end
CharacterSelect_SelectCharacter(CharacterSelect.selectedIndex, 1);
end
function CharacterSelectButton_OnClick(self)
local id = self:GetID();
local numChars = GetNumCharacters();
if ( id <= numChars and id ~= CharacterSelect.selectedIndex ) then
CharacterSelect_SelectCharacter(id);
else
PlaySound("igMainMenuOptionCheckBoxOn");
end
end
function CharacterSelectButton_OnDoubleClick(self)
local id = self:GetID();
local numChars = GetNumCharacters();
if ( id <= numChars ) then
if ( id ~= CharacterSelect.selectedIndex ) then
CharacterSelect_SelectCharacter(id);
end
CharacterSelect_EnterWorld();
else
PlaySound("igMainMenuOptionCheckBoxOn");
end
end
function CharacterSelect_TabResize(self)
local buttonMiddle = _G[self:GetName().."Middle"];
local buttonMiddleDisabled = _G[self:GetName().."MiddleDisabled"];
local width = self:GetTextWidth() - 8;
local leftWidth = _G[self:GetName().."Left"]:GetWidth();
buttonMiddle:SetWidth(width);
buttonMiddleDisabled:SetWidth(width);
self:SetWidth(width + (2 * leftWidth));
end
function CharacterSelect_SelectCharacter(id, noCreate)
if ( id == CharacterSelect.createIndex ) then
if ( not noCreate ) then
PlaySound("gsCharacterSelectionCreateNew");
SetGlueScreen("charcreate");
end
else
CharacterSelect.currentModel = GetSelectBackgroundModel(id);
SetBackgroundModel(CharacterSelect,CharacterSelect.currentModel);
SelectCharacter(id);
end
end
function CharacterDeleteDialog_OnShow()
local name, race, class, level = GetCharacterInfo(CharacterSelect.selectedIndex);
local faction, isAlliance;
if name == "You" or name == "Found" or name == "Asecret" or name == "Area" then
DisconnectFromServer();
CharacterDeleteDialog:Hide();
return;
end
local factionType = GetFactionForRaceName(race)
if factionType == "Alliance" then
faction = ALLIANCE_RACE;
isAlliance = true;
else
faction = HORDE_RACE;
isAlliance = false;
end
CharacterDeleteText1:SetFont("Fonts\\FRIZQT__.TTF", 12)
CharacterDeleteText2:SetFont("Fonts\\FRIZQT__.TTF", 10)
CharacterDeleteAlertText:SetFont("Fonts\\FRIZQT__.TTF", 10)
CharacterDeleteAlertText:SetTextColor(1, 0.2, 0.2)
CharacterDeleteAlertText:SetText(WARNING_CHAR_INF)
CharacterDeleteCenterText:SetFont("Fonts\\FRIZQT__.TTF", 11)
CharacterDeleteCenterText:SetTextColor(1, 0, 0)
CharacterDeleteCenterText:SetText(WARNING_INF)
CharacterDeleteText1:SetFormattedText(CONFIRM_CHAR_DELETE, name, level, class, faction);
CharacterDeleteText1:ClearAllPoints()
CharacterDeleteText1:SetPoint("CENTER", CharacterDeleteBackground, "CENTER", 0, 50)
CharacterDeleteText2:ClearAllPoints()
CharacterDeleteText2:SetPoint("CENTER", CharacterDeleteBackground, "CENTER", 0, -20)
CharacterDeleteBackground:SetWidth(300);
CharacterDeleteBackground:SetHeight(250);
CharacterDeleteButton1:Disable();
if not CharacterDeleteLeftTexture then
CharacterDeleteLeftTexture = CharacterDeleteBackground:CreateTexture(nil, "ARTWORK")
CharacterDeleteLeftTexture:SetSize(42, 42)
CharacterDeleteLeftTexture:SetPoint("RIGHT", CharacterDeleteText1, "LEFT", 70, 0)
CharacterDeleteLeftTexture:SetTexture("Interface\\Glues\\CharacterSelect\\PlusManz-Alliance")
end
if not CharacterDeleteRightTexture then
CharacterDeleteRightTexture = CharacterDeleteBackground:CreateTexture(nil, "ARTWORK")
CharacterDeleteRightTexture:SetSize(42, 42)
CharacterDeleteRightTexture:SetPoint("LEFT", CharacterDeleteText1, "RIGHT", -70, 0)
CharacterDeleteRightTexture:SetTexture("Interface\\Glues\\CharacterSelect\\PlusManz-Horde")
end
if isAlliance == true then
CharacterDeleteLeftTexture:SetDesaturated(false)
CharacterDeleteLeftTexture:SetAlpha(1.0)
CharacterDeleteRightTexture:SetDesaturated(true)
CharacterDeleteRightTexture:SetAlpha(0.6)
else
CharacterDeleteRightTexture:SetDesaturated(false)
CharacterDeleteRightTexture:SetAlpha(1.0)
CharacterDeleteLeftTexture:SetDesaturated(true)
CharacterDeleteLeftTexture:SetAlpha(0.6)
end
CharacterDeleteLeftTexture:Show()
CharacterDeleteRightTexture:Show()
if not CharacterDeleteTooltip then
CharacterDeleteTooltip = CreateFrame("Frame", nil, CharacterDeleteBackground)
CharacterDeleteTooltip:SetFrameLevel(CharacterDeleteBackground:GetFrameLevel() - 1)
CharacterDeleteTooltip:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\ui-tooltip-border-mawBlack",
tile = true,
tileSize = 12,
edgeSize = 12,
insets = { left = 3, right = 3, top = 3, bottom = 3 }
})
CharacterDeleteTooltip:SetBackdropColor(0, 0, 0)
end
CharacterDeleteTooltip:ClearAllPoints()
CharacterDeleteTooltip:SetPoint("LEFT", CharacterDeleteLeftTexture, "LEFT", -10, 0)
CharacterDeleteTooltip:SetPoint("RIGHT", CharacterDeleteRightTexture, "RIGHT", 10, 0)
CharacterDeleteTooltip:SetPoint("TOP", CharacterDeleteText1, "TOP", 0, 8)
CharacterDeleteTooltip:SetPoint("BOTTOM", CharacterDeleteText1, "BOTTOM", 0, -10)
CharacterDeleteTooltip:Show()
if not CharacterDeleteCenterTooltip then
CharacterDeleteCenterTooltip = CreateFrame("Frame", nil, CharacterDeleteBackground)
CharacterDeleteCenterTooltip:SetFrameLevel(CharacterDeleteBackground:GetFrameLevel() - 1)
CharacterDeleteCenterTooltip:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\ui-tooltip-border-mawBlack",
tile = true,
tileSize = 12,
edgeSize = 12,
insets = { left = 3, right = 3, top = 3, bottom = 3 }
})
CharacterDeleteCenterTooltip:SetBackdropColor(0, 0, 0)
end
CharacterDeleteCenterTooltip:ClearAllPoints()
CharacterDeleteCenterTooltip:SetPoint("TOP", CharacterDeleteCenterText, "TOP", 0, 5)
CharacterDeleteCenterTooltip:SetPoint("BOTTOM", CharacterDeleteCenterText, "BOTTOM", 0, -5)
CharacterDeleteCenterTooltip:SetPoint("LEFT", CharacterDeleteCenterText, "LEFT", 20, 0)
CharacterDeleteCenterTooltip:SetPoint("RIGHT", CharacterDeleteCenterText, "RIGHT", -20, 0)
CharacterDeleteCenterTooltip:Show()
CharacterDeleteEditBox:SetText("")
CharacterDeleteEditBox:SetFocus()
end
function CharacterSelect_EnterWorld()
PlaySound("gsCharacterSelectionEnterWorld");
StopGlueAmbience();
EnterWorld();
end
function CharacterSelect_Exit()
PlaySound("gsCharacterSelectionExit");
DisconnectFromServer();
SetGlueScreen("login");
end
function CharacterSelect_AccountOptions()
PlaySound("gsCharacterSelectionAcctOptions");
end
function CharacterSelect_TechSupport()
PlaySound("gsCharacterSelectionAcctOptions");
LaunchURL(TECH_SUPPORT_URL);
end
function CharacterSelect_Delete()
PlaySound("gsCharacterSelectionDelCharacter");
if ( CharacterSelect.selectedIndex > 0 ) then
CharacterDeleteDialog:Show();
end
end
function CharacterSelect_ChangeRealm()
PlaySound("gsCharacterSelectionDelCharacter");
RequestRealmList(1);
end
function CharacterSelectFrame_OnMouseDown(button)
if ( button == "LeftButton" ) then
CHARACTER_SELECT_ROTATION_START_X = GetCursorPosition();
CHARACTER_SELECT_INITIAL_FACING = GetCharacterSelectFacing();
end
end
function CharacterSelectFrame_OnMouseUp(button)
if ( button == "LeftButton" ) then
CHARACTER_SELECT_ROTATION_START_X = nil
end
end
function CharacterSelectFrame_OnUpdate()
if ( CHARACTER_SELECT_ROTATION_START_X ) then
local x = GetCursorPosition();
local diff = (x - CHARACTER_SELECT_ROTATION_START_X) * CHARACTER_ROTATION_CONSTANT;
CHARACTER_SELECT_ROTATION_START_X = GetCursorPosition();
SetCharacterSelectFacing(GetCharacterSelectFacing() + diff);
end
end
function CharacterSelectRotateRight_OnUpdate(self)
if ( self:GetButtonState() == "PUSHED" ) then
SetCharacterSelectFacing(GetCharacterSelectFacing() + CHARACTER_FACING_INCREMENT);
end
end
function CharacterSelectRotateLeft_OnUpdate(self)
if ( self:GetButtonState() == "PUSHED" ) then
SetCharacterSelectFacing(GetCharacterSelectFacing() - CHARACTER_FACING_INCREMENT);
end
end
function CharacterSelect_ManageAccount()
PlaySound("gsCharacterSelectionAcctOptions");
LaunchURL(AUTH_NO_TIME_URL);
end
function RealmSplit_GetFormatedChoice(formatText)
if ( SERVER_SPLIT_CLIENT_STATE == 1 ) then
realmChoice = SERVER_SPLIT_SERVER_ONE;
else
realmChoice = SERVER_SPLIT_SERVER_TWO;
end
return format(formatText, realmChoice);
end
function RealmSplit_SetChoiceText()
RealmSplitCurrentChoice:SetText( RealmSplit_GetFormatedChoice(SERVER_SPLIT_CURRENT_CHOICE) );
RealmSplitCurrentChoice:Show();
end
function CharacterSelect_PaidServiceOnClick(self, button, down, service)
PAID_SERVICE_CHARACTER_ID = self:GetID();
PAID_SERVICE_TYPE = service;
PlaySound("gsCharacterSelectionCreateNew");
SetGlueScreen("charcreate");
end
function CharacterSelect_DeathKnightSwap(self)
if ( CharacterSelect.currentModel == "DEATHKNIGHT" ) then
if (self.currentModel ~= "DEATHKNIGHT") then
self.currentModel = "DEATHKNIGHT";
self:SetNormalTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Up-Blue");
self:SetPushedTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Down-Blue");
self:SetHighlightTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Highlight-Blue");
end
else
if (self.currentModel == "DEATHKNIGHT") then
self.currentModel = nil;
self:SetNormalTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Up");
self:SetPushedTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Down");
self:SetHighlightTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Highlight");
end
end
end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,106 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!-- This function is called when a script error occurs -->
<Script>
function _ERRORMESSAGE(message)
debuginfo();
if ( not ScriptErrors:IsShown() ) then
ScriptErrors_Message:SetText(message);
ScriptErrors:Show();
end
return message;
end
function message(text)
_ERRORMESSAGE(text);
end
seterrorhandler(_ERRORMESSAGE);
</Script>
<Texture name="DialogButtonNormalTexture" file="Interface\Buttons\UI-Panel-Button-Up" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Texture name="DialogButtonPushedTexture" file="Interface\Buttons\UI-Panel-Button-Down" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Texture name="DialogButtonDisabledTexture" file="Interface\Buttons\UI-Panel-Button-Disabled" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Texture name="DialogButtonHighlightTexture" file="Interface\Buttons\UI-Panel-Button-Highlight" alphaMode="ADD" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Button name="GlueMenuButtonTemplate" virtual="true">
<Size>
<AbsDimension x="128" y="24"/>
</Size>
<NormalTexture inherits="DialogButtonNormalTexture"/>
<PushedTexture inherits="DialogButtonPushedTexture"/>
<DisabledTexture inherits="DialogButtonDisabledTexture"/>
<HighlightTexture inherits="DialogButtonHighlightTexture"/>
<NormalFont style="DialogButtonNormalText"/>
<HighlightFont style="DialogButtonHighlightText"/>
<DisabledFont style="GlueFontDisable"/>
</Button>
<Frame name="DialogBoxFrame" virtual="true" toplevel="true" frameStrata="DIALOG" hidden="true">
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="4" right="4" top="4" bottom="4"/>
</BackgroundInsets>
</Backdrop>
<Frames>
<Button name="$parentButton">
<Size>
<AbsDimension x="128" y="32"/>
</Size>
<Anchors>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="16"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
self:GetParent():Hide();
</OnClick>
</Scripts>
<NormalTexture inherits="DialogButtonNormalTexture"/>
<PushedTexture inherits="DialogButtonPushedTexture"/>
<HighlightTexture inherits="DialogButtonHighlightTexture"/>
<ButtonText text="OKAY"/>
<NormalFont style="DialogButtonNormalText"/>
<HighlightFont style="DialogButtonHighlightText"/>
</Button>
</Frames>
</Frame>
<!-- This is the general scripting error dialog -->
<Frame name="ScriptErrors" inherits="DialogBoxFrame">
<Size>
<AbsDimension x="384" y="228"/>
</Size>
<Layers>
<Layer level="ARTWORK">
<FontString name="ScriptErrors_Message" inherits="GlueFontRedLarge" justifyH="CENTER" justifyV="TOP" nonspacewrap="true">
<Size>
<AbsDimension x="360" y="0"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-16"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
</Ui>
@@ -0,0 +1,29 @@
SECONDS_PER_PULSE = 1;
function GlueButtonMaster_OnUpdate(self, elapsed)
if ( _G[self:GetName().."Glow"]:IsShown() ) then
local sign = self.pulseSign;
local counter;
if ( not self.pulsing ) then
counter = 0;
self.pulsing = 1;
sign = 1;
else
counter = self.pulseCounter + (sign * elapsed);
if ( counter > SECONDS_PER_PULSE ) then
counter = SECONDS_PER_PULSE;
sign = -sign;
elseif ( counter < 0) then
counter = 0;
sign = -sign;
end
end
local alpha = counter / SECONDS_PER_PULSE;
_G[self:GetName().."Glow"]:SetVertexColor(1.0, 1.0, 1.0, alpha);
self.pulseSign = sign;
self.pulseCounter = counter;
end
end
@@ -0,0 +1,130 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="GlueButtons.lua"/>
<Button name="GlueButtonMasterTemplate" virtual="true" hidden="false">
<Scripts>
<OnLoad>
self.pulseCounter = 0;
self.pulseSign = 1;
</OnLoad>
<OnUpdate>
GlueButtonMaster_OnUpdate(self, elapsed);
</OnUpdate>
<OnEnter>
_G[self:GetName().."Rays"]:Show();
self.startPulse = 1;
</OnEnter>
<OnLeave>
_G[self:GetName().."Rays"]:Hide();
self.startPulse = nil;
</OnLeave>
</Scripts>
</Button>
<Texture name="GluePanelButtonUpTexture" file="Interface\Glues\Common\Glue-Panel-Button-Up" virtual="true">
<TexCoords left="0" right="0.578125" top="0" bottom="0.75"/>
</Texture>
<Texture name="GluePanelButtonDownTexture" file="Interface\Glues\Common\Glue-Panel-Button-Down" virtual="true">
<TexCoords left="0" right="0.578125" top="0" bottom="0.75"/>
</Texture>
<Texture name="GluePanelButtonDisabledTexture" file="Interface\Glues\Common\Glue-Panel-Button-Disabled" virtual="true">
<TexCoords left="0" right="0.578125" top="0" bottom="0.75"/>
</Texture>
<Texture name="GluePanelButtonHighlightTexture" file="Interface\Glues\Common\Glue-Panel-Button-Highlight" alphaMode="ADD" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Texture name="GluePanelButtonUpTextureBlue" file="Interface\Glues\Common\Glue-Panel-Button-Up-Blue" virtual="true">
<TexCoords left="0" right="0.578125" top="0" bottom="0.75"/>
</Texture>
<Texture name="GluePanelButtonDownTextureBlue" file="Interface\Glues\Common\Glue-Panel-Button-Down-Blue" virtual="true">
<TexCoords left="0" right="0.578125" top="0" bottom="0.75"/>
</Texture>
<Texture name="GluePanelButtonHighlightTextureBlue" file="Interface\Glues\Common\Glue-Panel-Button-Highlight-Blue" alphaMode="ADD" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Button name="GlueButtonTemplate" virtual="true">
<Size>
<AbsDimension x="170" y="45"/>
</Size>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<DisabledFont style="GlueFontDisable"/>
<NormalTexture inherits="GluePanelButtonUpTexture"/>
<PushedTexture inherits="GluePanelButtonDownTexture"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTexture" alphaMode="ADD"/>
</Button>
<Button name="GlueButtonTemplateBlue" virtual="true">
<Size>
<AbsDimension x="170" y="45"/>
</Size>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<DisabledFont style="GlueFontDisable"/>
<NormalTexture inherits="GluePanelButtonUpTextureBlue"/>
<PushedTexture inherits="GluePanelButtonDownTextureBlue"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTextureBlue" alphaMode="ADD"/>
</Button>
<Button name="GlueButtonSmallTemplate" virtual="true">
<Size>
<AbsDimension x="150" y="38"/>
</Size>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormalSmall"/>
<HighlightFont style="GlueFontHighlightSmall"/>
<DisabledFont style="GlueFontDisableSmall"/>
<NormalTexture inherits="GluePanelButtonUpTexture"/>
<PushedTexture inherits="GluePanelButtonDownTexture"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTexture" alphaMode="ADD"/>
</Button>
<Button name="GlueButtonSmallTemplateBlue" virtual="true">
<Size>
<AbsDimension x="150" y="38"/>
</Size>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormalSmall"/>
<HighlightFont style="GlueFontHighlightSmall"/>
<DisabledFont style="GlueFontDisableSmall"/>
<NormalTexture inherits="GluePanelButtonUpTextureBlue"/>
<PushedTexture inherits="GluePanelButtonDownTextureBlue"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTextureBlue" alphaMode="ADD"/>
</Button>
</Ui>
@@ -0,0 +1,742 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
MAX_NUM_GLUE_DIALOG_BUTTONS = 3;
GlueDialogTypes = { };
GlueDialogTypes["SYSTEM_INCOMPATIBLE_SSE"] = {
text = SYSTEM_INCOMPATIBLE_SSE,
button1 = OKAY,
html = 1,
showAlert = 1,
escapeHides = true,
OnAccept = function ()
end,
OnCancel = function()
end,
}
GlueDialogTypes["CANCEL_RESET_SETTINGS"] = {
text = CANCEL_RESET_SETTINGS,
button1 = OKAY,
button2 = CANCEL,
escapeHides = true,
OnAccept = function ()
AccountLoginUIResetFrame:Hide();
-- Switch the reset settings button back to reset mode
OptionsSelectResetSettingsButton:SetText(RESET_SETTINGS);
OptionsSelectResetSettingsButton:SetScript("OnClick", OptionsSelectResetSettingsButton_OnClick_Reset);
SetClearConfigData(false);
end,
OnCancel = function()
end,
}
GlueDialogTypes["RESET_SERVER_SETTINGS"] = {
text = RESET_SERVER_SETTINGS,
button1 = OKAY,
button2 = CANCEL,
escapeHides = true,
OnAccept = function ()
AccountLoginUIResetFrame:Show();
-- Switch the reset settings button to cancel mode
OptionsSelectResetSettingsButton:SetText(CANCEL_RESET);
OptionsSelectResetSettingsButton:SetScript("OnClick", OptionsSelectResetSettingsButton_OnClick_Cancel);
SetClearConfigData(true);
end,
OnCancel = function ()
end,
}
GlueDialogTypes["CONFIRM_RESET_VIDEO_SETTINGS"] = {
text = CONFIRM_RESET_SETTINGS,
button1 = ALL_SETTINGS,
button2 = CURRENT_SETTINGS,
button3 = CANCEL,
showAlert = 1,
OnAccept = function ()
VideoOptionsFrame_SetAllToDefaults();
end,
OnCancel = function ()
VideoOptionsFrame_SetCurrentToDefaults();
end,
OnAlt = function() end,
escapeHides = true,
}
GlueDialogTypes["CONFIRM_RESET_AUDIO_SETTINGS"] = {
text = CONFIRM_RESET_SETTINGS,
button1 = ALL_SETTINGS,
button2 = CURRENT_SETTINGS,
button3 = CANCEL,
showAlert = 1,
OnAccept = function ()
AudioOptionsFrame_SetAllToDefaults();
end,
OnCancel = function ()
AudioOptionsFrame_SetCurrentToDefaults();
end,
OnAlt = function() end,
escapeHides = true,
}
GlueDialogTypes["CLIENT_RESTART_ALERT"] = {
text = CLIENT_RESTART_ALERT,
button1 = OKAY,
showAlert = 1,
}
GlueDialogTypes["REALM_IS_FULL"] = {
text = REALM_IS_FULL_WARNING,
button1 = YES,
button2 = NO,
showAlert = 1,
OnAccept = function()
SetGlueScreen("charselect");
ChangeRealm(RealmList.selectedCategory , RealmList.currentRealm);
end,
OnCancel = function()
CharacterSelect_ChangeRealm();
end,
}
GlueDialogTypes["SUGGEST_REALM"] = {
text = format(SUGGESTED_REALM_TEXT,"UNKNOWN REALM"),
button1 = ACCEPT,
button2 = VIEW_ALL_REALMS,
OnShow = function()
GlueDialogText:SetFormattedText(SUGGESTED_REALM_TEXT, RealmWizard.suggestedRealmName);
end,
OnAccept = function()
SetGlueScreen("charselect");
ChangeRealm(RealmWizard.suggestedCategory, RealmWizard.suggestedID);
end,
OnCancel = function()
SetGlueScreen("charselect");
CharacterSelect_ChangeRealm();
end,
}
GlueDialogTypes["DISCONNECTED"] = {
text = DISCONNECTED,
button1 = OKAY,
button2 = nil,
OnShow = function()
RealmList:Hide();
VirtualKeypadFrame:Hide();
SecurityMatrixLoginFrame:Hide();
StatusDialogClick();
end,
OnAccept = function()
end,
OnCancel = function()
end,
}
GlueDialogTypes["PARENTAL_CONTROL"] = {
text = AUTH_PARENTAL_CONTROL,
button1 = MANAGE_ACCOUNT,
button2 = OKAY,
OnShow = function()
RealmList:Hide();
VirtualKeypadFrame:Hide();
SecurityMatrixLoginFrame:Hide();
StatusDialogClick();
end,
OnAccept = function()
LaunchURL(AUTH_NO_TIME_URL);
end,
OnCancel = function()
StatusDialogClick();
end,
}
GlueDialogTypes["INVALID_NAME"] = {
text = CHAR_CREATE_INVALID_NAME,
button1 = OKAY,
button2 = nil,
OnAccept = function()
end,
OnCancel = function()
end,
}
GlueDialogTypes["CANCEL"] = {
text = "",
button1 = CANCEL,
button2 = nil,
OnAccept = function()
StatusDialogClick();
end,
OnCancel = function()
end,
}
GlueDialogTypes["QUEUED_WITH_FCM"] = {
text = "",
button1 = CANCEL,
button2 = QUEUE_FCM_BUTTON,
OnAccept = function()
StatusDialogClick();
end,
OnCancel = function()
LaunchURL(QUEUE_FCM_URL)
end,
}
GlueDialogTypes["OKAY"] = {
text = "",
button1 = OKAY,
button2 = nil,
OnShow = function()
if ( VirtualKeypadFrame:IsShown() ) then
VirtualKeypadFrame:Hide();
CancelLogin();
end
end,
OnAccept = function()
StatusDialogClick();
end,
OnCancel = function()
end,
}
GlueDialogTypes["OKAY_HTML"] = {
text = "",
button1 = OKAY,
button2 = nil,
html = 1,
OnShow = function()
if ( VirtualKeypadFrame:IsShown() ) then
VirtualKeypadFrame:Hide();
CancelLogin();
end
end,
OnAccept = function()
StatusDialogClick();
end,
OnCancel = function()
end,
}
GlueDialogTypes["OKAY_HTML_EXIT"] = {
text = "",
button1 = OKAY,
button2 = EXIT_GAME,
html = 1,
OnShow = function()
if ( VirtualKeypadFrame:IsShown() ) then
VirtualKeypadFrame:Hide();
CancelLogin();
end
end,
OnAccept = function()
StatusDialogClick();
end,
OnCancel = function()
AccountLogin_Exit();
end,
}
GlueDialogTypes["CONFIRM_PAID_SERVICE"] = {
text = CONFIRM_PAID_SERVICE,
button1 = DONE,
button2 = CANCEL,
OnAccept = function()
CreateCharacter(CharacterCreateNameEdit:GetText());
end,
OnCancel = function()
end,
}
GlueDialogTypes["OKAY_WITH_URL"] = {
text = "",
button1 = HELP,
button2 = OKAY,
OnAccept = function()
LaunchURL(_G[GlueDialog.data]);
end,
OnCancel = function()
StatusDialogClick();
end,
}
GlueDialogTypes["CONNECTION_HELP"] = {
text = "",
button1 = HELP,
button2 = OKAY,
OnShow = function()
VirtualKeypadFrame:Hide();
StatusDialogClick();
end,
OnAccept = function()
AccountLoginUI:Hide();
ConnectionHelpFrame:Show();
end,
OnCancel = function()
end,
}
GlueDialogTypes["CONNECTION_HELP_HTML"] = {
text = "",
button1 = HELP,
button2 = OKAY,
html = 1,
OnShow = function()
VirtualKeypadFrame:Hide();
StatusDialogClick();
end,
OnAccept = function()
AccountLoginUI:Hide();
ConnectionHelpFrame:Show();
end,
OnCancel = function()
end,
}
GlueDialogTypes["CLIENT_ACCOUNT_MISMATCH"] = {
button1 = RETURN_TO_LOGIN,
button2 = EXIT_GAME,
html = 1,
OnAccept = function()
SetGlueScreen("login");
end,
OnCancel = function()
PlaySound("gsTitleQuit");
QuitGame();
end,
}
GlueDialogTypes["CLIENT_TRIAL"] = {
text = CLIENT_TRIAL,
button1 = RETURN_TO_LOGIN,
button2 = EXIT_GAME,
html = 1,
OnAccept = function()
SetGlueScreen("login");
end,
OnCancel = function()
PlaySound("gsTitleQuit");
QuitGame();
end,
}
GlueDialogTypes["SCANDLL_DOWNLOAD"] = {
text = "",
button1 = QUIT,
button2 = nil,
OnAccept = function()
AccountLogin_Exit();
end,
OnCancel = function()
end,
}
GlueDialogTypes["SCANDLL_ERROR"] = {
text = "",
button1 = SCANDLL_BUTTON_CONTINUEANYWAY,
button2 = QUIT,
OnAccept = function()
GlueDialog:Hide();
ScanDLLContinueAnyway();
AccountLoginUI:Show();
end,
OnCancel = function()
-- Opposite semantics
AccountLogin_Exit();
end,
}
GlueDialogTypes["SCANDLL_HACKFOUND"] = {
text = "",
button1 = SCANDLL_BUTTON_CONTINUEANYWAY,
button2 = QUIT,
html = 1,
showAlert = 1,
OnAccept = function()
local formatString = _G["SCANDLL_MESSAGE_"..AccountLogin.hackType.."FOUND_CONFIRM"];
GlueDialog_Show("SCANDLL_HACKFOUND_CONFIRM", format(formatString, AccountLogin.hackName, AccountLogin.hackURL));
end,
OnCancel = function()
AccountLogin_Exit();
end,
}
GlueDialogTypes["SCANDLL_HACKFOUND_NOCONTINUE"] = {
text = "",
button1 = QUIT,
button2 = nil,
html = 1,
showAlert = 1,
OnAccept = function()
AccountLogin_Exit();
end,
OnCancel = function()
AccountLogin_Exit();
end,
}
GlueDialogTypes["SCANDLL_HACKFOUND_CONFIRM"] = {
text = "",
button1 = SCANDLL_BUTTON_CONTINUEANYWAY,
button2 = QUIT,
html = 1,
showAlert = 1,
OnAccept = function()
GlueDialog:Hide();
ScanDLLContinueAnyway();
AccountLoginUI:Show();
end,
OnCancel = function()
AccountLogin_Exit();
end,
}
GlueDialogTypes["SERVER_SPLIT"] = {
text = SERVER_SPLIT,
button1 = SERVER_SPLIT_SERVER_ONE,
button2 = SERVER_SPLIT_SERVER_TWO,
button3 = SERVER_SPLIT_NOT_NOW,
escapeHides = true;
OnAccept = function()
SetStateRequestInfo( 1 );
end,
OnCancel = function()
SetStateRequestInfo( 2 );
end,
OnAlt = function()
SetStateRequestInfo( 0 );
end,
}
GlueDialogTypes["SERVER_SPLIT_WITH_CHOICE"] = {
text = SERVER_SPLIT,
button1 = SERVER_SPLIT_SERVER_ONE,
button2 = SERVER_SPLIT_SERVER_TWO,
button3 = SERVER_SPLIT_DONT_CHANGE,
escapeHides = true;
OnAccept = function()
SetStateRequestInfo( 1 );
end,
OnCancel = function()
SetStateRequestInfo( 2 );
end,
OnAlt = function()
SetStateRequestInfo( 0 );
end,
}
GlueDialogTypes["ACCOUNT_MSG"] = {
text = "",
button1 = OKAY,
button2 = ACCOUNT_MESSAGE_BUTTON_READ,
html = 1,
escapeHides = true,
OnShow = function()
VirtualKeypadFrame:Hide();
StatusDialogClick();
end,
OnAccept = function()
ACCOUNT_MSG_NUM_AVAILABLE = ACCOUNT_MSG_NUM_AVAILABLE - 1;
if ( ACCOUNT_MSG_NUM_AVAILABLE > 0 ) then
ACCOUNT_MSG_CURRENT_INDEX = AccountMsg_GetIndexNextUnreadMsg(ACCOUNT_MSG_CURRENT_INDEX);
ACCOUNT_MSG_BODY_LOADED = false;
AccountMsg_LoadBody( ACCOUNT_MSG_CURRENT_INDEX );
end
StatusDialogClick();
end,
OnCancel = function()
AccountMsg_SetMsgRead(ACCOUNT_MSG_CURRENT_INDEX);
ACCOUNT_MSG_NUM_AVAILABLE = ACCOUNT_MSG_NUM_AVAILABLE - 1;
if ( ACCOUNT_MSG_NUM_AVAILABLE > 0 ) then
ACCOUNT_MSG_CURRENT_INDEX = AccountMsg_GetIndexNextUnreadMsg(ACCOUNT_MSG_CURRENT_INDEX);
ACCOUNT_MSG_BODY_LOADED = false;
AccountMsg_LoadBody( ACCOUNT_MSG_CURRENT_INDEX );
end
StatusDialogClick();
end,
}
GlueDialogTypes["DECLINE_FAILED"] = {
text = "",
button1 = OKAY,
button2 = nil,
OnAccept = function()
DeclensionFrame:Show();
end,
OnCancel = function()
end,
}
GlueDialogTypes["REALM_LOCALE_WARNING"] = {
text = REALM_TYPE_LOCALE_WARNING,
button1 = OKAY,
button2 = nil,
OnAccept = function()
end,
OnCancel = function()
end,
}
GlueDialogTypes["REALM_TOURNAMENT_WARNING"] = {
text = REALM_TYPE_TOURNAMENT_WARNING,
button1 = OKAY,
button2 = nil,
OnAccept = function()
end,
OnCancel = function()
end,
}
function GlueDialog_Show(which, text, data)
local dialogInfo = GlueDialogTypes[which];
-- Pick a free dialog to use
if ( GlueDialog:IsShown() ) then
if ( GlueDialog.which ~= which ) then -- We don't actually want to hide, we just want to redisplay?
if ( GlueDialogTypes[GlueDialog.which].OnHide ) then
GlueDialogTypes[GlueDialog.which].OnHide();
end
GlueDialog:Hide();
end
end
GlueDialog.data = data;
local glueText;
if ( dialogInfo.html ) then
glueText = GlueDialogHTML;
GlueDialogHTML:Show();
GlueDialogText:Hide();
else
glueText = GlueDialogText;
GlueDialogHTML:Hide();
GlueDialogText:Show();
end
-- Set the text of the dialog
if ( text ) then
glueText:SetText(text);
else
glueText:SetText(dialogInfo.text);
end
-- Set the buttons of the dialog
if ( dialogInfo.button3 ) then
GlueDialogButton1:ClearAllPoints();
GlueDialogButton2:ClearAllPoints();
GlueDialogButton3:ClearAllPoints();
if ( dialogInfo.displayVertical ) then
GlueDialogButton3:SetPoint("BOTTOM", "GlueDialogBackground", "BOTTOM", 0, 16);
GlueDialogButton2:SetPoint("BOTTOM", "GlueDialogButton3", "TOP", 0, 0);
GlueDialogButton1:SetPoint("BOTTOM", "GlueDialogButton2", "TOP", 0, 0);
else
GlueDialogButton1:SetPoint("BOTTOMLEFT", "GlueDialogBackground", "BOTTOMLEFT", 60, 16);
GlueDialogButton2:SetPoint("LEFT", "GlueDialogButton1", "RIGHT", -8, 0);
GlueDialogButton3:SetPoint("LEFT", "GlueDialogButton2", "RIGHT", -8, 0);
end
GlueDialogButton2:SetText(dialogInfo.button2);
GlueDialogButton2:Show();
GlueDialogButton3:SetText(dialogInfo.button3);
GlueDialogButton3:Show();
elseif ( dialogInfo.button2 ) then
GlueDialogButton1:ClearAllPoints();
GlueDialogButton2:ClearAllPoints();
if ( dialogInfo.displayVertical ) then
GlueDialogButton2:SetPoint("BOTTOM", "GlueDialogBackground", "BOTTOM", 0, 16);
GlueDialogButton1:SetPoint("BOTTOM", "GlueDialogButton2", "TOP", 0, 0);
else
GlueDialogButton1:SetPoint("BOTTOMRIGHT", "GlueDialogBackground", "BOTTOM", -6, 16);
GlueDialogButton2:SetPoint("LEFT", "GlueDialogButton1", "RIGHT", 13, 0);
end
GlueDialogButton2:SetText(dialogInfo.button2);
GlueDialogButton2:Show();
GlueDialogButton3:Hide();
else
GlueDialogButton1:ClearAllPoints();
GlueDialogButton1:SetPoint("BOTTOM", "GlueDialogBackground", "BOTTOM", 0, 16);
GlueDialogButton2:Hide();
GlueDialogButton3:Hide();
end
GlueDialogButton1:SetText(dialogInfo.button1);
-- Set the miscellaneous variables for the dialog
GlueDialog.which = which;
GlueDialog.data = data;
-- Show or hide the alert icon
if ( dialogInfo.showAlert ) then
GlueDialogBackground:SetWidth(GlueDialogBackground.alertWidth);
GlueDialogAlertIcon:Show();
else
GlueDialogBackground:SetWidth(GlueDialogBackground.origWidth);
GlueDialogAlertIcon:Hide();
end
GlueDialogText:SetWidth(GlueDialogText.origWidth);
-- Editbox setup
if ( dialogInfo.hasEditBox ) then
GlueDialogEditBox:Show();
if ( dialogInfo.maxLetters ) then
GlueDialogEditBox:SetMaxLetters(dialogInfo.maxLetters);
end
if ( dialogInfo.maxBytes ) then
GlueDialogEditBox:SetMaxBytes(dialogInfo.maxBytes);
end
else
GlueDialogEditBox:Hide();
end
-- size the width first
if( dialogInfo.displayVertical ) then
GlueDialogBackground:SetWidth(16 + GlueDialogButton1:GetWidth() + 16);
elseif ( dialogInfo.button3 ) then
local displayWidth = 45 + GlueDialogButton1:GetWidth() + 8 + GlueDialogButton2:GetWidth() + 8 + GlueDialogButton3:GetWidth() + 45;
GlueDialogBackground:SetWidth(displayWidth);
GlueDialogText:SetWidth(displayWidth - 40);
end
-- Get the height of the string
local textHeight, _;
if ( dialogInfo.html ) then
_,_,_,textHeight = GlueDialogHTML:GetBoundsRect();
else
textHeight = GlueDialogText:GetHeight();
end
-- now size the dialog box height
if ( dialogInfo.hasEditBox ) then
GlueDialogBackground:SetHeight(16 + textHeight + 8 + GlueDialogEditBox:GetHeight() + 8 + GlueDialogButton1:GetHeight() + 16);
elseif( dialogInfo.displayVertical ) then
local displayHeight = 16 + textHeight + 8 + GlueDialogButton1:GetHeight() + 16;
if ( dialogInfo.button2 ) then
displayHeight = displayHeight + 8 + GlueDialogButton2:GetHeight();
end
if ( dialogInfo.button3 ) then
displayHeight = displayHeight + 8 + GlueDialogButton3:GetHeight();
end
GlueDialogBackground:SetHeight(displayHeight);
else
GlueDialogBackground:SetHeight(16 + textHeight + 8 + GlueDialogButton1:GetHeight() + 16);
end
GlueDialog:Show();
end
function GlueDialog_OnLoad(self)
self:RegisterEvent("OPEN_STATUS_DIALOG");
self:RegisterEvent("UPDATE_STATUS_DIALOG");
self:RegisterEvent("CLOSE_STATUS_DIALOG");
GlueDialogText.origWidth = GlueDialogText:GetWidth();
GlueDialogBackground.origWidth = GlueDialogBackground:GetWidth();
GlueDialogBackground.alertWidth = 600;
end
function GlueDialog_OnShow(self)
local OnShow = GlueDialogTypes[self.which].OnShow;
if ( OnShow ) then
OnShow();
end
end
function GlueDialog_OnUpdate(self, elapsed)
for i=1, MAX_NUM_GLUE_DIALOG_BUTTONS do
button = _G[ "GlueDialogButton"..i ];
if ( button and (CURRENT_GLUE_SCREEN == "login") or (CURRENT_GLUE_SCREEN == "realmwizard") or CURRENT_GLUE_SCREEN == "movie" ) then
button:SetNormalTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Up-Blue");
button:SetPushedTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Down-Blue");
button:SetHighlightTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Highlight-Blue");
else
button:SetNormalTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Up");
button:SetPushedTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Down");
button:SetHighlightTexture("Interface\\Glues\\Common\\Glue-Panel-Button-Highlight");
end
end
end
function GlueDialog_OnEvent(self, event, arg1, arg2, arg3)
if ( event == "OPEN_STATUS_DIALOG" ) then
GlueDialog_Show(arg1, arg2, arg3);
elseif ( event == "UPDATE_STATUS_DIALOG" and arg1 and (strlen(arg1) > 0) ) then
GlueDialogText:SetText(arg1);
local buttonText = nil;
if ( arg2 ) then
buttonText = arg2;
elseif ( GlueDialogTypes[GlueDialog.which] ) then
buttonText = GlueDialogTypes[GlueDialog.which].button1;
end
if ( buttonText ) then
GlueDialogButton1:SetText(buttonText);
end
GlueDialogBackground:SetHeight(32 + GlueDialogText:GetHeight() + 8 + GlueDialogButton1:GetHeight() + 16);
elseif ( event == "CLOSE_STATUS_DIALOG" ) then
GlueDialog:Hide();
end
end
function GlueDialog_OnHide()
-- PlaySound("igMainMenuClose");
end
function GlueDialog_OnClick(index)
GlueDialog:Hide();
if ( index == 1 ) then
local OnAccept = GlueDialogTypes[GlueDialog.which].OnAccept;
if ( OnAccept ) then
OnAccept();
end
elseif ( index == 2 ) then
local OnCancel = GlueDialogTypes[GlueDialog.which].OnCancel;
if ( OnCancel ) then
OnCancel();
end
elseif ( index == 3 ) then
local OnAlt = GlueDialogTypes[GlueDialog.which].OnAlt;
if ( OnAlt ) then
OnAlt();
end
end
PlaySound("gsTitleOptionOK");
end
function GlueDialog_OnKeyDown(key)
if ( key == "PRINTSCREEN" ) then
Screenshot();
return;
end
local info = GlueDialogTypes[GlueDialog.which];
if ( not info or info.ignoreKeys ) then
return;
end
if ( info and info.escapeHides ) then
if ( info.hideSound ) then
PlaySound(info.hideSound);
end
GlueDialog:Hide();
elseif ( key == "ESCAPE" ) then
if ( GlueDialogButton2:IsShown() ) then
GlueDialogButton2:Click();
else
GlueDialogButton1:Click();
end
if ( info.hideSound ) then
PlaySound(info.hideSound);
end
elseif (key == "ENTER" ) then
GlueDialogButton1:Click();
if ( info.hideSound ) then
PlaySound(info.hideSound);
end
end
end
@@ -0,0 +1,179 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="GlueDialog.lua"/>
<Button name="GlueDialogButtonTemplate" virtual="true">
<Size>
<AbsDimension x="220" y="40"/>
</Size>
<Scripts>
<OnClick>
GlueDialog_OnClick(self:GetID());
</OnClick>
</Scripts>
<ButtonText>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="2"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<DisabledFont style="GlueFontDisable"/>
<NormalTexture inherits="GluePanelButtonUpTexture"/>
<PushedTexture inherits="GluePanelButtonDownTexture"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTexture"/>
</Button>
<Frame name="GlueDialog" toplevel="true" parent="GlueParent" setAllPoints="true" enableMouse="true" enableKeyboard="true" frameStrata="DIALOG" hidden="true">
<Frames>
<Frame name="GlueDialogBackground">
<Size>
<AbsDimension x="512" y="256"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\tooltips\BorderAlert" tile="true">
<BackgroundInsets>
<AbsInset left="4" right="4" top="4" bottom="4"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="GlueDialogText" inherits="GlueFontNormalLarge">
<Size>
<AbsDimension x="450" y="0"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-16"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<Texture name="GlueDialogAlertIcon" file="Interface\DialogFrame\UI-Dialog-Icon-AlertNew" hidden="true">
<Size>
<AbsDimension x="48" y="48"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="24" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<SimpleHTML name="GlueDialogHTML" hyperlinkFormat="|cff06ff07|H%s|h[%s]|h|r" hidden="true">
<Size>
<AbsDimension x="450" y="30"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-16"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnHyperlinkClick>
LaunchURL(link);
</OnHyperlinkClick>
</Scripts>
<FontString inherits="GlueFontNormalLarge" spacing="2"/>
<FontStringHeader1 inherits="GlueFontNormalLarge" spacing="4"/>
<FontStringHeader2 inherits="GlueFontHighlight" spacing="4"/>
</SimpleHTML>
<Button name="GlueDialogButton1" inherits="GlueDialogButtonTemplate" id="1"/>
<Button name="GlueDialogButton2" inherits="GlueDialogButtonTemplate" id="2"/>
<Button name="GlueDialogButton3" inherits="GlueDialogButtonTemplate" id="3"/>
</Frames>
</Frame>
<EditBox name="$parentEditBox" historyLines="1" hidden="true">
<Size>
<AbsDimension x="130" y="32"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Left">
<Size>
<AbsDimension x="75" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="-10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.29296875" top="0" bottom="1.0"/>
</Texture>
<Texture file="Interface\ChatFrame\UI-ChatInputBorder-Right">
<Size>
<AbsDimension x="75" y="32"/>
</Size>
<Anchors>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="10" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.70703125" right="1.0" top="0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnEnterPressed>
StaticPopup_EditBoxOnEnterPressed();
</OnEnterPressed>
<OnEscapePressed>
StaticPopup_EditBoxOnEscapePressed();
</OnEscapePressed>
</Scripts>
<FontString inherits="GlueFontHighlight"/>
</EditBox>
</Frames>
<Scripts>
<OnLoad>
GlueDialog_OnLoad(self);
</OnLoad>
<OnShow>
GlueDialog_OnShow(self);
self:Raise();
</OnShow>
<OnUpdate>
GlueDialog_OnUpdate(self, elapsed);
</OnUpdate>
<OnEvent>
GlueDialog_OnEvent(self, event, ...);
</OnEvent>
<OnHide>
GlueDialog_OnHide();
</OnHide>
<OnKeyDown>
GlueDialog_OnKeyDown(key);
</OnKeyDown>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,545 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
CurrentGlueMusic = "GS_LichKing";
GlueCreditsSoundKits = { };
GlueCreditsSoundKits[1] = "Menu-Credits01";
GlueCreditsSoundKits[2] = "Menu-Credits02";
GlueCreditsSoundKits[3] = "Menu-Credits03";
GlueScreenInfo = { };
GlueScreenInfo["login"] = "AccountLogin";
GlueScreenInfo["charselect"] = "CharacterSelect";
GlueScreenInfo["realmwizard"] = "RealmWizard";
GlueScreenInfo["charcreate"] = "CharacterCreate";
GlueScreenInfo["patchdownload"] = "PatchDownload";
GlueScreenInfo["trialconvert"] = "TrialConvert";
GlueScreenInfo["movie"] = "MovieFrame";
GlueScreenInfo["credits"] = "CreditsFrame";
GlueScreenInfo["options"] = "OptionsFrame";
CharModelFogInfo = { };
CharModelFogInfo["HUMAN"] = { r=0.8, g=0.65, b=0.73, far=222 };
CharModelFogInfo["ORC"] = { r=0.5, g=0.5, b=0.5, far=270 };
CharModelFogInfo["DWARF"] = { r=0.85, g=0.88, b=1.0, far=500 };
CharModelFogInfo["NIGHTELF"] = { r=0.25, g=0.22, b=0.55, far=611 };
CharModelFogInfo["TAUREN"] = { r=1.0, g=0.61, b=0.42, far=153 };
CharModelFogInfo["SCOURGE"] = { r=0, g=0.22, b=0.22, far=26 };
CharModelFogInfo["CHARACTERSELECT"] = { r=0.8, g=0.65, b=0.73, far=222 };
CharModelGlowInfo = { };
CharModelGlowInfo["WORGEN"] = 0.0;
CharModelGlowInfo["GOBLIN"] = 0.0;
CharModelGlowInfo["HUMAN"] = 0.15;
CharModelGlowInfo["DWARF"] = 0.15;
CharModelGlowInfo["CHARACTERSELECT"] = 0.3;
GlueAmbienceTracks = { };
GlueAmbienceTracks["HUMAN"] = "GlueScreenHuman";
GlueAmbienceTracks["ORC"] = "GlueScreenOrcTroll";
GlueAmbienceTracks["DWARF"] = "GlueScreenDwarfGnome";
GlueAmbienceTracks["TAUREN"] = "GlueScreenTauren";
GlueAmbienceTracks["SCOURGE"] = "GlueScreenUndead";
GlueAmbienceTracks["NIGHTELF"] = "GlueScreenNightElf";
GlueAmbienceTracks["DRAENEI"] = "GlueScreenDraenei";
GlueAmbienceTracks["BLOODELF"] = "GlueScreenBloodElf";
GlueAmbienceTracks["DARKPORTAL"] = "GlueScreenIntro";
GlueAmbienceTracks["DEATHKNIGHT"] = "GlueScreenIntro";
GlueAmbienceTracks["CHARACTERSELECT"] = "GlueScreenIntro";
GlueAmbienceTracks["GOBLIN"] = "GlueScreenGoblin";
GlueAmbienceTracks["WORGEN"] = "GlueScreenWorgen";
-- RaceLights[] duplicates the 3.2.2 color values in the models. Henceforth, the models no longer contain directional lights
RaceLights = {
HUMAN = {
{1, 0, 0.000000, 0.000000, -1.000000, 1.0, 0.27, 0.27, .27, 1.0, 0, 0, 0},
{1, 0, -0.45756075, -0.58900136, -0.66611975, 1.0, 0.000000, 0.000000, 0.000000, 1.0, 0.19882353, 0.34921569, 0.43588236 },
{1, 0, -0.64623469, 0.57582057, -0.50081086, 1.0, 0.000000, 0.000000, 0.000000, 2.0, 0.52196085, 0.44, 0.29764709 },
},
ORC = {
{1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.15000, 0.15000, 0.15000, 1.0, 0.00000, 0.00000, 0.00000},
{1, 0, -0.74919, 0.35208, -0.56103, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.44706, 0.54510, 0.73725},
{1, 0, 0.53162, -0.84340, 0.07780, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.55, 0.338625, 0.148825},
},
DWARF = {
{1, 0, -0.00000, -0.00000, -1.00000, 1.0, 0.30000, 0.30000, 0.30000, 0.0, 0.00000, 0.00000, 0.00000},
{1, 0, -0.88314, 0.42916, -0.18945, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.44706, 0.67451, 0.760785},
},
TAUREN = {
{1, 0, -0.48073, 0.71827, -0.50297, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.65, 0.397645, 0.2727},
{1, 0, -0.49767, -0.78677, 0.36513, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.60000, 0.47059, 0.32471},
},
SCOURGE = {
{1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.20000, 0.20000, 0.20000, 1.0, 0.00000, 0.00000, 0.00000},
},
NIGHTELF = {
{1, 0, -0.00000, -0.00000, -1.00000, 1.0, 0.09020, 0.09020, 0.17020, 1.0, 0.00000, 0.00000, 0.00000},
},
DRAENEI = {
{1, 0, 0.61185, 0.62942, -0.47903, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.56941, 0.52000, 0.60000},
{1, 0, -0.64345, -0.31052, -0.69968, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.60941, 0.60392, 0.70000},
{1, 0, -0.46481, -0.14320, 0.87376, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.5835, 0.48941, 0.60000},
},
BLOODELF = {
{1, 0, -0.82249, -0.54912, -0.14822, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.581175, 0.50588, 0.42588},
{1, 0, 0.00000, -0.00000, -1.00000, 1.0, 0.60392, 0.61490, 0.70000, 1.0, 0.00000, 0.00000, 0.00000},
{1, 0, 0.02575, 0.86518, -0.50081, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.59137, 0.51745, 0.63471},
},
DEATHKNIGHT = {
{1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.38824, 0.66353, 0.76941, 1.0, 0.00000, 0.00000, 0.00000},
},
CHARACTERSELECT = {
{1, 0, 0.00000, 0.00000, -1.00000, 1.0, 0.15000, 0.15000, 0.15000, 1.0, 0.00000, 0.00000, 0.00000},
{1, 0, -0.74919, 0.35208, -0.56103, 1.0, 0.00000, 0.00000, 0.00000, 1.0, 0.44706, 0.54510, 0.73725},
{1, 0, 0.53162, -0.84340, 0.07780, 1.0, 0.00000, 0.00000, 0.00000, 2.0, 0.55, 0.338625, 0.148825},
},
}
-- indicies for adding lights ModelFFX:Add*Light
LIGHT_LIVE = 0;
LIGHT_GHOST = 1;
-- Alpha animation stuff
FADEFRAMES = {};
CURRENT_GLUE_SCREEN = nil;
PENDING_GLUE_SCREEN = nil;
-- Time in seconds to fade
LOGIN_FADE_IN = 1.5;
LOGIN_FADE_OUT = 0.5;
CHARACTER_SELECT_FADE_IN = 0.75;
RACE_SELECT_INFO_FADE_IN = .5;
RACE_SELECT_INFO_FADE_OUT = .5;
-- Realm Split info
SERVER_SPLIT_SHOW_DIALOG = false;
SERVER_SPLIT_CLIENT_STATE = -1; -- -1 uninitialized; 0 - no choice; 1 - realm 1; 2 - realm 2
SERVER_SPLIT_STATE_PENDING = -1; -- -1 uninitialized; 0 - no server split; 1 - server split (choice mode); 2 - server split (no choice mode)
SERVER_SPLIT_DATE = nil;
-- Account Messaging info
ACCOUNT_MSG_NUM_AVAILABLE = 0;
ACCOUNT_MSG_PRIORITY = 0;
ACCOUNT_MSG_HEADERS_LOADED = false;
ACCOUNT_MSG_BODY_LOADED = false;
ACCOUNT_MSG_CURRENT_INDEX = nil;
-- Gender Constants
SEX_NONE = 1;
SEX_MALE = 2;
SEX_FEMALE = 3;
function SetGlueScreen(name)
local newFrame;
for index, value in pairs(GlueScreenInfo) do
local frame = _G[value];
if ( frame ) then
frame:Hide();
if ( index == name ) then
newFrame = frame;
end
end
end
if ( newFrame ) then
newFrame:Show();
SetCurrentScreen(name);
SetCurrentGlueScreenName(name);
if ( name == "credits" ) then
PlayCreditsMusic( GlueCreditsSoundKits[CreditsFrame.creditsType] );
StopGlueAmbience();
elseif ( name ~= "movie" ) then
PlayGlueMusic(CurrentGlueMusic);
if (name == "login") then
PlayGlueAmbience(GlueAmbienceTracks["DARKPORTAL"], 4.0);
end
end
end
end
function SetCurrentGlueScreenName(name)
CURRENT_GLUE_SCREEN = name;
end
function GetCurrentGlueScreenName()
return CURRENT_GLUE_SCREEN;
end
function SetPendingGlueScreenName(name)
PENDING_GLUE_SCREEN = name;
end
function GetPendingGlueScreenName()
return PENDING_GLUE_SCREEN;
end
function GlueParent_OnLoad(self)
local width = GetScreenWidth();
local height = GetScreenHeight();
if ( width / height > 16 / 9) then
local maxWidth = height * 16 / 9;
local barWidth = ( width - maxWidth ) / 2;
self:ClearAllPoints();
self:SetPoint("TOPLEFT", barWidth, 0);
self:SetPoint("BOTTOMRIGHT", -barWidth, 0);
end
self:RegisterEvent("FRAMES_LOADED");
self:RegisterEvent("SET_GLUE_SCREEN");
self:RegisterEvent("START_GLUE_MUSIC");
self:RegisterEvent("DISCONNECTED_FROM_SERVER");
self:RegisterEvent("GET_PREFERRED_REALM_INFO");
self:RegisterEvent("SERVER_SPLIT_NOTICE");
self:RegisterEvent("ACCOUNT_MESSAGES_AVAILABLE");
self:RegisterEvent("ACCOUNT_MESSAGES_HEADERS_LOADED");
self:RegisterEvent("ACCOUNT_MESSAGES_BODY_LOADED");
end
function GlueParent_OnEvent(event, arg1, arg2, arg3)
if ( event == "FRAMES_LOADED" ) then
LocalizeFrames();
elseif ( event == "SET_GLUE_SCREEN" ) then
GlueScreenExit(GetCurrentGlueScreenName(), arg1);
elseif ( event == "START_GLUE_MUSIC" ) then
PlayGlueMusic(CurrentGlueMusic);
PlayGlueAmbience(GlueAmbienceTracks["DARKPORTAL"], 4.0);
elseif ( event == "DISCONNECTED_FROM_SERVER" ) then
TokenEntry_Cancel(TokenEnterDialog);
SetGlueScreen("login");
if ( arg1 == 4 ) then
GlueDialog_Show("PARENTAL_CONTROL");
else
GlueDialog_Show("DISCONNECTED");
end
AddonList:Hide();
elseif ( event == "GET_PREFERRED_REALM_INFO" ) then
if( arg1 == 1) then
SetPreferredInfo(1);
else
SetGlueScreen("realmwizard");
PlayGlueAmbience(GlueAmbienceTracks["DARKPORTAL"], 4.0);
end
elseif ( event == "SERVER_SPLIT_NOTICE" ) then
CharacterSelectRealmSplitButton:Show();
if ( SERVER_SPLIT_STATE_PENDING == -1 and arg1 == 0 and arg2 == 1 ) then
SERVER_SPLIT_SHOW_DIALOG = true;
end
SERVER_SPLIT_CLIENT_STATE = arg1;
SERVER_SPLIT_STATE_PENDING = arg2;
SERVER_SPLIT_DATE = arg3;
elseif ( event == "ACCOUNT_MESSAGES_AVAILABLE" ) then
-- ACCOUNT_MSG_NUM_AVAILABLE = arg1;
ACCOUNT_MSG_HEADERS_LOADED = false;
ACCOUNT_MSG_BODY_LOADED = false;
ACCOUNT_MSG_CURRENT_INDEX = nil;
AccountMsg_LoadHeaders();
elseif ( event == "ACCOUNT_MESSAGES_HEADERS_LOADED" ) then
ACCOUNT_MSG_HEADERS_LOADED = true;
ACCOUNT_MSG_NUM_AVAILABLE = AccountMsg_GetNumUnreadMsgs();
ACCOUNT_MSG_CURRENT_INDEX = AccountMsg_GetIndexNextUnreadMsg();
if ( ACCOUNT_MSG_NUM_AVAILABLE > 0 ) then
AccountMsg_LoadBody( ACCOUNT_MSG_CURRENT_INDEX );
end
elseif ( event == "ACCOUNT_MESSAGES_BODY_LOADED" ) then
ACCOUNT_MSG_BODY_LOADED = true;
end
end
-- Glue screen animation handling
function GlueScreenExit(currentFrame, pendingFrame)
if ( currentFrame == "login" and pendingFrame == "charselect" ) then
GlueFrameFadeOut(AccountLoginUI, LOGIN_FADE_OUT, GoToPendingGlueScreen);
SetPendingGlueScreenName(pendingFrame);
else
SetGlueScreen(pendingFrame);
end
end
function GoToPendingGlueScreen()
SetGlueScreen(GetPendingGlueScreenName());
end
-- Generic fade function
function GlueFrameFade(frame, timeToFade, mode, finishedFunction)
if ( frame ) then
frame.fadeTimer = 0;
frame.timeToFade = timeToFade;
frame.mode = mode;
-- finishedFunction is an optional function that is called when the animation is complete
if ( finishedFunction ) then
frame.finishedFunction = finishedFunction;
end
tinsert(FADEFRAMES, frame);
end
end
-- Fade in function
function GlueFrameFadeIn(frame, timeToFade, finishedFunction)
GlueFrameFade(frame, timeToFade, "IN", finishedFunction);
end
-- Fade out function
function GlueFrameFadeOut(frame, timeToFade, finishedFunction)
GlueFrameFade(frame, timeToFade, "OUT", finishedFunction);
end
-- Function that actually performs the alpha change
function GlueFrameFadeUpdate(elapsed)
local index = 1;
while FADEFRAMES[index] do
local frame = FADEFRAMES[index];
frame.fadeTimer = frame.fadeTimer + elapsed;
if ( frame.fadeTimer < frame.timeToFade ) then
if ( frame.mode == "IN" ) then
frame:SetAlpha(frame.fadeTimer / frame.timeToFade);
elseif ( frame.mode == "OUT" ) then
frame:SetAlpha((frame.timeToFade - frame.fadeTimer) / frame.timeToFade);
end
else
if ( frame.mode == "IN" ) then
frame:SetAlpha(1.0);
elseif ( frame.mode == "OUT" ) then
frame:SetAlpha(0);
end
GlueFrameFadeRemoveFrame(frame);
if ( frame.finishedFunction ) then
frame.finishedFunction();
frame.finishedFunction = nil;
end
end
index = index + 1;
end
end
function GlueFrameRemoveFrame(frame, list)
local index = 1;
while list[index] do
if ( frame == list[index] ) then
tremove(list, index);
end
index = index + 1;
end
end
function GlueFrameFadeRemoveFrame(frame)
GlueFrameRemoveFrame(frame, FADEFRAMES);
end
function SetLighting(model, race)
model:SetSequence(0);
model:SetCamera(0);
local fogInfo = CharModelFogInfo[race];
if ( fogInfo ) then
model:SetFogColor(fogInfo.r, fogInfo.g, fogInfo.b);
model:SetFogNear(0);
model:SetFogFar(fogInfo.far);
else
model:ClearFog();
end
local glowInfo = CharModelGlowInfo[race];
if ( glowInfo ) then
model:SetGlow(glowInfo);
else
model:SetGlow(0.3);
end
model:ResetLights();
local LightValues = RaceLights[race];
if(LightValues) then
for index, Array in pairs (LightValues) do
if (Array[1]==1) then -- is this light enabled?
for j, f in pairs ({model.AddCharacterLight, model.AddLight, model.AddPetLight }) do
f(model, LIGHT_LIVE, unpack(Array));
end
end
end
end
end
CHARACTER_MODEL_LIGHT = {
["Alliance"] = {2.499000, -3.400000, -3.844000, 0.505020, 0.680000, 0.750000, 1.120000, 0.550000, 0.680000, 1.120000, 1.350000},
["Horde"] = {9.800000, -8.640000, -9.600000, 0.829100, 0.980000, 0.570000, 0.380000, 0.780000, 0.840000, 0.398850, 0.273120},
["DeathKnight"] = {2.587001, -4.596000, -2.451000, 0.533330, 0.625590, 0.885200, 1.200000, 1.300000, 0.629360, 0.889180, 1.350000}
}
function SetBackgroundModel(model, name, raza, gender)
local nameupper = strupper(name);
local ligthning = nameupper;
if nameupper == "NIGHTELF" or nameupper == "SCOURGE" then
ligthning = "NIGHTELF";
elseif nameupper == "BLOODELF" then
ligthning = "BLOODELF";
end
local path = "Interface\\Glues\\Models\\UI_"..name.."\\UI_"..name..".m2";
local allianceRaces = {
["HUMAN"] = true,
["DWARF"] = true,
["NIGHTELF"] = true,
["GNOME"] = true,
["DRAENEI"] = true,
["WORGEN"] = true
};
local hordeRaces = {
["ORC"] = true,
["SCOURGE"] = true,
["TAUREN"] = true,
["TROLL"] = true,
["BLOODELF"] = true,
["GOBLIN"] = true
};
local backgroundType = nil;
if model == CharacterCreate then
if nameupper == "DEATHKNIGHT" then
SetCharCustomizeBackground("Interface\\Glues\\Models\\UI_DeathKnight\\UI_DeathKnight.m2");
ligthning = "DEATHKNIGHT";
backgroundType = "DeathKnight";
elseif allianceRaces[nameupper] then
SetCharCustomizeBackground("Interface\\Glues\\Models\\UI_ALLIANCE\\UI_Alliance.m2");
ligthning = "HUMAN";
backgroundType = "Alliance";
elseif hordeRaces[nameupper] then
SetCharCustomizeBackground("Interface\\Glues\\Models\\UI_HORDE\\UI_HORDE.m2");
ligthning = "ORC";
backgroundType = "Horde";
else
SetCharCustomizeBackground(path);
end
else
GLOBAL_RACE_CHANGE = 0;
if nameupper == "DEATHKNIGHT" then
SetCharSelectBackground("Interface\\Glues\\Models\\UI_DeathKnight\\UI_DeathKnight.m2");
ligthning = "DEATHKNIGHT";
backgroundType = "DeathKnight";
elseif allianceRaces[nameupper] then
SetCharSelectBackground("Interface\\Glues\\Models\\UI_ALLIANCE\\UI_Alliance.m2");
ligthning = "HUMAN";
backgroundType = "Alliance";
elseif hordeRaces[nameupper] then
SetCharSelectBackground("Interface\\Glues\\Models\\UI_HORDE\\UI_HORDE.m2");
ligthning = "ORC";
backgroundType = "Horde";
else
SetCharSelectBackground(path);
end
end
if backgroundType and CHARACTER_MODEL_LIGHT[backgroundType] then
local lightSettings = CHARACTER_MODEL_LIGHT[backgroundType];
model:ResetLights();
model:AddCharacterLight(LIGHT_LIVE, 1, 0, unpack(lightSettings));
model:AddLight(LIGHT_LIVE, 1, 0, unpack(lightSettings));
model:AddPetLight(LIGHT_LIVE, 1, 0, unpack(lightSettings));
else
SetLighting(model, ligthning);
end
PlayGlueAmbience(GlueAmbienceTracks[nameupper], 4.0);
end
function SecondsToTime(seconds, noSeconds)
local time = "";
local count = 0;
local tempTime;
seconds = floor(seconds);
if ( seconds >= 86400 ) then
tempTime = floor(seconds / 86400);
time = tempTime.." "..DAYS_ABBR.." ";
seconds = mod(seconds, 86400);
count = count + 1;
end
if ( seconds >= 3600 ) then
tempTime = floor(seconds / 3600);
time = time..tempTime.." "..HOURS_ABBR.." ";
seconds = mod(seconds, 3600);
count = count + 1;
end
if ( count < 2 and seconds >= 60 ) then
tempTime = floor(seconds / 60);
time = time..tempTime.." "..MINUTES_ABBR.." ";
seconds = mod(seconds, 60);
count = count + 1;
end
if ( count < 2 and seconds > 0 and not noSeconds ) then
seconds = format("%d", seconds);
time = time..seconds.." "..SECONDS_ABBR.." ";
end
return time;
end
function MinutesToTime(mins, hideDays)
local time = "";
local count = 0;
local tempTime;
-- only show days if hideDays is false
if ( mins > 1440 and not hideDays ) then
tempTime = floor(mins / 1440);
time = tempTime.." "..DAYS_ABBR.." ";
mins = mod(mins, 1440);
count = count + 1;
end
if ( mins > 60 ) then
tempTime = floor(mins / 60);
time = time..tempTime.." "..HOURS_ABBR.." ";
mins = mod(mins, 60);
count = count + 1;
end
if ( count < 2 ) then
tempTime = mins;
time = time..tempTime.." "..MINUTES_ABBR.." ";
count = count + 1;
end
return time;
end
function TriStateCheckbox_SetState(checked, checkButton)
local checkedTexture = _G[checkButton:GetName().."CheckedTexture"];
if ( not checkedTexture ) then
message("Can't find checked texture");
end
if ( not checked or checked == 0 ) then
-- nil or 0 means not checked
checkButton:SetChecked(nil);
checkButton.state = 0;
elseif ( checked == 2 ) then
-- 2 is a normal
checkButton:SetChecked(1);
checkedTexture:SetVertexColor(1, 1, 1);
checkedTexture:SetDesaturated(0);
checkButton.state = 2;
else
-- 1 is a gray check
checkButton:SetChecked(1);
local shaderSupported = checkedTexture:SetDesaturated(1);
if ( not shaderSupported ) then
checkedTexture:SetVertexColor(0.5, 0.5, 0.5);
end
checkButton.state = 1;
end
end
function SetStateRequestInfo( choice )
if ( SERVER_SPLIT_CLIENT_STATE ~= choice ) then
SERVER_SPLIT_CLIENT_STATE = choice;
SetRealmSplitState(choice);
RealmSplit_SetChoiceText();
-- RequestRealmSplitInfo();
end
end
function UpgradeAccount()
PlaySound("gsLoginNewAccount");
LaunchURL(AUTH_NO_TIME_URL);
end
@@ -0,0 +1,19 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="GlueParent.lua"/>
<Frame name="GlueParent" setAllPoints="true">
<Scripts>
<!-- Register here for any events you want to monitor globally -->
<OnLoad>
GlueParent_OnLoad(self);
</OnLoad>
<!-- Respond here to any events you want to monitor globally -->
<OnEvent>
GlueParent_OnEvent(event, ...);
</OnEvent>
<OnUpdate>
GlueFrameFadeUpdate(elapsed);
</OnUpdate>
</Scripts>
</Frame>
</Ui>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,362 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
function GlueScrollFrameTemplate_OnMouseWheel(self, value, scrollBar)
scrollBar = scrollBar or _G[self:GetName() .. "ScrollBar"];
if ( value > 0 ) then
scrollBar:SetValue(scrollBar:GetValue() - (scrollBar:GetHeight() / 2));
else
scrollBar:SetValue(scrollBar:GetValue() + (scrollBar:GetHeight() / 2));
end
end
-- Function to handle the update of manually calculated scrollframes. Used mostly for listings with an indeterminate number of items
function GlueScrollFrame_Update(frame, numItems, numToDisplay, valueStep, highlightFrame, smallHighlightWidth, bigHighlightWidth )
-- If more than one screen full of skills then show the scrollbar
local frameName = frame:GetName();
local scrollBar = _G[ frameName.."ScrollBar" ];
if ( numItems > numToDisplay ) then
frame:Show();
else
scrollBar:SetValue(0);
frame:Hide();
end
if ( frame:IsShown() ) then
local scrollChildFrame = _G[ frameName.."ScrollChildFrame" ];
local scrollUpButton = _G[ frameName.."ScrollBarScrollUpButton" ];
local scrollDownButton = _G[ frameName.."ScrollBarScrollDownButton" ];
local scrollFrameHeight = 0;
local scrollChildHeight = 0;
if ( numItems > 0 ) then
scrollFrameHeight = (numItems - numToDisplay) * valueStep;
scrollChildHeight = numItems * valueStep;
if ( scrollFrameHeight < 0 ) then
scrollFrameHeight = 0;
end
scrollChildFrame:Show();
else
scrollChildFrame:Hide();
end
scrollBar:SetMinMaxValues(0, scrollFrameHeight);
scrollBar:SetValueStep(valueStep);
scrollChildFrame:SetHeight(scrollChildHeight);
-- Arrow button handling
if ( scrollBar:GetValue() == 0 ) then
scrollUpButton:Disable();
else
scrollUpButton:Enable();
end
if ((scrollBar:GetValue() - scrollFrameHeight) == 0) then
scrollDownButton:Disable();
else
scrollDownButton:Enable();
end
-- Shrink because scrollbar is shown
if ( highlightFrame ) then
highlightFrame:SetWidth(smallHighlightWidth);
end
else
-- Widen because scrollbar is hidden
if ( highlightFrame ) then
highlightFrame:SetWidth(bigHighlightWidth);
end
end
end
function GlueScrollFrame_OnScrollRangeChanged(self, yrange)
local scrollbar = _G[self:GetName().."ScrollBar"];
if ( not yrange ) then
yrange = self:GetVerticalScrollRange();
end
local value = scrollbar:GetValue();
if ( value > yrange ) then
value = yrange;
end
scrollbar:SetMinMaxValues(0, yrange);
scrollbar:SetValue(value);
if ( floor(yrange) == 0 ) then
if (self.scrollBarHideable) then
_G[self:GetName().."ScrollBar"]:Hide();
_G[scrollbar:GetName().."ScrollDownButton"]:Hide();
_G[scrollbar:GetName().."ScrollUpButton"]:Hide();
else
_G[scrollbar:GetName().."ScrollDownButton"]:Disable();
_G[scrollbar:GetName().."ScrollUpButton"]:Disable();
_G[scrollbar:GetName().."ScrollDownButton"]:Show();
_G[scrollbar:GetName().."ScrollUpButton"]:Show();
end
else
_G[scrollbar:GetName().."ScrollDownButton"]:Show();
_G[scrollbar:GetName().."ScrollUpButton"]:Show();
_G[self:GetName().."ScrollBar"]:Show();
_G[scrollbar:GetName().."ScrollDownButton"]:Enable();
end
end
function GlueScrollFrame_OnVerticalScroll(self, value)
local scrollbar = _G[self:GetName().."ScrollBar"];
scrollbar:SetValue(value);
local min;
local max;
min, max = scrollbar:GetMinMaxValues();
if ( value == 0 ) then
_G[scrollbar:GetName().."ScrollUpButton"]:Disable();
else
_G[scrollbar:GetName().."ScrollUpButton"]:Enable();
end
if ((scrollbar:GetValue() - max) == 0) then
_G[scrollbar:GetName().."ScrollDownButton"]:Disable();
else
_G[scrollbar:GetName().."ScrollDownButton"]:Enable();
end
end
function GlueScrollFrame_OnLoad(self)
_G[self:GetName().."ScrollBarScrollDownButton"]:Disable();
_G[self:GetName().."ScrollBarScrollUpButton"]:Disable();
local scrollbar = _G[self:GetName().."ScrollBar"];
scrollbar:SetMinMaxValues(0, 0);
scrollbar:SetValue(0);
self.offset = 0;
end
-- Function to handle the update of manually calculated scrollframes. Used mostly for listings with an indeterminate number of items
function FauxScrollFrame_Update(frame, numItems, numToDisplay, valueStep, button, smallWidth, bigWidth, highlightFrame, smallHighlightWidth, bigHighlightWidth, alwaysShowScrollBar )
-- If more than one screen full of skills then show the scrollbar
local frameName = frame:GetName();
local scrollBar = _G[ frameName.."ScrollBar" ];
local showScrollBar;
if ( numItems > numToDisplay or alwaysShowScrollBar ) then
frame:Show();
showScrollBar = 1;
else
scrollBar:SetValue(0);
frame:Hide();
end
if ( frame:IsShown() ) then
local scrollChildFrame = _G[ frameName.."ScrollChildFrame" ];
local scrollUpButton = _G[ frameName.."ScrollBarScrollUpButton" ];
local scrollDownButton = _G[ frameName.."ScrollBarScrollDownButton" ];
local scrollFrameHeight = 0;
local scrollChildHeight = 0;
if ( numItems > 0 ) then
scrollFrameHeight = (numItems - numToDisplay) * valueStep;
scrollChildHeight = numItems * valueStep;
if ( scrollFrameHeight < 0 ) then
scrollFrameHeight = 0;
end
scrollChildFrame:Show();
else
scrollChildFrame:Hide();
end
scrollBar:SetMinMaxValues(0, scrollFrameHeight);
scrollBar:SetValueStep(valueStep);
scrollChildFrame:SetHeight(scrollChildHeight);
-- Arrow button handling
if ( scrollBar:GetValue() == 0 ) then
scrollUpButton:Disable();
else
scrollUpButton:Enable();
end
if ((scrollBar:GetValue() - scrollFrameHeight) == 0) then
scrollDownButton:Disable();
else
scrollDownButton:Enable();
end
-- Shrink because scrollbar is shown
if ( highlightFrame ) then
highlightFrame:SetWidth(smallHighlightWidth);
end
if ( button ) then
for i=1, numToDisplay do
_G[button..i]:SetWidth(smallWidth);
end
end
else
-- Widen because scrollbar is hidden
if ( highlightFrame ) then
highlightFrame:SetWidth(bigHighlightWidth);
end
if ( button ) then
for i=1, numToDisplay do
_G[button..i]:SetWidth(bigWidth);
end
end
end
return showScrollBar;
end
function FauxScrollFrame_OnVerticalScroll(self, value, itemHeight, updateFunction)
local scrollbar = _G[self:GetName().."ScrollBar"];
scrollbar:SetValue(value);
self.offset = floor((value / itemHeight) + 0.5);
updateFunction(self);
end
function FauxScrollFrame_GetOffset(frame)
return frame.offset;
end
function FauxScrollFrame_SetOffset(frame, offset)
frame.offset = offset;
end
--Tab stuffs
function GlueTemplates_TabResize(padding, tab, absoluteSize)
local tabName;
if ( tab ) then
tabName = tab:GetName();
end
local buttonMiddle = _G[tabName.."Middle"];
local buttonMiddleDisabled = _G[tabName.."MiddleDisabled"];
local sideWidths = 2 * _G[tabName.."Left"]:GetWidth();
local tabText = _G[tab:GetName().."Text"];
local width, tabWidth;
-- If there's an absolute size specified then use it
if ( absoluteSize ) then
if ( absoluteSize < sideWidths) then
width = 1;
tabWidth = sideWidths
else
width = absoluteSize - sideWidths;
tabWidth = absoluteSize
end
tabText:SetWidth(width);
else
-- Otherwise try to use padding
if ( padding ) then
width = tabText:GetStringWidth() + padding;
else
width = tabText:GetStringWidth() + 24;
end
tabWidth = width + sideWidths;
tabText:SetWidth(0);
end
if ( buttonMiddle ) then
buttonMiddle:SetWidth(width);
end
if ( buttonMiddleDisabled ) then
buttonMiddleDisabled:SetWidth(width);
end
tab:SetWidth(tabWidth);
local highlightTexture = _G[tabName.."HighlightTexture"];
if ( highlightTexture ) then
highlightTexture:SetWidth(tabWidth);
end
end
function GlueTemplates_SetTab(frame, id)
frame.selectedTab = id;
GlueTemplates_UpdateTabs(frame);
end
function GlueTemplates_GetSelectedTab(frame)
return frame.selectedTab;
end
function GlueTemplates_UpdateTabs(frame)
if ( frame.selectedTab ) then
local tab;
for i=1, frame.numTabs, 1 do
tab = _G[frame:GetName().."Tab"..i];
if ( tab.isDisabled ) then
GlueTemplates_SetDisabledTabState(tab);
elseif ( i == frame.selectedTab ) then
GlueTemplates_SelectTab(tab);
else
GlueTemplates_DeselectTab(tab);
end
end
end
end
function GlueTemplates_SetNumTabs(frame, numTabs)
frame.numTabs = numTabs;
end
function GlueTemplates_DisableTab(frame, index)
_G[frame:GetName().."Tab"..index].isDisabled = 1;
GlueTemplates_UpdateTabs(frame);
end
function GlueTemplates_EnableTab(frame, index)
local tab = _G[frame:GetName().."Tab"..index];
tab.isDisabled = nil;
-- Reset text color
tab:SetDisabledTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
GlueTemplates_UpdateTabs(frame);
end
function GlueTemplates_DeselectTab(tab)
local name = tab:GetName();
_G[name.."Left"]:Show();
_G[name.."Middle"]:Show();
_G[name.."Right"]:Show();
--tab:UnlockHighlight();
tab:Enable();
_G[name.."LeftDisabled"]:Hide();
_G[name.."MiddleDisabled"]:Hide();
_G[name.."RightDisabled"]:Hide();
end
function GlueTemplates_SelectTab(tab)
local name = tab:GetName();
_G[name.."Left"]:Hide();
_G[name.."Middle"]:Hide();
_G[name.."Right"]:Hide();
--tab:LockHighlight();
tab:Disable();
_G[name.."LeftDisabled"]:Show();
_G[name.."MiddleDisabled"]:Show();
_G[name.."RightDisabled"]:Show();
end
function GlueTemplates_SetDisabledTabState(tab)
local name = tab:GetName();
_G[name.."Left"]:Show();
_G[name.."Middle"]:Show();
_G[name.."Right"]:Show();
--tab:UnlockHighlight();
tab:Disable();
tab.text = tab:GetText();
-- Gray out text
tab:SetDisabledTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
_G[name.."LeftDisabled"]:Hide();
_G[name.."MiddleDisabled"]:Hide();
_G[name.."RightDisabled"]:Hide();
end
function EditBox_HandleTabbing(self, tabList)
local editboxName = self:GetName();
local index;
for i=1, #tabList do
if ( editboxName == tabList[i] ) then
index = i;
break;
end
end
if ( IsShiftKeyDown() ) then
index = index - 1;
else
index = index + 1;
end
if ( index == 0 ) then
index = #tabList;
elseif ( index > #tabList ) then
index = 1;
end
local target = tabList[index];
_G[target]:SetFocus();
end
@@ -0,0 +1,268 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="GlueTemplates.lua"/>
<!-- ============================================================================ -->
<!-- TEXTURAS DE EDITBOX GLUEDARK -->
<!-- ============================================================================ -->
<Texture name="GlueDark_editboxLeft" file="Interface/Glues/Common/generic" virtual="true">
<Size x="13" y="36"/>
<TexCoords left="0.771484375" right="0.806640625" top="0.45703125" bottom="0.556640625"/>
</Texture>
<Texture name="GlueDark_editboxLeftHover" file="Interface/Glues/Common/generic" virtual="true">
<Size x="13" y="36"/>
<TexCoords left="0.236328125" right="0.271484375" top="0.865234375" bottom="0.96484375"/>
</Texture>
<Texture name="GlueDark_editboxMiddle" file="Interface/Glues/Common/generic" virtual="true">
<Size x="13" y="36"/>
<TexCoords left="0.58984375" right="0.625" top="0.677734375" bottom="0.77734375"/>
</Texture>
<Texture name="GlueDark_editboxMiddleHover" file="Interface/Glues/Common/generic" virtual="true">
<Size x="13" y="36"/>
<TexCoords left="0.197265625" right="0.232421875" top="0.865234375" bottom="0.96484375"/>
</Texture>
<Texture name="GlueDark_editboxRight" file="Interface/Glues/Common/generic" virtual="true">
<Size x="13" y="36"/>
<TexCoords left="0.859375" right="0.89453125" top="0.234375" bottom="0.333984375"/>
</Texture>
<Texture name="GlueDark_editboxRightHover" file="Interface/Glues/Common/generic" virtual="true">
<Size x="13" y="36"/>
<TexCoords left="0.30859375" right="0.34375" top="0.83984375" bottom="0.939453125"/>
</Texture>
<!-- ============================================================================ -->
<Button name="GlueCloseButton" virtual="true">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Scripts>
<OnClick>
self:GetParent():Hide();
</OnClick>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Up"/>
<PushedTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Down"/>
<HighlightTexture file="Interface\Buttons\UI-Panel-MinimizeButton-Highlight" alphaMode="ADD"/>
</Button>
<EditBox name="GlueDark_EditBoxTemplate" historyLines="1" virtual="true">
<Size x="54" y="37"/>
<HitRectInsets left="6" right="6" top="5" bottom="5"/>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" parentKey="Left" inherits="GlueDark_editboxLeft">
<Anchors>
<Anchor point="TOPLEFT"/>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture name="$parentRight" parentKey="Right" inherits="GlueDark_editboxRight">
<Anchors>
<Anchor point="TOPRIGHT"/>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
</Texture>
<Texture name="$parentMiddle" parentKey="Middle" inherits="GlueDark_editboxMiddle">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentLeft" relativePoint="TOPRIGHT" x="0"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentRight" relativePoint="BOTTOMLEFT" x="0.3"/>
</Anchors>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentTitleText" parentKey="TitleText" inherits="GlueDark_Font_15" justifyH="CENTER">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP" y="0" x="0"/>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
if not self.isFocused then
self.Left:SetTexCoord(0.236328125, 0.271484375, 0.865234375, 0.96484375);
self.Middle:SetTexCoord(0.197265625, 0.232421875, 0.865234375, 0.96484375);
self.Right:SetTexCoord(0.30859375, 0.34375, 0.83984375, 0.939453125);
end
</OnEnter>
<OnLeave>
if not self.isFocused then
self.Left:SetTexCoord(0.771484375, 0.806640625, 0.45703125, 0.556640625);
self.Middle:SetTexCoord(0.58984375, 0.625, 0.677734375, 0.77734375);
self.Right:SetTexCoord(0.859375, 0.89453125, 0.234375, 0.333984375);
end
</OnLeave>
<OnEditFocusGained>
self.isFocused = true;
self.Left:SetTexCoord(0.236328125, 0.271484375, 0.865234375, 0.96484375);
self.Middle:SetTexCoord(0.197265625, 0.232421875, 0.865234375, 0.96484375);
self.Right:SetTexCoord(0.30859375, 0.34375, 0.83984375, 0.939453125);
self:HighlightText();
</OnEditFocusGained>
<OnEditFocusLost>
self.isFocused = nil;
self:HighlightText(0, 0);
self.Left:SetTexCoord(0.771484375, 0.806640625, 0.45703125, 0.556640625);
self.Middle:SetTexCoord(0.58984375, 0.625, 0.677734375, 0.77734375);
self.Right:SetTexCoord(0.859375, 0.89453125, 0.234375, 0.333984375);
</OnEditFocusLost>
</Scripts>
<FontString inherits="GlueEditBoxFont"/>
<TextInsets>
<AbsInset left="12" right="12" top="8" bottom="8"/>
</TextInsets>
</EditBox>
<Texture name="GlueScrollBarButton" virtual="true">
<TexCoords left="0.23" right="0.77" top="0.23" bottom="0.77"/>
</Texture>
<Button name="GlueScrollUpButtonTemplate" virtual="true">
<Size>
<AbsDimension x="18" y="18"/>
</Size>
<NormalTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Up"/>
<PushedTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Down"/>
<DisabledTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Disabled"/>
<HighlightTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollUpButton-Highlight" alphaMode="ADD"/>
</Button>
<Button name="GlueScrollDownButtonTemplate" virtual="true">
<Size>
<AbsDimension x="18" y="18"/>
</Size>
<NormalTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Up"/>
<PushedTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Down"/>
<DisabledTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Disabled"/>
<HighlightTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-ScrollDownButton-Highlight" alphaMode="ADD"/>
</Button>
<Texture name="GluePanelButtonDisabledDownTexture" file="Interface\Buttons\UI-Panel-Button-Disabled-Down" virtual="true">
<TexCoords left="0" right="0.625" top="0" bottom="0.6875"/>
</Texture>
<Button name="GluePanelButtonTemplate" virtual="true">
<ButtonText name="$parentText">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="1"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<DisabledFont style="GlueFontDisable"/>
<NormalTexture inherits="GluePanelButtonUpTexture"/>
<PushedTexture inherits="GluePanelButtonDownTexture"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTexture"/>
</Button>
<Button name="GluePanelButtonGrayTemplate" virtual="true">
<NormalFont style="GlueFontHighlight"/>
<HighlightFont style="GlueFontHighlight"/>
<DisabledFont style="GlueFontDisable"/>
<NormalTexture inherits="GluePanelButtonDisabledTexture"/>
<PushedTexture inherits="GluePanelButtonDisabledDownTexture"/>
<DisabledTexture inherits="GluePanelButtonDisabledTexture"/>
<HighlightTexture inherits="GluePanelButtonHighlightTexture"/>
</Button>
<CheckButton name="GlueCheckButtonTemplate" virtual="true">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GlueFontNormalSmall">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>
<Slider name="GlueScrollBarTemplate" virtual="true">
<Size>
<AbsDimension x="16" y="0"/>
</Size>
<Frames>
<Button name="$parentScrollUpButton" inherits="GlueScrollUpButtonTemplate">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP"/>
</Anchors>
<Scripts>
<OnClick>
local parent = self:GetParent();
parent:SetValue(parent:GetValue() - (parent:GetHeight() / 2));
PlaySound("UChatScrollButton");
</OnClick>
</Scripts>
</Button>
<Button name="$parentScrollDownButton" inherits="GlueScrollDownButtonTemplate">
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM"/>
</Anchors>
<Scripts>
<OnClick>
local parent = self:GetParent();
parent:SetValue(parent:GetValue() + (parent:GetHeight() / 2));
PlaySound("UChatScrollButton");
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnValueChanged>
self:GetParent():SetVerticalScroll(value);
</OnValueChanged>
</Scripts>
<ThumbTexture inherits="GlueScrollBarButton" file="Interface\Buttons\UI-ScrollBar-Knob">
<Size>
<AbsDimension x="18" y="24"/>
</Size>
<TexCoords left="0.20" right="0.80" top="0.125" bottom="0.875"/>
</ThumbTexture>
</Slider>
<ScrollFrame name="GlueScrollFrameTemplate" virtual="true">
<Frames>
<Slider name="$parentScrollBar" inherits="GlueScrollBarTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="6" y="-16"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="6" y="16"/>
</Offset>
</Anchor>
</Anchors>
</Slider>
</Frames>
<Scripts>
<OnLoad>
_G[self:GetName().."ScrollBarScrollDownButton"]:Disable();
_G[self:GetName().."ScrollBarScrollUpButton"]:Disable();
GlueScrollFrame_OnScrollRangeChanged(self);
</OnLoad>
<OnScrollRangeChanged>
GlueScrollFrame_OnScrollRangeChanged(self, yrange);
</OnScrollRangeChanged>
<OnVerticalScroll>
GlueScrollFrame_OnVerticalScroll(self, offset);
</OnVerticalScroll>
<OnMouseWheel>
GlueScrollFrameTemplate_OnMouseWheel(self, delta);
</OnMouseWheel>
</Scripts>
</ScrollFrame>
</Ui>
@@ -0,0 +1,43 @@
##DebugHook.lua
GlueStrings.lua
GlueFonts.xml
GlueFontStyles.xml
GlueLocalization.xml
## add new files after here
GlueBasicControls.xml
GlueParent.xml
GlueButtons.xml
GlueTemplates.xml
GlueDialog.xml
GlueDropDownMenu.xml
GlueTooltip.xml
GlueSplash.xml
RealmList.xml
AddonList.xml
AccountLogin.xml
CharacterSelect.xml
CharacterCreate.xml
PatchDownload.xml
MovieFrame.xml
RealmWizard.xml
CreditsFrame.xml
SecurityMatrix.xml
OptionsFrameTemplates.xml
OptionsPanelTemplates.xml
TrialConvert.xml
VideoOptionsFrame.xml
VideoOptionsPanels.xml
AudioOptionsFrame.xml
AudioOptionsPanels.xml
OptionsSelect.xml
##CameraSelect.xml
CharacterInfo.lua
CharacterCreate.lua
# custom modules
XML_TXXUI.xml
XML_IXXUI.xml
# add new modules above here
LocalizationPost.xml
@@ -0,0 +1,77 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
function OptionsSelectFrame_Hide()
PlaySound("gsLoginChangeRealmCancel");
OptionsSelectFrame:Hide();
end
function OptionsSelectResetSettingsButton_OnClick_Reset(self)
PlaySound("igMainMenuOptionCheckBoxOn");
GlueDialog_Show("RESET_SERVER_SETTINGS");
end
function OptionsSelectResetSettingsButton_OnClick_Cancel(self)
PlaySound("igMainMenuOptionCheckBoxOn");
GlueDialog_Show("CANCEL_RESET_SETTINGS");
end
function AccountLogin_RealmReset()
SetCVar("realmName", "");
AccountLogin_Exit();
end
function MovieList_Show()
PlaySound("igMainMenuOption");
OptionsSelectFrame:Hide();
CinematicsFrame:Show();
Cinematics_SetupButtons();
end
function CinematicsFrame_OnLoad(self)
self:RegisterEvent("PLAY_MOVIE");
end
function CinematicsFrame_OnKeyDown(key)
if key == "ESCAPE" then
CinematicsFrame_Hide();
end
end
function CinematicsFrame_Hide()
PlaySound("gsLoginChangeRealmCancel");
CinematicsFrame:Hide();
if CharacterSelect and CharacterSelect:IsShown() then
CharacterSelect:Show();
else
if CharacterSelect_Show then
CharacterSelect_Show();
end
end
end
function Cinematics_SetupButtons()
local buttons = {CinematicsButton1, CinematicsButton2, CinematicsButton3};
for i, button in ipairs(buttons) do
button:Show();
end
end
function Cinematics_OnMovieFinished()
if CharacterSelect and CharacterSelect:IsShown() then
CharacterSelect:Show();
else
if CharacterSelect_Show then
CharacterSelect_Show();
end
end
end
function OptionsSelectFrame_OnShow()
local locale = GetLocale() or "enUS";
local button = OptionsSelectResetSettingsButton;
if button and GlueStrings and GlueStrings["RESET_REALM_EXIT"] then
button:SetText(GlueStrings["RESET_REALM_EXIT"][locale] or GlueStrings["RESET_REALM_EXIT"].enUS);
end
end
@@ -0,0 +1,173 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="OptionsSelect.lua"/>
<Frame name="OptionsSelectFrame" toplevel="true" setAllPoints="true" hidden="true" enableMouse="true" enableKeyboard="true" frameStrata="HIGH">
<Layers>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
<Color a="0.75" r="0" g="0" b="0"/>
</Texture>
</Layer>
</Layers>
<Frames>
<Frame name="$parentBackground">
<Size x="360" y="280"/>
<Anchors>
<Anchor point="CENTER">
<Offset x="0" y="-20"/>
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\tooltips\BorderAlert" tile="true">
<BackgroundInsets>
<AbsInset left="3" right="3" top="3" bottom="3"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentHeader" file="Interface\DialogFrame\UI-DialogBox-Header" hidden="true">
<Size>
<AbsDimension x="300" y="68"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="$parentHeaderText" inherits="GlueFontNormal" text="OPTIONS">
<Anchors>
<Anchor point="TOP" relativeTo="$parentHeader">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentContainer">
<Anchors>
<Anchor point="TOPLEFT">
<Offset x="12" y="-36"/>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset x="-16" y="50"/>
</Anchor>
</Anchors>
<Frames>
<Button name="$parentVideoOptionsButton" inherits="GlueButtonTemplateBlue" text="VIDEOOPTIONS_MENU">
<Size x="220" y="45"/>
<Anchors>
<Anchor point="TOP">
<Offset x="0" y="-10"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PlaySound("igMainMenuOption");
VideoOptionsFrame.lastFrame = OptionsSelectFrame;
VideoOptionsFrame:Show();
</OnClick>
</Scripts>
</Button>
<Button name="$parentAudioOptionsButton" inherits="GlueButtonTemplateBlue" text="SOUNDOPTIONS_MENU">
<Size x="220" y="45"/>
<Anchors>
<Anchor point="TOP" relativeTo="$parentVideoOptionsButton" relativePoint="BOTTOM">
<Offset x="0" y="10"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PlaySound("igMainMenuOption");
AudioOptionsFrame.lastFrame = OptionsSelectFrame;
AudioOptionsFrame:Show();
</OnClick>
</Scripts>
</Button>
<Button name="$parentTrailersButton" inherits="GlueButtonTemplateBlue" text="CINEMATICS_MENU">
<Size x="220" y="45"/>
<Anchors>
<Anchor point="TOP" relativeTo="$parentAudioOptionsButton" relativePoint="BOTTOM">
<Offset x="0" y="10"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PlaySound("igMainMenuOption");
MovieList_Show();
</OnClick>
</Scripts>
</Button>
<Button name="$parentRealmResetOptionsButton" inherits="GlueButtonTemplateBlue" text="RESET_REALM_EXIT">
<Size x="220" y="45"/>
<Anchors>
<Anchor point="TOP" relativeTo="$parentTrailersButton" relativePoint="BOTTOM">
<Offset x="0" y="10"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
PlaySound("igMainMenuOption");
AccountLogin_RealmReset();
</OnClick>
<OnShow>
OptionsSelectFrame_OnShow();
</OnShow>
</Scripts>
</Button>
</Frames>
</Frame>
<Button name="OptionsSelectResetSettingsButton" inherits="GlueButtonSmallTemplateBlue" text="RESET_SETTINGS">
<Size x="220" y="38"/>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="8" y="6"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
OptionsSelectResetSettingsButton_OnClick_Reset(self);
</OnClick>
</Scripts>
</Button>
<Button name="$parentOkayButton" inherits="GlueButtonSmallTemplateBlue" text="CLOSE">
<Size x="125" y="38"/>
<Anchors>
<Anchor point="BOTTOMRIGHT">
<Offset x="-8" y="6"/>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
OptionsSelectFrame_Hide();
</OnClick>
</Scripts>
</Button>
</Frames>
</Frame>
</Frames>
<Scripts>
<OnKeyDown>
if ( key == "ESCAPE" ) then
OptionsSelectFrame_Hide();
elseif ( key == "PRINTSCREEN" ) then
Screenshot();
end
</OnKeyDown>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,672 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
REALM_BUTTON_HEIGHT = 16;
MAX_REALMS_DISPLAYED = 18;
MAX_REALM_CATEGORY_TABS = 8;
local TEXTURE_SIZE = 36
local REALM_BACKGROUNDS = {
["RealmListRealmButton1"] = "Interface\\GluesVideo\\Assets\\RealmSelection\\Realm1.blp",
["RealmListRealmButton2"] = "Interface\\GluesVideo\\Assets\\RealmSelection\\Realm2.blp",
}
local logoAnimationInProgress = false
local realmListLogoFrame = nil
local realmListLogo = nil
local logoAnimationInProgress = false
local realmListLogoFrame = nil
local realmListLogo = nil
local function InitializeRealmListLogo(self)
if not realmListLogoFrame then
realmListLogoFrame = CreateFrame("Frame", nil, self)
realmListLogoFrame:SetSize(285, 285)
realmListLogoFrame:SetPoint("CENTER", self, "CENTER", 0, 0)
realmListLogoFrame:Hide()
realmListLogo = realmListLogoFrame:CreateTexture("RealmListLogo", "ARTWORK")
realmListLogo:SetTexture(" ")
realmListLogo:SetAllPoints(realmListLogoFrame)
realmListLogoFrame.zoomDirection = 1
realmListLogoFrame.zoomSpeed = 0.1
realmListLogoFrame.minSize = 250
realmListLogoFrame.maxSize = 280
realmListLogoFrame.currentSize = 250
realmListLogoFrame:SetScript("OnUpdate", function(self, elapsed)
self.currentSize = self.currentSize + (self.zoomDirection * self.zoomSpeed)
if self.currentSize >= self.maxSize then
self.currentSize = self.maxSize
self.zoomDirection = -1
elseif self.currentSize <= self.minSize then
self.currentSize = self.minSize
self.zoomDirection = 1
end
self:SetSize(self.currentSize, self.currentSize)
end)
end
end
local function ResetRealmListLogoAnimation()
logoAnimationInProgress = false
if realmListLogoFrame then
realmListLogoFrame:Hide()
realmListLogoFrame:SetScript("OnUpdate", nil)
end
end
local function ShowRealmListLogo()
if logoAnimationInProgress or not realmListLogoFrame then
return
end
logoAnimationInProgress = true
realmListLogoFrame:Show()
local startY = 480
local endY = 380
local startSize = 285
local minSize = 250
local maxSize = 285
local midSize = (minSize + maxSize) / 2
local animationTime = 0
local currentSize = startSize
local zoomPhaseTime = 0
local zoomSpeed = 0.5
local smoothingProgress = -1
realmListLogoFrame:SetPoint("TOP", RealmList, "CENTER", 0, startY)
realmListLogoFrame:SetAlpha(0)
realmListLogoFrame:SetSize(startSize, startSize)
realmListLogoFrame:SetScript("OnUpdate", function(self, elapsed)
animationTime = animationTime + elapsed
if animationTime <= 1.0 then
local progress = animationTime / 1.0
local currentY = startY - (startY - endY) * progress
local currentAlpha = progress
self:SetPoint("TOP", RealmList, "CENTER", 0, currentY)
self:SetAlpha(currentAlpha)
elseif animationTime <= 1.5 then
local transitionProgress = (animationTime - 1.0) / 0.5
currentSize = startSize - (startSize - minSize) * transitionProgress
self:SetSize(currentSize, currentSize)
smoothingProgress = 0
else
if smoothingProgress < 1 then
smoothingProgress = smoothingProgress + elapsed * 5 -- 5 = 1/0.2
if smoothingProgress > 1 then smoothingProgress = 1 end
zoomPhaseTime = zoomPhaseTime + elapsed * zoomSpeed * smoothingProgress
else
zoomPhaseTime = zoomPhaseTime + elapsed * zoomSpeed
end
local oscillation = math.sin(zoomPhaseTime * math.pi * 2)
oscillation = oscillation * 0.5 + 0.5
currentSize = minSize + (maxSize - minSize) * oscillation
local currentWidth, currentHeight = self:GetSize()
local smoothingFactor = smoothingProgress < 1 and 0.05 or 0.1
local newWidth = currentWidth + (currentSize - currentWidth) * smoothingFactor
local newHeight = currentHeight + (currentSize - currentHeight) * smoothingFactor
self:SetSize(newWidth, newHeight)
end
end)
end
local function CreateRealmButtonBorder(button)
if button.borderFrame then return button.borderFrame end
local border = CreateFrame("Frame", nil, button, BackdropTemplateMixin and "BackdropTemplate")
border:SetFrameLevel(button:GetFrameLevel() + 1)
border:SetBackdrop({
edgeFile = "Interface\\tooltips\\ui-tooltip-border-maw",
tile = true,
tileSize = 16,
edgeSize = 16,
insets = { left = 5, right = 5, top = 5, bottom = 5 }
})
border:SetBackdropBorderColor(1, 1, 1, 1)
local backgroundContainer = CreateFrame("Frame", nil, border)
backgroundContainer:SetAllPoints(border)
backgroundContainer:SetFrameLevel(border:GetFrameLevel() - 1)
local TEXTURE_OFFSET_X = 4
local TEXTURE_OFFSET_Y = 4
local background = backgroundContainer:CreateTexture(nil, "BACKGROUND")
background:SetPoint("TOPLEFT", backgroundContainer, "TOPLEFT", TEXTURE_OFFSET_X, -TEXTURE_OFFSET_Y)
background:SetPoint("BOTTOMRIGHT", backgroundContainer, "BOTTOMRIGHT", -TEXTURE_OFFSET_X, TEXTURE_OFFSET_Y)
background:SetTexture(REALM_BACKGROUNDS[button:GetName()] or "Interface\\GluesVideo\\Assets\\RealmSelection\\Realm1.blp")
border:SetPoint("TOPLEFT", button, "TOPLEFT", -30, 20)
border:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", 30, -350)
border:Show()
local currentScale = 1
local targetScale = 1
local isMouseOverBackground = false
local function IsMouseOverBackground()
local x, y = GetCursorPosition()
local scale = button:GetEffectiveScale()
x = x / scale
y = y / scale
local left = backgroundContainer:GetLeft()
local right = backgroundContainer:GetRight()
local top = backgroundContainer:GetTop()
local bottom = backgroundContainer:GetBottom()
return x >= left and x <= right and y <= top and y >= bottom
end
local function UpdateBackgroundZoom(elapsed)
if isMouseOverBackground then
targetScale = 1.1
else
targetScale = 1
end
if math.abs(currentScale - targetScale) > 0.001 then
currentScale = currentScale + (targetScale - currentScale) * (elapsed * 2)
background:SetTexCoord(
0.5 - (0.5 / currentScale),
0.5 + (0.5 / currentScale),
0.5 - (0.5 / currentScale),
0.5 + (0.5 / currentScale)
)
end
end
button:SetScript("OnUpdate", function(_, elapsed)
isMouseOverBackground = IsMouseOverBackground()
UpdateBackgroundZoom(elapsed)
end)
local texture1 = button:CreateTexture(nil, "ARTWORK")
texture1:SetSize(TEXTURE_SIZE, TEXTURE_SIZE)
texture1:SetPoint("TOPLEFT", button, "TOPLEFT", -30, -45)
local texture2 = button:CreateTexture(nil, "ARTWORK")
texture2:SetSize(TEXTURE_SIZE, TEXTURE_SIZE)
texture2:SetPoint("TOP", texture1, "BOTTOM", 0, 3)
local texture3 = button:CreateTexture(nil, "ARTWORK")
texture3:SetSize(TEXTURE_SIZE, TEXTURE_SIZE)
texture3:SetPoint("TOP", texture2, "BOTTOM", 0, 4)
local texture4 = button:CreateTexture(nil, "ARTWORK")
texture4:SetSize(TEXTURE_SIZE, TEXTURE_SIZE)
texture4:SetPoint("TOP", texture3, "BOTTOM", 0, 4)
local buttonName = button:GetName()
if buttonName == "RealmListRealmButton1" then
texture1:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\TypeGame1")
texture2:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\Characters1")
texture3:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\Population1")
texture4:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\Expansion1")
elseif buttonName == "RealmListRealmButton2" then
texture1:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\TypeGame2")
texture2:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\Characters2")
texture3:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\Population2")
texture4:SetTexture("Interface\\GluesVideo\\Assets\\RealmSelection\\RealmIcon\\Expansion2")
else
texture1:SetTexture("Interface\\Icons\\inv_misc_questionmark")
texture2:SetTexture("Interface\\Icons\\inv_misc_questionmark")
texture3:SetTexture("Interface\\Icons\\inv_misc_questionmark")
texture4:SetTexture("Interface\\Icons\\inv_misc_questionmark")
end
button.borderFrame = border
return border
end
function RealmList_OnLoad(self)
self:RegisterEvent("OPEN_REALM_LIST");
self.currentRealm = 0;
self.offset = 0;
end
function RealmList_OnEvent(self, event)
if ( event == "OPEN_REALM_LIST" ) then
if ( self:IsShown() ) then
RealmListUpdate();
else
self:Show();
end
end
end
function RealmListUpdate()
if ( not RealmList.selectedCategory ) then
RealmList.selectedCategory = 1;
end
RealmList.refreshTime = RealmListUpdateRate();
RealmList_UpdateTabs(GetRealmCategories());
local numRealms = GetNumRealms(RealmList.selectedCategory);
local name, numCharacters, invalidRealm, currentRealm, pvp, rp, load, locked;
local realmIndex;
local isFull;
local major, minor, revision, build, type;
RealmListOkButton:Hide();
RealmListHighlight:Hide();
for i=1, MAX_REALMS_DISPLAYED, 1 do
realmIndex = RealmList.offset + i;
local button = _G["RealmListRealmButton"..i];
local acceptButton = _G["RealmListRealmButton"..i.."AcceptButton"];
if ( realmIndex > numRealms ) then
button:Hide();
else
name, numCharacters, invalidRealm, realmDown, currentRealm, pvp, rp, load, locked, major, minor, revision = GetRealmInfo(RealmList.selectedCategory, realmIndex);
if ( not name ) then
button:Hide();
else
local pvpText = _G["RealmListRealmButton"..i.."PVP"] or button:CreateFontString("$parentPVP", "ARTWORK", "GlueFontHighlightSmall");
local loadText = _G["RealmListRealmButton"..i.."Load"] or button:CreateFontString("$parentLoad", "ARTWORK", "GlueFontHighlightSmall");
local players = _G["RealmListRealmButton"..i.."Players"] or button:CreateFontString("$parentPlayers", "ARTWORK", "GlueFontHighlightSmall");
if ( pvp and rp ) then
pvpText:SetText(RPPVP_PARENTHESES);
pvpText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
elseif ( rp ) then
pvpText:SetText(RP_PARENTHESES);
pvpText:SetTextColor(GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b);
elseif ( pvp ) then
pvpText:SetText(PVP_PARENTHESES);
pvpText:SetTextColor(RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
else
pvpText:SetText(GAMETYPE_NORMAL);
pvpText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
isFull = nil;
if ( realmDown ) then
loadText:SetText(REALM_DOWN);
loadText:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
elseif ( locked ) then
loadText:SetText(REALM_LOCKED);
loadText:SetTextColor(RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
elseif ( load == -3.0 ) then
loadText:SetText(LOAD_RECOMMENDED);
loadText:SetTextColor(BLUE_FONT_COLOR.r, BLUE_FONT_COLOR.g, BLUE_FONT_COLOR.b);
elseif ( load == -2.0 ) then
loadText:SetText(LOAD_NEW);
loadText:SetTextColor(GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b);
elseif ( load == 2.0 ) then
loadText:SetText(LOAD_FULL);
loadText:SetTextColor(RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
isFull = 1;
elseif ( load > 0 ) then
loadText:SetText(LOAD_HIGH);
loadText:SetTextColor(RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
elseif ( load < 0 ) then
loadText:SetText(LOAD_LOW);
loadText:SetTextColor(GREEN_FONT_COLOR.r, GREEN_FONT_COLOR.g, GREEN_FONT_COLOR.b);
else
loadText:SetText(LOAD_MEDIUM);
loadText:SetTextColor(NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b);
end
if ( numCharacters > 0 ) then
players:SetText(numCharacters);
else
players:SetText(" 0");
end
pvpText:ClearAllPoints();
pvpText:SetPoint("TOPLEFT", button, "TOPLEFT", 10, -40);
pvpText:SetWidth(150);
pvpText:SetJustifyH("LEFT");
players:ClearAllPoints();
players:SetPoint("TOPLEFT", pvpText, "BOTTOMLEFT", 0, -5);
players:SetWidth(150);
players:SetJustifyH("LEFT");
loadText:ClearAllPoints();
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", 0, -5);
loadText:SetWidth(150);
loadText:SetJustifyH("LEFT");
if (major) then
button:SetText(name.."\n("..major.."."..minor.."."..revision..")");
else
button:SetText(name);
end
CreateRealmButtonBorder(button);
button:Show();
button:SetID(realmIndex);
button.name = name;
if ( realmDown ) then
button:Disable();
else
button:Enable();
end
if (pvp and rp) then -- RPPVP
pvpText:SetPoint("TOPLEFT", button, "TOPLEFT", 118, -57);
pvpText:SetWidth(180);
elseif (rp) then -- RP
pvpText:SetPoint("TOPLEFT", button, "TOPLEFT", 118, -57);
pvpText:SetWidth(150);
elseif (pvp) then -- PVP
pvpText:SetPoint("TOPLEFT", button, "TOPLEFT", 118, -57);
pvpText:SetWidth(150);
else -- Normal (PVE)
pvpText:SetPoint("TOPLEFT", button, "TOPLEFT", 118, -57);
pvpText:SetWidth(150);
end
players:SetPoint("TOPLEFT", pvpText, "BOTTOMLEFT", -35, -20);
players:SetWidth(150);
if (load == -3.0) then -- "Recomendado"
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", 0, -20);
loadText:SetWidth(180);
elseif (load == -2.0) then -- "Nuevo"
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", 0, -20);
loadText:SetWidth(150);
elseif (load == 2.0) then -- "Lleno"
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", 0, -20);
loadText:SetWidth(150);
elseif (load > 0) then -- "Alto"
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", 0, -20);
loadText:SetWidth(150);
elseif (load < 0) then -- "Bajo"
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", 0, -20);
loadText:SetWidth(150);
else -- "Medio" (valor por defecto)
loadText:SetPoint("TOPLEFT", players, "BOTTOMLEFT", -5, -20);
loadText:SetWidth(150);
end
pvpText:SetJustifyH("LEFT");
players:SetJustifyH("LEFT");
loadText:SetJustifyH("LEFT");
local expansionText = _G["RealmListRealmButton"..i.."ExpansionText"] or button:CreateFontString("$parentExpansionText", "ARTWORK", "GlueFontHighlightSmall");
local expansionNames = {
["RealmListRealmButton1"] = "Wrath of the Lich King",
["RealmListRealmButton2"] = "Dragonflight",
};
local buttonName = "RealmListRealmButton"..i;
local expansionName = expansionNames[buttonName] or "Clásico";
if string.len(expansionName) > 23 then
local midPoint = math.floor(string.len(expansionName) / 2)
local spacePos = string.find(expansionName, " ", midPoint) or midPoint
local line1 = string.sub(expansionName, 1, spacePos)
local line2 = string.sub(expansionName, spacePos + 1)
expansionText:SetText(line1.."\n"..line2)
else
expansionText:SetText(expansionName)
end
expansionText:SetTextColor(0.9, 0.8, 0.5);
expansionText:ClearAllPoints();
expansionText:SetPoint("LEFT", _G["RealmListRealmButton"..i.."ExpansionLabel"], "RIGHT", -5, 0);
expansionText:SetJustifyH("LEFT");
if string.len(expansionName) > 23 then
expansionText:SetHeight(24)
else
expansionText:SetHeight(12)
end
if ( realmDown ) then
button:SetNormalFontObject(RealmDownNormal);
button:SetHighlightFontObject(RealmDownHighlight);
else
if ( invalidRealm ) then
button:SetNormalFontObject(RealmInvalidNormal);
button:SetHighlightFontObject(RealmInvalidHighlight);
else
if ( numCharacters > 0 ) then
button:SetNormalFontObject(RealmCharactersNormal);
button:SetHighlightFontObject(GlueFontHighlightLeft);
else
button:SetNormalFontObject(RealmNoCharactersNormal);
button:SetHighlightFontObject(GlueFontHighlightLeft);
end
end
end
CreateRealmButtonBorder(button)
button:Show();
button:SetID(realmIndex);
button.name = name;
if ( realmDown ) then
button:Disable();
else
button:Enable();
end
if ( RealmList.selectedName ) then
if ( name == RealmList.selectedName ) then
RealmList.currentRealm = realmIndex;
button:LockHighlight();
RealmListOkButton:Enable();
if ( isFull and numCharacters == 0 ) then
RealmList.showRealmIsFullDialog = 1;
else
RealmList.showRealmIsFullDialog = nil;
end
if ( realmDown ) then
RealmListOkButton:Disable();
else
RealmListOkButton:Enable();
end
else
button:UnlockHighlight();
end
else
if ( currentRealm == 1 ) then
RealmList.currentRealm = realmIndex;
button:LockHighlight();
if ( realmDown ) then
RealmListOkButton:Disable();
else
RealmListOkButton:Enable();
end
else
button:UnlockHighlight();
end
end
end
end
end
RealmList.selectedName = nil;
GlueScrollFrame_Update(RealmListScrollFrame, numRealms, MAX_REALMS_DISPLAYED, REALM_BUTTON_HEIGHT, RealmListHighlight, 557, 587);
end
function RealmList_UpdateTabs(...)
local numTabs = select("#", ...);
local tab;
for i=1, MAX_REALM_CATEGORY_TABS do
tab = _G["RealmListTab"..i];
if ( not tab ) then
tab = CreateFrame("Button", "RealmListTab"..i, RealmListBackground, "RealmListTabButtonTemplate");
tab:SetID(i);
tab:SetPoint("LEFT", "RealmListTab"..(i-1), "RIGHT", -15, 0);
end
tab.disabled = nil;
if ( numTabs == 1 ) then
tab:Hide();
elseif ( i <= numTabs ) then
tab:SetText(select(i, ...));
GlueTemplates_TabResize(0, tab);
tab:Show();
if (IsInvalidTournamentRealmCategory(i)) then
tab:SetDisabledFontObject("GlueFontDisableSmall");
tab.disabled = true;
else
tab:SetDisabledFontObject("GlueFontHighlightSmall");
end
else
tab:Hide();
end
end
GlueTemplates_SetNumTabs(RealmList, numTabs);
if ( not GlueTemplates_GetSelectedTab(RealmList) ) then
GlueTemplates_SetTab(RealmList, 1);
end
end
function RealmList_OnKeyDown(key)
if ( key == "ESCAPE" ) then
RealmList_OnCancel();
elseif ( key == "ENTER" ) then
RealmList_OnOk();
elseif ( key == "PRINTSCREEN" ) then
Screenshot();
end
end
function RealmList_OnOk()
RealmList:Hide();
-- If trying to join a Full realm then popup a dialog
if ( RealmList.showRealmIsFullDialog ) then
GlueDialog_Show("REALM_IS_FULL");
return;
end
if ( RealmList.currentRealm > 0 ) then
ChangeRealm(RealmList.selectedCategory , RealmList.currentRealm);
end
end
function RealmList_OnCancel()
RealmList:Hide();
RealmListDialogCancelled();
local serverName, isPVP, isRP, isDown = GetServerName();
if ( (GetNumRealms(RealmList.selectedCategory) == 0) or (isDown) ) then
SetGlueScreen("realmwizard");
end
end
function RealmSelectButton_OnClick(self, id)
if ( IsInvalidLocale( RealmList.selectedCategory ) ) then
--Display popup explaining locale specific realms
GlueDialog_Show("REALM_LOCALE_WARNING");
else
RealmList.refreshTime = RealmListUpdateRate();
RealmList.currentRealm = id;
RealmList.selectedName = self.name;
RealmListUpdate();
end
end
function RealmSelectButton_OnDoubleClick(self, id)
if ( IsInvalidLocale( RealmList.selectedCategory ) ) then
--Display popup explaining locale specific realms
GlueDialog_Show("REALM_LOCALE_WARNING");
else
RealmList.currentRealm = id;
RealmList.selectedName = self.name;
RealmList_OnOk();
end
end
function RealmListScrollFrame_OnVerticalScroll(self, offset)
RealmList.refreshTime = RealmListUpdateRate();
local scrollbar = _G[self:GetName().."ScrollBar"];
scrollbar:SetValue(offset);
RealmList.offset = floor((offset / REALM_BUTTON_HEIGHT) + 0.5);
RealmListUpdate();
end
function RealmList_OnShow(self)
InitializeRealmListLogo(self)
ShowRealmListLogo()
RealmListUpdate();
self.refreshTime = RealmListUpdateRate();
local selectedCategory = GetSelectedCategory();
if ( selectedCategory == 0 ) then
selectedCategory = 1;
end
local button = _G["RealmListTab"..selectedCategory];
if ( button ) then
RealmListTab_OnClick(button);
GlueTemplates_SetTab(RealmList, selectedCategory);
end
end
function RealmList_OnHide()
CancelRealmListQuery()
ResetRealmListLogoAnimation()
end
function RealmList_OnUpdate(self, elapsed)
if ( self.refreshTime ) then
self.refreshTime = self.refreshTime - elapsed;
if ( self.refreshTime <= 0 ) then
self.refreshTime = nil;
RequestRealmList();
end
end
-- Account Msg stuff
if ( (ACCOUNT_MSG_NUM_AVAILABLE > 0) and not GlueDialog:IsShown() ) then
if ( ACCOUNT_MSG_HEADERS_LOADED ) then
if ( ACCOUNT_MSG_BODY_LOADED ) then
local dialogString = AccountMsg_GetHeaderSubject( ACCOUNT_MSG_CURRENT_INDEX ).."\n\n"..AccountMsg_GetBody();
GlueDialog_Show("ACCOUNT_MSG", dialogString);
end
end
end
end
function RealmListTab_OnClick(tab)
if ( tab.disabled ) then
if ( IsTournamentRealmCategory(tab:GetID()) ) then
--Display popup explaining tournament realms
-- RealmHelpFrame:Show();
GlueDialog_Show("REALM_TOURNAMENT_WARNING");
end
local button = _G["RealmListTab"..RealmList.selectedCategory];
if ( button ) then
button:Click();
end
return;
end
RealmList.selectedCategory = tab:GetID();
RealmListUpdate();
end
function RealmHelpText_OnShow(self)
self:SetText("<html><body><p>" .. string.format(REALM_HELP_FRAME_TEXT, REALM_HELP_FRAME_URL) .. "</p></body></html>");
end
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,92 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
function RealmWizard_OnLoad(self)
self:SetCamera(0);
self:SetSequence(0);
if (IsStreamingTrial()) then
AccountLoginCinematicsButton:Disable();
RealmWizard:SetModel("Interface\\Glues\\Models\\UI_MainMenu\\UI_MainMenu.m2");
else
RealmWizard:SetModel("Interface\\Glues\\Models\\UI_MainMenu_Northrend\\UI_MainMenu_Northrend.m2");
end
end
function RealmWizard_OnShow(self)
self:SetSequence(0);
RealmWizardGameTypeButton1:Click(1);
if ( not RealmWizard.selectedCategory ) then
RealmWizardSuggest:Disable();
end
RealmWizard_UpdateCategories(GetRealmCategories());
end
function RealmWizard_OnHide(self)
StopAllSFX( 1.0 );
end
function RealmWizard_UpdateCategories(...)
local numTabs = select("#", ...);
local button, buttonText;
local numCategoriesShown = 0;
local categoryIndex = 1;
for i=1, MAX_REALM_CATEGORY_TABS do
button = _G["RealmWizardLocationButton"..i];
buttonText = _G["RealmWizardLocationButton"..i.."Text"];
while (IsTournamentRealmCategory(categoryIndex)) do
categoryIndex = categoryIndex + 1;
if (categoryIndex > numTabs) then
break;
end
end
if ( categoryIndex <= numTabs ) then
buttonText:SetText(select(categoryIndex, ...));
button.categoryIndex = categoryIndex;
if ( categoryIndex == RealmWizard.selectedCategory ) then
button:SetChecked(1);
else
button:SetChecked(nil);
end
button:Show();
numCategoriesShown = numCategoriesShown + 1;
categoryIndex = categoryIndex + 1;
else
button:Hide();
end
end
RealmWizardLocation:SetHeight(numCategoriesShown * 28 + RealmWizardLocationLabelDescription:GetHeight() + 50);
if (GetCVar("realmName") == "") or not(GetCVar("realmName")) then
RealmWizardSuggest:Enable();
RealmWizard.selectedCategory = 1;
RealmWizardSuggest:GetScript("OnClick")(RealmWizardSuggest)
end
end
function RealmWizardLocationButton_OnClick(id)
RealmWizardSuggest:Enable();
RealmWizard.selectedCategory = id;
RealmWizard_UpdateCategories(GetRealmCategories());
end
-- Wrapper function so it can be included as a dialog function
function RealmWizard_SetRealm()
ChangeRealm(RealmWizard.suggestedCategory, RealmWizard.suggestedID);
end
function RealmWizard_Exit()
DisconnectFromServer();
SetGlueScreen("login");
end
function RealmWizard_OnKeyDown(key)
if ( key == "ESCAPE" ) then
RealmWizard_Exit();
elseif ( key == "ENTER" ) then
RealmWizardSuggest:Click();
elseif ( key == "PRINTSCREEN" ) then
Screenshot();
end
end
@@ -0,0 +1,493 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
-- if you change something here you probably want to change the frame version too
local next = next;
local function SecureNext(elements, key)
-- not totally necessary in all cases in this file (since Interface Options are independent), but
-- it's used anyway to keep things consistent, plus it's not a huge performance hindrance
return securecall(next, elements, key);
end
-- [[ OptionsTooltip ]] --
function OptionsTooltip_OnLoad (self)
local name = self:GetName();
-- set backdrop
self:SetBackdropBorderColor(1.0, 1.0, 1.0);
self:SetBackdropColor(0.09, 0.09, 0.19 );
-- setup text lines
self.lines = {
_G[name .. "Text1"],
_G[name .. "Text2"],
};
-- setup tooltip functions
self.SetOwner =
function (self, owner, ownerPoint, myPoint, xOffset, yOffset)
self:Hide();
self:ClearAllPoints();
self:SetParent(owner);
-- HACK: bumping the frame level up seems to get around a bug where frames on the same frame
-- level are drawing as if they were on the same frame strata as the tooltip, even when their
-- frame strata is lower than the tooltip
self:SetFrameLevel(owner:GetFrameLevel() + 2);
ownerPoint = ownerPoint or "TOPRIGHT";
myPoint = myPoint or "BOTTOMLEFT";
xOffset = xOffset or 8;
yOffset = yOffset or 8;
self:SetPoint(myPoint, owner, ownerPoint, xOffset, yOffset);
end
self.Clear =
function (self)
for _, line in next, self.lines do
line:SetText("");
line:SetTextColor(1, .82, 0, 1);
line:Hide();
end
end
self.AddLine =
function (self, text, r, g, b, a)
r = r or 1;
g = g or .82;
b = b or 0;
a = a or 1;
-- find a free line
local freeLine;
for _, line in next, self.lines do
if ( not line:IsShown() ) then
freeLine = line;
break;
end
end
freeLine:SetTextColor(r, g, b, a);
freeLine:SetText(text);
freeLine:Show();
if ( self:IsShown() ) then
OptionsTooltip_OnShow(self);
else
self:Show();
end
end
self.SetText =
function (self, text, r, g, b, a)
self:Clear();
self:AddLine(text, r, g, b, a);
end
end
function OptionsTooltip_OnShow (self)
local height = 0;
for _, line in next, self.lines do
height = height + line:GetHeight();
end
self:SetHeight(height + 22);
end
-- [[ functions for OptionsFrameTemplates controls ]] --
function OptionsList_OnLoad (self, buttonTemplate)
local name = self:GetName();
--Setup random things!
self.scrollFrame = _G[name .. "List"];
self:SetBackdropBorderColor(.6, .6, .6, 1);
_G[name.."Bottom"]:SetVertexColor(.66, .66, .66);
--Create buttons for scrolling
local buttons = {};
local button = CreateFrame("BUTTON", name .. "Button1", self, buttonTemplate or "OptionsListButtonTemplate");
button:SetPoint("TOPLEFT", self, 0, -8);
self.buttonHeight = button:GetHeight();
tinsert(buttons, button);
local maxButtons = (self:GetHeight() - 8) / self.buttonHeight;
for i = 2, maxButtons do
button = CreateFrame("BUTTON", name .. "Button" .. i, self, buttonTemplate or "OptionsListButtonTemplate");
button:SetPoint("TOPLEFT", buttons[#buttons], "BOTTOMLEFT");
tinsert(buttons, button);
end
self.buttonHeight = button:GetHeight();
self.buttons = buttons;
end
function OptionsList_DisplayScrollBar (frame)
local list = frame.scrollFrame;
list:Show();
local listWidth = list:GetWidth();
for _, button in SecureNext, frame.buttons do
button:SetWidth(button:GetWidth() - listWidth);
end
end
function OptionsList_HideScrollBar (frame)
local list = frame.scrollFrame;
list:Hide();
local listWidth = list:GetWidth();
for _, button in SecureNext, frame.buttons do
button:SetWidth(button:GetWidth() + listWidth);
end
end
function OptionsList_HideButton (button)
-- Sparse for now, who knows what will end up here?
button:Hide();
end
function OptionsList_DisplayButton (button, element)
-- Do display things
button:Show();
button.element = element;
if (element.parent) then
button:SetNormalFontObject(GlueFontHighlightSmall);
button:SetHighlightFontObject(GlueFontHighlightSmall);
button.text:SetPoint("LEFT", 16, 2);
else
button:SetNormalFontObject(GlueFontNormal);
button:SetHighlightFontObject(GlueFontHighlight);
button.text:SetPoint("LEFT", 8, 2);
end
button.text:SetText(element.name);
if (element.hasChildren) then
if (element.collapsed) then
button.toggle:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-UP");
button.toggle:SetPushedTexture("Interface\\Buttons\\UI-PlusButton-DOWN");
else
button.toggle:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-UP");
button.toggle:SetPushedTexture("Interface\\Buttons\\UI-MinusButton-DOWN");
end
button.toggle:Show();
else
button.toggle:Hide();
end
end
function OptionsList_DisplayPanel (panel)
local panelContainer = panel:GetParent();
if ( panelContainer.displayedPanel ) then
panelContainer.displayedPanel:Hide();
end
panelContainer.displayedPanel = panel;
panel:ClearAllPoints();
panel:SetPoint("TOPLEFT", panelContainer, "TOPLEFT");
panel:SetPoint("BOTTOMRIGHT", panelContainer, "BOTTOMRIGHT");
panel:Show();
end
function OptionsList_ClearSelection (listFrame, buttons)
for _, button in SecureNext, buttons do
button:UnlockHighlight();
end
listFrame.selection = nil;
end
function OptionsList_SelectButton (listFrame, button)
button:LockHighlight()
listFrame.selection = button.element;
end
function OptionsListScroll_Update (frame)
local parent = frame:GetParent();
parent:update();
end
function OptionsListButton_OnLoad (self, toggleFunc)
self.text = _G[self:GetName() .. "Text"];
self.highlight = self:GetHighlightTexture();
self.highlight:SetVertexColor(.196, .388, .8);
self.text:SetPoint("RIGHT", "$parentToggle", "LEFT", -2, 0);
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
self.toggleFunc = toggleFunc or OptionsListButton_ToggleSubCategories;
end
function OptionsListButton_OnClick (self, mouseButton)
if ( mouseButton == "RightButton" ) then
if ( self.element.hasChildren ) then
OptionsListButtonToggle_OnClick(self.toggle);
end
return;
end
local listFrame = self:GetParent();
OptionsList_ClearSelection(listFrame, listFrame.buttons);
OptionsList_SelectButton(listFrame, self);
OptionsList_DisplayPanel(self.element);
end
function OptionsListButton_ToggleSubCategories (button)
local element = self.element;
element.collapsed = not element.collapsed;
local collapsed = element.collapsed;
local categoryFrame = self:GetParent();
local optionsFrame = categoryFrame:GetParent();
local categoryList = optionsFrame.categoryList;
for _, category in SecureNext, categoryList do
if ( category.parent == element.name ) then
if ( collapsed ) then
category.hidden = true;
else
category.hidden = false;
end
end
end
categoryFrame:update();
end
function OptionsListButtonToggle_OnClick (self)
local button = self:GetParent();
button:toggleFunc();
end
-- [[ OptionsFrameTemplate ]] --
-- NOTE: the difference between "category" and "panel" is mostly a terminology difference
-- let's say we have a set of options called foo
-- "category" is used when referring to foo as data
-- "panel" is used when referring to the frame that displays foo
function OptionsFrame_OnLoad(self)
self.categoryFrame = _G[self:GetName().."CategoryFrame"];
self.panelContainer = _G[self:GetName().."PanelContainer"];
self.okay = _G[self:GetName().."Okay"];
self.cancel = _G[self:GetName().."Cancel"];
self.apply = _G[self:GetName().."Apply"];
self.default = _G[self:GetName().."Default"];
self.categoryList = { };
end
function OptionsFrame_OnShow (self)
if ( self.lastFrame ) then
self.lastFrame:Hide();
end
--Refresh the category frames and display the first category if nothing is displayed.
self.categoryFrame:update();
if ( not self.panelContainer.displayedPanel ) then
OptionsListButton_OnClick(self.categoryFrame.buttons[1]);
end
--Refresh the categories to pick up changes made while the options frame was hidden.
OptionsFrame_RefreshCategories(self);
end
function OptionsFrame_OnHide (self)
PlaySound("gsTitleOptionExit");
if ( self.lastFrame ) then
self.lastFrame:Show();
self.lastFrame = nil;
end
end
function OptionsFrame_OnKeyDown(self, key)
if ( key == "ESCAPE" ) then
self.cancel:Click();
elseif ( key == "PRINTSCREEN" ) then
Screenshot();
end
end
local function OptionsFrame_RunOkayForCategory (category)
pcall(category.okay, category);
end
local function OptionsFrame_RunCancelForCategory (category)
pcall(category.cancel, category);
end
local function OptionsFrame_RunDefaultForCategory (category)
pcall(category.default, category);
end
local function OptionsFrame_RunRefreshForCategory (category)
pcall(category.refresh, category);
end
function OptionsFrameOkay_OnClick (self, apply)
--Iterate through registered panels and run their okay methods in a taint-safe fashion
for _, category in SecureNext, self.categoryList do
securecall(OptionsFrame_RunOkayForCategory, category);
end
end
function OptionsFrameCancel_OnClick (self)
--Iterate through registered panels and run their cancel methods in a taint-safe fashion
for _, category in SecureNext, self.categoryList do
securecall(OptionsFrame_RunCancelForCategory, category);
end
end
function OptionsFrameDefault_OnClick (self)
-- NOTE: defer setting defaults until a popup dialog button is clicked
end
function OptionsFrame_SetAllToDefaults (self)
--Iterate through registered panels and run their default methods in a taint-safe fashion
for _, category in SecureNext, self.categoryList do
securecall("pcall", category.default, category);
end
--Refresh the categories to pick up changes made.
OptionsFrame_RefreshCategories(self);
end
function OptionsFrame_SetCurrentToDefaults (self)
local displayedPanel = self.panelContainer.displayedPanel;
if ( not displayedPanel or not displayedPanel.default ) then
return;
end
displayedPanel.default(displayedPanel);
--Run the refresh method to refresh any values that were changed.
displayedPanel.refresh(displayedPanel);
end
function OptionsFrame_RefreshCategories (self)
for _, category in SecureNext, self.categoryList do
securecall(OptionsFrame_RunRefreshForCategory, category);
end
end
--Table to reuse! Yay reuse!
local displayedElements = {};
function OptionsCategoryFrame_Update (self)
--Redraw the scroll lists
local categoryList = self:GetParent().categoryList;
local element;
for i, element in SecureNext, displayedElements do
displayedElements[i] = nil;
end
for i, element in SecureNext, categoryList do
if ( not element.hidden ) then
tinsert(displayedElements, element);
end
end
local scrollFrame = self.scrollFrame;
local buttons = self.buttons;
local numButtons = #buttons;
local numCategories = #displayedElements;
if ( numCategories > numButtons and ( not scrollFrame:IsShown() ) ) then
OptionsList_DisplayScrollBar(self);
elseif ( numCategories <= numButtons and ( scrollFrame:IsShown() ) ) then
OptionsList_HideScrollBar(self);
end
FauxScrollFrame_Update(scrollFrame, numCategories, numButtons, buttons[1]:GetHeight());
local selection = self.selection;
if ( selection ) then
-- Store the currently selected element and clear all the buttons, we're redrawing.
OptionsList_ClearSelection(self, self.buttons);
end
local offset = FauxScrollFrame_GetOffset(scrollFrame);
for i = 1, numButtons do
element = displayedElements[i + offset];
if ( not element ) then
OptionsList_HideButton(buttons[i]);
else
OptionsList_DisplayButton(buttons[i], element);
if ( selection and selection == element and not self.selection ) then
OptionsList_SelectButton(self, buttons[i]);
end
end
end
if ( selection ) then
-- If there was a selected element before we cleared the button highlights, restore it, 'cause we're done.
-- Note: This theoretically might already have been done by OptionsList_SelectButton, but in the event that the selected button hasn't been drawn, this is still necessary.
self.selection = selection;
end
end
function OptionsFrame_OpenToCategory (self, panel)
local panelName;
if ( type(panel) == "string" ) then
panelName = panel;
panel = nil;
end
if ( not panelName or panel ) then
return;
end
local categoryList = self.categoryList;
local elementToDisplay;
for i, element in SecureNext, categoryList do
if ( element == panel or (panelName and element.name and element.name == panelName) ) then
elementToDisplay = element;
break;
end
end
if ( not elementToDisplay ) then
return;
end
local buttons = self.categoryFrame.buttons
for i, button in SecureNext, buttons do
if ( button.element == elementToDisplay ) then
button:Click();
elseif ( elementToDisplay.parent and button.element and (button.element.name == elementToDisplay.parent and button.element.collapsed) ) then
button.toggle:Click();
end
end
if ( not self:IsShown() ) then
self:Show();
end
end
function OptionsFrame_AddCategory (self, panel)
if ( not issecure() ) then
-- disallow any non-blizzard code to enter here...
-- we may want to change this in the future if we merge this with Interface Options
end
local parent = panel.parent;
if ( parent ) then
for i = 1, #self.categoryList do
if ( self.categoryList[i].name == parent ) then
if ( self.categoryList[i].hasChildren ) then
panel.hidden = self.categoryList[i].collapsed;
else
panel.hidden = true;
self.categoryList[i].hasChildren = true;
self.categoryList[i].collapsed = true;
end
tinsert(self.categoryList, i + 1, panel);
self.categoryFrame:update();
return;
end
end
end
tinsert(self.categoryList, panel);
self.categoryFrame:update();
end
@@ -0,0 +1,542 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!-- if you change something here you probably want to change the frame version too -->
<Script file="OptionsFrameTemplates.lua"/>
<!-- OptionsTooltip -->
<!-- because glue screens don't have a GameTooltip -->
<Frame name="OptionsTooltip" frameStrata="TOOLTIP" hidden="true" clampedToScreen="true">
<Size>
<AbsDimension x="268" y="0"/>
</Size>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText1" inherits="GlueFontNormal" justifyH="LEFT">
<Size>
<AbsDimension x="250" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-10"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentText2" inherits="GlueFontNormalSmall" justifyH="LEFT">
<Size>
<AbsDimension x="250" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentText1" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-8" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
OptionsTooltip_OnLoad(self);
</OnLoad>
<OnShow>
OptionsTooltip_OnShow(self);
</OnShow>
</Scripts>
</Frame>
<!-- Options Frame Templates -->
<Button name="OptionsFrameTabButtonTemplate" virtual="true">
<Size>
<AbsDimension x="115" y="24"/>
</Size>
<Layers>
<Layer level="BORDER">
<Texture name="$parentLeftDisabled" file="Interface\OptionsFrame\UI-OptionsFrame-ActiveTab">
<Size>
<AbsDimension x="20" y="24"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-3"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0" right="0.15625" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentMiddleDisabled" file="Interface\OptionsFrame\UI-OptionsFrame-ActiveTab">
<Size>
<AbsDimension x="88" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeftDisabled" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.15625" right="0.84375" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentRightDisabled" file="Interface\OptionsFrame\UI-OptionsFrame-ActiveTab">
<Size>
<AbsDimension x="20" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentMiddleDisabled" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.84375" right="1.0" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentLeft" file="Interface\OptionsFrame\UI-OptionsFrame-InActiveTab">
<Size>
<AbsDimension x="20" y="24"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0" right="0.15625" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\OptionsFrame\UI-OptionsFrame-InActiveTab">
<Size>
<AbsDimension x="88" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.15625" right="0.84375" top="0" bottom="1.0"/>
</Texture>
<Texture name="$parentRight" file="Interface\OptionsFrame\UI-OptionsFrame-InActiveTab">
<Size>
<AbsDimension x="20" y="24"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentMiddle" relativePoint="RIGHT"/>
</Anchors>
<TexCoords left="0.84375" right="1.0" top="0" bottom="1.0"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetFrameLevel() + 4);
</OnLoad>
<OnShow>
PanelTemplates_TabResize(self, 0);
_G[self:GetName().."HighlightTexture"]:SetWidth(self:GetTextWidth() + 30);
</OnShow>
</Scripts>
<ButtonText name="$parentText">
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="-3"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormalSmall"/>
<HighlightFont style="GlueFontHighlightSmall"/>
<DisabledFont style="GlueFontHighlightSmall"/>
<HighlightTexture name="$parentHighlightTexture" file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="10" y="-4"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-10" y="-4"/>
</Offset>
</Anchor>
</Anchors>
</HighlightTexture>
</Button>
<Frame name="OptionsFrameListTemplate" virtual="true">
<Layers>
<!--
<Layer level="ARTWORK">
<FontString name="$parentLabel" inherits="GlueFontHighlight" text="CATEGORY">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="6" y="4"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
-->
<Layer level="BACKGROUND">
<!-- Yay. It's a backdrop. -->
<Texture name="$parentTopLeft" file="Interface\Tooltips\UI-Tooltip-Border">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0.5" right="0.625" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottomLeft" file="Interface\Tooltips\UI-Tooltip-Border">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT"/>
</Anchors>
<TexCoords left="0.75" right="0.875" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottomRight" file="Interface\Tooltips\UI-Tooltip-Border">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="BOTTOMRIGHT"/>
</Anchors>
<TexCoords left="0.875" right="1" top="0" bottom="1"/>
</Texture>
<Texture name="$parentTopRight" file="Interface\Tooltips\UI-Tooltip-Border">
<Size>
<AbsDimension x="16" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.625" right="0.75" top="0" bottom="1"/>
</Texture>
<Texture name="$parentLeft" file="Interface\Tooltips\UI-Tooltip-Border">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomLeft" relativePoint="TOPRIGHT"/>
</Anchors>
<TexCoords left="0" right="0.125" top="0" bottom="1"/>
</Texture>
<Texture name="$parentRight" file="Interface\Tooltips\UI-Tooltip-Border">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopRight" relativePoint="BOTTOMLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.125" right="0.25" top="0" bottom="1"/>
</Texture>
<Texture name="$parentBottom" file="Interface\OptionsFrame\UI-OptionsFrame-Spacer">
<Size>
<AbsDimension x="0" y="16"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="BOTTOMLEFT"/>
</Anchors>
</Texture>
<Texture name="$parentTop" file="Interface\OptionsFrame\UI-OptionsFrame-Spacer">
<Size>
<AbsDimension x="0" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="7"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="TOPLEFT"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<ScrollFrame name="$parentList" hidden="true">
<Size>
<AbsDimension x="24" y="0"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-3" y="-3"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="-3" y="3"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="12"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="0" right="0" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(.6, .6, .6, .6);
GlueScrollFrame_OnLoad(self);
</OnLoad>
<OnMouseWheel>
GlueScrollFrameTemplate_OnMouseWheel(self, delta);
</OnMouseWheel>
<OnVerticalScroll>
FauxScrollFrame_OnVerticalScroll(self, offset, self:GetParent().buttonHeight, OptionsListScroll_Update);
</OnVerticalScroll>
</Scripts>
<Frames>
<Slider name="$parentScrollBar" inherits="GlueScrollBarTemplate">
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="-20"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="19"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnValueChanged>
self:GetParent():SetVerticalScroll(value);
</OnValueChanged>
</Scripts>
</Slider>
<Frame name="$parentScrollChildFrame" hidden="true"/>
</Frames>
</ScrollFrame>
</Frames>
<Scripts>
<OnLoad>
OptionsList_OnLoad(self);
</OnLoad>
</Scripts>
</Frame>
<Button name="OptionsListButtonTemplate" virtual="true">
<Size>
<AbsDimension x="175" y="18"/>
</Size>
<Frames>
<Button name="$parentToggle">
<Size>
<AbsDimension x="14" y="14"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="-6" y="-1"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:GetParent().toggle = self;
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
</OnLoad>
<OnClick>
PlaySound("igMainMenuOptionCheckBoxOn");
OptionsFrame_ToggleSubCategories(self);
</OnClick>
</Scripts>
<NormalTexture name="$parentNormalTexture" file="Interface\Buttons\UI-MinusButton-UP"/>
<PushedTexture name="$parentPushedTexture" file="Interface\Buttons\UI-MinusButton-DOWN"/>
<HighlightTexture name="$parentHighlightTexture" file="Interface\Buttons\UI-PlusButton-Hilight" alphaMode="ADD"/>
</Button>
</Frames>
<Scripts>
<OnLoad>
OptionsListButton_OnLoad(self);
</OnLoad>
<OnClick>
PlaySound("igMainMenuOptionCheckBoxOn");
OptionsListButton_OnClick(self, button);
</OnClick>
</Scripts>
<ButtonText name="$parentText" justifyH="LEFT">
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentToggle" relativePoint="LEFT">
<Offset>
<AbsDimension x="-2" y="0"/>
</Offset>
</Anchor>
</Anchors>
</ButtonText>
<NormalFont style="GlueFontNormal"/>
<HighlightFont style="GlueFontHighlight"/>
<HighlightTexture file="Interface\QuestFrame\UI-QuestLogTitleHighlight" alphaMode="ADD">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="0" y="1"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="0" y="1"/>
</Offset>
</Anchor>
</Anchors>
</HighlightTexture>
</Button>
<Frame name="OptionsFrameTemplate" toplevel="true" parent="GlueParent" virtual="true" hidden="true" enableMouse="true" enableKeyboard="true" frameStrata="HIGH">
<Size>
<AbsDimension x="648" y="520"/>
</Size>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\tooltips\ui-tooltip-border-maw" tile="true">
<BackgroundInsets>
<AbsInset left="3" right="3" top="3" bottom="3"/>
</BackgroundInsets>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentHeader">
<Size>
<AbsDimension x="300" y="75"/>
</Size>
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="12"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
<FontString name="$parentHeaderText" inherits="GlueFontNormal" text="OPTIONS">
<Anchors>
<Anchor point="TOP" relativeTo="$parentHeader">
<Offset>
<AbsDimension x="0" y="-25"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentBackdrop" enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GlueParent" relativePoint="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="GlueParent" relativePoint="BOTTOMRIGHT"/>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture setAllPoints="true">
<Color r="0" g="0" b="0" a=".75"/>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetParent():GetFrameLevel() - 1);
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentCategoryFrame" inherits="OptionsFrameListTemplate">
<Size>
<AbsDimension x="175" y="429"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="22" y="-40"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
--self.labelText = CATEGORY;
OptionsList_OnLoad(self);
self.update = OptionsCategoryFrame_Update;
</OnLoad>
</Scripts>
</Frame>
<Frame name="$parentPanelContainer">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parentCategoryFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="16" y="0"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMLEFT" relativeTo="$parentCategoryFrame" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="16" y="1"/>
</Offset>
</Anchor>
<Anchor point="RIGHT">
<Offset>
<AbsDimension x="-22" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(.6, .6, .6, 1);
</OnLoad>
</Scripts>
</Frame>
</Frames>
<Scripts>
<OnLoad>
OptionsFrame_OnLoad(self);
</OnLoad>
<OnShow>
OptionsFrame_OnShow(self);
</OnShow>
<OnHide>
OptionsFrame_OnHide(self);
</OnHide>
<OnKeyDown>
OptionsFrame_OnKeyDown(self, key);
</OnKeyDown>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,459 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
-- if you change something here you probably want to change the frame version too
CONTROLTYPE_CHECKBOX = 1;
CONTROLTYPE_DROPDOWN = 2;
CONTROLTYPE_SLIDER = 3;
local ALT_KEY = "altkey";
local CONTROL_KEY = "controlkey";
local SHIFT_KEY = "shiftkey";
local NO_KEY = "none";
local next = next;
local function SecureNext(elements, key)
return securecall(next, elements, key);
end
local tinsert = tinsert;
local tonumber = tonumber;
local tostring = tostring;
local gsub = gsub;
-- [[ functions for OptionsPanelTemplates controls ]] --
function BlizzardOptionsPanel_Slider_Disable (slider)
local name = slider:GetName();
getmetatable(slider).__index.Disable(slider);
_G[name.."Text"]:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
_G[name.."Low"]:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
_G[name.."High"]:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
end
function BlizzardOptionsPanel_Slider_Enable (slider)
local name = slider:GetName();
getmetatable(slider).__index.Enable(slider);
_G[name.."Text"]:SetVertexColor(NORMAL_FONT_COLOR.r , NORMAL_FONT_COLOR.g , NORMAL_FONT_COLOR.b);
_G[name.."Low"]:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
_G[name.."High"]:SetVertexColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b);
end
function BlizzardOptionsPanel_Slider_Refresh (slider)
local value;
if ( slider.GetCurrentValue ) then
value = slider:GetCurrentValue();
elseif ( slider.cvar ) then
value = BlizzardOptionsPanel_GetCVarSafe(slider.cvar);
end
if ( value ) then
if ( slider.SetDisplayValue ) then
slider:SetDisplayValue(value);
else
slider:SetValue(value);
end
slider.value = value;
end
end
function BlizzardOptionsPanel_CheckButton_OnClick (checkButton)
BlizzardOptionsPanel_CheckButton_SetNewValue(checkButton);
local setting = "0";
if ( checkButton:GetChecked() ) then
if ( not checkButton.invert ) then
setting = "1";
end
elseif ( checkButton.invert ) then
setting = "1";
end
if ( checkButton.setFunc ) then
checkButton.setFunc(setting);
end
end
function BlizzardOptionsPanel_CheckButton_SetNewValue (checkButton)
local setting = "0";
if ( checkButton:GetChecked() ) then
if ( not checkButton.invert ) then
setting = "1"
end
elseif ( checkButton.invert ) then
setting = "1"
end
if ( setting == checkButton.value ) then
checkButton.newValue = nil;
else
checkButton.newValue = setting;
end
if ( checkButton.dependentControls ) then
if ( checkButton:GetChecked() ) then
for _, control in SecureNext, checkButton.dependentControls do
control:Enable();
end
else
for _, control in SecureNext, checkButton.dependentControls do
control:Disable();
end
end
end
end
--[[
function BlizzardOptionsPanel_CheckButton_OnClick (checkButton)
local setting = "0";
if ( checkButton:GetChecked() ) then
if ( not checkButton.invert ) then
setting = "1"
end
elseif ( checkButton.invert ) then
setting = "1"
end
checkButton.value = setting;
if ( checkButton.cvar ) then
BlizzardOptionsPanel_SetCVarSafe(checkButton.cvar, setting, checkButton.event);
end
if ( checkButton.uvar ) then
_G[checkButton.uvar] = setting;
end
if ( checkButton.dependentControls ) then
if ( checkButton:GetChecked() ) then
for _, control in SecureNext, checkButton.dependentControls do
control:Enable();
end
else
for _, control in SecureNext, checkButton.dependentControls do
control:Disable();
end
end
end
if ( checkButton.setFunc ) then
checkButton.setFunc(checkButton.value);
end
end
--]]
function BlizzardOptionsPanel_CheckButton_Refresh (checkButton)
local value;
if ( checkButton.cvar ) then
value = GetCVar(checkButton.cvar);
elseif ( checkButton.GetValue ) then
value = tostring(checkButton:GetValue());
end
if ( value ) then
if ( not checkButton.invert ) then
if ( value == "1" ) then
checkButton:SetChecked(true);
else
checkButton:SetChecked(false);
end
else
if ( value == "0" ) then
checkButton:SetChecked(true);
else
checkButton:SetChecked(false);
end
end
if ( checkButton.dependentControls ) then
if ( checkButton:GetChecked() ) then
for _, depControl in SecureNext, checkButton.dependentControls do
depControl:Enable();
end
else
for _, depControl in SecureNext, checkButton.dependentControls do
depControl:Disable();
end
end
end
checkButton.value = value;
end
end
function BlizzardOptionsPanel_DropDown_Refresh (dropDown)
if ( dropDown.RefreshValue ) then
dropDown:RefreshValue();
end
end
-- [[ BlizzardOptionsPanel functions ]] --
function BlizzardOptionsPanel_SetCVarSafe (cvar, value, event)
local oldValue = GetCVar(cvar);
oldValueNum = tonumber(oldValue);
valueNum = tonumber(value);
if ( oldValueNum or valueNum ) then
if ( oldValueNum ~= valueNum ) then
SetCVar(cvar, value, event);
end
else
if ( oldValue ~= value ) then
SetCVar(cvar, value, event);
end
end
end
function BlizzardOptionsPanel_GetCVarSafe (cvar)
local value = GetCVar(cvar);
value = tonumber(value) or value;
return value;
end
function BlizzardOptionsPanel_GetCVarDefaultSafe (cvar)
local value = GetCVarDefault(cvar);
value = tonumber(value) or value;
return value;
end
function BlizzardOptionsPanel_GetCVarMinSafe (cvar)
local value = GetCVarMin(cvar);
value = tonumber(value) or value;
return value;
end
function BlizzardOptionsPanel_GetCVarMaxSafe (cvar)
local value = GetCVarMax(cvar);
value = tonumber(value) or value;
return value;
end
function BlizzardOptionsPanel_OkayControl (control)
if ( control.newValue ) then
if ( control.value ~= control.newValue ) then
control:SetValue(control.newValue);
control.value = control.newValue;
control.newValue = nil;
end
elseif ( control.value ) then
if ( control:GetValue() ~= control.value ) then
control:SetValue(control.value);
end
end
end
function BlizzardOptionsPanel_CancelControl (control)
if ( control.newValue ) then
if ( control.value and control.value ~= control.newValue ) then
-- we need to force-set the value here just in case the control was doing dynamic updating
control:SetValue(control.value);
control.newValue = nil;
end
elseif ( control.value ) then
if ( control:GetValue() ~= control.value ) then
control:SetValue(control.value);
end
end
end
function BlizzardOptionsPanel_DefaultControl (control)
if ( control.defaultValue and control.value ~= control.defaultValue ) then
control:SetValue(control.defaultValue);
control.value = control.defaultValue;
control.newValue = nil;
end
end
function BlizzardOptionsPanel_RefreshControl (control)
if ( control.type == CONTROLTYPE_CHECKBOX ) then
BlizzardOptionsPanel_CheckButton_Refresh(control);
elseif ( control.type == CONTROLTYPE_DROPDOWN ) then
BlizzardOptionsPanel_DropDown_Refresh(control);
elseif ( control.type == CONTROLTYPE_SLIDER ) then
BlizzardOptionsPanel_Slider_Refresh(control);
end
end
function BlizzardOptionsPanel_Okay (self)
for _, control in SecureNext, self.controls do
securecall(BlizzardOptionsPanel_OkayControl, control);
end
end
function BlizzardOptionsPanel_Cancel (self)
for _, control in SecureNext, self.controls do
securecall(BlizzardOptionsPanel_CancelControl, control);
end
end
function BlizzardOptionsPanel_Default (self)
for _, control in SecureNext, self.controls do
securecall(BlizzardOptionsPanel_DefaultControl, control);
end
end
function BlizzardOptionsPanel_Refresh (self)
for _, control in SecureNext, self.controls do
securecall(BlizzardOptionsPanel_RefreshControl, control);
end
end
function BlizzardOptionsPanel_OnLoad (frame, okay, cancel, default, refresh)
frame.okay = okay or BlizzardOptionsPanel_Okay;
frame.cancel = cancel or BlizzardOptionsPanel_Cancel;
frame.default = default or BlizzardOptionsPanel_Default;
frame.refresh = refresh or BlizzardOptionsPanel_Refresh;
frame:RegisterEvent("SET_GLUE_SCREEN");
frame:SetScript("OnEvent", BlizzardOptionsPanel_OnEvent);
end
function BlizzardOptionsPanel_OnEvent (frame, event, ...)
if ( event == "SET_GLUE_SCREEN" ) then
if ( frame.options and frame.controls ) then
local entry;
local minValue, maxValue;
for i, control in SecureNext, frame.controls do
entry = frame.options[(control.cvar or control.label)];
if ( entry ) then
if ( entry.text ) then
control.tooltipText = (_G["OPTION_TOOLTIP_" .. gsub(entry.text, "_TEXT$", "")] or entry.tooltip);
local text = _G[control:GetName() .. "Text"];
if ( text ) then
text:SetText(_G[entry.text] or entry.text);
end
end
control.tooltipRequirement = entry.tooltipRequirement;
control.gameRestart = entry.gameRestart;
control.event = entry.event or entry.text;
if ( control.cvar ) then
if ( control.type == CONTROLTYPE_CHECKBOX ) then
control.defaultValue = GetCVarDefault(control.cvar);
else
control.defaultValue = BlizzardOptionsPanel_GetCVarDefaultSafe(control.cvar);
minValue = BlizzardOptionsPanel_GetCVarMinSafe(control.cvar) or entry.minValue;
maxValue = BlizzardOptionsPanel_GetCVarMaxSafe(control.cvar) or entry.maxValue;
end
else
control.defaultValue = control.defaultValue or entry.default;
minValue = entry.minValue;
maxValue = entry.maxValue;
end
if ( control.type == CONTROLTYPE_SLIDER ) then
BlizzardOptionsPanel_Slider_Enable(control);
control:SetMinMaxValues(minValue, maxValue);
control:SetValueStep(entry.valueStep);
end
BlizzardOptionsPanel_SetupControl(control);
end
end
end
frame:UnregisterEvent(event);
end
end
function BlizzardOptionsPanel_RegisterControl (control, parentFrame)
if ( ( not parentFrame ) or ( not control ) ) then
return;
end
parentFrame.controls = parentFrame.controls or {};
tinsert(parentFrame.controls, control);
-- Use the panel's OnEvent handler to wait and setup the control after game data is loaded
end
function BlizzardOptionsPanel_SetupControl (control)
if ( control.type == CONTROLTYPE_CHECKBOX ) then
if ( control.cvar ) then
local value = GetCVar(control.cvar);
control.value = value;
if ( control.uvar ) then
_G[control.uvar] = value;
end
control.GetValue = function(self) return GetCVar(self.cvar); end
control.SetValue = function(self, value) self.value = value; BlizzardOptionsPanel_SetCVarSafe(self.cvar, value, self.event); if ( self.uvar ) then _G[self.uvar] = value end end
control.Disable = function (self) getmetatable(self).__index.Disable(self) _G[self:GetName().."Text"]:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b) end;
control.Enable = function (self)
getmetatable(self).__index.Enable(self);
local text = _G[self:GetName().."Text"];
local fontObject = text:GetFontObject();
_G[self:GetName().."Text"]:SetTextColor(fontObject:GetTextColor());
end
elseif ( control.GetValue ) then
if ( control.type == CONTROLTYPE_CHECKBOX ) then
value = control:GetValue();
if ( value ) then
control.value = tostring(value);
else
control.value = "0";
end
if ( control.uvar ) then
_G[control.uvar] = value;
end
control.SetValue = function(self, value) self.value = value; if ( self.uvar ) then _G[self.uvar] = value; end end;
control.Disable = function (self) getmetatable(self).__index.Disable(self) _G[self:GetName().."Text"]:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b) end;
control.Enable = function (self)
getmetatable(self).__index.Enable(self);
local text = _G[self:GetName().."Text"];
local fontObject = text:GetFontObject();
_G[self:GetName().."Text"]:SetTextColor(fontObject:GetTextColor());
end
end
end
elseif ( control.type == CONTROLTYPE_SLIDER ) then
local value;
if ( control.GetCurrentValue ) then
value = control:GetCurrentValue();
elseif ( control.cvar ) then
value = BlizzardOptionsPanel_GetCVarSafe(control.cvar);
else
value = control:GetValue();
end
if ( control.SetDisplayValue ) then
control:SetDisplayValue(value);
else
control:SetValue(value);
end
-- set the value AFTER the set value function call so the current value matches the new value
-- just in case an OnValueChange script changed the new value
control.value = value;
control.Disable = BlizzardOptionsPanel_Slider_Disable;
control.Enable = BlizzardOptionsPanel_Slider_Enable;
end
end
function BlizzardOptionsPanel_SetupDependentControl (dependency, control)
if ( not dependency ) then
return;
end
assert(control);
dependency.dependentControls = dependency.dependentControls or {};
tinsert(dependency.dependentControls, control);
if ( control.type ~= CONTROLTYPE_DROPDOWN ) then
control.Disable = function (self) getmetatable(self).__index.Disable(self) _G[self:GetName().."Text"]:SetTextColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b) end;
control.Enable = function (self) getmetatable(self).__index.Enable(self) _G[self:GetName().."Text"]:SetTextColor(HIGHLIGHT_FONT_COLOR.r, HIGHLIGHT_FONT_COLOR.g, HIGHLIGHT_FONT_COLOR.b) end;
else
control.Disable = function (self) UIDropDownMenu_DisableDropDown(self) end;
control.Enable = function (self) UIDropDownMenu_EnableDropDown(self) end;
end
end
@@ -0,0 +1,173 @@
<!-- Autora: Noa -->
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!-- if you change something here you probably want to change the frame version too -->
<CheckButton name="OptionsBaseCheckButtonTemplate" virtual="true">
<Size>
<AbsDimension x="26" y="26"/>
</Size>
<HitRectInsets>
<AbsInset left="0" right="-100" top="0" bottom="0"/>
</HitRectInsets>
<Scripts>
<OnClick>
if ( self:GetChecked() ) then
PlaySound("igMainMenuOptionCheckBoxOn");
else
PlaySound("igMainMenuOptionCheckBoxOff");
end
BlizzardOptionsPanel_CheckButton_OnClick(self);
</OnClick>
<OnEnter>
if ( self.tooltipText ) then
OptionsTooltip:SetOwner(self);
OptionsTooltip:SetText(self.tooltipText, nil, nil, nil, nil);
end
if ( self.tooltipRequirement ) then
OptionsTooltip:AddLine(self.tooltipRequirement, 1.0, 1.0, 1.0, 1.0);
OptionsTooltip:Show();
end
</OnEnter>
<OnLeave>
OptionsTooltip:Hide();
</OnLeave>
</Scripts>
<NormalTexture file="Interface\Buttons\UI-CheckBox-Up"/>
<PushedTexture file="Interface\Buttons\UI-CheckBox-Down"/>
<HighlightTexture file="Interface\Buttons\UI-CheckBox-Highlight" alphaMode="ADD"/>
<CheckedTexture file="Interface\Buttons\UI-CheckBox-Check"/>
<DisabledCheckedTexture file="Interface\Buttons\UI-CheckBox-Check-Disabled"/>
</CheckButton>
<CheckButton name="OptionsCheckButtonTemplate" virtual="true" inherits="OptionsBaseCheckButtonTemplate">
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="OptionsFont">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="1"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</CheckButton>
<CheckButton name="OptionsSmallCheckButtonTemplate" virtual="true" inherits="OptionsBaseCheckButtonTemplate">
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="OptionsFontSmall">
<Anchors>
<Anchor point="LEFT" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="1"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</CheckButton>
<Slider name="OptionsSliderTemplate" orientation="HORIZONTAL" virtual="true" enableMouse="true">
<Size>
<AbsDimension x="144" y="17"/>
</Size>
<HitRectInsets>
<AbsInset left="0" right="0" top="-10" bottom="-10"/>
</HitRectInsets>
<Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background" edgeFile="Interface\tooltips\Glue-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="8"/>
</EdgeSize>
<TileSize>
<AbsValue val="8"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="3" right="3" top="3" bottom="3"/>
<Color r="0" g="0" b="0" a="1"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="OptionsFontHighlight">
<Anchors>
<Anchor point="BOTTOM" relativePoint="TOP"/>
</Anchors>
</FontString>
<FontString name="$parentLow" inherits="OptionsFontSmall" text="LOW">
<Anchors>
<Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="-4" y="3"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="$parentHigh" inherits="OptionsFontSmall" text="HIGH">
<Anchors>
<Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT">
<Offset>
<AbsDimension x="4" y="3"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnEnter>
if ( self:IsEnabled() ) then
if ( self.tooltipText ) then
OptionsTooltip:SetOwner(self, self.tooltipOwnerPoint, self.tooltipPoint);
OptionsTooltip:SetText(self.tooltipText, nil, nil, nil, nil);
end
if ( self.tooltipRequirement ) then
OptionsTooltip:AddLine(self.tooltipRequirement, 1.0, 1.0, 1.0, 1.0);
OptionsTooltip:Show();
end
end
</OnEnter>
<OnLeave>
OptionsTooltip:Hide();
</OnLeave>
</Scripts>
<ThumbTexture name="$parentThumb" file="Interface\Buttons\UI-SliderBar-Button-Horizontal">
<Size>
<AbsDimension x="32" y="32"/>
</Size>
</ThumbTexture>
</Slider>
<Frame name="OptionsBoxTemplate" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentTitle" inherits="OptionsFontHighlightSmall">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="5" y="0"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Backdrop edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(0.4, 0.4, 0.4);
self:SetBackdropColor(0.5, 0.5, 0.5);
</OnLoad>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1,616 @@
-- ============================================================================
-- Autora: Noa
-- ============================================================================
-- if you change something here you probably want to change the frame version too
local OPTIONS_FARCLIP_MIN = 177;
local OPTIONS_FARCLIP_MAX = 1277;
local VIDEO_OPTIONS_CUSTOM_QUALITY = 6;
local VIDEO_OPTIONS_COMPARISON_EPSILON = 0.000001;
-- [[ Generic Video Options Panel ]] --
function VideoOptionsPanel_Okay (self)
for _, control in next, self.controls do
if ( control.newValue ) then
if ( control.value ~= control.newValue ) then
if ( control.gameRestart ) then
VideoOptionsFrame.gameRestart = true;
end
if ( control.restart ) then
VideoOptionsFrame.gxRestart = true;
end
control:SetValue(control.newValue);
control.value = control.newValue;
control.newValue = nil;
end
elseif ( control.value ) then
control:SetValue(control.value);
end
end
end
function VideoOptionsPanel_Cancel (self)
for _, control in next, self.controls do
if ( control.newValue ) then
if ( control.value and control.value ~= control.newValue ) then
if ( control.restart ) then
VideoOptionsFrame.gxRestart = true;
end
-- we need to force-set the value here just in case the control was doing dynamic updating
control:SetValue(control.value);
control.newValue = nil;
end
elseif ( control.value ) then
control:SetValue(control.value);
end
end
end
function VideoOptionsPanel_Default (self)
for _, control in next, self.controls do
if ( control.defaultValue and control.value ~= control.defaultValue ) then
if ( control.restart ) then
VideoOptionsFrame.gxRestart = true;
end
control:SetValue(control.defaultValue);
control.newValue = nil;
end
end
end
function VideoOptionsPanel_OnLoad (self, okay, cancel, default, refresh)
okay = okay or VideoOptionsPanel_Okay;
cancel = cancel or VideoOptionsPanel_Cancel;
default = default or VideoOptionsPanel_Default;
refresh = refresh or BlizzardOptionsPanel_Refresh;
BlizzardOptionsPanel_OnLoad(self, okay, cancel, default, refresh);
OptionsFrame_AddCategory(VideoOptionsFrame, self);
end
-- [[ Resolution Panel ]] --
ResolutionPanelOptions = {
gxVSync = { text = "VERTICAL_SYNC" },
gxTripleBuffer = { text = "TRIPLE_BUFFER" },
gxCursor = { text = "HARDWARE_CURSOR" },
gxFixLag = { text = "FIX_LAG" },
gxWindow = { text = "WINDOWED_MODE" },
gxMaximize = { text = "WINDOWED_MAXIMIZED" },
windowResizeLock = { text = "WINDOW_LOCK" },
desktopGamma = { text = "DESKTOP_GAMMA" },
gamma = { text = "GAMMA", minValue = -.5, maxValue = .5, valueStep = .1 },
}
function VideoOptionsResolutionPanel_Default (self)
RestoreVideoResolutionDefaults();
for _, control in next, self.controls do
control.newValue = nil;
end
end
function VideoOptionsResolutionPanel_Refresh (self)
BlizzardOptionsPanel_Refresh(self);
VideoOptionsResolutionPanel_RefreshGammaControls();
end
function VideoOptionsResolutionPanel_OnLoad (self)
self.name = RESOLUTION_LABEL;
self.options = ResolutionPanelOptions;
VideoOptionsPanel_OnLoad(self, nil, nil, VideoOptionsResolutionPanel_Default, VideoOptionsResolutionPanel_Refresh);
self:SetScript("OnEvent", VideoOptionsResolutionPanel_OnEvent);
end
function VideoOptionsResolutionPanel_OnEvent (self, event, ...)
BlizzardOptionsPanel_OnEvent(self, event, ...);
if ( event == "SET_GLUE_SCREEN" ) then
-- don't allow systems that don't support features to enable them
local anisotropic, pixelShaders, vertexShaders, trilinear, buffering, maxAnisotropy, hardwareCursor = GetVideoCaps();
if ( not hardwareCursor ) then
VideoOptionsResolutionPanelHardwareCursor:SetChecked(false);
VideoOptionsResolutionPanelHardwareCursor:Disable();
end
VideoOptionsResolutionPanelHardwareCursor.SetChecked =
function (self, checked)
local anisotropic, pixelShaders, vertexShaders, trilinear, buffering, maxAnisotropy, hardwareCursor = GetVideoCaps();
if ( not hardwareCursor ) then
checked = false;
end
getmetatable(self).__index.SetChecked(self, checked);
end
VideoOptionsResolutionPanelHardwareCursor.Enable =
function (self)
local anisotropic, pixelShaders, vertexShaders, trilinear, buffering, maxAnisotropy, hardwareCursor = GetVideoCaps();
if ( not hardwareCursor ) then
return;
end
getmetatable(self).__index.Enable(self);
local text = _G[self:GetName().."Text"];
local fontObject = text:GetFontObject();
_G[self:GetName().."Text"]:SetTextColor(fontObject:GetTextColor());
end
end
end
function VideoOptionsResolutionPanel_RefreshGammaControls ()
if ( VideoOptionsResolutionPanelWindowed:GetChecked() ) then
VideoOptionsResolutionPanelDesktopGamma:SetChecked();
VideoOptionsResolutionPanelDesktopGamma:Disable();
BlizzardOptionsPanel_Slider_Disable(VideoOptionsResolutionPanelGammaSlider);
else
VideoOptionsResolutionPanelDesktopGamma:Enable();
if ( VideoOptionsResolutionPanelDesktopGamma:GetChecked() ) then
BlizzardOptionsPanel_Slider_Disable(VideoOptionsResolutionPanelGammaSlider);
else
BlizzardOptionsPanel_Slider_Enable(VideoOptionsResolutionPanelGammaSlider);
end
end
end
function VideoOptionsResolutionPanel_SetWindowed ()
VideoOptionsResolutionPanel_RefreshGammaControls();
local value;
if ( VideoOptionsResolutionPanelWindowed:GetChecked() or
VideoOptionsResolutionPanelDesktopGamma:GetChecked() ) then
value = 1;
else
value = 0;
end
BlizzardOptionsPanel_SetCVarSafe("desktopGamma", value);
end
function VideoOptionsResolutionPanel_SetGamma (value)
VideoOptionsResolutionPanel_RefreshGammaControls();
BlizzardOptionsPanel_SetCVarSafe("desktopGamma", value);
end
function VideoOptionsResolutionPanelResolutionDropDown_OnLoad(self)
--self.cvar = "gxResolution";
local value = GetCurrentResolution();
--self.defaultValue = BlizzardOptionsPanel_GetCVarDefaultSafe(self.cvar);
self.value = value;
self.restart = true;
GlueDropDownMenu_SetWidth(110, self);
GlueDropDownMenu_Initialize(self, VideoOptionsResolutionPanelResolutionDropDown_Initialize);
GlueDropDownMenu_SetSelectedID(self, value, 1);
self.SetValue =
function (self, value)
SetScreenResolution(value);
end
self.GetValue =
function (self)
return GetCurrentResolution();
end
self.RefreshValue =
function (self)
local value = GetCurrentResolution();
GlueDropDownMenu_Initialize(self, VideoOptionsResolutionPanelResolutionDropDown_Initialize);
GlueDropDownMenu_SetSelectedID(self, value, 1);
self.value = value;
self.newValue = value;
end
end
function VideoOptionsResolutionPanelResolutionDropDown_Initialize()
VideoOptionsResolutionPanelResolutionDropDown_LoadResolutions(GetScreenResolutions());
end
function VideoOptionsResolutionPanelResolutionDropDown_LoadResolutions(...)
local info = GlueDropDownMenu_CreateInfo();
local resolution, xIndex, width, height;
for i=1, select("#", ...) do
resolution = (select(i, ...));
xIndex = strfind(resolution, "x");
width = strsub(resolution, 1, xIndex-1);
height = strsub(resolution, xIndex+1, strlen(resolution));
if ( width/height > 4/3 ) then
resolution = resolution.." "..WIDESCREEN_TAG;
end
info.text = resolution;
info.value = resolution;
info.func = VideoOptionsResolutionPanelResolutionDropDown_OnClick;
info.checked = nil;
GlueDropDownMenu_AddButton(info);
end
end
function VideoOptionsResolutionPanelResolutionDropDown_OnClick(self)
local value = self:GetID();
local dropdown = VideoOptionsResolutionPanelResolutionDropDown;
GlueDropDownMenu_SetSelectedID(dropdown, value, 1);
if ( dropdown.value == value ) then
dropdown.newValue = nil;
else
dropdown.newValue = value;
end
VideoOptionsFrameApply:Enable();
end
function VideoOptionsResolutionPanelRefreshDropDown_OnLoad(self)
self.cvar = "gxRefresh";
local value = BlizzardOptionsPanel_GetCVarSafe(self.cvar);
self.defaultValue = BlizzardOptionsPanel_GetCVarDefaultSafe(self.cvar);
self.value = value;
self.restart = true;
GlueDropDownMenu_SetWidth(110, self);
GlueDropDownMenu_Initialize(self, VideoOptionsResolutionPanelRefreshDropDown_Initialize);
GlueDropDownMenu_SetSelectedValue(self, value);
self.SetValue =
function (self, value)
BlizzardOptionsPanel_SetCVarSafe(self.cvar, value);
end;
self.GetValue =
function (self)
return BlizzardOptionsPanel_GetCVarSafe(self.cvar);
end
self.RefreshValue =
function (self)
local value = BlizzardOptionsPanel_GetCVarSafe(self.cvar);
GlueDropDownMenu_Initialize(self, VideoOptionsResolutionPanelRefreshDropDown_Initialize);
GlueDropDownMenu_SetSelectedValue(self, value);
self.value = value;
self.newValue = value;
end
end
function VideoOptionsResolutionPanelRefreshDropDown_Initialize()
VideoOptionsResolutionPanel_GetRefreshRates(GetRefreshRates());
end
function VideoOptionsResolutionPanel_GetRefreshRates(...)
local info = GlueDropDownMenu_CreateInfo();
if ( select("#", ...) == 1 and select(1, ...) == 0 ) then
VideoOptionsResolutionPanelRefreshDropDownButton:Disable();
VideoOptionsResolutionPanelRefreshDropDownLabel:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
VideoOptionsResolutionPanelRefreshDropDownText:SetVertexColor(GRAY_FONT_COLOR.r, GRAY_FONT_COLOR.g, GRAY_FONT_COLOR.b);
return;
end
for i=1, select("#", ...) do
info.text = select(i, ...)..HERTZ;
info.func = VideoOptionsResolutionPanelRefreshDropDown_OnClick;
if ( GlueDropDownMenu_GetSelectedValue(VideoOptionsResolutionPanelRefreshDropDown) and tonumber(GlueDropDownMenu_GetSelectedValue(VideoOptionsResolutionPanelRefreshDropDown)) == select(i, ...) ) then
info.checked = 1;
GlueDropDownMenu_SetText(info.text, VideoOptionsResolutionPanelRefreshDropDown);
else
info.checked = nil;
end
info.value = select(i, ...)
GlueDropDownMenu_AddButton(info);
end
end
function VideoOptionsResolutionPanelRefreshDropDown_OnClick(self)
local value = self.value;
local dropdown = VideoOptionsResolutionPanelRefreshDropDown;
GlueDropDownMenu_SetSelectedValue(dropdown, value);
if ( dropdown.value == value ) then
dropdown.newValue = nil;
else
dropdown.newValue = value;
end
VideoOptionsFrameApply:Enable();
end
function VideoOptionsResolutionPanelMultiSampleDropDown_OnLoad(self)
local value = GetCurrentMultisampleFormat();
--self.defaultValue = 1;
self.value = value;
self.restart = true;
GlueDropDownMenu_SetWidth(160, self);
GlueDropDownMenu_SetAnchor(self, -200, 23, "TOPRIGHT", "VideoOptionsResolutionPanelMultiSampleDropDownRight", "BOTTOMRIGHT");
GlueDropDownMenu_Initialize(self, VideoOptionsResolutionPanelMultiSampleDropDown_Initialize);
GlueDropDownMenu_SetSelectedID(self, value);
self.SetValue =
function (self, value)
SetMultisampleFormat(value);
end;
self.GetValue =
function (self)
return GetCurrentMultisampleFormat();
end
self.RefreshValue =
function (self)
local value = GetCurrentMultisampleFormat();
GlueDropDownMenu_Initialize(self, VideoOptionsResolutionPanelMultiSampleDropDown_Initialize);
GlueDropDownMenu_SetSelectedID(self, value);
self.value = value;
self.newValue = value;
end
end
function VideoOptionsResolutionPanelMultiSampleDropDown_Initialize()
VideoOptionsResolutionPanel_GetMultisampleFormats(GetMultisampleFormats());
end
function VideoOptionsResolutionPanel_GetMultisampleFormats(...)
local colorBits, depthBits, multiSample;
local info = GlueDropDownMenu_CreateInfo();
local checked;
local index = 1;
for i=1, select("#", ...), 3 do
colorBits, depthBits, multiSample = select(i, ...);
info.text = format(MULTISAMPLING_FORMAT_STRING, colorBits, depthBits, multiSample);
info.func = VideoOptionsResolutionPanelMultiSampleDropDown_OnClick;
if ( index == GlueDropDownMenu_GetSelectedID(VideoOptionsResolutionPanelMultiSampleDropDown) ) then
checked = 1;
GlueDropDownMenu_SetText(info.text, VideoOptionsResolutionPanelMultiSampleDropDown);
else
checked = nil;
end
info.checked = checked;
GlueDropDownMenu_AddButton(info);
index = index + 1;
end
end
function VideoOptionsResolutionPanelMultiSampleDropDown_OnClick(self)
local value = self:GetID();
local dropdown = VideoOptionsResolutionPanelMultiSampleDropDown;
GlueDropDownMenu_SetSelectedID(dropdown, value);
if ( dropdown.value == value ) then
dropdown.newValue = nil;
else
dropdown.newValue = value;
end
VideoOptionsFrameApply:Enable();
end
-- [[ Effects Panel ]] --
EffectsPanelOptions = {
farclip = { text = "FARCLIP", minValue = OPTIONS_FARCLIP_MIN, maxValue = OPTIONS_FARCLIP_MAX, valueStep = (OPTIONS_FARCLIP_MAX - OPTIONS_FARCLIP_MIN)/10},
TerrainMip = { text = "TERRAIN_MIP", minValue = 0, maxValue = 1, valueStep = 1, tooltip = OPTION_TOOLTIP_TERRAIN_TEXTURE, },
particleDensity = { text = "PARTICLE_DENSITY", minValue = 0.1, maxValue = 1.0, valueStep = 0.1},
environmentDetail = { text = "ENVIRONMENT_DETAIL", minValue = 0.5, maxValue = 1.5, valueStep = .25},
groundEffectDensity = { text = "GROUND_DENSITY", minValue = 16, maxValue = 64, valueStep = 8},
groundEffectDist = { text = "GROUND_RADIUS", minValue = 70, maxValue = 140, valueStep = 10 },
BaseMip = { text = "TEXTURE_DETAIL", minValue = 0, maxValue = 1, valueStep = 1, tooltipPoint = "BOTTOMRIGHT", tooltipOwnerPoint = "TOPLEFT", },
extShadowQuality = { text = "SHADOW_QUALITY", minValue = 0, maxValue = 4, valueStep = 1 },
textureFilteringMode = { text = "ANISOTROPIC", minValue = 0, maxValue = 5, valueStep = 1, gameRestart = 1, tooltipPoint = "BOTTOMRIGHT", tooltipOwnerPoint = "TOPLEFT", tooltipRequirement = OPTION_RESTART_REQUIREMENT, },
weatherDensity = { text = "WEATHER_DETAIL", minValue = 0, maxValue = 3, valueStep = 1, tooltipPoint = "BOTTOMRIGHT", tooltipOwnerPoint = "TOPLEFT", },
componentTextureLevel = { text = "PLAYER_DETAIL", minValue = 8, maxValue = 9, valueStep = 1, tooltipPoint = "BOTTOMRIGHT", tooltipOwnerPoint = "TOPLEFT", gameRestart = 1, tooltipRequirement = OPTION_RESTART_REQUIREMENT, },
specular = { text = "TERRAIN_HIGHLIGHTS"},
ffxGlow = { text = "FULL_SCREEN_GLOW", },
ffxDeath = { text = "DEATH_EFFECT", },
projectedTextures = { text = "PROJECTED_TEXTURES", },
quality = { text = "", minValue = 1, maxValue = 6, valueStep = 1 },
}
function VideoOptionsEffectsPanel_Default (self)
RestoreVideoEffectsDefaults();
for _, control in next, self.controls do
if ( control ~= VideoOptionsEffectsPanelQualitySlider ) then
control.newValue = nil;
end
end
end
function VideoOptionsEffectsPanel_Refresh (self)
BlizzardOptionsPanel_Refresh(self);
VideoOptionsEffectsPanel_UpdateVideoQuality();
-- HACK: force update the quality slider because the update video quality call will change the new value
VideoOptionsEffectsPanelQualitySlider.value = VideoOptionsEffectsPanelQualitySlider.newValue;
end
function VideoOptionsEffectsPanel_OnLoad (self)
self.name = EFFECTS_LABEL;
self.options = EffectsPanelOptions;
VideoOptionsPanel_OnLoad(self, nil, nil, VideoOptionsEffectsPanel_Default, VideoOptionsEffectsPanel_Refresh);
-- this must come AFTER the parent OnLoad because the functions will be set to defaults there
self:SetScript("OnEvent", VideoOptionsEffectsPanel_OnEvent);
end
function VideoOptionsEffectsPanel_OnEvent (self, event, ...)
BlizzardOptionsPanel_OnEvent(self, event, ...);
if ( event == "SET_GLUE_SCREEN" ) then
-- fixup value steps for the farclip control, which has an adjustable min/max
local farclipControl = VideoOptionsEffectsPanelViewDistance;
local minValue, maxValue = farclipControl:GetMinMaxValues();
farclipControl:SetValueStep((maxValue - minValue) / 10);
-- some of the values in the preset graphics quality levels aren't available on all platforms, so we
-- need to fixup the quality levels now
VideoOptionsEffectsPanel_FixupQualityLevels();
VideoOptionsEffectsPanel_UpdateVideoQuality();
if ( not IsPlayerResolutionAvailable() ) then
VideoOptionsEffectsPanelPlayerTexture:Disable();
end
end
end
function VideoOptionsEffectsPanel_SetVideoQuality (quality)
if ( not quality or not GraphicsQualityLevels[quality] or VideoOptionsEffectsPanel.videoQuality == quality ) then
return;
elseif ( quality == VIDEO_OPTIONS_CUSTOM_QUALITY ) then
VideoOptionsEffectsPanel.videoQuality = quality;
VideoOptionsEffectsPanel_SetVideoQualityLabels(quality);
return;
end
for control, value in next, GraphicsQualityLevels[quality] do
control = _G[control];
if ( control.type == CONTROLTYPE_SLIDER ) then
control:SetDisplayValue(value);
elseif ( control.type == CONTROLTYPE_CHECKBOX ) then
if ( value ) then
control:SetChecked(true);
else
control:SetChecked(false);
end
BlizzardOptionsPanel_CheckButton_SetNewValue(control);
end
end
VideoOptionsEffectsPanel.videoQuality = quality;
VideoOptionsEffectsPanel_SetVideoQualityLabels(quality);
end
function VideoOptionsEffectsPanel_SetVideoQualityLabels (quality)
quality = quality or 5;
local qualityText = _G["VIDEO_QUALITY_LABEL" .. quality] or "Unknown";
VideoOptionsEffectsPanelQualityLabel:SetFormattedText(VIDEO_QUALITY_S, qualityText);
VideoOptionsEffectsPanelQualitySubText:SetText(_G["VIDEO_QUALITY_SUBTEXT" .. quality]);
VideoOptionsEffectsPanelQualitySlider:SetValue(quality);
end
function VideoOptionsEffectsPanel_GetVideoQuality ()
for quality, controls in ipairs(GraphicsQualityLevels) do
local mismatch = false;
for control, value in next, controls do
control = _G[control];
if ( control.type == CONTROLTYPE_CHECKBOX ) then
local checked = control:GetChecked();
if ( ( value and not checked ) or ( not value and checked ) ) then
mismatch = true;
break;
end
elseif ( control.GetValue ) then
if ( not (abs(control:GetValue() - value) <= VIDEO_OPTIONS_COMPARISON_EPSILON) ) then
-- you may have been expecting ( control:GetValue() ~= value ) but here's why we can't use that:
-- 1) floating point error: if we set a value to 0.4 and the machine's floating point error results in the value being 0.40000000596046 instead,
-- we want those two values to be considered equal
-- 2) NaN/IND numbers: if for whatever reason a control gives us an NaN or IND number, any comparisons with those numbers will evaluate to false,
-- so we phrase the comparison inversely so NaN/IND comparisons result in a mismatch
mismatch = true;
break;
end
end
end
if ( not mismatch ) then
return quality;
end
end
return VIDEO_OPTIONS_CUSTOM_QUALITY;
end
function VideoOptionsEffectsPanel_SetCustomQuality ()
for control in next, GraphicsQualityLevels[1] do
control = _G[control];
control:Enable();
end
end
function VideoOptionsEffectsPanel_SetPresetQuality ()
for control in next, GraphicsQualityLevels[1] do
control = _G[control];
control:Disable();
end
end
function VideoOptionsEffectsPanel_UpdateVideoQuality ()
local quality = VideoOptionsEffectsPanel_GetVideoQuality();
if ( quality ~= VideoOptionsEffectsPanel.videoQuality ) then
VideoOptionsEffectsPanel_SetVideoQuality(quality);
end
end
function VideoOptionsEffectsPanelSlider_OnValueChanged (self, value)
self.newValue = value;
if(self:GetParent():IsVisible()) then
VideoOptionsEffectsPanel_UpdateVideoQuality();
VideoOptionsFrameApply:Enable();
end
end
function VideoOptionsEffectsPanel_FixupQualityLevels ()
-- set the lowest and highest
for quality, controls in ipairs(GraphicsQualityLevels) do
for index, value in next, controls do
local control = _G[index];
if ( control.type ~= CONTROLTYPE_CHECKBOX and control.cvar ) then
local minValue = BlizzardOptionsPanel_GetCVarMinSafe(control.cvar);
local maxValue = BlizzardOptionsPanel_GetCVarMaxSafe(control.cvar);
if ( minValue and value < minValue ) then
controls[index] = minValue;
elseif ( maxValue and value > maxValue ) then
controls[index] = maxValue;
end
end
end
end
end
--[[Stereo Options]]
VideoStereoPanelOptions = {
gxStereoEnabled = { text = "ENABLE_STEREO_VIDEO" },
gxStereoConvergence = { text = "DEPTH_CONVERGENCE", minValue = 0.2, maxValue = 50, valueStep = 0.1, tooltip = OPTION_STEREO_CONVERGENCE},
gxStereoSeparation = { text = "EYE_SEPARATION", minValue = 0, maxValue = 100, valueStep = 1, tooltip = OPTION_STEREO_SEPARATION},
gxCursor = { text = "STEREO_HARDWARE_CURSOR" },
}
function VideoOptionsStereoPanel_OnLoad (self)
self.name = STEREO_VIDEO_LABEL;
self.options = VideoStereoPanelOptions;
if ( IsStereoVideoAvailable() ) then
VideoOptionsPanel_OnLoad(self);
end
self:RegisterEvent("SET_GLUE_SCREEN");
self:SetScript("OnEvent", VideoOptionsStereoPanel_OnEvent);
end
function VideoOptionsStereoPanel_Default (self)
RestoreVideoStereoDefaults();
for _, control in next, self.controls do
if ( control.defaultValue and control.value ~= control.defaultValue ) then
control:SetValue(control.defaultValue);
end
control.newValue = nil;
end
end
function VideoOptionsStereoPanel_OnEvent(self, event, ...)
BlizzardOptionsPanel_OnEvent(self, event, ...);
if ( event == "SET_GLUE_SCREEN" ) then
-- don't allow systems that don't support features to enable them
local anisotropic, pixelShaders, vertexShaders, trilinear, buffering, maxAnisotropy, hardwareCursor = GetVideoCaps();
if ( not hardwareCursor ) then
VideoOptionsStereoPanelHardwareCursor:SetChecked(false);
VideoOptionsStereoPanelHardwareCursor:Disable();
end
VideoOptionsStereoPanelHardwareCursor.SetChecked =
function (self, checked)
local anisotropic, pixelShaders, vertexShaders, trilinear, buffering, maxAnisotropy, hardwareCursor = GetVideoCaps();
if ( not hardwareCursor ) then
checked = false;
end
getmetatable(self).__index.SetChecked(self, checked);
end
VideoOptionsStereoPanelHardwareCursor.Enable =
function (self)
local anisotropic, pixelShaders, vertexShaders, trilinear, buffering, maxAnisotropy, hardwareCursor = GetVideoCaps();
if ( not hardwareCursor ) then
return;
end
getmetatable(self).__index.Enable(self);
local text = _G[self:GetName().."Text"];
local fontObject = text:GetFontObject();
_G[self:GetName().."Text"]:SetTextColor(fontObject:GetTextColor());
end
end
end
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Some files were not shown because too many files have changed in this diff Show More