2921 lines
82 KiB
Lua
2921 lines
82 KiB
Lua
local f0_local0 = module
|
|
local f0_local1, f0_local2 = ...
|
|
f0_local0( f0_local1, package.seeall )
|
|
CoD.PrintModuleLoad( _NAME )
|
|
f0_local0 = function ( f1_arg0, f1_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f1_arg0 )
|
|
CoDAnywhere.DoNotShowPopup( f1_arg1.controller )
|
|
end
|
|
|
|
f0_local1 = function ( f2_arg0 )
|
|
assert( self.properties.exclusiveController )
|
|
local f2_local0 = self.properties.exclusiveController
|
|
local f2_local1 = {}
|
|
local f2_local2 = ""
|
|
local f2_local3 = "Error: Failed to find string for CoDA Intro Feeder"
|
|
local f2_local4 = "Error: Failed to find string for CoDA Intro Feeder"
|
|
if CoDAnywhere.ShouldShowFounderPopup( f2_local0, true ) == true then
|
|
f2_local2 = "white"
|
|
f2_local3 = "@LUA_MENU_COD_ANYWHERE_INTRO_FOUNDER_1"
|
|
f2_local4 = "@LUA_MENU_COD_ANYWHERE_INTRO_FOUNDER_2"
|
|
elseif CoDAnywhere.ShouldShowWelcomeBackPopup( f2_local0, true ) == true then
|
|
f2_local2 = "white"
|
|
f2_local3 = "@LUA_MENU_COD_ANYWHERE_INTRO_WELCOME_1"
|
|
f2_local4 = "@LUA_MENU_COD_ANYWHERE_INTRO_WELCOME_2"
|
|
else
|
|
f2_local2 = "white"
|
|
f2_local3 = "@LUA_MENU_COD_ANYWHERE_INTRO_NEW_1"
|
|
f2_local4 = "@LUA_MENU_COD_ANYWHERE_INTRO_NEW_2"
|
|
end
|
|
return {
|
|
{
|
|
type = "generic_menu_background",
|
|
properties = {
|
|
top_offset = GenericTitleBarDims.TitleBarHeight,
|
|
menu_frame_r = 0.4,
|
|
menu_frame_g = 0.4,
|
|
menu_frame_b = 0.4,
|
|
background_alpha = 0.25,
|
|
border_alpha = 0.25
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( f2_local2 )
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_intro_text1",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
left = -215,
|
|
top = -190,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1,
|
|
width = 430,
|
|
blue = 0
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( f2_local3 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_intro_text2",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
left = -215,
|
|
top = -190,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1,
|
|
width = 430,
|
|
blue = 0
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( f2_local4 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_intro_button",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = Engine.Localize( "@LUA_MENU_CONTINUE" ),
|
|
button_action_func = f0_local0
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_intro_popup()
|
|
return {
|
|
type = "UIElement",
|
|
id = "cod_anywhere_intro_popup",
|
|
properties = {
|
|
childrenFeeder = f0_local1,
|
|
func = nil
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
children = childfeeder
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_import_continue( f4_arg0, f4_arg1, f4_arg2 )
|
|
LUI.FlowManager.RequestAddMenu( f4_arg0, "cod_anywhere_registration_menu", true, f4_arg1.controller, true )
|
|
end
|
|
|
|
f0_local2 = function ( f5_arg0 )
|
|
local f5_local0 = {}
|
|
local f5_local1 = {
|
|
false,
|
|
true
|
|
}
|
|
local f5_local2 = {
|
|
{
|
|
text = Engine.Localize( "@LUA_MENU_ACCEPT" ),
|
|
func = function ( f6_arg0, f6_arg1 )
|
|
cod_anywhere_import_continue( f6_arg0, f6_arg1, true )
|
|
end,
|
|
import = true
|
|
},
|
|
{
|
|
text = Engine.Localize( "@LUA_MENU_CODA_IMPORT_REFUSE" ),
|
|
func = function ( f7_arg0, f7_arg1 )
|
|
cod_anywhere_import_continue( f7_arg0, f7_arg1, false )
|
|
end,
|
|
import = false
|
|
}
|
|
}
|
|
for f5_local3 = 1, #f5_local2, 1 do
|
|
f5_local0[#f5_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_button_" .. f5_local3,
|
|
listDefaultFocus = f5_local1[f5_local3],
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = f5_local2[f5_local3].text,
|
|
button_action_func = f5_local2[f5_local3].func
|
|
}
|
|
}
|
|
end
|
|
return f5_local0
|
|
end
|
|
|
|
function cod_anywhere_import_popup()
|
|
return {
|
|
type = "UIElement",
|
|
id = "cod_anywhere_import_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_IMPORT_TITLE" ),
|
|
popup_childfeeder = f0_local2,
|
|
popup_title_alignment = LUI.Alignment.Center
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = CoD.ColorizeState( Swatches.Overlay.Color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = Swatches.Overlay.AlphaMore
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
width = 576,
|
|
top = -200,
|
|
bottom = 150
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = updateSelectionListPopup
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_drop_shadow",
|
|
properties = {
|
|
offset_shadow = 0
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_titlebar",
|
|
properties = {
|
|
title_bar_text = MBh.Property( "popup_title" ),
|
|
title_bar_alignment = MBh.Property( "popup_title_alignment" ),
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
properties = {
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_import_text1",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -100,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1,
|
|
blue = 0
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_IMPORT_TEXT1" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_import_text2",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -70,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_IMPORT_TEXT2" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_import_text3",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 10,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 0.75
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_IMPORT_TEXT3" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "selection_list_popup_vert_list_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = GenericTitleBarDims.TitleBarHeight + 6 + 256,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
alignment = LUI.Alignment.Top
|
|
}
|
|
},
|
|
childrenFeeder = MBh.Property( "popup_childfeeder" )
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "cod_anywhere_import_back_id",
|
|
handlers = {
|
|
button_secondary = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_email_confirm_continue( f9_arg0, f9_arg1 )
|
|
LUI.FlowManager.RequestPopupMenu( f9_arg0, "cod_anywhere_agreement_popup", true, f9_arg1.controller, true )
|
|
end
|
|
|
|
local f0_local3 = function ( f10_arg0 )
|
|
local f10_local0 = {}
|
|
local f10_local1 = {
|
|
{
|
|
text = Engine.Localize( "@LUA_MENU_ACCEPT" ),
|
|
func = cod_anywhere_email_confirm_continue
|
|
},
|
|
{
|
|
text = Engine.Localize( "@LUA_MENU_CANCEL" ),
|
|
func = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
for f10_local2 = 1, #f10_local1, 1 do
|
|
f10_local0[#f10_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_button_" .. f10_local2,
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = f10_local1[f10_local2].text,
|
|
button_action_func = f10_local1[f10_local2].func
|
|
}
|
|
}
|
|
end
|
|
return f10_local0
|
|
end
|
|
|
|
function cod_anywhere_email_confirm_popup()
|
|
return {
|
|
type = "UIElement",
|
|
id = "cod_anywhere_email_confirm_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_EMAIL_CONFIRM_TITLE" ),
|
|
popup_childfeeder = f0_local3,
|
|
popup_title_alignment = LUI.Alignment.Center
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = CoD.ColorizeState( Swatches.Overlay.Color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = Swatches.Overlay.AlphaMore
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
width = 576,
|
|
top = -155,
|
|
bottom = 155
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = updateSelectionListPopup
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_drop_shadow",
|
|
properties = {
|
|
offset_shadow = 0
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_titlebar",
|
|
properties = {
|
|
title_bar_text = MBh.Property( "popup_title" ),
|
|
title_bar_alignment = MBh.Property( "popup_title_alignment" ),
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
properties = {
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_email_confirm_text1",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -100,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1,
|
|
blue = 0
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_EMAIL_CONFIRM_TEXT1" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_email_confirm_text2",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -75,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
red = Colors.generic_button_text_default_color.r,
|
|
green = Colors.generic_button_text_default_color.g,
|
|
blue = Colors.generic_button_text_default_color.b
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_EMAIL_CONFIRM_TEXT2" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIMarqueeText",
|
|
id = "cod_anywhere_email_confirm_text3",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 20,
|
|
right = -20,
|
|
top = -30,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
red = Colors.generic_button_content_focus_color.r,
|
|
green = Colors.generic_button_content_focus_color.g,
|
|
blue = Colors.generic_button_content_focus_color.b
|
|
}
|
|
},
|
|
properties = {
|
|
text = ""
|
|
},
|
|
handlers = {
|
|
menu_create = function ( f12_arg0, f12_arg1 )
|
|
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
|
|
local f12_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_local0.reg_menu )
|
|
f12_arg0:setText( f12_local1.reg_email or "error" )
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_email_confirm_text4",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 10,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
red = Colors.generic_button_text_default_color.r,
|
|
green = Colors.generic_button_text_default_color.g,
|
|
blue = Colors.generic_button_text_default_color.b
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_EMAIL_CONFIRM_TEXT3" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "selection_list_popup_vert_list_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = GenericTitleBarDims.TitleBarHeight + 6 + 210,
|
|
bottom = -8,
|
|
left = 5,
|
|
right = -5,
|
|
alignment = LUI.Alignment.Top
|
|
}
|
|
},
|
|
childrenFeeder = MBh.Property( "popup_childfeeder" )
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "cod_anywhere_email_back_id",
|
|
handlers = {
|
|
button_secondary = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_quit_confirm_popup()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "cod_anywhere_quit_confirm_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@PLATFORM_QUIT" ),
|
|
message_text = Engine.Localize( "@MENU_ARE_YOU_SURE_QUIT" ),
|
|
yes_action = function ( f14_arg0, f14_arg1 )
|
|
f14_arg0:dispatchEventToRoot( {
|
|
name = "cod_anywhere_success_exit",
|
|
id = "coda_registration"
|
|
} )
|
|
end
|
|
,
|
|
no_action = MBh.LeaveMenu(),
|
|
yes_text = Engine.Localize( "@MENU_QUIT" ),
|
|
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function SignInSetup( f15_arg0, f15_arg1 )
|
|
local f15_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f15_arg0 )
|
|
f15_local0.signin_email = RegistrationDefaults.reg_email
|
|
f15_local0.signin_password = RegistrationDefaults.reg_password
|
|
f15_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
|
end
|
|
|
|
function SignInEmailPopup( f16_arg0, f16_arg1 )
|
|
local f16_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f16_arg0 )
|
|
Engine.OpenScreenKeyboard( f16_arg1.controller, f16_arg0.properties.field_name, f16_local0.signin_email and f16_local0.signin_email or "", f16_arg0.properties.max_length, false, false, f16_arg0.properties.keyboard_type )
|
|
f16_arg0.properties.active = true
|
|
end
|
|
|
|
function SignInEmailDisplayChanged( f17_arg0, f17_arg1 )
|
|
local f17_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f17_arg0 )
|
|
local f17_local1 = f17_local0.signin_email or ""
|
|
if string.len( f17_local1 ) >= 16 then
|
|
f17_local1 = string.sub( f17_local1, 1, 16 ) .. " ..."
|
|
end
|
|
return f17_local1
|
|
end
|
|
|
|
function SignInEmailChanged( f18_arg0, f18_arg1 )
|
|
local f18_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f18_arg0 )
|
|
if f18_arg1.text == nil or string.find( f18_arg1.text, " " ) ~= nil then
|
|
return
|
|
elseif f18_arg0.properties.active then
|
|
f18_arg0.properties.active = false
|
|
f18_local0.signin_email = f18_arg1.text
|
|
f18_arg0:processEvent( {
|
|
name = "content_refresh",
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
function SignInPasswordChanged( f19_arg0, f19_arg1 )
|
|
local f19_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f19_arg0 )
|
|
f19_local0.signin_password = f19_arg1.text
|
|
if f19_local0.signin_email and string.len( f19_local0.signin_email ) > 0 and f19_local0.signin_password and string.len( f19_local0.signin_password ) > 0 then
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "enable_confirm",
|
|
id = "cod_anywhere_signin_confirm"
|
|
} )
|
|
else
|
|
f19_arg0:dispatchEventToRoot( {
|
|
name = "disable_confirm",
|
|
id = "cod_anywhere_signin_confirm"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function SignInContinue( f20_arg0, f20_arg1 )
|
|
local f20_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f20_arg0 )
|
|
CoDAnywhere.StartAccountLinking( f20_arg1.controller, f20_local0.signin_email, f20_local0.signin_password )
|
|
end
|
|
|
|
function cod_anywhere_sign_in_popup()
|
|
return {
|
|
type = "UIElement",
|
|
id = "cod_anywhere_signin_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_SIGNIN_TITLE" ),
|
|
popup_title_alignment = LUI.Alignment.Center
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = SignInSetup,
|
|
signin_continue = SignInContinue,
|
|
open_cod_anywhere_success_popup = MBh.LeaveMenu(),
|
|
open_cod_anywhere_error_popup = OpenCoDAnywhereErrorPopup
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
material = RegisterMaterial( "white" ),
|
|
top = -360,
|
|
bottom = 360,
|
|
left = 0,
|
|
right = 0,
|
|
red = 0.1,
|
|
green = 0.14,
|
|
blue = 0.16,
|
|
alpha = 0.85
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
left = -425,
|
|
right = 425,
|
|
top = -175,
|
|
bottom = 175
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = updateSelectionListPopup
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_menu_titlebar",
|
|
properties = {
|
|
title_bar_text = MBh.Property( "popup_title" ),
|
|
title_bar_alignment = MBh.Property( "popup_title_alignment" ),
|
|
border_alpha = 1,
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
properties = {
|
|
top_offset = GenericTitleBarDims.TitleBarHeight,
|
|
menu_frame_r = 0.4,
|
|
menu_frame_g = 0.4,
|
|
menu_frame_b = 0.4,
|
|
background_alpha = 1,
|
|
border_alpha = 1,
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "cod_anywhere_signin_vlist",
|
|
states = {
|
|
default = {
|
|
alignment = LUI.Alignment.Top,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
top = 50
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_signin_email",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 80,
|
|
right = -80,
|
|
top = 0,
|
|
bottom = GenericButtonSettings.Styles.GradientButton.height
|
|
}
|
|
},
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Info,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_EMAIL" ),
|
|
content_width = 350,
|
|
content_margin = 55,
|
|
text_padding_with_content = 420,
|
|
button_display_func = SignInEmailDisplayChanged,
|
|
button_action_func = SignInEmailPopup,
|
|
text_alignment = LUI.Alignment.Center,
|
|
keyboard_type = CoD.KeyboardInputTypes.Email,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_EMAIL" ),
|
|
max_length = 53,
|
|
additional_handlers = {
|
|
text_input_complete = SignInEmailChanged
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_signin_password",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 80,
|
|
right = -80,
|
|
top = 0,
|
|
bottom = GenericButtonSettings.Styles.GradientButton.height
|
|
}
|
|
},
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Input,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASSWORD" ),
|
|
content_width = 350,
|
|
content_margin = 55,
|
|
text_padding_with_content = 420,
|
|
field_edited_func = SignInPasswordChanged,
|
|
text_alignment = LUI.Alignment.Center,
|
|
keyboard_type = CoD.KeyboardInputTypes.Password,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASSWORD" ),
|
|
password_field = true
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 8,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 1,
|
|
right = -1,
|
|
top = 0,
|
|
bottom = 1,
|
|
material = RegisterMaterial( "white" ),
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.25
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 10,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_signin_confirm",
|
|
disabled = true,
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 80,
|
|
right = -80,
|
|
top = 0,
|
|
bottom = GenericButtonSettings.Styles.GradientButton.height
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_SIGNIN_CONFIRM" ),
|
|
button_action_func = SignInContinue,
|
|
text_align_without_content = LUI.Alignment.Center,
|
|
text_padding_without_content = 50
|
|
},
|
|
handlers = {
|
|
enable_confirm = function ( f22_arg0, f22_arg1 )
|
|
f22_arg0:processEvent( {
|
|
name = "enable"
|
|
} )
|
|
end
|
|
,
|
|
disable_confirm = function ( f23_arg0, f23_arg1 )
|
|
f23_arg0:processEvent( {
|
|
name = "disable"
|
|
} )
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 10,
|
|
right = -10,
|
|
top = 210,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
red = Colors.generic_button_text_default_color.r,
|
|
green = Colors.generic_button_text_default_color.g,
|
|
blue = Colors.generic_button_text_default_color.b,
|
|
alpha = 0.65
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_SIGNIN_TEXT" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 1,
|
|
right = -1,
|
|
top = -42,
|
|
bottom = -41,
|
|
material = RegisterMaterial( "white" ),
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1,
|
|
alpha = 0.25
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "cod_anywhere_signin_buttons",
|
|
handlers = {
|
|
button_secondary = MBh.LeaveMenu()
|
|
}
|
|
},
|
|
{
|
|
type = "button_helper_text_main",
|
|
properties = {
|
|
left_inset = 20,
|
|
right_inset = -75,
|
|
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
|
|
bottom_margin = 0,
|
|
height = GenericFooterDims.Height,
|
|
spacing = 12,
|
|
background_alpha = 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_agreement_continue( f24_arg0, f24_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f24_arg0 )
|
|
f24_arg0:dispatchEventToRoot( {
|
|
name = "cod_anywhere_start_registration",
|
|
id = "coda_registration"
|
|
} )
|
|
end
|
|
|
|
function AgreementScrollLeftRight( f25_arg0, f25_arg1, f25_arg2 )
|
|
local f25_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f25_arg0 )
|
|
local f25_local1 = ""
|
|
local f25_local2 = ""
|
|
if f25_arg1.name == "button_shoulderr" then
|
|
if f25_local0.current_page + 1 <= f25_local0.num_pages then
|
|
f25_local0.current_page = f25_local0.current_page + 1
|
|
else
|
|
return
|
|
end
|
|
elseif f25_arg1.name == "button_shoulderl" then
|
|
if f25_local0.current_page - 1 >= 1 then
|
|
f25_local0.current_page = f25_local0.current_page - 1
|
|
else
|
|
return
|
|
end
|
|
end
|
|
if f25_local0.current_page > 1 then
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "enable_agreement_left_arrow",
|
|
id = "cod_anywhere_agreement_popup"
|
|
} )
|
|
else
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "disable_agreement_left_arrow",
|
|
id = "cod_anywhere_agreement_popup"
|
|
} )
|
|
end
|
|
if f25_local0.current_page < f25_local0.num_pages then
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "enable_agreement_right_arrow",
|
|
id = "cod_anywhere_agreement_popup"
|
|
} )
|
|
else
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "disable_agreement_right_arrow",
|
|
id = "cod_anywhere_agreement_popup"
|
|
} )
|
|
end
|
|
f25_local0.top_offset = f25_local0.top_offset_buffer
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "set_agreement_text",
|
|
id = "cod_anywhere_agreement_text",
|
|
page = ""
|
|
} )
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "agreement_scroll_up",
|
|
id = "cod_anywhere_agreement_text"
|
|
} )
|
|
f25_local1 = f25_local0.agreement_pages[f25_local0.current_page].text
|
|
f25_local2 = Engine.Localize( "@LUA_MENU_CODA_AGREEMENT_PAGES" ) .. f25_local0.current_page .. "/" .. f25_local0.num_pages
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "set_agreement_text",
|
|
id = "cod_anywhere_agreement_text",
|
|
page = f25_local1
|
|
} )
|
|
f25_arg0:dispatchEventToRoot( {
|
|
name = "set_pages_text",
|
|
id = "cod_anywhere_agreement_pages_text",
|
|
text = f25_local2
|
|
} )
|
|
end
|
|
|
|
function AgreementScroll( f26_arg0, f26_arg1 )
|
|
if f26_arg1.name == "button_up" then
|
|
f26_arg0:dispatchEventToRoot( {
|
|
name = "agreement_scroll_up",
|
|
id = "cod_anywhere_agreement_text"
|
|
} )
|
|
elseif f26_arg1.name == "button_down" then
|
|
f26_arg0:dispatchEventToRoot( {
|
|
name = "agreement_scroll_down",
|
|
id = "cod_anywhere_agreement_text"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function AgreementScrollUp( f27_arg0, f27_arg1 )
|
|
local f27_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f27_arg0 )
|
|
local f27_local1, f27_local2 = f27_arg0:getElementTextDims()
|
|
if f27_local0.top_offset < f27_local0.top_offset_buffer * 2 then
|
|
f27_local0.top_offset = f27_local0.top_offset + CoD.TextSettings.NormalFont.Height
|
|
end
|
|
f27_arg0:registerAnimationState( "scroll", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 40,
|
|
right = -40,
|
|
top = f27_local0.top_offset,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1
|
|
} )
|
|
f27_arg0:animateToState( "scroll" )
|
|
end
|
|
|
|
function AgreementScrollDown( f28_arg0, f28_arg1 )
|
|
local f28_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f28_arg0 )
|
|
local f28_local1, f28_local2 = f28_arg0:getElementTextDims()
|
|
if f28_local0.top_offset * -1 < f28_local2 - 300 then
|
|
f28_local0.top_offset = f28_local0.top_offset - CoD.TextSettings.NormalFont.Height
|
|
end
|
|
f28_arg0:registerAnimationState( "scroll", {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 40,
|
|
right = -40,
|
|
top = f28_local0.top_offset,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1
|
|
} )
|
|
f28_arg0:animateToState( "scroll" )
|
|
end
|
|
|
|
function AgreementSetup( f29_arg0, f29_arg1 )
|
|
local f29_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f29_arg0 )
|
|
local f29_local1 = ""
|
|
local f29_local2 = ""
|
|
local f29_local3 = Engine.GetCurrentLanguage()
|
|
f29_local0.top_offset_buffer = 0
|
|
f29_local0.bottom_offset_buffer = 300
|
|
f29_local0.top_offset = f29_local0.top_offset_buffer
|
|
f29_local0.current_page = 1
|
|
f29_local0.agreement_pages = {
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT1" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT2" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT3" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT4" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT5" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT6" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT7" )
|
|
},
|
|
{
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT8" )
|
|
}
|
|
}
|
|
if Languages[Engine.GetCurrentLanguage and Engine.GetCurrentLanguage() or 0] == "LANGUAGE_ENGLISH" then
|
|
f29_local0.num_pages = 8
|
|
else
|
|
f29_local0.num_pages = 8
|
|
end
|
|
f29_local1 = f29_local0.agreement_pages[f29_local0.current_page].text
|
|
f29_arg0:dispatchEventToRoot( {
|
|
name = "set_pages_text",
|
|
id = "cod_anywhere_agreement_pages_text",
|
|
text = Engine.Localize( "@LUA_MENU_CODA_AGREEMENT_PAGES" ) .. f29_local0.current_page .. "/" .. f29_local0.num_pages
|
|
} )
|
|
f29_arg0:dispatchEventToRoot( {
|
|
name = "enable_agreement_right_arrow",
|
|
id = "cod_anywhere_agreement_popup"
|
|
} )
|
|
f29_arg0:dispatchEventToRoot( {
|
|
name = "disable_agreement_left_arrow",
|
|
id = "cod_anywhere_agreement_popup"
|
|
} )
|
|
f29_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addAcceptButton )
|
|
f29_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addDeclineButton )
|
|
f29_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addLeftButton )
|
|
f29_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addRightButton )
|
|
end
|
|
|
|
function cod_anywhere_agreement_popup()
|
|
return {
|
|
type = "UIElement",
|
|
id = "cod_anywhere_agreement_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_AGREEMENT_TITLE" ),
|
|
popup_title_alignment = LUI.Alignment.Center
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = AgreementSetup,
|
|
agreement_continue = cod_anywhere_agreement_continue
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = CoD.ColorizeState( Swatches.Overlay.Color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = Swatches.Overlay.AlphaMore
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
handlers = {
|
|
button_alt1 = cod_anywhere_agreement_continue,
|
|
button_shoulderr = AgreementScrollLeftRight,
|
|
button_shoulderl = AgreementScrollLeftRight,
|
|
button_up = AgreementScroll,
|
|
button_down = AgreementScroll,
|
|
button_secondary = MBh.LeaveMenu()
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
width = 880,
|
|
height = 600
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = updateSelectionListPopup
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_drop_shadow",
|
|
properties = {
|
|
offset_shadow = 0
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_titlebar",
|
|
properties = {
|
|
title_bar_text = MBh.Property( "popup_title" ),
|
|
title_bar_alignment = MBh.Property( "popup_title_alignment" ),
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
properties = {
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_agreement_subtitle",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 40,
|
|
right = -40,
|
|
top = 45,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_AGREEMENT_SUBTITLE" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIStencil",
|
|
id = "cod_anywhere_agreement_stencil",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 80,
|
|
bottom = -60,
|
|
alpha = 1
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_agreement_text",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 40,
|
|
right = -40,
|
|
top = 0,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
alpha = 1,
|
|
red = Colors.cac_label_text.r,
|
|
green = Colors.cac_label_text.g,
|
|
blue = Colors.cac_label_text.b
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.LocalizeLong( "@LUA_MENU_CODA_AGREEMENT_TEXT1" )
|
|
},
|
|
handlers = {
|
|
set_agreement_text = function ( f31_arg0, f31_arg1 )
|
|
if f31_arg1.page then
|
|
f31_arg0:setText( f31_arg1.page )
|
|
end
|
|
end
|
|
,
|
|
agreement_scroll_up = AgreementScrollUp,
|
|
agreement_scroll_down = AgreementScrollDown
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_agreement_pages_text",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
left = -100,
|
|
right = -10,
|
|
top = -30,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Right,
|
|
alpha = 1
|
|
}
|
|
},
|
|
properties = {
|
|
text = ""
|
|
},
|
|
handlers = {
|
|
set_pages_text = function ( f32_arg0, f32_arg1 )
|
|
if f32_arg1.text then
|
|
f32_arg0:setText( f32_arg1.text )
|
|
end
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "left_nav_arrow_image_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "widg_btn_arrow_lt" ),
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
width = 32,
|
|
height = 64,
|
|
alpha = 0
|
|
},
|
|
bright = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
disable_agreement_left_arrow = MBh.AnimateToState( "default", 0 ),
|
|
enable_agreement_left_arrow = MBh.AnimateToState( "bright", 0 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
id = "right_nav_arrow_image_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "widg_btn_arrow_rt" ),
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
right = 0,
|
|
width = 32,
|
|
height = 64,
|
|
alpha = 0
|
|
},
|
|
bright = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
disable_agreement_right_arrow = MBh.AnimateToState( "default", 0 ),
|
|
enable_agreement_right_arrow = MBh.AnimateToState( "bright", 0 )
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "" ),
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
left = -35,
|
|
right = 0,
|
|
top = 20,
|
|
bottom = -20,
|
|
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or Colors.frontend_hilite.r,
|
|
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or Colors.frontend_hilite.g,
|
|
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or Colors.frontend_hilite.b,
|
|
alpha = 0
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "button_helper_text_main",
|
|
id = "button_helper_text_id",
|
|
properties = {
|
|
left_inset = 20,
|
|
right_inset = -75,
|
|
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
|
|
bottom_margin = 0,
|
|
height = GenericFooterDims.Height,
|
|
spacing = 12,
|
|
background_alpha = 0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function RegisterFirstNameChanged( f33_arg0, f33_arg1 )
|
|
local f33_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f33_arg0 )
|
|
if f33_arg1.text then
|
|
f33_local0.reg_firstname = f33_arg1.text
|
|
CheckShowConfirmButton( f33_arg0, f33_arg1 )
|
|
end
|
|
end
|
|
|
|
function RegisterLastNameChanged( f34_arg0, f34_arg1 )
|
|
local f34_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f34_arg0 )
|
|
if f34_arg1.text then
|
|
f34_local0.reg_lastname = f34_arg1.text
|
|
CheckShowConfirmButton( f34_arg0, f34_arg1 )
|
|
end
|
|
end
|
|
|
|
function GetCountryText( f35_arg0, f35_arg1 )
|
|
local f35_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f35_arg0 )
|
|
local f35_local1 = f35_local0.reg_country or 1
|
|
return Engine.Localize( RegistrationDefaults.country_list[f35_local0.reg_country or 1].display_string )
|
|
end
|
|
|
|
function CountryNext( f36_arg0, f36_arg1, f36_arg2 )
|
|
local f36_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f36_arg0 )
|
|
local f36_local1 = f36_local0.reg_country + 1
|
|
if f36_local1 > #RegistrationDefaults.country_list then
|
|
f36_local1 = 1
|
|
end
|
|
f36_local0.reg_country = f36_local1
|
|
end
|
|
|
|
function CountryPrev( f37_arg0, f37_arg1, f37_arg2 )
|
|
local f37_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f37_arg0 )
|
|
local f37_local1 = f37_local0.reg_country - 1
|
|
if f37_local1 < 1 then
|
|
f37_local1 = #RegistrationDefaults.country_list
|
|
end
|
|
f37_local0.reg_country = f37_local1
|
|
end
|
|
|
|
function RegisterZipChanged( f38_arg0, f38_arg1 )
|
|
local f38_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f38_arg0 )
|
|
if f38_arg1.text then
|
|
f38_local0.reg_zipcode = f38_arg1.text
|
|
CheckShowConfirmButton( f38_arg0, f38_arg1 )
|
|
end
|
|
end
|
|
|
|
function RegisterUsernameChanged( f39_arg0, f39_arg1 )
|
|
local f39_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f39_arg0 )
|
|
if f39_arg0.properties.active then
|
|
f39_arg0.properties.active = false
|
|
if f39_arg1.text ~= nil then
|
|
f39_local0.reg_community_name = f39_arg1.text
|
|
VerifyUsername( f39_arg0, f39_arg1, f39_arg1.text, true )
|
|
CheckShowConfirmButton( f39_arg0, f39_arg1 )
|
|
end
|
|
f39_arg0:processEvent( {
|
|
name = "content_refresh"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function RegisterUsernameDisplayChanged( f40_arg0, f40_arg1 )
|
|
local f40_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f40_arg0 )
|
|
return f40_local0.reg_community_name or ""
|
|
end
|
|
|
|
function RegisterUsernamePopup( f41_arg0, f41_arg1 )
|
|
local f41_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f41_arg0 )
|
|
Engine.OpenScreenKeyboard( f41_arg1.controller, f41_arg0.properties.field_name, f41_local0.reg_community_name and f41_local0.reg_community_name or "", f41_arg0.properties.max_length, false, true, f41_arg0.properties.keyboard_type )
|
|
f41_arg0.properties.active = true
|
|
end
|
|
|
|
function VerifyUsername( f42_arg0, f42_arg1, f42_arg2, f42_arg3 )
|
|
local f42_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f42_arg0 )
|
|
local f42_local1 = Engine.Localize( "@LUA_MENU_CODA_REGISTER_USERNAME" )
|
|
if f42_arg2 == nil or not string.find( f42_arg2, "^[%w_]+$" ) then
|
|
if f42_arg3 and f42_arg3 == true then
|
|
LUI.FlowManager.RequestPopupMenu( f42_arg0, "cod_anywhere_entry_error_popup", true, f42_arg1.controller, false, {
|
|
cancel_will_close = false,
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ENTRY_ERROR" ),
|
|
button_text = Engine.Localize( "@LUA_MENU_CONTINUE" ),
|
|
message_text = f42_local1
|
|
} )
|
|
end
|
|
f42_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_username_icon"
|
|
} )
|
|
f42_local0.community_name_error = true
|
|
return f42_local1
|
|
else
|
|
f42_local0.community_name_error = false
|
|
f42_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_username_icon"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function RegisterEmailPopup( f43_arg0, f43_arg1 )
|
|
local f43_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f43_arg0 )
|
|
Engine.OpenScreenKeyboard( f43_arg1.controller, f43_arg0.properties.field_name, f43_local0.reg_email and f43_local0.reg_email or "", f43_arg0.properties.max_length, false, false, f43_arg0.properties.keyboard_type )
|
|
f43_arg0.properties.active = true
|
|
end
|
|
|
|
function RegisterEmailDisplayChanged( f44_arg0, f44_arg1 )
|
|
local f44_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f44_arg0 )
|
|
local f44_local1 = f44_local0.reg_email or ""
|
|
if string.len( f44_local1 ) >= 24 then
|
|
f44_local1 = string.sub( f44_local1, 1, 25 ) .. " ..."
|
|
end
|
|
return f44_local1
|
|
end
|
|
|
|
function RegisterEmailChanged( f45_arg0, f45_arg1 )
|
|
local f45_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f45_arg0 )
|
|
if f45_arg0.properties.active then
|
|
f45_arg0.properties.active = false
|
|
if f45_arg1.text ~= nil then
|
|
f45_local0.reg_email = f45_arg1.text
|
|
VerifyEmail( f45_arg0, f45_arg1, f45_arg1.text, true )
|
|
CheckShowConfirmButton( f45_arg0, f45_arg1 )
|
|
end
|
|
f45_arg0:processEvent( {
|
|
name = "content_refresh"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function VerifyEmail( f46_arg0, f46_arg1, f46_arg2, f46_arg3 )
|
|
local f46_local0 = Engine.Localize( "@LUA_MENU_CODA_REGISTER_EMAIL" )
|
|
if f46_arg2 == nil or string.find( f46_arg2, "@" ) == nil or string.find( f46_arg2, "." ) == nil then
|
|
if f46_arg3 and f46_arg3 == true then
|
|
LUI.FlowManager.RequestPopupMenu( f46_arg0, "cod_anywhere_entry_error_popup", true, f46_arg1.controller, false, {
|
|
cancel_will_close = false,
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ENTRY_ERROR" ),
|
|
button_text = Engine.Localize( "@LUA_MENU_CONTINUE" ),
|
|
message_text = f46_local0
|
|
} )
|
|
end
|
|
f46_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_email_icon"
|
|
} )
|
|
return f46_local0
|
|
else
|
|
f46_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_email_icon"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function RegisterPasswordChanged( f47_arg0, f47_arg1 )
|
|
local f47_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f47_arg0 )
|
|
if f47_arg1.text then
|
|
f47_local0.reg_password = f47_arg1.text
|
|
VerifyPassword( f47_arg0, f47_arg1, f47_arg1.text, true )
|
|
VerifyConfirmPassword( f47_arg0, f47_arg1, f47_local0.reg_password_confirm, true )
|
|
CheckShowConfirmButton( f47_arg0, f47_arg1 )
|
|
end
|
|
end
|
|
|
|
function VerifyPassword( f48_arg0, f48_arg1, f48_arg2, f48_arg3 )
|
|
local f48_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f48_arg0 )
|
|
local f48_local1 = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASSWORD" )
|
|
local f48_local2 = true
|
|
if f48_arg2 == nil or f48_arg2 == "" then
|
|
f48_local2 = false
|
|
end
|
|
if f48_local2 == false or string.len( f48_arg2 ) < 8 or string.len( f48_arg2 ) > 20 then
|
|
f48_local2 = false
|
|
end
|
|
if f48_local2 == false or f48_arg2 == f48_local0.reg_email then
|
|
f48_local2 = false
|
|
end
|
|
if f48_local2 == false then
|
|
if show_popup and show_popup == true then
|
|
LUI.FlowManager.RequestPopupMenu( f48_arg0, "cod_anywhere_entry_error_popup", true, f48_arg1.controller, false, {
|
|
cancel_will_close = false,
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ENTRY_ERROR" ),
|
|
button_text = Engine.Localize( "@LUA_MENU_CONTINUE" ),
|
|
message_text = f48_local1
|
|
} )
|
|
end
|
|
f48_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_password_icon"
|
|
} )
|
|
return f48_local1
|
|
else
|
|
f48_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_password_icon"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function RegisterConfirmPasswordChanged( f49_arg0, f49_arg1 )
|
|
local f49_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f49_arg0 )
|
|
if f49_arg1.text then
|
|
f49_local0.reg_password_confirm = f49_arg1.text
|
|
VerifyConfirmPassword( f49_arg0, f49_arg1, f49_arg1.text, true )
|
|
CheckShowConfirmButton( f49_arg0, f49_arg1 )
|
|
end
|
|
end
|
|
|
|
function VerifyConfirmPassword( f50_arg0, f50_arg1, f50_arg2, f50_arg3 )
|
|
local f50_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f50_arg0 )
|
|
local f50_local1 = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASS_CONFIRM" )
|
|
if f50_arg2 == nil or f50_arg2 ~= f50_local0.reg_password then
|
|
if show_popup and show_popup == true then
|
|
LUI.FlowManager.RequestPopupMenu( f50_arg0, "cod_anywhere_entry_error_popup", true, f50_arg1.controller, false, {
|
|
cancel_will_close = false,
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ENTRY_ERROR" ),
|
|
button_text = Engine.Localize( "@LUA_MENU_CONTINUE" ),
|
|
message_text = f50_local1
|
|
} )
|
|
end
|
|
f50_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_confirm_password_icon"
|
|
} )
|
|
return f50_local1
|
|
else
|
|
f50_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_confirm_password_icon"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function GetSubscribeSelection( f51_arg0, f51_arg1 )
|
|
local f51_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f51_arg0 )
|
|
return RegistrationDefaults.subscribe_list[f51_local0.reg_subscribe or 1]
|
|
end
|
|
|
|
function SubscribeNext( f52_arg0, f52_arg1, f52_arg2 )
|
|
local f52_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f52_arg0 )
|
|
local f52_local1 = f52_local0.reg_subscribe + 1
|
|
if f52_local1 > #RegistrationDefaults.subscribe_list then
|
|
f52_local1 = 1
|
|
end
|
|
f52_local0.reg_subscribe = f52_local1
|
|
end
|
|
|
|
function SubscribePrev( f53_arg0, f53_arg1, f53_arg2 )
|
|
local f53_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f53_arg0 )
|
|
local f53_local1 = f53_local0.reg_subscribe - 1
|
|
if f53_local1 < 1 then
|
|
f53_local1 = #RegistrationDefaults.subscribe_list
|
|
end
|
|
f53_local0.reg_subscribe = f53_local1
|
|
end
|
|
|
|
function GetMonthText( f54_arg0, f54_arg1 )
|
|
local f54_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f54_arg0 )
|
|
return Engine.Localize( RegistrationDefaults.month_list[f54_local0.reg_dob_month or 1] )
|
|
end
|
|
|
|
function MonthNext( f55_arg0, f55_arg1, f55_arg2 )
|
|
local f55_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f55_arg0 )
|
|
local f55_local1 = f55_local0.reg_dob_month + 1
|
|
if f55_local1 > #RegistrationDefaults.month_list then
|
|
f55_local1 = 1
|
|
end
|
|
f55_local0.reg_dob_month = f55_local1
|
|
VerifyDoB( f55_arg0, f55_arg1, f55_arg1.text, true )
|
|
if RegistrationDefaults.month_days[f55_local0.reg_dob_month] < f55_local0.reg_dob_day then
|
|
f55_local0.reg_dob_day = RegistrationDefaults.month_days[f55_local0.reg_dob_month]
|
|
f55_arg0:dispatchEventToRoot( {
|
|
name = "content_refresh",
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
function MonthPrev( f56_arg0, f56_arg1, f56_arg2 )
|
|
local f56_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f56_arg0 )
|
|
local f56_local1 = f56_local0.reg_dob_month - 1
|
|
if f56_local1 < 1 then
|
|
f56_local1 = #RegistrationDefaults.month_list
|
|
end
|
|
f56_local0.reg_dob_month = f56_local1
|
|
VerifyDoB( f56_arg0, f56_arg1, f56_arg1.text, true )
|
|
if RegistrationDefaults.month_days[f56_local0.reg_dob_month] < f56_local0.reg_dob_day then
|
|
f56_local0.reg_dob_day = RegistrationDefaults.month_days[f56_local0.reg_dob_month]
|
|
f56_arg0:dispatchEventToRoot( {
|
|
name = "content_refresh",
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
function GetDayNum( f57_arg0, f57_arg1 )
|
|
local f57_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f57_arg0 )
|
|
return f57_local0.reg_dob_day or 1
|
|
end
|
|
|
|
function DayNext( f58_arg0, f58_arg1, f58_arg2 )
|
|
local f58_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f58_arg0 )
|
|
local f58_local1 = f58_local0.reg_dob_day + 1
|
|
local f58_local2 = RegistrationDefaults.month_days[f58_local0.reg_dob_month]
|
|
if f58_local0.is_leap_year and f58_local0.reg_dob_month == 2 then
|
|
f58_local2 = f58_local2 + 1
|
|
end
|
|
if f58_local2 < f58_local1 then
|
|
f58_local1 = 1
|
|
end
|
|
f58_local0.reg_dob_day = f58_local1
|
|
VerifyDoB( f58_arg0, f58_arg1, f58_arg1.text, true )
|
|
end
|
|
|
|
function DayPrev( f59_arg0, f59_arg1, f59_arg2 )
|
|
local f59_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f59_arg0 )
|
|
local f59_local1 = f59_local0.reg_dob_day - 1
|
|
local f59_local2 = RegistrationDefaults.month_days[f59_local0.reg_dob_month]
|
|
if f59_local0.is_leap_year and f59_local0.reg_dob_month == 2 then
|
|
f59_local2 = f59_local2 + 1
|
|
end
|
|
if f59_local1 < 1 then
|
|
f59_local1 = f59_local2
|
|
end
|
|
f59_local0.reg_dob_day = f59_local1
|
|
VerifyDoB( f59_arg0, f59_arg1, f59_arg1.text, true )
|
|
end
|
|
|
|
function GetYearNum( f60_arg0, f60_arg1 )
|
|
local f60_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f60_arg0 )
|
|
return f60_local0.reg_dob_year or 2000
|
|
end
|
|
|
|
function YearNext( f61_arg0, f61_arg1, f61_arg2 )
|
|
local f61_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f61_arg0 )
|
|
local f61_local1 = f61_local0.reg_dob_year + 1
|
|
if f61_local1 > RegistrationDefaults.max_year then
|
|
f61_local1 = RegistrationDefaults.min_year
|
|
end
|
|
f61_local0.reg_dob_year = f61_local1
|
|
VerifyDoB( f61_arg0, f61_arg1, f61_arg1.text, true )
|
|
local f61_local2
|
|
if f61_local0.reg_dob_year % 400 ~= 0 and (f61_local0.reg_dob_year % 4 ~= 0 or f61_local0.reg_dob_year % 100 <= 0) then
|
|
f61_local2 = false
|
|
else
|
|
f61_local2 = true
|
|
end
|
|
f61_local0.is_leap_year = f61_local2
|
|
if f61_local0.is_leap_year == false and f61_local0.reg_dob_day == 29 then
|
|
f61_local0.reg_dob_day = RegistrationDefaults.month_days[f61_local0.reg_dob_month]
|
|
f61_arg0:dispatchEventToRoot( {
|
|
name = "content_refresh",
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
function YearPrev( f62_arg0, f62_arg1, f62_arg2 )
|
|
local f62_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f62_arg0 )
|
|
local f62_local1 = f62_local0.reg_dob_year - 1
|
|
if f62_local1 < RegistrationDefaults.min_year then
|
|
f62_local1 = RegistrationDefaults.max_year
|
|
end
|
|
f62_local0.reg_dob_year = f62_local1
|
|
VerifyDoB( f62_arg0, f62_arg1, f62_arg1.text, true )
|
|
local f62_local2
|
|
if f62_local0.reg_dob_year % 400 ~= 0 and (f62_local0.reg_dob_year % 4 ~= 0 or f62_local0.reg_dob_year % 100 <= 0) then
|
|
f62_local2 = false
|
|
else
|
|
f62_local2 = true
|
|
end
|
|
f62_local0.is_leap_year = f62_local2
|
|
if f62_local0.is_leap_year == false and f62_local0.reg_dob_day == 29 then
|
|
f62_local0.reg_dob_day = RegistrationDefaults.month_days[f62_local0.reg_dob_month]
|
|
f62_arg0:dispatchEventToRoot( {
|
|
name = "content_refresh",
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
function VerifyDoB( f63_arg0, f63_arg1 )
|
|
local f63_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f63_arg0 )
|
|
local f63_local1 = 13
|
|
local f63_local2 = 18
|
|
local f63_local3, f63_local4, f63_local5 = Engine.GetCurrentDayMonthYear()
|
|
local f63_local6 = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB" )
|
|
local f63_local7 = false
|
|
if f63_local0.reg_dob_year + f63_local1 < f63_local5 then
|
|
f63_local7 = true
|
|
elseif f63_local0.reg_dob_year + f63_local1 == f63_local5 then
|
|
if f63_local0.reg_dob_month < f63_local4 then
|
|
f63_local7 = true
|
|
elseif f63_local0.reg_dob_month == f63_local4 then
|
|
if f63_local0.reg_dob_day <= f63_local3 then
|
|
f63_local7 = true
|
|
else
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_day_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_year_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_month_icon"
|
|
} )
|
|
end
|
|
else
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_month_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_day_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_year_icon"
|
|
} )
|
|
end
|
|
else
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "show_problem_icon",
|
|
id = "cod_anywhere_register_year_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_month_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_day_icon"
|
|
} )
|
|
end
|
|
if f63_local0.reg_dob_year == nil or not f63_local7 then
|
|
if show_popup and show_popup == true then
|
|
LUI.FlowManager.RequestPopupMenu( f63_arg0, "cod_anywhere_entry_error_popup", true, f63_arg1.controller, false, {
|
|
cancel_will_close = false,
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ENTRY_ERROR" ),
|
|
button_text = Engine.Localize( "@LUA_MENU_CONTINUE" ),
|
|
message_text = f63_local6
|
|
} )
|
|
end
|
|
return f63_local6
|
|
else
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_year_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_month_icon"
|
|
} )
|
|
f63_arg0:dispatchEventToRoot( {
|
|
name = "hide_problem_icon",
|
|
id = "cod_anywhere_register_day_icon"
|
|
} )
|
|
end
|
|
end
|
|
|
|
function codanywhere_age_error_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "codanywhere_age_error_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "MENU_ERROR" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_CODA_AGE_ERROR" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function CheckShowConfirmButton( f65_arg0, f65_arg1 )
|
|
local f65_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f65_arg0 )
|
|
local f65_local1 = true
|
|
if f65_local0.reg_firstname == nil or #f65_local0.reg_firstname == 0 or f65_local0.reg_lastname == nil or #f65_local0.reg_lastname == 0 or f65_local0.reg_zipcode == nil or #f65_local0.reg_zipcode == 0 or f65_local0.reg_community_name == nil or #f65_local0.reg_community_name == 0 or f65_local0.reg_email == nil or #f65_local0.reg_email == 0 or f65_local0.reg_password == nil or #f65_local0.reg_password == 0 or f65_local0.reg_password_confirm == nil or #f65_local0.reg_password_confirm == 0 or f65_local0.community_name_error then
|
|
f65_local1 = false
|
|
end
|
|
if f65_local1 == true then
|
|
f65_arg0:dispatchEventToRoot( {
|
|
name = "show_confirm_button"
|
|
} )
|
|
return true
|
|
else
|
|
f65_arg0:dispatchEventToRoot( {
|
|
name = "hide_confirm_button"
|
|
} )
|
|
return false
|
|
end
|
|
end
|
|
|
|
function ContinueRegister( f66_arg0, f66_arg1 )
|
|
if (CheckShowConfirmButton( f66_arg0, f66_arg1 ) or false) == false then
|
|
return
|
|
end
|
|
local f66_local0 = false
|
|
if RegisterConfirm( f66_arg0, f66_arg1, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( f66_arg0, "cod_anywhere_email_confirm_popup", true, f66_arg1.controller, false, {
|
|
reg_menu = f66_arg0
|
|
} )
|
|
end
|
|
end
|
|
|
|
function RegisterConfirm( f67_arg0, f67_arg1, f67_arg2 )
|
|
local f67_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f67_arg0 )
|
|
local f67_local1 = {}
|
|
if f67_arg1.controller == nil then
|
|
f67_arg1.controller = f67_local0.controller
|
|
end
|
|
f67_local1[#f67_local1 + 1] = VerifyUsername( f67_arg0, f67_arg1, f67_local0.reg_community_name, false )
|
|
f67_local1[#f67_local1 + 1] = VerifyEmail( f67_arg0, f67_arg1, f67_local0.reg_email, false )
|
|
f67_local1[#f67_local1 + 1] = VerifyPassword( f67_arg0, f67_arg1, f67_local0.reg_password, false )
|
|
f67_local1[#f67_local1 + 1] = VerifyConfirmPassword( f67_arg0, f67_arg1, f67_local0.reg_password_confirm, false )
|
|
f67_local1[#f67_local1 + 1] = VerifyDoB( f67_arg0, f67_arg1, f67_local0.reg_dob_year, false )
|
|
if #f67_local1 ~= 0 then
|
|
local f67_local2 = ""
|
|
for f67_local3 = 1, #f67_local1, 1 do
|
|
f67_local2 = f67_local2 .. f67_local1[f67_local3]
|
|
if f67_local3 < #f67_local1 then
|
|
f67_local2 = f67_local2 .. ",\n"
|
|
end
|
|
end
|
|
local f67_local3 = {
|
|
cancel_will_close = false,
|
|
popup_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ENTRY_ERROR" ),
|
|
message_text = f67_local2,
|
|
button_text = Engine.Localize( "@LUA_MENU_CONTINUE" )
|
|
}
|
|
if VerifyDoB( f67_arg0, f67_arg1 ) ~= nil then
|
|
LUI.FlowManager.RequestPopupMenu( f67_arg0, "codanywhere_age_error_popup", true, f67_arg1.controller )
|
|
return
|
|
end
|
|
LUI.FlowManager.RequestPopupMenu( f67_arg0, "cod_anywhere_entry_error_popup", true, f67_arg1.controller, false, f67_local3 )
|
|
else
|
|
if f67_arg2 == true then
|
|
return true
|
|
end
|
|
local f67_local2 = f67_local0.reg_dob_month
|
|
if f67_local0.reg_dob_month < 10 then
|
|
f67_local2 = "0" .. f67_local0.reg_dob_month
|
|
end
|
|
local f67_local3 = f67_local0.reg_dob_day
|
|
if f67_local0.reg_dob_day < 10 then
|
|
f67_local3 = "0" .. f67_local0.reg_dob_day
|
|
end
|
|
CoDAnywhere.StartAccountCreation( f67_arg1.controller, f67_local0.reg_firstname, f67_local0.reg_lastname, f67_local0.reg_email, f67_local0.reg_subscribe == 1, f67_local3 .. "-" .. f67_local2 .. "-" .. f67_local0.reg_dob_year, RegistrationDefaults.country_list[f67_local0.reg_country].code, f67_local0.reg_zipcode, f67_local0.reg_password, f67_local0.reg_community_name )
|
|
end
|
|
end
|
|
|
|
function RegistrationOptionsFeeder( f68_arg0 )
|
|
local f68_local0 = nil
|
|
Engine.MenuDvarsSetup( f68_arg0.exclusiveController )
|
|
return {
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_firstname",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Input,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_FIRSTNAME" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_FIRSTNAME_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
field_edited_func = RegisterFirstNameChanged,
|
|
text_alignment = LUI.Alignment.Center,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_FIRSTNAME" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_lastname",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Input,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_LASTNAME" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_LASTNAME_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
field_edited_func = RegisterLastNameChanged,
|
|
text_alignment = LUI.Alignment.Center,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_LASTNAME" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_country",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_COUNTRY" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_COUNTRY_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
button_display_func = GetCountryText,
|
|
button_left_func = function ( f69_arg0, f69_arg1 )
|
|
return CountryPrev( f69_arg0, f69_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
button_right_func = function ( f70_arg0, f70_arg1 )
|
|
return CountryNext( f70_arg0, f70_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_zip",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Input,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ZIP" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ZIP_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
field_edited_func = RegisterZipChanged,
|
|
text_alignment = LUI.Alignment.Center,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_ZIP" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_username",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Info,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_USERNAME" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_USERNAME_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
button_display_func = RegisterUsernameDisplayChanged,
|
|
button_action_func = RegisterUsernamePopup,
|
|
text_alignment = LUI.Alignment.Center,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_USERNAME" ),
|
|
keyboard_type = CoD.KeyboardInputTypes.Email,
|
|
max_length = 20,
|
|
additional_handlers = {
|
|
text_input_complete = RegisterUsernameChanged
|
|
},
|
|
filter_profanity = true
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_username_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_email",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Info,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_EMAIL" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_EMAIL_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
button_display_func = RegisterEmailDisplayChanged,
|
|
button_action_func = RegisterEmailPopup,
|
|
text_alignment = LUI.Alignment.Center,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_EMAIL" ),
|
|
keyboard_type = CoD.KeyboardInputTypes.Email,
|
|
max_length = 53,
|
|
additional_handlers = {
|
|
text_input_complete = RegisterEmailChanged
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_email_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_password",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Input,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASSWORD" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASSWORD_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
field_edited_func = RegisterPasswordChanged,
|
|
text_alignment = LUI.Alignment.Center,
|
|
keyboard_type = CoD.KeyboardInputTypes.Password,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASSWORD" ),
|
|
password_field = true
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_password_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_password_confirm",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Input,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASS_CONFIRM" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASS_CONFIRM_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
field_edited_func = RegisterConfirmPasswordChanged,
|
|
text_alignment = LUI.Alignment.Center,
|
|
keyboard_type = CoD.KeyboardInputTypes.Password,
|
|
field_name = Engine.Localize( "@LUA_MENU_CODA_REGISTER_PASS_CONFIRM" ),
|
|
password_field = true
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_confirm_password_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_subscribe",
|
|
states = DefaultButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_SUBSCRIBE" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_SUBSCRIBE_DESC" ),
|
|
content_width = ButtonDefaults.content_width,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content,
|
|
button_display_func = GetSubscribeSelection,
|
|
button_left_func = function ( f71_arg0, f71_arg1 )
|
|
return SubscribePrev( f71_arg0, f71_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
button_right_func = function ( f72_arg0, f72_arg1 )
|
|
return SubscribeNext( f72_arg0, f72_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
id = "cod_anywhere_register_blank_spacer",
|
|
focusable = false,
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 320,
|
|
top = 0,
|
|
bottom = 28
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 453,
|
|
top = 0,
|
|
bottom = 138,
|
|
material = RegisterMaterial( "box_registration" ),
|
|
alpha = 1
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 30,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "box_registration_rtcap" ),
|
|
alpha = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "cod_anywhere_register_dob_spacer",
|
|
focusable = false,
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.primary_text_color, {
|
|
topAnchor = true,
|
|
leftAnchor = true,
|
|
bottomAnchor = false,
|
|
rightAnchor = false,
|
|
top = 4,
|
|
left = 0,
|
|
bottom = CoD.TextSettings.NormalFont.Height + 5,
|
|
right = 325,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Right,
|
|
alpha = 1
|
|
} )
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB" )
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_dob_month",
|
|
states = DefaultDoBButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB_MONTH" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB_MONTH_DESC" ),
|
|
content_width = ButtonDefaults.content_width - 40,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content - 20,
|
|
button_display_func = GetMonthText,
|
|
button_left_func = function ( f73_arg0, f73_arg1 )
|
|
return MonthPrev( f73_arg0, f73_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
button_right_func = function ( f74_arg0, f74_arg1 )
|
|
return MonthNext( f74_arg0, f74_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
text_default_color = Colors.secondary_text_color
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_month_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_dob_day",
|
|
states = DefaultDoBButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB_DAY" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB_DAY_DESC" ),
|
|
content_width = ButtonDefaults.content_width - 40,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content - 20,
|
|
button_display_func = GetDayNum,
|
|
button_left_func = function ( f75_arg0, f75_arg1 )
|
|
return DayPrev( f75_arg0, f75_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
button_right_func = function ( f76_arg0, f76_arg1 )
|
|
return DayNext( f76_arg0, f76_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
text_default_color = Colors.secondary_text_color
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_day_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_register_dob_year",
|
|
states = DefaultDoBButtonStates,
|
|
properties = {
|
|
variant = GenericButtonSettings.Variants.Select,
|
|
button_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB_YEAR" ),
|
|
desc_text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_DOB_YEAR_DESC" ),
|
|
content_width = ButtonDefaults.content_width - 40,
|
|
content_margin = ButtonDefaults.content_margin,
|
|
text_padding_with_content = ButtonDefaults.text_padding_with_content - 20,
|
|
button_display_func = GetYearNum,
|
|
button_left_func = function ( f77_arg0, f77_arg1 )
|
|
return YearPrev( f77_arg0, f77_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
button_right_func = function ( f78_arg0, f78_arg1 )
|
|
return YearNext( f78_arg0, f78_arg1, f68_arg0.exclusiveController )
|
|
end
|
|
,
|
|
text_default_color = Colors.secondary_text_color
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "cod_anywhere_register_year_icon",
|
|
states = DefaultIconState(),
|
|
handlers = DefaultIconHandlers
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function coda_menu_setup( f79_arg0, f79_arg1 )
|
|
local f79_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f79_arg0 )
|
|
f79_local0.reg_firstname = RegistrationDefaults.reg_firstname
|
|
f79_local0.reg_lastname = RegistrationDefaults.reg_lastname
|
|
f79_local0.reg_country = RegistrationDefaults.reg_country
|
|
f79_local0.reg_zipcode = RegistrationDefaults.reg_zipcode
|
|
f79_local0.reg_dob_month = RegistrationDefaults.reg_dob_month
|
|
f79_local0.reg_dob_day = RegistrationDefaults.reg_dob_day
|
|
f79_local0.reg_dob_year = RegistrationDefaults.reg_dob_year
|
|
f79_local0.reg_community_name = RegistrationDefaults.reg_community_name
|
|
f79_local0.reg_email = RegistrationDefaults.reg_email
|
|
f79_local0.reg_password = RegistrationDefaults.reg_password
|
|
f79_local0.reg_password_confirm = RegistrationDefaults.reg_password_confirm
|
|
f79_local0.reg_subscribe = RegistrationDefaults.reg_subscribe
|
|
f79_local0.controller = f79_arg1.controller
|
|
f79_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
|
end
|
|
|
|
local f0_local4 = {
|
|
reg_firstname = "",
|
|
reg_lastname = "",
|
|
reg_country = 1,
|
|
reg_zipcode = "",
|
|
reg_dob_month = 1,
|
|
reg_dob_day = 1,
|
|
reg_dob_year = 2000,
|
|
reg_community_name = "",
|
|
reg_email = "",
|
|
reg_password = "",
|
|
reg_password_confirm = "",
|
|
reg_subscribe = 1,
|
|
is_leap_year = true,
|
|
min_year = 1900,
|
|
max_year = Engine.GetCurrentYear(),
|
|
country_list = {
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_US",
|
|
code = "US"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_AU",
|
|
code = "AU"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_AT",
|
|
code = "AT"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_BE",
|
|
code = "BE"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_BR",
|
|
code = "BR"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_CA",
|
|
code = "CA"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_CZ",
|
|
code = "CZ"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_DK",
|
|
code = "DK"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_FI",
|
|
code = "FI"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_FR",
|
|
code = "FR"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_DE",
|
|
code = "DE"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_GR",
|
|
code = "GR"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_HU",
|
|
code = "HU"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_IE",
|
|
code = "IE"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_IT",
|
|
code = "IT"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_MX",
|
|
code = "MX"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_NL",
|
|
code = "NL"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_NZ",
|
|
code = "NZ"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_NO",
|
|
code = "NO"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_PL",
|
|
code = "PL"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_PT",
|
|
code = "PT"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_RU",
|
|
code = "RU"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_ES",
|
|
code = "ES"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_SE",
|
|
code = "SE"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_CH",
|
|
code = "CH"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_GB",
|
|
code = "GB"
|
|
},
|
|
{
|
|
display_string = "@LUA_MENU_CODA_COUNTRY_JP",
|
|
code = "JP"
|
|
}
|
|
},
|
|
month_list = {
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_1",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_2",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_3",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_4",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_5",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_6",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_7",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_8",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_9",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_10",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_11",
|
|
"@LUA_MENU_CODA_REGISTER_MONTH_12"
|
|
},
|
|
month_days = {
|
|
31,
|
|
28,
|
|
31,
|
|
30,
|
|
31,
|
|
30,
|
|
31,
|
|
31,
|
|
30,
|
|
31,
|
|
30,
|
|
31
|
|
}
|
|
}
|
|
local f0_local5 = {}
|
|
local f0_local6 = Engine.Localize( "LUA_MENU_YES" )
|
|
local f0_local7 = Engine.Localize( "LUA_MENU_NO" )
|
|
f0_local4.subscribe_list = f0_local6
|
|
RegistrationDefaults = f0_local4
|
|
DefaultButtonStates = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 800,
|
|
top = 0,
|
|
bottom = GenericButtonSettings.Styles.GradientButton.height
|
|
}
|
|
}
|
|
DefaultDoBButtonStates = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 780,
|
|
top = 0,
|
|
bottom = GenericButtonSettings.Styles.GradientButton.height
|
|
}
|
|
}
|
|
ButtonDefaults = {
|
|
content_width = 400,
|
|
content_margin = 56,
|
|
text_padding_with_content = 475
|
|
}
|
|
function DefaultIconState()
|
|
return {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
left = -52,
|
|
right = -20,
|
|
top = 0,
|
|
bottom = -5,
|
|
material = RegisterMaterial( "icon_new" ),
|
|
alpha = 0
|
|
},
|
|
show = {
|
|
alpha = 1
|
|
}
|
|
}
|
|
end
|
|
|
|
DefaultIconHandlers = {
|
|
show_problem_icon = function ( f81_arg0, f81_arg1, f81_arg2 )
|
|
if f81_arg1.id == f81_arg0.id then
|
|
f81_arg0:animateToState( "show", 0 )
|
|
end
|
|
end,
|
|
hide_problem_icon = function ( f82_arg0, f82_arg1, f82_arg2 )
|
|
if f82_arg1.id == f82_arg0.id then
|
|
f82_arg0:animateToState( "default", 0 )
|
|
end
|
|
end
|
|
}
|
|
function PlatformSpecificConfirmIcon( f83_arg0, f83_arg1 )
|
|
if Engine.IsConsoleGame() or Engine.IsGamepadEnabled() == 1 then
|
|
return Engine.Localize( ButtonMap.button_alt1.string ) .. " " .. Engine.Localize( "@LUA_MENU_CODA_REGISTER_CONFIRM" )
|
|
else
|
|
return Engine.Localize( ButtonMap.button_alt1.keyboard_string ) .. " " .. Engine.Localize( "@LUA_MENU_CODA_REGISTER_CONFIRM" )
|
|
end
|
|
end
|
|
|
|
function OpenCoDAnywhereErrorPopup( f84_arg0, f84_arg1 )
|
|
LUI.FlowManager.RequestPopupMenu( f84_arg0, "cod_anywhere_error_popup_menu", true, f84_arg1.controller )
|
|
end
|
|
|
|
function OpenCoDAnywhereSuccessPopup( f85_arg0, f85_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f85_arg0 )
|
|
f85_arg0:dispatchEventToRoot( {
|
|
name = "cod_anywhere_success_exit",
|
|
id = "coda_registration"
|
|
} )
|
|
LUI.FlowManager.RequestPopupMenu( f85_arg0, "cod_anywhere_success_popup_menu", true, f85_arg1.controller )
|
|
end
|
|
|
|
function LeaveCoDAnywhereMenu( f86_arg0, f86_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f86_arg0 )
|
|
end
|
|
|
|
function cod_anywhere_registration_menu()
|
|
return {
|
|
type = "UIElement",
|
|
id = "coda_registration",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
properties = {},
|
|
handlers = {
|
|
menu_create = coda_menu_setup,
|
|
open_cod_anywhere_error_popup = OpenCoDAnywhereErrorPopup,
|
|
open_cod_anywhere_success_popup = OpenCoDAnywhereSuccessPopup,
|
|
cod_anywhere_start_registration = RegisterConfirm,
|
|
cod_anywhere_success_exit = MBh.LeaveMenu(),
|
|
leave_platform_screen = LeaveCoDAnywhereMenu
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "coda_registration_background_img",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
top = 0,
|
|
right = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "bkgd_cas" )
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_title",
|
|
id = "coda_registration_title_text_id",
|
|
properties = {
|
|
menu_title = Engine.Localize( "@LUA_MENU_CODA_REGISTER_TITLE" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "coda_registration_vlist_id",
|
|
states = {
|
|
default = {
|
|
alignment = LUI.Alignment.Top,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = GenericMenuDims.menu_left,
|
|
right = GenericMenuDims.menu_right,
|
|
top = GenericMenuDims.menu_top,
|
|
bottom = GenericMenuDims.menu_bottom_tall
|
|
}
|
|
},
|
|
childrenFeeder = RegistrationOptionsFeeder
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
id = "coda_registration_desc_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
top = 115,
|
|
bottom = 634,
|
|
left = -430,
|
|
right = -75
|
|
}
|
|
},
|
|
properties = {
|
|
top_offset = 0
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIText",
|
|
id = "coda_registration_desc_text_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
left = 15,
|
|
right = -15,
|
|
top = 15,
|
|
bottom = CoD.TextSettings.NormalFont.Height + 15,
|
|
red = 1,
|
|
green = 1,
|
|
blue = 1
|
|
}
|
|
},
|
|
properties = {
|
|
text = ""
|
|
},
|
|
handlers = {
|
|
set_button_info_text = function ( f88_arg0, f88_arg1 )
|
|
if f88_arg1.text then
|
|
f88_arg0:setText( f88_arg1.text )
|
|
end
|
|
end
|
|
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "coda_registration_ratings_text_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left,
|
|
left = 15,
|
|
right = -15,
|
|
top = -170,
|
|
bottom = -170 + CoD.TextSettings.NormalFont.Height,
|
|
alpha = 0.4
|
|
}
|
|
},
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_CODA_REGISTER_RATINGS" )
|
|
}
|
|
},
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -35,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
red = 0.22,
|
|
green = 0.22,
|
|
blue = 0.22,
|
|
alpha = 0
|
|
},
|
|
show = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
show_confirm_button = function ( f89_arg0, f89_arg1 )
|
|
f89_arg0:animateToState( "show", 0 )
|
|
end
|
|
,
|
|
hide_confirm_button = function ( f90_arg0, f90_arg1 )
|
|
f90_arg0:animateToState( "default", 0 )
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIBindButton",
|
|
id = "coda_registration_confirm button",
|
|
handlers = {
|
|
button_alt1 = ContinueRegister
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "coda_registration_confirm_text_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center,
|
|
left = 5,
|
|
right = -5,
|
|
top = 3,
|
|
bottom = CoD.TextSettings.NormalFont.Height + 10,
|
|
alpha = 1
|
|
}
|
|
},
|
|
properties = {
|
|
text = PlatformSpecificConfirmIcon()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "button_helper_text_main",
|
|
id = "coda_registration_text_id"
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "coda_registration_bind_buttons_id",
|
|
handlers = {
|
|
button_secondary = function ( f91_arg0, f91_arg1 )
|
|
if Engine.HasSpeechFeature() and LUI.MenuAutoNav.IsRunning() then
|
|
LUI.FlowManager.RequestLeaveMenu( f91_arg0 )
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( f91_arg0, "cod_anywhere_quit_confirm_popup", false, f91_arg1.controller, false )
|
|
end
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_entry_error_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "cod_anywhere_entry_error_popup",
|
|
properties = {
|
|
cancel_will_close = false,
|
|
popup_title = "",
|
|
message_text = "",
|
|
button_text = ""
|
|
}
|
|
}
|
|
end
|
|
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_intro_popup", cod_anywhere_intro_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_registration_menu", cod_anywhere_registration_menu )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_entry_error_popup", cod_anywhere_entry_error_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_import_popup", cod_anywhere_import_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_email_confirm_popup", cod_anywhere_email_confirm_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_agreement_popup", cod_anywhere_agreement_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_quit_confirm_popup", cod_anywhere_quit_confirm_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_sign_in_popup", cod_anywhere_sign_in_popup )
|
|
LUI.MenuBuilder.registerDef( "codanywhere_age_error_popup", codanywhere_age_error_popup )
|
|
LockTable( _M )
|