diff --git a/AccountLogin.lua b/AccountLogin.lua index abf53f1..e56a3ae 100644 --- a/AccountLogin.lua +++ b/AccountLogin.lua @@ -249,6 +249,7 @@ function Autologin_PrevPage() Autologin_UpdateUI(); end + FADE_IN_TIME = 2; DEFAULT_TOOLTIP_COLOR = {0.8, 0.8, 0.8, 0.09, 0.09, 0.09}; MAX_PIN_LENGTH = 10; @@ -257,13 +258,11 @@ function AccountLogin_OnLoad() this:SetSequence(0); this:SetCamera(0); - TOSFrame.noticeType = "EULA"; - this:RegisterEvent("SHOW_SERVER_ALERT"); this:RegisterEvent("SHOW_SURVEY_NOTIFICATION"); local versionType, buildType, version, internalVersion, date = GetBuildInfo(); - AccountLoginVersion:SetText(format(TEXT(VERSION_TEMPLATE), versionType, version, internalVersion, buildType, date)); + AccountLoginVersion:SetText(format(VERSION_TEMPLATE, versionType, version, internalVersion, buildType, date)); -- Color edit box backdrops local backdropColor = DEFAULT_TOOLTIP_COLOR; @@ -271,14 +270,15 @@ function AccountLogin_OnLoad() AccountLoginAccountEdit:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]); AccountLoginPasswordEdit:SetBackdropBorderColor(backdropColor[1], backdropColor[2], backdropColor[3]); AccountLoginPasswordEdit:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]); + VirtualKeypadText:SetBackdropBorderColor(backdropColor[1], backdropColor[2], backdropColor[3]); + VirtualKeypadText:SetBackdropColor(backdropColor[4], backdropColor[5], backdropColor[6]); end function AccountLogin_OnShow() CurrentGlueMusic = "Sound\\Music\\GlueScreenMusic\\wow_main_theme.mp3"; - - -- Try to show the EULA or the TOS - -- AccountLogin_ShowUserAgreements(); - + + AcceptTOS(); + AcceptEULA(); local serverName = GetServerName(); if(serverName) then AccountLoginRealmName:SetText(serverName); @@ -286,9 +286,6 @@ function AccountLogin_OnShow() AccountLoginRealmName:Hide() end - -- Autologin OnShow. Load sets `Autologin_SelectedIdx` from the - -- last-used account name (via GetSavedAccountName), so honor that - -- here instead of unconditionally picking row 1. Autologin_Load(); Autologin_PasswordFieldForced = false; if ( table.getn(Autologin_Table) ~= 0 ) then @@ -307,9 +304,6 @@ function AccountLogin_OnShow() elseif ( AccountLoginPasswordEdit:IsVisible() ) then AccountLogin_FocusPassword(); end - -- If the password field is hidden (saved-account autologin), don't - -- grab focus — Enter will still trigger Login via the parent frame's - -- OnKeyDown handler, and the user can click the name field to edit. end function AccountLogin_FocusPassword() @@ -333,7 +327,7 @@ function AccountLogin_OnKeyDown() else AccountLogin_Exit(); end - + elseif ( arg1 == "ENTER" ) then if ( not TOSAccepted() ) then return; @@ -363,14 +357,34 @@ function AccountLogin_Login() Autologin_OnLogin(); end -function AccountLogin_ManageAccount() +function AccountLogin_Turtle_Armory_Website() PlaySound("gsLoginNewAccount"); - LaunchURL(AUTH_NO_TIME_URL); + LaunchURL(TURTLE_ARMORY_WEBSITE); end -function AccountLogin_LaunchCommunitySite() +function AccountLogin_Turtle_Website() PlaySound("gsLoginNewAccount"); - LaunchURL(COMMUNITY_URL); + LaunchURL(AUTH_TURTLE_WEBSITE); +end + +function AccountLogin_Turtle_Knowledge_Database() + PlaySound("gsLoginNewAccount"); + LaunchURL(TURTLE_KNOWLEDGE_DATABASE_WEBSITE); +end + +function AccountLogin_Turtle_Community_Forum() + PlaySound("gsLoginNewAccount"); + LaunchURL(TURTLE_COMMUNITY_FORUM_WEBSITE); +end + +function AccountLogin_Turtle_Discord() + PlaySound("gsLoginNewAccount"); + LaunchURL(TURTLE_DISCORD_WEBSITE); +end + +function AccountLogin_Turtle_Reddit() + PlaySound("gsLoginNewAccount"); + LaunchURL(TURTLE_REDDIT_WEBSITE); end function AccountLogin_Credits() @@ -412,73 +426,12 @@ function AccountLogin_SurveyNotificationDone(accepted) AccountLoginUI:Show(); end -function AccountLogin_ShowUserAgreements() - TOSScrollFrame:Hide(); - EULAScrollFrame:Hide(); - ScanningScrollFrame:Hide(); - ContestScrollFrame:Hide(); - TOSText:Hide(); - EULAText:Hide(); - ScanningText:Hide(); - if ( not EULAAccepted() ) then - if ( ShowEULANotice() ) then - TOSNotice:SetText(EULA_NOTICE); - TOSNotice:Show(); - end - AccountLoginUI:Hide(); - TOSFrame.noticeType = "EULA"; - TOSFrameTitle:SetText(EULA_FRAME_TITLE); - TOSFrameHeader:SetWidth(TOSFrameTitle:GetWidth() + 310); - EULAScrollFrame:Show(); - EULAText:Show(); - TOSFrame:Show(); - elseif ( not TOSAccepted() ) then - if ( ShowTOSNotice() ) then - TOSNotice:SetText(TOS_NOTICE); - TOSNotice:Show(); - end - AccountLoginUI:Hide(); - TOSFrame.noticeType = "TOS"; - TOSFrameTitle:SetText(TOS_FRAME_TITLE); - TOSFrameHeader:SetWidth(TOSFrameTitle:GetWidth() + 310); - TOSScrollFrame:Show(); - TOSText:Show(); - TOSFrame:Show(); - elseif ( not ScanningAccepted() and SHOW_SCANNING_AGREEMENT ) then - if ( ShowScanningNotice() ) then - TOSNotice:SetText(SCANNING_NOTICE); - TOSNotice:Show(); - end - AccountLoginUI:Hide(); - TOSFrame.noticeType = "SCAN"; - TOSFrameTitle:SetText(SCAN_FRAME_TITLE); - TOSFrameHeader:SetWidth(TOSFrameTitle:GetWidth() + 310); - ScanningScrollFrame:Show(); - ScanningText:Show(); - TOSFrame:Show(); - elseif ( not ContestAccepted() and SHOW_CONTEST_AGREEMENT ) then - if ( ShowContestNotice() ) then - TOSNotice:SetText(CONTEST_NOTICE); - TOSNotice:Show(); - end - AccountLoginUI:Hide(); - TOSFrame.noticeType = "CONTEST"; - TOSFrameTitle:SetText(CONTEST_FRAME_TITLE); - TOSFrameHeader:SetWidth(TOSFrameTitle:GetWidth() + 310); - ContestScrollFrame:Show(); - ContestText:Show(); - TOSFrame:Show(); - else - AccountLoginUI:Show(); - TOSFrame:Hide(); - end -end - -- Virtual keypad functions +local buttonText = {} function VirtualKeypadFrame_OnEvent(event) if ( event == "PLAYER_ENTER_PIN" ) then for i=1, 10 do - getglobal("VirtualKeypadButton"..i):SetText(getglobal("arg"..i)); + buttonText[i] = _G["arg"..i] end end -- Randomize location to prevent hacking (yeah right) @@ -486,8 +439,8 @@ function VirtualKeypadFrame_OnEvent(event) local yPadding = 10; local xPos = random(xPadding, GlueParent:GetWidth()-VirtualKeypadFrame:GetWidth()-xPadding); local yPos = random(yPadding, GlueParent:GetHeight()-VirtualKeypadFrame:GetHeight()-yPadding); - VirtualKeypadFrame:SetPoint("TOPLEFT", GlueParent, "TOPLEFT", xPos, -yPos); - + --VirtualKeypadFrame:SetPoint("TOPLEFT", GlueParent, "TOPLEFT", xPos, -yPos); + VirtualKeypadFrame:Show(); VirtualKeypad_UpdateButtons(); end @@ -497,45 +450,31 @@ function VirtualKeypadButton_OnClick() if ( not text ) then text = ""; end - VirtualKeypadText:SetText(text.."*"); VirtualKeypadFrame.PIN = VirtualKeypadFrame.PIN..this:GetID(); + VirtualKeypadText:SetText(VirtualKeypadFrame.PIN); VirtualKeypad_UpdateButtons(); end function VirtualKeypadOkayButton_OnClick() - local PIN = VirtualKeypadFrame.PIN; + local PIN = VirtualKeypadText:GetText(); local numNumbers = strlen(PIN); + if numNumbers < 6 then return end local pinNumber = {}; for i=1, MAX_PIN_LENGTH do if ( i <= numNumbers ) then - pinNumber[i] = strsub(PIN,i,i); + pinNumber[i] = nil; + for j=1, 10 do + if tonumber(buttonText[j]) == tonumber(strsub(PIN,i,i)) then + pinNumber[i] = j-1; + end + end else pinNumber[i] = nil; end end - PINEntered(pinNumber[1] , pinNumber[2], pinNumber[3], pinNumber[4], pinNumber[5], pinNumber[6], pinNumber[7], pinNumber[8], pinNumber[9], pinNumber[10]); + PINEntered(pinNumber[1], pinNumber[2], pinNumber[3], pinNumber[4], pinNumber[5], pinNumber[6], pinNumber[7], pinNumber[8], pinNumber[9], pinNumber[10]); VirtualKeypadFrame:Hide(); end function VirtualKeypad_UpdateButtons() - local numNumbers = strlen(VirtualKeypadFrame.PIN); - if ( numNumbers >= 4 and numNumbers <= MAX_PIN_LENGTH ) then - VirtualKeypadOkayButton:Enable(); - else - VirtualKeypadOkayButton:Disable(); - end - if ( numNumbers == 0 ) then - VirtualKeypadBackButton:Disable(); - else - VirtualKeypadBackButton:Enable(); - end - if ( numNumbers >= MAX_PIN_LENGTH ) then - for i=1, MAX_PIN_LENGTH do - getglobal("VirtualKeypadButton"..i):Disable(); - end - else - for i=1, MAX_PIN_LENGTH do - getglobal("VirtualKeypadButton"..i):Enable(); - end - end end diff --git a/AccountLogin.xml b/AccountLogin.xml index ca1fb26..1b58ba4 100644 --- a/AccountLogin.xml +++ b/AccountLogin.xml @@ -2,6 +2,14 @@ ..\FrameXML\UI.xsd">