init
This commit is contained in:
1314
lui/common_menus/caccustomizeutils.dec.lua
Normal file
1314
lui/common_menus/caccustomizeutils.dec.lua
Normal file
File diff suppressed because it is too large
Load Diff
426
lui/common_menus/cacutils.dec.lua
Normal file
426
lui/common_menus/cacutils.dec.lua
Normal file
@ -0,0 +1,426 @@
|
||||
Cac = {
|
||||
Settings = {
|
||||
DataLoc = {
|
||||
squadMembers = {
|
||||
maxClassSlots = 10
|
||||
},
|
||||
privateMatchSquadMembers = {
|
||||
maxClassSlots = 6
|
||||
},
|
||||
coopSquadMembers = {
|
||||
maxClassSlots = 1
|
||||
},
|
||||
loadouts = {
|
||||
maxClassSlots = 10,
|
||||
baseClassSlots = 6
|
||||
},
|
||||
defaultClassesTeam0 = {
|
||||
maxClassSlots = 6,
|
||||
teamName = "allies"
|
||||
},
|
||||
defaultClassesTeam1 = {
|
||||
maxClassSlots = 6,
|
||||
baseClassSlots = 6,
|
||||
teamName = "axis",
|
||||
infectedString = Engine.Localize( "LUA_MENU_INFECT_CAPS" ),
|
||||
string = Engine.Localize( "@LUA_MENU_AXIS_CAPS" )
|
||||
},
|
||||
defaultClassesTeam2 = {
|
||||
maxClassSlots = 6,
|
||||
baseClassSlots = 6,
|
||||
teamName = "allies",
|
||||
infectedString = Engine.Localize( "LUA_MENU_MP_SURVIVORS_CAPS" ),
|
||||
string = Engine.Localize( "@LUA_MENU_ALLIES_CAPS" )
|
||||
},
|
||||
defaultClassesTeam3 = {
|
||||
teamName = "spectator"
|
||||
}
|
||||
},
|
||||
minUsableSlots = 5
|
||||
},
|
||||
MemberCost = {
|
||||
0,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
200,
|
||||
300,
|
||||
400,
|
||||
500
|
||||
}
|
||||
}
|
||||
if MatchRules then
|
||||
MatchRules.AllowCustomClasses = function ( f1_arg0 )
|
||||
if not MatchRules.IsUsingMatchRulesData() then
|
||||
return false
|
||||
else
|
||||
local f1_local0
|
||||
if f1_arg0 then
|
||||
f1_local0 = Cac.IsDefaultClass( f1_arg0 )
|
||||
if not f1_local0 then
|
||||
|
||||
elseif not f1_local0 then
|
||||
return MatchRules.GetData( "commonOption", "allowCustomClasses" )
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
f1_local0 = false
|
||||
end
|
||||
|
||||
end
|
||||
Cac.GetCacConfig = function ( f2_arg0, f2_arg1, f2_arg2, ... )
|
||||
local f2_local0 = {
|
||||
...
|
||||
}
|
||||
for f2_local1 = 1, #f2_local0, 1 do
|
||||
if type( f2_local0[f2_local1] ) == "string" and Cac.IsDefaultClass( f2_local0[f2_local1] ) then
|
||||
local f2_local4 = Cac.Settings.DataLoc[f2_local0[f2_local1]].teamName
|
||||
local f2_local5 = f2_local0[f2_local1 + 1]
|
||||
table.remove( f2_local0, 1 )
|
||||
table.remove( f2_local0, 1 )
|
||||
return MatchRules.GetData( "defaultClasses", f2_local4, f2_local5, "class", unpack( f2_local0 ) )
|
||||
end
|
||||
end
|
||||
local f2_local1 = CoD.GetStatsGroupForSquadLocation( f2_arg1 )
|
||||
if f2_local0[1] == "loadouts" and type( f2_local0[2] ) == "number" then
|
||||
local f2_local2 = f2_local0[1]
|
||||
local f2_local3 = f2_local0[2]
|
||||
if Cac.Settings.DataLoc[f2_local2].baseClassSlots <= f2_local3 then
|
||||
table.remove( f2_local0, 1 )
|
||||
table.remove( f2_local0, 1 )
|
||||
return Engine.GetPlayerDataExtendedEx( f2_arg0, f2_local1, f2_arg1, f2_arg2, f2_local2, f2_local3 - Cac.Settings.DataLoc[f2_local2].baseClassSlots, unpack( f2_local0 ) )
|
||||
end
|
||||
end
|
||||
return Engine.GetPlayerDataEx( f2_arg0, f2_local1, f2_arg1, f2_arg2, ... )
|
||||
end
|
||||
|
||||
Cac.SetCacConfig = function ( f3_arg0, f3_arg1, f3_arg2, ... )
|
||||
local f3_local0 = {
|
||||
...
|
||||
}
|
||||
for f3_local1 = 1, #f3_local0, 1 do
|
||||
if type( f3_local0[f3_local1] ) == "string" and Cac.IsDefaultClass( f3_local0[f3_local1] ) then
|
||||
local f3_local4 = Cac.Settings.DataLoc[f3_local0[f3_local1]].teamName
|
||||
local f3_local5 = f3_local0[f3_local1 + 1]
|
||||
table.remove( f3_local0, 1 )
|
||||
table.remove( f3_local0, 1 )
|
||||
return MatchRules.SetData( "defaultClasses", f3_local4, f3_local5, "class", unpack( f3_local0 ) )
|
||||
end
|
||||
end
|
||||
local f3_local1 = CoD.GetStatsGroupForSquadLocation( f3_arg1 )
|
||||
if f3_local0[1] == "loadouts" and type( f3_local0[2] ) == "number" then
|
||||
local f3_local2 = f3_local0[1]
|
||||
local f3_local3 = f3_local0[2]
|
||||
if Cac.Settings.DataLoc[f3_local2].baseClassSlots <= f3_local3 then
|
||||
table.remove( f3_local0, 1 )
|
||||
table.remove( f3_local0, 1 )
|
||||
return Engine.SetPlayerDataExtendedEx( f3_arg0, f3_local1, f3_arg1, f3_arg2, f3_local2, f3_local3 - Cac.Settings.DataLoc[f3_local2].baseClassSlots, unpack( f3_local0 ) )
|
||||
end
|
||||
end
|
||||
return Engine.SetPlayerDataEx( f3_arg0, f3_local1, f3_arg1, f3_arg2, ... )
|
||||
end
|
||||
|
||||
Cac.GetNumCustomSlots = function ( f4_arg0, f4_arg1 )
|
||||
if not f4_arg1 then
|
||||
f4_arg1 = Cac.GetCustomClassLoc()
|
||||
end
|
||||
if Cac.IsDefaultClass( f4_arg1 ) or IsOnlineMatch() and (Engine.HasExtendedLoadouts( f4_arg0 ) or not IsPrivateMatch()) and Engine.GetDvarInt( "extendedLoadoutsEnable" ) == 1 then
|
||||
return Cac.Settings.DataLoc[f4_arg1].maxClassSlots
|
||||
else
|
||||
return Cac.Settings.DataLoc[f4_arg1].baseClassSlots
|
||||
end
|
||||
end
|
||||
|
||||
Cac.IsClassInUse = function ( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4 )
|
||||
local f5_local0 = nil
|
||||
local f5_local1 = Cac.IsDefaultClass( f5_arg3 )
|
||||
if f5_arg1 == "privateMatchSquadMembers" and not f5_local1 and f5_arg4 < Cac.Settings.DataLoc[f5_arg3].baseClassSlots then
|
||||
f5_local0 = true
|
||||
else
|
||||
f5_local0 = Cac.GetCacConfig( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, "inUse" )
|
||||
if not f5_local1 and Engine.InFrontend() and f5_arg4 <= 2 and not f5_local0 then
|
||||
Cac.SetClassInUse( f5_arg0, f5_arg1, f5_arg2, f5_arg3, f5_arg4, true )
|
||||
end
|
||||
end
|
||||
return f5_local0
|
||||
end
|
||||
|
||||
Cac.SetClassInUse = function ( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_arg4, f6_arg5 )
|
||||
if f6_arg5 == nil then
|
||||
f6_arg5 = true
|
||||
end
|
||||
return Cac.SetCacConfig( f6_arg0, f6_arg1, f6_arg2, f6_arg3, f6_arg4, "inUse", f6_arg5 )
|
||||
end
|
||||
|
||||
Cac.IsSquadMemberInUse = function ( f7_arg0, f7_arg1, f7_arg2 )
|
||||
local f7_local0 = nil
|
||||
if f7_arg1 == "privateMatchSquadMembers" then
|
||||
f7_local0 = true
|
||||
else
|
||||
f7_local0 = Cac.GetCacConfig( f7_arg0, f7_arg1, f7_arg2, "inUse" )
|
||||
end
|
||||
return f7_local0
|
||||
end
|
||||
|
||||
Cac.SetSquadMemberInUse = function ( f8_arg0, f8_arg1, f8_arg2 )
|
||||
return Cac.SetCacConfig( f8_arg0, f8_arg1, f8_arg2, "inUse", true )
|
||||
end
|
||||
|
||||
Cac.HasCustomClasses = function ( f9_arg0, f9_arg1, f9_arg2, f9_arg3 )
|
||||
local f9_local0 = false
|
||||
for f9_local1 = 0, Cac.GetNumCustomSlots( f9_arg0, f9_arg3 ) - 1, 1 do
|
||||
if Cac.IsClassInUse( f9_arg0, f9_arg1, f9_arg2, f9_arg3, f9_local1 ) then
|
||||
f9_local0 = true
|
||||
break
|
||||
end
|
||||
end
|
||||
return f9_local0
|
||||
end
|
||||
|
||||
Cac.GetFirstCustomClass = function ( f10_arg0, f10_arg1, f10_arg2, f10_arg3 )
|
||||
for f10_local0 = 0, Cac.GetNumCustomSlots( f10_arg0, f10_arg3 ) - 1, 1 do
|
||||
if Cac.IsClassInUse( f10_arg0, f10_arg1, f10_arg2, f10_arg3, f10_local0 ) then
|
||||
return f10_local0
|
||||
end
|
||||
end
|
||||
assert( Cac.HasCustomClasses( f10_arg0, f10_arg1, f10_arg2, f10_arg3 ) )
|
||||
return 0
|
||||
end
|
||||
|
||||
Cac.IsCaCSlotRestricted = function ( f11_arg0, f11_arg1, f11_arg2, f11_arg3, f11_arg4 )
|
||||
local f11_local0 = false
|
||||
if MatchRules.AllowCustomClasses( f11_arg3 ) then
|
||||
if not f11_arg3 then
|
||||
f11_arg3 = Cac.GetCustomClassLoc()
|
||||
end
|
||||
if not Engine.InFrontend() and f11_arg3 == "loadouts" then
|
||||
local f11_local1 = CoD.GetStatsGroupForGameMode()
|
||||
if MatchRules.CustomClassIsRestricted( f11_arg0, CoD.GetStatsGroupForGameMode(), f11_arg1, f11_arg2, f11_arg3, f11_arg4 ) then
|
||||
f11_local0 = true
|
||||
end
|
||||
end
|
||||
end
|
||||
return f11_local0
|
||||
end
|
||||
|
||||
Cac.IsCaCSlotLocked = function ( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
|
||||
if not Cac.IsDefaultClass( f12_arg3 ) then
|
||||
return not Cac.IsClassInUse( f12_arg0, f12_arg1, f12_arg2, f12_arg3, f12_arg4 )
|
||||
else
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Cac.GetSquadLoc = function ()
|
||||
local f13_local0
|
||||
if not Engine.GetDvarBool( "onlinegame" ) or Engine.GetDvarBool( "xblive_privatematch" ) then
|
||||
f13_local0 = Engine.GetDvarBool( "force_ranking" )
|
||||
else
|
||||
f13_local0 = true
|
||||
end
|
||||
if Engine.IsAliensMode() then
|
||||
return "coopSquadMembers"
|
||||
elseif f13_local0 then
|
||||
return "squadMembers"
|
||||
else
|
||||
return "privateMatchSquadMembers"
|
||||
end
|
||||
end
|
||||
|
||||
Cac.GetEditSquadMember = function ()
|
||||
return Engine.GetDvarInt( "ui_editSquadMemberIndex" ) or 0
|
||||
end
|
||||
|
||||
Cac.SetEditSquadMember = function ( f15_arg0 )
|
||||
Engine.SetDvarInt( "ui_editSquadMemberIndex", f15_arg0 )
|
||||
end
|
||||
|
||||
Cac.GetActiveSquadMember = function ( f16_arg0, f16_arg1 )
|
||||
local f16_local0 = f16_arg1 or CoD.GetStatsGroupForGameMode()
|
||||
if f16_local0 ~= CoD.StatsGroup.Ranked or not "activeSquadMember" then
|
||||
local f16_local1 = "privateMatchActiveSquadMember"
|
||||
end
|
||||
if Engine.IsAliensMode() then
|
||||
local f16_local1 = "coopActiveSquadMember"
|
||||
end
|
||||
return Engine.GetPlayerDataEx( f16_arg0, f16_local0, f16_local1 )
|
||||
end
|
||||
|
||||
Cac.SetActiveSquadMember = function ( f17_arg0, f17_arg1 )
|
||||
local f17_local0 = CoD.GetStatsGroupForGameMode()
|
||||
local f17_local1
|
||||
if f17_local0 == CoD.StatsGroup.Ranked then
|
||||
f17_local1 = "activeSquadMember"
|
||||
if not f17_local1 then
|
||||
|
||||
else
|
||||
Engine.SetPlayerDataEx( f17_arg0, f17_local0, f17_local1, f17_arg1 )
|
||||
if f17_local0 == CoD.StatsGroup.Ranked then
|
||||
syncXP( f17_arg0, f17_arg1 )
|
||||
end
|
||||
Cac.SyncPrivateDataFromPlayercard( f17_arg0 )
|
||||
end
|
||||
end
|
||||
f17_local1 = "privateMatchActiveSquadMember"
|
||||
end
|
||||
|
||||
Cac.SyncPrivateDataFromPlayercard = function ( f18_arg0 )
|
||||
local f18_local0 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "activeSquadMember" )
|
||||
local f18_local1 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "squadMembers", f18_local0, "patch" )
|
||||
local f18_local2 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "squadMembers", f18_local0, "patchbacking" )
|
||||
local f18_local3 = Engine.GetPlayerDataEx( f18_arg0, CoD.StatsGroup.Ranked, "squadMembers", f18_local0, "background" )
|
||||
for f18_local4 = 0, Cac.Settings.DataLoc.privateMatchSquadMembers.maxClassSlots - 1, 1 do
|
||||
Engine.SetPlayerDataEx( f18_arg0, CoD.StatsGroup.Private, "privateMatchSquadMembers", f18_local4, "patch", f18_local1 )
|
||||
Engine.SetPlayerDataEx( f18_arg0, CoD.StatsGroup.Private, "privateMatchSquadMembers", f18_local4, "patchbacking", f18_local2 )
|
||||
Engine.SetPlayerDataEx( f18_arg0, CoD.StatsGroup.Private, "privateMatchSquadMembers", f18_local4, "background", f18_local3 )
|
||||
end
|
||||
end
|
||||
|
||||
Cac.GetCustomClassLoc = function ( f19_arg0 )
|
||||
local f19_local0 = "loadouts"
|
||||
if f19_arg0 ~= nil then
|
||||
f19_local0 = f19_arg0
|
||||
elseif not MatchRules.AllowCustomClasses( f19_arg0 ) then
|
||||
if not Engine.InFrontend() then
|
||||
f19_local0 = "defaultClassesTeam1"
|
||||
else
|
||||
f19_local0 = "defaultClassesTeam1"
|
||||
end
|
||||
end
|
||||
return f19_local0
|
||||
end
|
||||
|
||||
Cac.GetLoadoutName = function ( f20_arg0, f20_arg1, f20_arg2, f20_arg3, f20_arg4 )
|
||||
local f20_local0 = Cac.GetCacConfig( f20_arg0, f20_arg1, f20_arg2, f20_arg3, f20_arg4, "name" )
|
||||
if f20_local0 == "" then
|
||||
f20_local0 = Engine.Localize( "@MP_LOADOUT_DEFAULT_NAME", f20_arg4 + 1 )
|
||||
end
|
||||
return f20_local0
|
||||
end
|
||||
|
||||
Cac.MaxSquadMemberCount = function ( f21_arg0 )
|
||||
return Cac.Settings.DataLoc[f21_arg0].maxClassSlots
|
||||
end
|
||||
|
||||
Cac.ActiveSquadMemberCount = function ( f22_arg0, f22_arg1 )
|
||||
local f22_local0 = 0
|
||||
for f22_local1 = 0, Cac.MaxSquadMemberCount( f22_arg1 ) - 1, 1 do
|
||||
if Cac.IsSquadMemberInUse( f22_arg0, f22_arg1, f22_local1 ) then
|
||||
f22_local0 = f22_local0 + 1
|
||||
end
|
||||
end
|
||||
return f22_local0
|
||||
end
|
||||
|
||||
Cac.AddNewSquadMember = function ( f23_arg0, f23_arg1 )
|
||||
local f23_local0 = Cac.ActiveSquadMemberCount( f23_arg0, f23_arg1 )
|
||||
if f23_local0 + 1 <= Cac.MaxSquadMemberCount( f23_arg1 ) then
|
||||
Cac.SetSquadMemberInUse( f23_arg0, f23_arg1, f23_local0 )
|
||||
return f23_local0
|
||||
else
|
||||
DebugPrint( "WARNING: Attempting to add squad member when we are already at max. Ignoring..." )
|
||||
end
|
||||
end
|
||||
|
||||
Cac.UnlockSquadMember = function ( f24_arg0, f24_arg1, f24_arg2 )
|
||||
if f24_arg2 < Cac.MaxSquadMemberCount( f24_arg1 ) then
|
||||
Cac.SetSquadMemberInUse( f24_arg0, f24_arg1, f24_arg2 )
|
||||
else
|
||||
DebugPrint( "WARNING: Attempting to unlock squad member past the max index. Ignoring..." )
|
||||
end
|
||||
local f24_local0 = Cac.ActiveSquadMemberCount( f24_arg0, f24_arg1 )
|
||||
for f24_local1 = 1, f24_local0, 1 do
|
||||
Engine.SetPlayerDataEx( f24_arg0, CoD.GetStatsGroupForGameMode(), "challengeState", "ch_squad_member" .. f24_local1 .. "_purchase", 2 )
|
||||
end
|
||||
end
|
||||
|
||||
Cac.GetSquadMemberName = function ( f25_arg0, f25_arg1, f25_arg2 )
|
||||
return Engine.GetPlayerDataEx( f25_arg0, CoD.GetStatsGroupForGameMode(), f25_arg1, f25_arg2, "name" )
|
||||
end
|
||||
|
||||
Cac.SetSquadMemberName = function ( f26_arg0, f26_arg1, f26_arg2, f26_arg3 )
|
||||
return Engine.SetPlayerDataEx( f26_arg0, CoD.GetStatsGroupForGameMode(), f26_arg1, f26_arg2, "name", f26_arg3 )
|
||||
end
|
||||
|
||||
Cac.HasSquadMemberPrestiged = function ( f27_arg0, f27_arg1, f27_arg2 )
|
||||
return Engine.GetPlayerDataEx( f27_arg0, CoD.GetStatsGroupForGameMode(), f27_arg1, f27_arg2, "squadMemXP" ) >= Rank.GetRankMaxXP( Rank.GetMaxRank() )
|
||||
end
|
||||
|
||||
Cac.GetSquadMemberPrestigeLevel = function ( f28_arg0, f28_arg1, f28_arg2 )
|
||||
if not Cac.HasSquadMemberPrestiged( f28_arg0, f28_arg1, f28_arg2 ) then
|
||||
return 0
|
||||
end
|
||||
local f28_local0 = 1
|
||||
local f28_local1 = Engine.GetPlayerDataEx( f28_arg0, CoD.GetStatsGroupForGameMode(), "characterXP", f28_arg2 )
|
||||
for f28_local2 = 0, Cac.MaxSquadMemberCount( f28_arg1 ) - 1, 1 do
|
||||
if f28_local2 ~= f28_arg2 and Cac.IsSquadMemberInUse( f28_arg0, f28_arg1, f28_local2 ) and Cac.HasSquadMemberPrestiged( f28_arg0, f28_arg1, f28_local2 ) and Engine.GetPlayerDataEx( f28_arg0, CoD.GetStatsGroupForGameMode(), "characterXP", f28_local2 ) < f28_local1 then
|
||||
f28_local0 = f28_local0 + 1
|
||||
end
|
||||
end
|
||||
return f28_local0
|
||||
end
|
||||
|
||||
Cac.GetPrestigeLevel = function ( f29_arg0, f29_arg1 )
|
||||
local f29_local0 = 0
|
||||
for f29_local1 = 0, Cac.MaxSquadMemberCount( f29_arg1 ) - 1, 1 do
|
||||
if Cac.IsSquadMemberInUse( f29_arg0, f29_arg1, f29_local1 ) and Cac.HasSquadMemberPrestiged( f29_arg0, f29_arg1, f29_local1 ) then
|
||||
f29_local0 = f29_local0 + 1
|
||||
end
|
||||
end
|
||||
return f29_local0
|
||||
end
|
||||
|
||||
Cac.SyncPrestigeLevel = function ( f30_arg0 )
|
||||
Engine.SetPlayerDataEx( f30_arg0, CoD.GetStatsGroupForGameMode(), "prestige", Cac.GetPrestigeLevel( f30_arg0, Cac.GetSquadLoc() ) )
|
||||
end
|
||||
|
||||
Cac.GetSquadMemberLoadoutUnlockCost = function ( f31_arg0 )
|
||||
if Cac.Settings.DataLoc.loadouts.baseClassSlots <= f31_arg0 then
|
||||
return 0
|
||||
else
|
||||
return 20 + (f31_arg0 - 3) * 5
|
||||
end
|
||||
end
|
||||
|
||||
Cac.ValidateAllPlayersPrivateSquadMembers = function ()
|
||||
for f32_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
||||
if Engine.HasActiveLocalClient( f32_local0 ) and Engine.HasPlayerData( f32_local0 ) then
|
||||
if not Lobby.IsItemOfTypeUnlocked( f32_local0, "wolf", "DLC" ) then
|
||||
DebugPrint( "You are not Entitled to the Wolf. So removing." )
|
||||
Engine.SetPlayerDataReservedInt( f32_local0, CoD.StatsGroup.Common, "mp_dog_type", 0 )
|
||||
end
|
||||
for f32_local3 = 0, Cac.MaxSquadMemberCount( "privateMatchSquadMembers" ) - 1, 1 do
|
||||
Cac.ValidateCustomizationItems( f32_local0, "privateMatchSquadMembers", f32_local3 )
|
||||
if not Engine.IsAliensMode() then
|
||||
Cac.ValidateLoadoutItems( f32_local0, "privateMatchSquadMembers", f32_local3, "loadouts" )
|
||||
end
|
||||
end
|
||||
if not Engine.IsAliensMode() then
|
||||
Cac.ValidateCustomizationItems( f32_local0, "squadMembers", Cac.GetActiveSquadMember( f32_local0, CoD.StatsGroup.Ranked ) )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Cac.ValidateAllPlayersPublicSquadMembers = function ()
|
||||
local f33_local0 = Cac.GetSquadLoc()
|
||||
assert( f33_local0 ~= "privateMatchSquadMembers", "Cac.GetSquadLoc() returned private match location in public lobby." )
|
||||
for f33_local1 = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
||||
if Engine.HasActiveLocalClient( f33_local1 ) then
|
||||
if not Lobby.IsItemOfTypeUnlocked( f33_local1, "wolf", "DLC" ) then
|
||||
DebugPrint( "You are not Entitled to the Wolf. So removing." )
|
||||
Engine.SetPlayerDataReservedInt( f33_local1, CoD.StatsGroup.Common, "mp_dog_type", 0 )
|
||||
end
|
||||
local f33_local4 = Cac.GetActiveSquadMember( f33_local1 )
|
||||
Cac.ValidateCustomizationItems( f33_local1, f33_local0, f33_local4 )
|
||||
if not Engine.IsAliensMode() then
|
||||
Cac.ValidateLoadoutItems( f33_local1, "squadMembers", f33_local4, "loadouts" )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
2095
lui/common_menus/commonpopups.dec.lua
Normal file
2095
lui/common_menus/commonpopups.dec.lua
Normal file
File diff suppressed because it is too large
Load Diff
2760
lui/common_menus/friendslist.dec.lua
Normal file
2760
lui/common_menus/friendslist.dec.lua
Normal file
File diff suppressed because it is too large
Load Diff
16
lui/common_menus/friendslistutils.dec.lua
Normal file
16
lui/common_menus/friendslistutils.dec.lua
Normal file
@ -0,0 +1,16 @@
|
||||
if Friends then
|
||||
Friends.Constants = {
|
||||
scrollbarWidth = 14,
|
||||
FriendButtonHeight = 90,
|
||||
reportOffensiveLobbyPlayer = 4,
|
||||
reportExploitingLobbyPlayer = 5,
|
||||
reportCheatingLobbyPlayer = 6,
|
||||
reportBoostingLobbyPlayer = 7
|
||||
}
|
||||
Friends.FacebookAllowedFlags = {
|
||||
Active = 1,
|
||||
FriendsActive = 2,
|
||||
UploadPhotoActive = 4,
|
||||
UploadVideoActive = 8
|
||||
}
|
||||
end
|
150
lui/common_menus/friendswidget.dec.lua
Normal file
150
lui/common_menus/friendswidget.dec.lua
Normal file
@ -0,0 +1,150 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
function CanSomeoneAccessFriendslist()
|
||||
for f1_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
||||
if Engine.HasActiveLocalClient( f1_local0 ) and Engine.UserCanAccessFriendsList( f1_local0 ) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function online_friends_widget( f2_arg0, f2_arg1 )
|
||||
if not f2_arg1 then
|
||||
f2_arg1 = {}
|
||||
end
|
||||
local self = LUI.UIElement.new( {
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
bottom = -35,
|
||||
right = -100,
|
||||
width = 50,
|
||||
height = 36,
|
||||
alpha = 1
|
||||
} )
|
||||
self:registerAnimationState( "disabled", {
|
||||
alpha = 0
|
||||
} )
|
||||
self.id = "online_friends_widget"
|
||||
self:registerEventHandler( "show_widget", function ( element, event )
|
||||
local f3_local0 = element:getParent()
|
||||
if f3_local0 then
|
||||
local f3_local1 = LUI.ButtonHelperText.CommonEvents.addFriendsButton
|
||||
f3_local1.ignorePopups = f2_arg1.ignorePopups
|
||||
f3_local0:processEvent( f3_local1 )
|
||||
element:animateToState( "default", 100 )
|
||||
if Engine.IsXB3() or not Engine.IsConsoleGame() then
|
||||
Engine.ExecNow( "friends_widget_refresh" )
|
||||
end
|
||||
end
|
||||
end )
|
||||
self:registerEventHandler( "hide_widget", function ( element, event )
|
||||
local f4_local0 = element:getParent()
|
||||
if f4_local0 then
|
||||
local f4_local1 = LUI.ButtonHelperText.CommonEvents.removeFriendsButton
|
||||
f4_local1.dispatchChildren = true
|
||||
f4_local0:processEvent( f4_local1 )
|
||||
element:animateToState( "disabled", 0 )
|
||||
end
|
||||
end )
|
||||
self:registerEventHandler( "live_connection", function ( element, event )
|
||||
if event.signed_in == nil then
|
||||
local f5_local0 = Engine.IsNetworkConnected()
|
||||
if f5_local0 then
|
||||
f5_local0 = Engine.IsUserSignedInToLive()
|
||||
end
|
||||
event.signed_in = f5_local0
|
||||
end
|
||||
if event.signed_in and CanSomeoneAccessFriendslist() then
|
||||
element:processEvent( {
|
||||
name = "show_widget"
|
||||
} )
|
||||
else
|
||||
element:processEvent( {
|
||||
name = "hide_widget"
|
||||
} )
|
||||
end
|
||||
end )
|
||||
self:registerEventHandler( "network_connection", function ( element, event )
|
||||
if not event.plugged_in then
|
||||
element:processEvent( {
|
||||
name = "hide_widget"
|
||||
} )
|
||||
elseif Engine.IsUserSignedInToLive() then
|
||||
element:processEvent( {
|
||||
name = "show_widget"
|
||||
} )
|
||||
end
|
||||
end )
|
||||
self:registerEventHandler( "menu_create", function ( element, event )
|
||||
element:processEvent( {
|
||||
name = "live_connection"
|
||||
} )
|
||||
end )
|
||||
local f2_local1 = LUI.UIBindButton.new()
|
||||
f2_local1.id = "friends_bind_buttons_id"
|
||||
f2_local1:registerEventHandler( "button_alt2", function ( element, event )
|
||||
if Engine.IsNetworkConnected() and Engine.IsUserSignedInToLive( event.controller ) then
|
||||
local f8_local0 = Engine.UserCanAccessFriendsList( event.controller )
|
||||
local f8_local1 = Engine.IsUserAGuest( event.controller )
|
||||
if f8_local0 and not f8_local1 then
|
||||
if Engine.InFrontend() then
|
||||
LUI.FlowManager.RequestPopupMenu( element, "popup_friends", true, event.controller, false, {} )
|
||||
else
|
||||
LUI.FlowManager.RequestAddMenu( element, "popup_friends", true, event.controller, false, {} )
|
||||
end
|
||||
elseif f8_local1 then
|
||||
LUI.FlowManager.RequestPopupMenu( element, "mp_no_guest_popup", false, event.controller, false )
|
||||
elseif Engine.IsPS3() and event.controller ~= 0 then
|
||||
LUI.FlowManager.RequestPopupMenu( element, "mp_wrong_controller_popup", false, event.controller, false )
|
||||
end
|
||||
end
|
||||
return true
|
||||
end )
|
||||
self:addElement( f2_local1 )
|
||||
local f2_local2 = LUI.UIImage.new
|
||||
local f2_local3 = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = -5,
|
||||
bottom = 5,
|
||||
left = 0,
|
||||
right = 10,
|
||||
material = RegisterMaterial( "widg_triangle" )
|
||||
}
|
||||
if not Engine.InFrontend() then
|
||||
local f2_local4 = Engine.GetDvarBool( "dedicated_dhclient" )
|
||||
local f2_local5 = 0.7
|
||||
end
|
||||
f2_local3.alpha = f2_local4 and f2_local5 or 0.25
|
||||
f2_local3.zRot = -135
|
||||
f2_local2 = f2_local2( f2_local3 )
|
||||
f2_local2.id = "friends_triangle_id"
|
||||
self:addElement( f2_local2 )
|
||||
if Friends then
|
||||
f2_local3 = LUI.UIText.new( CoD.ColorizeState( Colors.frontend_hilite, {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
left = 0,
|
||||
right = 0,
|
||||
height = CoD.TextSettings.BigFont.Height,
|
||||
font = CoD.TextSettings.BigFont.Font,
|
||||
alignment = LUI.Alignment.Right
|
||||
} ) )
|
||||
f2_local3.id = "friends_number_text"
|
||||
f2_local3:setupUIBindText( "CountOnlineFriends" )
|
||||
self:addElement( f2_local3 )
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerType( "online_friends_widget", online_friends_widget )
|
||||
LockTable( _M )
|
423
lui/common_menus/gamemanual.dec.lua
Normal file
423
lui/common_menus/gamemanual.dec.lua
Normal file
@ -0,0 +1,423 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
f0_local0 = function ()
|
||||
local f1_local0 = nil
|
||||
local f1_local1 = Languages[Engine.GetCurrentLanguage and Engine.GetCurrentLanguage() or 0]
|
||||
assert( f1_local1 )
|
||||
local f1_local2 = "bkgd_manual_"
|
||||
if Engine.IsSpecialRegion() then
|
||||
if f1_local1 == "LANGUAGE_FRENCH" then
|
||||
f1_local2 = "bkgd_manual_alt_language_"
|
||||
f1_local1 = "LANGUAGE_FRENCHCA"
|
||||
elseif f1_local1 == "LANGUAGE_ENGLISH" then
|
||||
f1_local2 = "bkgd_manual_alt_language_"
|
||||
f1_local1 = "LANGUAGE_ENGLISHUK"
|
||||
end
|
||||
end
|
||||
local f1_local3 = {
|
||||
X360 = {
|
||||
LANGUAGE_BRITISH = 4,
|
||||
LANGUAGE_ENGLISH = 5,
|
||||
LANGUAGE_FRENCH = 5,
|
||||
LANGUAGE_GERMAN = 5,
|
||||
LANGUAGE_ITALIAN = 5,
|
||||
LANGUAGE_SPANISH = 5,
|
||||
LANGUAGE_RUSSIAN = 5,
|
||||
LANGUAGE_POLISH = 5,
|
||||
LANGUAGE_KOREAN = 5,
|
||||
LANGUAGE_TAIWANESE = 5,
|
||||
LANGUAGE_JAPANESE = 4,
|
||||
LANGUAGE_CHINESE = 5,
|
||||
LANGUAGE_THAI = 5,
|
||||
LANGUAGE_CZECH = 5,
|
||||
LANGUAGE_SPANISHNA = 5,
|
||||
LANGUAGE_PORTUGUESE = 5,
|
||||
LANGUAGE_FRENCHCA = 1,
|
||||
LANGUAGE_ENGLISHUK = 5
|
||||
},
|
||||
XB3 = {
|
||||
LANGUAGE_BRITISH = 5,
|
||||
LANGUAGE_ENGLISH = 4,
|
||||
LANGUAGE_FRENCH = 4,
|
||||
LANGUAGE_GERMAN = 4,
|
||||
LANGUAGE_ITALIAN = 4,
|
||||
LANGUAGE_SPANISH = 4,
|
||||
LANGUAGE_RUSSIAN = 4,
|
||||
LANGUAGE_POLISH = 4,
|
||||
LANGUAGE_KOREAN = 4,
|
||||
LANGUAGE_TAIWANESE = 4,
|
||||
LANGUAGE_JAPANESE = 5,
|
||||
LANGUAGE_CHINESE = 4,
|
||||
LANGUAGE_THAI = 4,
|
||||
LANGUAGE_CZECH = 4,
|
||||
LANGUAGE_SPANISHNA = 4,
|
||||
LANGUAGE_PORTUGUESE = 4,
|
||||
LANGUAGE_FRENCHCA = 4,
|
||||
LANGUAGE_ENGLISHUK = 4
|
||||
},
|
||||
PS3 = {
|
||||
LANGUAGE_BRITISH = 4,
|
||||
LANGUAGE_ENGLISH = 6,
|
||||
LANGUAGE_FRENCH = 7,
|
||||
LANGUAGE_GERMAN = 7,
|
||||
LANGUAGE_ITALIAN = 7,
|
||||
LANGUAGE_SPANISH = 7,
|
||||
LANGUAGE_RUSSIAN = 7,
|
||||
LANGUAGE_POLISH = 7,
|
||||
LANGUAGE_KOREAN = 6,
|
||||
LANGUAGE_TAIWANESE = 6,
|
||||
LANGUAGE_JAPANESE = 4,
|
||||
LANGUAGE_CHINESE = 6,
|
||||
LANGUAGE_THAI = 6,
|
||||
LANGUAGE_CZECH = 6,
|
||||
LANGUAGE_SPANISHNA = 6,
|
||||
LANGUAGE_PORTUGUESE = 6,
|
||||
LANGUAGE_FRENCHCA = 6,
|
||||
LANGUAGE_ENGLISHUK = 7
|
||||
},
|
||||
PS4 = {
|
||||
LANGUAGE_BRITISH = 4,
|
||||
LANGUAGE_ENGLISH = 5,
|
||||
LANGUAGE_FRENCH = 7,
|
||||
LANGUAGE_GERMAN = 7,
|
||||
LANGUAGE_ITALIAN = 7,
|
||||
LANGUAGE_SPANISH = 7,
|
||||
LANGUAGE_RUSSIAN = 7,
|
||||
LANGUAGE_POLISH = 7,
|
||||
LANGUAGE_KOREAN = 6,
|
||||
LANGUAGE_TAIWANESE = 6,
|
||||
LANGUAGE_JAPANESE = 4,
|
||||
LANGUAGE_CHINESE = 6,
|
||||
LANGUAGE_THAI = 6,
|
||||
LANGUAGE_CZECH = 6,
|
||||
LANGUAGE_SPANISHNA = 5,
|
||||
LANGUAGE_PORTUGUESE = 5,
|
||||
LANGUAGE_FRENCHCA = 5,
|
||||
LANGUAGE_ENGLISHUK = 7
|
||||
},
|
||||
PC = {
|
||||
LANGUAGE_BRITISH = 3,
|
||||
LANGUAGE_ENGLISH = 5,
|
||||
LANGUAGE_FRENCH = 5,
|
||||
LANGUAGE_GERMAN = 5,
|
||||
LANGUAGE_ITALIAN = 5,
|
||||
LANGUAGE_SPANISH = 5,
|
||||
LANGUAGE_RUSSIAN = 5,
|
||||
LANGUAGE_POLISH = 5,
|
||||
LANGUAGE_KOREAN = 5,
|
||||
LANGUAGE_TAIWANESE = 5,
|
||||
LANGUAGE_JAPANESE = 3,
|
||||
LANGUAGE_CHINESE = 5,
|
||||
LANGUAGE_THAI = 5,
|
||||
LANGUAGE_CZECH = 5,
|
||||
LANGUAGE_SPANISHNA = 5,
|
||||
LANGUAGE_PORTUGUESE = 5,
|
||||
LANGUAGE_FRENCHCA = 5,
|
||||
LANGUAGE_ENGLISHUK = 5
|
||||
}
|
||||
}
|
||||
if Engine.IsXbox360() then
|
||||
f1_local0 = f1_local3.X360[f1_local1]
|
||||
elseif Engine.IsXB3() then
|
||||
f1_local0 = f1_local3.XB3[f1_local1]
|
||||
elseif Engine.IsPS3() then
|
||||
f1_local0 = f1_local3.PS3[f1_local1]
|
||||
elseif Engine.IsPS4() then
|
||||
f1_local0 = f1_local3.PS4[f1_local1]
|
||||
else
|
||||
f1_local0 = f1_local3.PC[f1_local1]
|
||||
end
|
||||
assert( f1_local0 )
|
||||
local f1_local4 = {}
|
||||
for f1_local5 = 1, f1_local0, 1 do
|
||||
table.insert( f1_local4, f1_local2 .. f1_local5 )
|
||||
end
|
||||
return f1_local4
|
||||
end
|
||||
|
||||
function changePage( f2_arg0, f2_arg1 )
|
||||
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
|
||||
local f2_local1 = f2_local0.currentPage
|
||||
f2_local0.currentPage = LUI.clamp( f2_local0.currentPage + f2_arg1, 1, #f2_local0.manualPages )
|
||||
f2_arg0:dispatchEventToRoot( {
|
||||
name = "change_page"
|
||||
} )
|
||||
if f2_local1 ~= f2_local0.currentPage then
|
||||
if f2_arg1 > 0 then
|
||||
f2_arg0:dispatchEventToRoot( {
|
||||
name = "next_page"
|
||||
} )
|
||||
elseif f2_arg1 < 0 then
|
||||
f2_arg0:dispatchEventToRoot( {
|
||||
name = "previous_page"
|
||||
} )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function game_manual()
|
||||
local f3_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "game_manual" )
|
||||
f3_local0.manualPages = f0_local0()
|
||||
assert( #f3_local0.manualPages > 0 )
|
||||
local self = LUI.UIElement.new()
|
||||
self.id = "game_manual"
|
||||
self:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
} )
|
||||
self:animateToState( "default" )
|
||||
local f3_local2 = LUI.UIImage.new()
|
||||
f3_local2.id = "centerPage"
|
||||
f3_local2:registerAnimationState( "default", {
|
||||
material = RegisterMaterial( f3_local0.manualPages[1] ),
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
} )
|
||||
f3_local2:animateToState( "default" )
|
||||
f3_local2:registerEventHandler( "change_page", function ( element, event )
|
||||
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
||||
element:setImage( RegisterMaterial( f4_local0.manualPages[f4_local0.currentPage] ) )
|
||||
end )
|
||||
self:addElement( f3_local2 )
|
||||
local f3_local3 = LUI.UIButton.new()
|
||||
f3_local3.id = "leftArrow"
|
||||
f3_local3:registerAnimationState( "default", {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = -330,
|
||||
left = 100,
|
||||
width = 40,
|
||||
height = 80,
|
||||
alpha = 1
|
||||
} )
|
||||
f3_local3:registerAnimationState( "disabled", {
|
||||
alpha = 0.5
|
||||
} )
|
||||
f3_local3:registerAnimationState( "bump", {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = -330,
|
||||
left = 90,
|
||||
width = 40,
|
||||
height = 80
|
||||
} )
|
||||
f3_local3:registerEventHandler( "next_page", MBh.AnimateToState( "default", 0 ) )
|
||||
f3_local3:registerEventHandler( "previous_page", function ( element, event )
|
||||
local f5_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
||||
local f5_local1 = {
|
||||
{
|
||||
"default",
|
||||
0
|
||||
},
|
||||
{
|
||||
"bump",
|
||||
40,
|
||||
true,
|
||||
true
|
||||
},
|
||||
{
|
||||
"default",
|
||||
100,
|
||||
true,
|
||||
true
|
||||
}
|
||||
}
|
||||
if f5_local0.currentPage <= 1 then
|
||||
table.insert( f5_local1, {
|
||||
"disabled",
|
||||
80
|
||||
} )
|
||||
end
|
||||
local f5_local2 = MBh.AnimateSequence( f5_local1 )
|
||||
f5_local2( element, event )
|
||||
end )
|
||||
f3_local3:registerEventHandler( "button_action", function ( element, event )
|
||||
changePage( element, -1 )
|
||||
end )
|
||||
f3_local3:registerEventHandler( "button_over", function ( element, event )
|
||||
if event.focusType == FocusType.MouseOver then
|
||||
element:processEvent( {
|
||||
name = "arrow_image_over",
|
||||
immediate = true
|
||||
} )
|
||||
end
|
||||
end )
|
||||
f3_local3:registerEventHandler( "button_up", function ( element, event )
|
||||
local f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
||||
if f8_local0.currentPage > 1 then
|
||||
element:animateToState( "default" )
|
||||
else
|
||||
element:animateToState( "disabled" )
|
||||
end
|
||||
element:processEvent( {
|
||||
name = "arrow_image_up",
|
||||
immediate = true
|
||||
} )
|
||||
end )
|
||||
f3_local3:animateToState( "default" )
|
||||
f3_local3:animateToState( "disabled" )
|
||||
local f3_local4 = LUI.UIImage.new()
|
||||
f3_local4.id = "leftArrowImage"
|
||||
f3_local4:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
|
||||
material = RegisterMaterial( "widg_margin_arrow_lt" ),
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
bottom = 0
|
||||
} ) )
|
||||
f3_local4:registerAnimationState( "over", CoD.ColorizeState( Colors.frontend_hilite, {} ) )
|
||||
f3_local4:animateToState( "default" )
|
||||
f3_local4:registerEventHandler( "arrow_image_over", MBh.AnimateToState( "over" ) )
|
||||
f3_local4:registerEventHandler( "arrow_image_up", MBh.AnimateToState( "default" ) )
|
||||
f3_local3:addElement( f3_local4 )
|
||||
self:addElement( f3_local3 )
|
||||
local f3_local5 = LUI.UIButton.new()
|
||||
f3_local5.id = "rightArrow"
|
||||
f3_local5:registerAnimationState( "default", {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
top = -330,
|
||||
right = -100,
|
||||
width = 40,
|
||||
height = 80,
|
||||
alpha = 1
|
||||
} )
|
||||
f3_local5:registerAnimationState( "disabled", {
|
||||
alpha = 0.5
|
||||
} )
|
||||
f3_local5:registerAnimationState( "bump", {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
top = -330,
|
||||
right = -90,
|
||||
width = 40,
|
||||
height = 80
|
||||
} )
|
||||
f3_local5:registerEventHandler( "previous_page", MBh.AnimateToState( "default", 0 ) )
|
||||
f3_local5:registerEventHandler( "next_page", function ( element, event )
|
||||
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
||||
local f9_local1 = {
|
||||
{
|
||||
"default",
|
||||
0
|
||||
},
|
||||
{
|
||||
"bump",
|
||||
40,
|
||||
true,
|
||||
true
|
||||
},
|
||||
{
|
||||
"default",
|
||||
100,
|
||||
true,
|
||||
true
|
||||
}
|
||||
}
|
||||
if #f9_local0.manualPages <= f9_local0.currentPage then
|
||||
table.insert( f9_local1, {
|
||||
"disabled",
|
||||
80
|
||||
} )
|
||||
end
|
||||
local f9_local2 = MBh.AnimateSequence( f9_local1 )
|
||||
f9_local2( element, event )
|
||||
end )
|
||||
f3_local5:animateToState( "default" )
|
||||
f3_local5:registerEventHandler( "button_action", function ( element, event )
|
||||
changePage( element, 1 )
|
||||
end )
|
||||
f3_local5:registerEventHandler( "button_over", function ( element, event )
|
||||
if event.focusType == FocusType.MouseOver then
|
||||
element:processEvent( {
|
||||
name = "arrow_image_over",
|
||||
immediate = true
|
||||
} )
|
||||
end
|
||||
end )
|
||||
f3_local5:registerEventHandler( "button_up", function ( element, event )
|
||||
local f12_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
||||
if f12_local0.currentPage < #f12_local0.manualPages then
|
||||
element:animateToState( "default" )
|
||||
else
|
||||
element:animateToState( "disabled" )
|
||||
end
|
||||
element:processEvent( {
|
||||
name = "arrow_image_up",
|
||||
immediate = true
|
||||
} )
|
||||
end )
|
||||
local f3_local6 = LUI.UIImage.new()
|
||||
f3_local6.id = "leftArrowImage"
|
||||
f3_local6:registerAnimationState( "default", CoD.ColorizeState( Colors.white, {
|
||||
material = RegisterMaterial( "widg_margin_arrow_rt" ),
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
bottom = 0
|
||||
} ) )
|
||||
f3_local6:registerAnimationState( "over", CoD.ColorizeState( Colors.frontend_hilite, {} ) )
|
||||
f3_local6:animateToState( "default" )
|
||||
f3_local6:registerEventHandler( "arrow_image_over", MBh.AnimateToState( "over" ) )
|
||||
f3_local6:registerEventHandler( "arrow_image_up", MBh.AnimateToState( "default" ) )
|
||||
f3_local5:addElement( f3_local6 )
|
||||
self:addElement( f3_local5 )
|
||||
local f3_local7 = LUI.MenuBuilder.BuildAddChild( self, {
|
||||
type = "button_helper_text_main",
|
||||
properties = {
|
||||
background_alpha = 1
|
||||
}
|
||||
} )
|
||||
f3_local7:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
||||
local f3_local8 = LUI.UIBindButton.new()
|
||||
f3_local8.id = "bind"
|
||||
f3_local8:registerEventHandler( "button_secondary", function ( element, event )
|
||||
LUI.FlowManager.RequestLeaveMenu( element )
|
||||
end )
|
||||
f3_local8:registerEventHandler( "button_left", function ( element, event )
|
||||
changePage( element, -1 )
|
||||
end )
|
||||
f3_local8:registerEventHandler( "button_right", function ( element, event )
|
||||
changePage( element, 1 )
|
||||
end )
|
||||
self:addElement( f3_local8 )
|
||||
self:registerEventHandler( "menu_create", function ( element, event )
|
||||
local f16_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( element )
|
||||
f16_local0.currentPage = 1
|
||||
changePage( element, 0 )
|
||||
end )
|
||||
return self
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerType( "game_manual", game_manual )
|
||||
LockTable( _M )
|
782
lui/common_menus/kinectcontrolmenu.dec.lua
Normal file
782
lui/common_menus/kinectcontrolmenu.dec.lua
Normal file
@ -0,0 +1,782 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
function KinectGuideFeeder( f1_arg0 )
|
||||
local f1_local0 = {}
|
||||
Kinect.BuildShortcutArray()
|
||||
if Kinect.ShortcutArray ~= nil then
|
||||
for f1_local1 = 1, #Kinect.ShortcutArray, 1 do
|
||||
local f1_local4 = f1_local1
|
||||
table.insert( f1_local0, {
|
||||
type = "UIButton",
|
||||
id = "kinect_guide_grid_" .. f1_local4 .. "_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = false,
|
||||
width = Kinect.Layout.CellWidth,
|
||||
height = Kinect.Layout.CellHeight
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
button_action = function ( f2_arg0, f2_arg1 )
|
||||
Kinect.ExecShortcut( f2_arg0, f2_arg1, f1_local4 )
|
||||
end
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "UIElement",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
alpha = 1
|
||||
},
|
||||
dim = {
|
||||
alpha = 0.8
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
button_over = MBh.AnimateLoop( {
|
||||
{
|
||||
"dim",
|
||||
750,
|
||||
true,
|
||||
true
|
||||
},
|
||||
{
|
||||
"default",
|
||||
750
|
||||
}
|
||||
} ),
|
||||
button_up = MBh.AnimateToState( "default", 0 )
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "kinect_button_background",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
alpha = 0.05
|
||||
},
|
||||
focused = {
|
||||
alpha = 0.4
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
button_over = MBh.AnimateToState( "focused" ),
|
||||
button_up = MBh.AnimateToState( "default" )
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIImage",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
bottom = 16,
|
||||
left = 0,
|
||||
right = 16,
|
||||
material = RegisterMaterial( "widg_triangle" ),
|
||||
alpha = 0
|
||||
},
|
||||
focused = {
|
||||
alpha = 1
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
button_over = MBh.AnimateToState( "focused" ),
|
||||
button_up = MBh.AnimateToState( "default" )
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIImage",
|
||||
states = {
|
||||
default = CoD.ColorizeState( Colors.white, {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
width = 128,
|
||||
height = 128,
|
||||
material = RegisterMaterial( "icon_kinect_number_0" .. f1_local4 ),
|
||||
alpha = 0.1
|
||||
} ),
|
||||
focused = CoD.ColorizeState( Colors.black, {
|
||||
scale = 0.1
|
||||
} ),
|
||||
unfocused = CoD.ColorizeState( Colors.black, {
|
||||
scale = 0
|
||||
} )
|
||||
},
|
||||
handlers = {
|
||||
button_over = MBh.AnimateSequence( {
|
||||
{
|
||||
"unfocused",
|
||||
0
|
||||
},
|
||||
{
|
||||
"focused",
|
||||
100
|
||||
},
|
||||
{
|
||||
"unfocused",
|
||||
100
|
||||
}
|
||||
} ),
|
||||
button_up = MBh.AnimateToState( "default", 0 )
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIElement",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
height = 32
|
||||
}
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "kinect_btn_footer_bg",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
alpha = 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIMarqueeText",
|
||||
id = "kinect_guide_grid_desc_id",
|
||||
properties = {
|
||||
text = Engine.Localize( Kinect.ShortcutArray[f1_local4].TextLabel ),
|
||||
textStyle = CoD.TextStyle.OutlinedMore
|
||||
},
|
||||
states = {
|
||||
default = CoD.ColorizeState( Kinect.Swatch.DescColor, {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 3,
|
||||
right = -3,
|
||||
height = CoD.TextSettings.NormalFont.Height,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
alignment = LUI.Alignment.Center
|
||||
} ),
|
||||
focused = CoD.ColorizeState( Kinect.Swatch.DescColorInvert, {} ),
|
||||
unfocused = CoD.ColorizeState( Kinect.Swatch.DescColor, {} )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} )
|
||||
end
|
||||
else
|
||||
DebugPrint( "Kinect: Warning, Kinect.ShortcutArray is nil!" )
|
||||
end
|
||||
return f1_local0
|
||||
end
|
||||
|
||||
function kinect_btn_footer_bg()
|
||||
return {
|
||||
type = "UIElement",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
}
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "UIImage",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 8,
|
||||
material = RegisterMaterial( "box_kinect_name_lt" )
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIImage",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 8,
|
||||
right = -8,
|
||||
material = RegisterMaterial( "box_kinect_name_mid" )
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIImage",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = -8,
|
||||
right = 0,
|
||||
material = RegisterMaterial( "box_kinect_name_rt" )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuAutoRefresh( f4_arg0, f4_arg1 )
|
||||
if Kinect.DoWeNeedToRebuildShortcutArray() == true then
|
||||
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
|
||||
end
|
||||
end
|
||||
|
||||
function kinect_guide_grid()
|
||||
return {
|
||||
type = "UIGrid",
|
||||
id = "kinect_guide_grid_id",
|
||||
handlers = {
|
||||
autorefresh = HandleKinectGuideMenuAutoRefresh
|
||||
},
|
||||
properties = {
|
||||
elementsPerRow = Kinect.Layout.NumRows,
|
||||
rowHeight = 150,
|
||||
hSpacing = 6,
|
||||
vSpacing = 6,
|
||||
vAlign = LUI.Alignment.Center,
|
||||
hAlign = LUI.Alignment.Center
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
}
|
||||
},
|
||||
childrenFeeder = KinectGuideFeeder
|
||||
}
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuSpeechBack( f6_arg0, f6_arg1, f6_arg2 )
|
||||
if not Kinect.IsWhatCanISayMenuUp() and Kinect.IsKinectGuideUp() then
|
||||
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
|
||||
LUI.Speech.PerformingSpeechAction()
|
||||
end
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuSpeechCancel( f7_arg0, f7_arg1, f7_arg2 )
|
||||
LUI.FlowManager.RequestLeaveMenu( f7_arg0 )
|
||||
LUI.Speech.PerformingSpeechAction()
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuSpeechYes( f8_arg0, f8_arg1, f8_arg2 )
|
||||
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuSpeechNo( f9_arg0, f9_arg1, f9_arg2 )
|
||||
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuSpeechShortcut( f10_arg0, f10_arg1, f10_arg2 )
|
||||
assert( f10_arg2, "HandleKinectGuideMenuSpeechShortcut: Missing extradata param!" )
|
||||
assert( f10_arg2.shortcutNum, "HandleKinectGuideMenuSpeechShortcut: Missing extradata shortcutNum param!" )
|
||||
Kinect.ExecShortcut( f10_arg0, f10_arg1, f10_arg2.shortcutNum )
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuSpeechReplaceShortcut( f11_arg0, f11_arg1, f11_arg2 )
|
||||
assert( f11_arg2, "HandleKinectGuideMenuSpeechReplaceShortcut: Missing extradata param!" )
|
||||
assert( f11_arg2.shortcutNum, "HandleKinectGuideMenuSpeechReplaceShortcut: Missing extradata shortcutNum param!" )
|
||||
end
|
||||
|
||||
if Engine.HasSpeechFeature() then
|
||||
KinectGuideMenuSpeechGrammarHandlersArray = {
|
||||
{
|
||||
action = "back",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechBack,
|
||||
extradata = nil
|
||||
},
|
||||
{
|
||||
action = "cancel",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechCancel,
|
||||
extradata = nil
|
||||
},
|
||||
{
|
||||
action = "yes",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechYes,
|
||||
extradata = nil
|
||||
},
|
||||
{
|
||||
action = "no",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechNo,
|
||||
extradata = nil
|
||||
},
|
||||
{
|
||||
action = "Shortcut 1",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 1
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 2",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 2
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 3",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 3
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 4",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 4
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 5",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 5
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 6",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 6
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 7",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 7
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 8",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 8
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Shortcut 9",
|
||||
confidence = LUI.Speech.shortcutMenuConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 9
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 1",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 1
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 2",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 2
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 3",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 3
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 4",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 4
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 5",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 5
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 6",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 6
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 7",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 7
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 8",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 8
|
||||
}
|
||||
},
|
||||
{
|
||||
action = "Replace Shortcut 9",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = HandleKinectGuideMenuSpeechReplaceShortcut,
|
||||
extradata = {
|
||||
shortcutNum = 9
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
KinectGuideMenuSpeechGrammarHandlersArray = {}
|
||||
end
|
||||
function HandleKinectGuideMenuSpeechHandler( f12_arg0, f12_arg1 )
|
||||
if Engine.HasSpeechFeature() then
|
||||
LUI.Speech.ProcessActionEvent( f12_arg0, f12_arg1, KinectGuideMenuSpeechGrammarHandlersArray )
|
||||
end
|
||||
end
|
||||
|
||||
function HandleKinectGuideMenuCreate( f13_arg0, f13_arg1 )
|
||||
f13_arg0:processEvent( {
|
||||
name = "add_button_helper_text",
|
||||
button_ref = "button_secondary",
|
||||
helper_text = Engine.Localize( "@LUA_MENU_BACK" ),
|
||||
side = "left",
|
||||
clickable = true
|
||||
} )
|
||||
end
|
||||
|
||||
function kinect_guide()
|
||||
return {
|
||||
type = "UIElement",
|
||||
id = "kinect_guide_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
menu_create = HandleKinectGuideMenuCreate,
|
||||
speech_action = HandleKinectGuideMenuSpeechHandler
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "UIImage",
|
||||
id = "kinect_menu_overlay_id",
|
||||
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",
|
||||
id = "kinect_menu_container_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = false,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = false,
|
||||
width = Kinect.Layout.Width,
|
||||
height = Kinect.Layout.Height
|
||||
}
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "generic_drop_shadow",
|
||||
properties = {
|
||||
offset_shadow = 0
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "generic_menu_titlebar",
|
||||
id = "kinect_title_id",
|
||||
properties = {
|
||||
font = CoD.TextSettings.ExtraBigFont,
|
||||
title_bar_text = Engine.Localize( "@SPEECH_SHORTCUTS_TITLE" ),
|
||||
title_bar_alignment = LUI.Alignment.Center,
|
||||
fill_alpha = 1
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "generic_menu_background",
|
||||
id = "kinect_background_id",
|
||||
properties = {
|
||||
fill_alpha = 1
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "kinect_guide_grid",
|
||||
id = "kinect_guide_grid_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = GenericTitleBarDims.TitleBarHeight + 10,
|
||||
bottom = -1 * (GenericFooterDims.Height + 5),
|
||||
left = 5,
|
||||
right = -5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UITimer",
|
||||
id = "kinect_guid_grid_autorefresh_timer",
|
||||
properties = {
|
||||
event = "autorefresh",
|
||||
interval = 1000,
|
||||
disposable = false,
|
||||
broadcastToRoot = false
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIImage",
|
||||
states = {
|
||||
default = CoD.ColorizeState( Swatches.GenericMenu.Border, {
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
bottom = -40,
|
||||
left = 1,
|
||||
right = -1,
|
||||
height = 1,
|
||||
material = RegisterMaterial( "white" ),
|
||||
alpha = Swatches.GenericMenu.BorderAlpha
|
||||
} )
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "button_helper_text_main",
|
||||
id = "kinect_helper_text_id",
|
||||
properties = {
|
||||
left_inset = 10,
|
||||
left_margin = 1,
|
||||
right_margin = -1,
|
||||
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
|
||||
spacing = 65,
|
||||
background_alpha = 0
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIBindButton",
|
||||
id = "kinect_bind_buttons_id",
|
||||
handlers = {
|
||||
button_secondary = MBh.LeaveMenu()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function kinect_button_background( f15_arg0, f15_arg1 )
|
||||
local f15_local0 = f15_arg1.red or 1
|
||||
local f15_local1 = f15_arg1.green or 1
|
||||
local f15_local2 = f15_arg1.blue or 1
|
||||
local f15_local3 = f15_arg1.alpha or 1
|
||||
local f15_local4 = f15_arg1.colorLocked or false
|
||||
local self = LUI.UIElement.new()
|
||||
self:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = top,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
} )
|
||||
self:animateToState( "default" )
|
||||
local f15_local6 = LUI.UIImage.new()
|
||||
f15_local6.id = "corner"
|
||||
f15_local6:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
bottom = 32,
|
||||
left = 0,
|
||||
right = 32,
|
||||
material = RegisterMaterial( "btn_cas_item_topleft" )
|
||||
} )
|
||||
f15_local6:animateToState( "default" )
|
||||
self:addElement( f15_local6 )
|
||||
local f15_local7 = LUI.UIImage.new()
|
||||
f15_local7.id = "top"
|
||||
f15_local7:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 32,
|
||||
left = 32,
|
||||
right = 0,
|
||||
material = RegisterMaterial( "white" )
|
||||
} )
|
||||
f15_local7:animateToState( "default" )
|
||||
self:addElement( f15_local7 )
|
||||
local f15_local8 = LUI.UIImage.new()
|
||||
f15_local8.id = "bottom"
|
||||
f15_local8:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 32,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
material = RegisterMaterial( "white" )
|
||||
} )
|
||||
f15_local8:animateToState( "default" )
|
||||
self:addElement( f15_local8 )
|
||||
self.colorize = function ( f16_arg0, f16_arg1, f16_arg2, f16_arg3 )
|
||||
for f16_local3, f16_local4 in ipairs( {
|
||||
f15_local6,
|
||||
f15_local7,
|
||||
f15_local8
|
||||
} ) do
|
||||
f16_local4:registerAnimationState( "current", {
|
||||
red = f16_arg0,
|
||||
green = f16_arg1,
|
||||
blue = f16_arg2,
|
||||
alpha = f16_arg3
|
||||
} )
|
||||
f16_local4:animateToState( "current" )
|
||||
end
|
||||
end
|
||||
|
||||
self.colorize( f15_local0, f15_local1, f15_local2, f15_local3 )
|
||||
if not f15_local4 then
|
||||
self:registerEventHandler( "updateBackgroundColor", function ( element, event )
|
||||
element.colorize( event.red, event.green, event.blue, event.alpha )
|
||||
end )
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerDef( "kinect_guide", kinect_guide )
|
||||
LUI.FlowManager.RegisterStackPopBehaviour( "kinect_guide", function ()
|
||||
Engine.ExecNow( "decnosplitscreencontrol kinect_guide_dec" )
|
||||
end )
|
||||
LUI.MenuBuilder.registerDef( "kinect_guide_grid", kinect_guide_grid )
|
||||
LUI.MenuBuilder.registerDef( "kinect_btn_footer_bg", kinect_btn_footer_bg )
|
||||
LUI.MenuBuilder.registerType( "kinect_button_background", kinect_button_background )
|
||||
LockTable( _M )
|
1023
lui/common_menus/kinectutils.dec.lua
Normal file
1023
lui/common_menus/kinectutils.dec.lua
Normal file
File diff suppressed because it is too large
Load Diff
1142
lui/common_menus/options.dec.lua
Normal file
1142
lui/common_menus/options.dec.lua
Normal file
File diff suppressed because it is too large
Load Diff
3699
lui/common_menus/optionslayout.dec.lua
Normal file
3699
lui/common_menus/optionslayout.dec.lua
Normal file
File diff suppressed because it is too large
Load Diff
425
lui/common_menus/playercard.dec.lua
Normal file
425
lui/common_menus/playercard.dec.lua
Normal file
@ -0,0 +1,425 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
LUI.Playercard = {}
|
||||
XP_BAR_WIDTH = 212
|
||||
LUI.Playercard.new = function ( f1_arg0, f1_arg1, f1_arg2 )
|
||||
local f1_local0 = 130
|
||||
local self = LUI.UIElement.new()
|
||||
self:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
left = 0,
|
||||
height = 128,
|
||||
width = 512,
|
||||
alpha = 1
|
||||
} )
|
||||
self:registerAnimationState( "hidden", {
|
||||
alpha = 0
|
||||
} )
|
||||
self:animateToState( "default" )
|
||||
self.card = LUI.UIElement.new()
|
||||
local f1_local2 = self.card
|
||||
self:addElement( f1_local2 )
|
||||
f1_local2.id = "playercard" .. (f1_arg1.gamertag and "_" .. f1_arg1.gamertag or "")
|
||||
f1_local2:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = -18,
|
||||
left = -12,
|
||||
height = 128,
|
||||
width = 512
|
||||
} )
|
||||
f1_local2:animateToState( "default" )
|
||||
local f1_local3 = LUI.UIImage.new()
|
||||
f1_local3.id = "mainBG"
|
||||
f1_local3:registerAnimationState( "default", {
|
||||
material = RegisterMaterial( "card_bg" ),
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
} )
|
||||
f1_local3:animateToState( "default" )
|
||||
f1_local2:addElement( f1_local3 )
|
||||
f1_local2.playerBG = LUI.UIImage.new()
|
||||
f1_local2.playerBG.id = "playerBG"
|
||||
f1_local2.playerBG:animateToState( "default" )
|
||||
f1_local2:addElement( f1_local2.playerBG )
|
||||
f1_local2.playerBGdarken = LUI.UIImage.new()
|
||||
f1_local2.playerBGdarken.id = "playerBGdarken"
|
||||
f1_local2.playerBGdarken:registerAnimationState( "default", {
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
width = 399,
|
||||
height = 64,
|
||||
bottom = -24,
|
||||
left = 53,
|
||||
alpha = 0.85
|
||||
} )
|
||||
f1_local2.playerBGdarken:animateToState( "default" )
|
||||
f1_local2.playerBGdarken:setImage( RegisterMaterial( "card_image_darken" ) )
|
||||
f1_local2:addElement( f1_local2.playerBGdarken )
|
||||
f1_local2.gamertag = LUI.UIMarqueeText.new()
|
||||
f1_local2.gamertag.id = "gamertag"
|
||||
f1_local2.gamertag:registerAnimationState( "default", {
|
||||
alignment = LUI.Alignment.Left,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = f1_local0,
|
||||
right = -60,
|
||||
top = 18,
|
||||
height = CoD.TextSettings.NormalFont.Height
|
||||
} )
|
||||
f1_local2.gamertag:animateToState( "default" )
|
||||
f1_local2:addElement( f1_local2.gamertag )
|
||||
f1_local2.slogan = LUI.UIMarqueeText.new()
|
||||
f1_local2.slogan.id = "slogan"
|
||||
f1_local2.slogan:setTextStyle( CoD.TextStyle.OutlinedMore )
|
||||
f1_local2.slogan:registerAnimationState( "default", {
|
||||
alignment = LUI.Alignment.Left,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = f1_local0,
|
||||
right = -60,
|
||||
top = 40,
|
||||
height = CoD.TextSettings.NormalFont.Height,
|
||||
red = 1,
|
||||
green = 1,
|
||||
blue = 1
|
||||
} )
|
||||
f1_local2.slogan:animateToState( "default" )
|
||||
f1_local2:addElement( f1_local2.slogan )
|
||||
f1_local2.clantag = LUI.UIText.new()
|
||||
f1_local2.clantag.id = "clantag"
|
||||
f1_local2.clantag.m_textStyle = CoD.TextStyle.OutlinedMore
|
||||
f1_local2.clantag:registerAnimationState( "default", {
|
||||
alignment = LUI.Alignment.Left,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = f1_local0,
|
||||
right = -60,
|
||||
top = 80,
|
||||
height = CoD.TextSettings.NormalFont.Height,
|
||||
red = Colors.primary_text_color.r,
|
||||
green = Colors.primary_text_color.g,
|
||||
blue = Colors.primary_text_color.b
|
||||
} )
|
||||
f1_local2.clantag:animateToState( "default" )
|
||||
f1_local2:addElement( f1_local2.clantag )
|
||||
if not (not IsPublicMatch or not IsPublicMatch()) or Engine.IsAliensMode() or f1_arg1.force_show_rank then
|
||||
f1_local2.rankIcon = LUI.UIImage.new()
|
||||
f1_local2.rankIcon.id = "rankIcon"
|
||||
f1_local2:addElement( f1_local2.rankIcon )
|
||||
f1_local2.rankNum = LUI.UIText.new()
|
||||
f1_local2.rankNum.id = "rankNum"
|
||||
f1_local2.rankNum.m_textStyle = CoD.TextStyle.ShadowedMore
|
||||
f1_local2.rankNum:registerAnimationState( "default", {
|
||||
alignment = LUI.Alignment.Right,
|
||||
font = CoD.TextSettings.BigFont.Font,
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
left = -165,
|
||||
right = -65,
|
||||
top = 58,
|
||||
height = CoD.TextSettings.BigFont.MaxHeight
|
||||
} )
|
||||
f1_local2.rankNum:animateToState( "default" )
|
||||
f1_local2:addElement( f1_local2.rankNum )
|
||||
end
|
||||
if f1_arg1.use_level_progress then
|
||||
LUI.Playercard.AddLevelProgressBar( f1_local2 )
|
||||
end
|
||||
f1_local2.patchShape = LUI.UIImage.new()
|
||||
f1_local2.patchShape.id = "patchShape"
|
||||
f1_local2:addElement( f1_local2.patchShape )
|
||||
f1_local2.patchEmblem = LUI.UIImage.new()
|
||||
f1_local2.patchEmblem.id = "patchEmblem"
|
||||
f1_local2.patchEmblem:animateToState( "default" )
|
||||
f1_local2.patchEmblem.scale = f1_arg1.patchScale or 0
|
||||
f1_local2:addElement( f1_local2.patchEmblem )
|
||||
self.feedContent = LUI.Playercard.FeedContent
|
||||
self:registerEventHandler( "update_playercard", function ( element, event )
|
||||
element:feedContent( event )
|
||||
end )
|
||||
self:registerEventHandler( "hide_playercard", function ( element, event )
|
||||
element:animateToState( "hidden", event.fade or 0 )
|
||||
end )
|
||||
self:registerEventHandler( "show_playercard", function ( element, event )
|
||||
element:animateToState( "default", event.fade or 0 )
|
||||
end )
|
||||
self:feedContent( f1_arg1 )
|
||||
return self
|
||||
end
|
||||
|
||||
LUI.Playercard.AddLevelProgressBar = function ( f5_arg0 )
|
||||
local f5_local0 = 0
|
||||
local f5_local1 = 140
|
||||
local f5_local2 = -50
|
||||
local f5_local3 = 150
|
||||
local f5_local4 = CoD.TextSettings.SmallFont.Height
|
||||
|
||||
local levelProgressContainer = LUI.UIElement.new( CoD.CreateState( 45, -22, -58, 0, CoD.AnchorTypes.BottomLeftRight ) )
|
||||
levelProgressContainer.id = "playercard_level_bar_container_id"
|
||||
local f5_local6 = CoD.CreateState( 0, 0, f5_local3, 0, CoD.AnchorTypes.TopBottomLeft )
|
||||
CoD.ColorizeState( Colors.black, f5_local6 )
|
||||
f5_local6.material = RegisterMaterial( "box_white_gradient_fade_rt" )
|
||||
f5_arg0.bgFade = LUI.UIImage.new( f5_local6 )
|
||||
levelProgressContainer:addElement( f5_arg0.bgFade )
|
||||
f5_local6 = CoD.CreateState( f5_local3, 0, 0, 0, CoD.AnchorTypes.All )
|
||||
CoD.ColorizeState( Colors.black, f5_local6 )
|
||||
f5_local6.material = RegisterMaterial( "white" )
|
||||
f5_arg0.bgFill = LUI.UIImage.new( f5_local6 )
|
||||
levelProgressContainer:addElement( f5_arg0.bgFill )
|
||||
f5_local6 = CoD.CreateState( f5_local1, 6, f5_local1 + XP_BAR_WIDTH, -6, CoD.AnchorTypes.TopBottomLeft )
|
||||
CoD.ColorizeState( Colors.grey_2, f5_local6 )
|
||||
f5_arg0.xpBar = LUI.UIImage.new( f5_local6 )
|
||||
f5_arg0.xpBar.id = "playercard_level_bar_bg_id"
|
||||
levelProgressContainer:addElement( f5_arg0.xpBar )
|
||||
f5_local6 = CoD.CreateState( 0, 0, 0, 0, CoD.AnchorTypes.TopBottomLeft )
|
||||
f5_local6.material = RegisterMaterial( "btn_cas_fill_f" )
|
||||
f5_arg0.xpFillBar = LUI.UIImage.new( {
|
||||
f5_local6
|
||||
} )
|
||||
f5_arg0.xpFillBar.id = "playercard_level_bar_id"
|
||||
f5_arg0.xpBar:addElement( f5_arg0.xpFillBar )
|
||||
f5_arg0.currentRankIcon = LUI.UIImage.new( CoD.CreateState( f5_local1 - 26, f5_local0, f5_local1 - 6, f5_local0 + f5_local4, CoD.AnchorTypes.TopLeft ) )
|
||||
f5_arg0.currentRankIcon.id = "playercard_current_rank_icon_id"
|
||||
f5_local6 = CoD.CreateState( 0, f5_local0, f5_local1 - 32, f5_local0 + f5_local4, CoD.AnchorTypes.TopLeft )
|
||||
f5_local6.font = CoD.TextSettings.SmallFont.Font
|
||||
f5_local6.alignment = LUI.Alignment.Right
|
||||
CoD.ColorizeState( Colors.md_grey, f5_local6 )
|
||||
f5_arg0.currentRankText = LUI.UIText.new( f5_local6 )
|
||||
f5_arg0.currentRankText.id = "playercard_current_rank_id"
|
||||
f5_arg0.nextRankIcon = LUI.UIImage.new( CoD.CreateState( f5_local2, f5_local0, f5_local2 + 20, f5_local0 + f5_local4, CoD.AnchorTypes.TopRight ) )
|
||||
f5_arg0.nextRankIcon.id = "playercard_next_rank_icon_id"
|
||||
f5_local6 = CoD.CreateState( f5_local2 + 25, f5_local0, 0, f5_local0 + f5_local4, CoD.AnchorTypes.TopRight )
|
||||
f5_local6.font = CoD.TextSettings.SmallFont.Font
|
||||
f5_local6.alignment = LUI.Alignment.Left
|
||||
CoD.ColorizeState( Colors.md_grey, f5_local6 )
|
||||
f5_arg0.nextRankText = LUI.UIText.new( f5_local6 )
|
||||
f5_arg0.nextRankText.id = "playercard_next_rank_id"
|
||||
levelProgressContainer:addElement( f5_arg0.currentRankIcon )
|
||||
levelProgressContainer:addElement( f5_arg0.currentRankText )
|
||||
levelProgressContainer:addElement( f5_arg0.nextRankIcon )
|
||||
levelProgressContainer:addElement( f5_arg0.nextRankText )
|
||||
f5_arg0:addElement( levelProgressContainer )
|
||||
f5_arg0.levelProgressContainer = levelProgressContainer
|
||||
|
||||
end
|
||||
|
||||
LUI.Playercard.FeedContent = function ( f6_arg0, f6_arg1 )
|
||||
local f6_local0 = f6_arg0.card
|
||||
if f6_arg1.gamertag then
|
||||
f6_local0.gamertag:setText( f6_arg1.gamertag )
|
||||
end
|
||||
if f6_arg1.clantag then
|
||||
local f6_local1 = f6_arg1.clantag
|
||||
if f6_arg1.clantag ~= "" then
|
||||
if not string.find( f6_arg1.clantag, "[", nil, true ) then
|
||||
f6_local1 = "[" .. f6_local1
|
||||
end
|
||||
if not string.find( f6_arg1.clantag, "]", nil, true ) then
|
||||
f6_local1 = f6_local1 .. "]"
|
||||
end
|
||||
end
|
||||
f6_local0.clantag:setText( f6_local1 )
|
||||
end
|
||||
if f6_arg1.background then
|
||||
local f6_local1 = RegisterMaterial( Cac.Customization.Fields[Cac.Customization.FieldIndexes.Background].GetUIMaterial( f6_arg1.background ) )
|
||||
if f6_local1 then
|
||||
f6_local0.playerBG:setImage( f6_local1 )
|
||||
f6_local0.playerBG:registerAnimationState( "default", {
|
||||
topAnchor = false,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
width = 399,
|
||||
height = 64,
|
||||
bottom = -24,
|
||||
left = 53
|
||||
} )
|
||||
f6_local0.playerBG:animateToState( "default" )
|
||||
end
|
||||
end
|
||||
if f6_local0.rankIcon and f6_local0.rankNum and f6_arg1.rank and f6_arg1.prestige then
|
||||
local f6_local1 = Engine.IsAliensMode() and CoD.PlayMode.Aliens or CoD.PlayMode.Core
|
||||
local f6_local2 = Rank.GetRankDisplay( f6_arg1.rank, f6_local1 )
|
||||
f6_local0.rankNum:setText( f6_local2 )
|
||||
local f6_local3 = RegisterMaterial( Rank.GetRankIcon( f6_arg1.rank, f6_arg1.prestige, f6_local1 ) )
|
||||
if f6_local3 then
|
||||
local f6_local4 = f6_arg1.prestige > 0
|
||||
local f6_local5
|
||||
if f6_local4 then
|
||||
f6_local5 = 46
|
||||
if not f6_local5 then
|
||||
|
||||
else
|
||||
local f6_local6
|
||||
if f6_local4 then
|
||||
f6_local6 = 61
|
||||
if not f6_local6 then
|
||||
|
||||
else
|
||||
local f6_local7, f6_local8, f6_local9, f6_local10 = GetTextDimensions( f6_local2, CoD.TextSettings.BigFont.Font, CoD.TextSettings.BigFont.MaxHeight )
|
||||
local f6_local11 = f6_local9 - f6_local7
|
||||
f6_local0.rankIcon:setImage( f6_local3 )
|
||||
f6_local0.rankIcon:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = false,
|
||||
rightAnchor = true,
|
||||
top = f6_local6,
|
||||
right = -70 - f6_local11,
|
||||
width = f6_local5,
|
||||
height = f6_local5
|
||||
} )
|
||||
f6_local0.rankIcon:animateToState( "default" )
|
||||
end
|
||||
end
|
||||
f6_local6 = 63
|
||||
end
|
||||
end
|
||||
f6_local5 = 40
|
||||
end
|
||||
end
|
||||
if f6_arg1.patchShape then
|
||||
local f6_local1 = RegisterMaterial( Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patchbacking].GetUIMaterial( f6_arg1.patchShape ) )
|
||||
if f6_local1 then
|
||||
f6_local0.patchShape:setImage( f6_local1 )
|
||||
f6_local0.patchShape:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
left = 0,
|
||||
width = 128,
|
||||
height = 128
|
||||
} )
|
||||
f6_local0.patchShape:animateToState( "default" )
|
||||
end
|
||||
end
|
||||
if f6_arg1.patchEmblem then
|
||||
local f6_local1 = RegisterMaterial( Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch].GetUIMaterial( f6_arg1.patchEmblem ) )
|
||||
if f6_local1 then
|
||||
f6_local0.patchEmblem:setImage( f6_local1 )
|
||||
f6_local0.patchEmblem:registerAnimationState( "default", {
|
||||
topAnchor = true,
|
||||
bottomAnchor = false,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false,
|
||||
top = 0,
|
||||
left = 0,
|
||||
width = 128,
|
||||
height = 128,
|
||||
red = 1,
|
||||
green = 1,
|
||||
blue = 1,
|
||||
alpha = 1,
|
||||
scale = f6_local0.patchEmblem.scale
|
||||
} )
|
||||
f6_local0.patchEmblem:animateToState( "default" )
|
||||
end
|
||||
local f6_local2 = Cac.Customization.Fields[Cac.Customization.FieldIndexes.Patch]
|
||||
if f6_local2 and f6_local2.GetQuip then
|
||||
local f6_local3 = f6_local2.GetQuip( f6_arg1.patchEmblem )
|
||||
if f6_local3 then
|
||||
f6_local0.slogan:setText( Engine.Localize( f6_local3 ) )
|
||||
end
|
||||
end
|
||||
end
|
||||
if f6_arg1.experience and f6_arg1.prestige and f6_local0.levelProgressContainer then
|
||||
local f6_local1 = Engine.GetCurrentCoDPlayMode()
|
||||
local f6_local2 = Rank.GetMaxRank( f6_local1 )
|
||||
local f6_local3 = Engine.IsAliensMode() and Lobby.GetAlienRankForXP( f6_arg1.experience ) or Lobby.GetRankForXP( f6_arg1.experience )
|
||||
local f6_local4
|
||||
if f6_local3 < f6_local2 then
|
||||
f6_local4 = f6_local3 + 1
|
||||
if not f6_local4 then
|
||||
|
||||
else
|
||||
local f6_local5 = Engine.IsAliensMode() and LUI.mp_menus.Aliens.AlienRanks.MaxPrestige or Lobby.GetMaxPrestigeLevel()
|
||||
local f6_local6 = Rank.GetRankMaxXP( f6_local2 ) <= f6_arg1.experience
|
||||
f6_local0.currentRankText:setText( Rank.GetRankDisplay( f6_local3 ) )
|
||||
local f6_local7 = RegisterMaterial( Rank.GetRankIcon( f6_local3, f6_arg1.prestige, f6_local1 ) )
|
||||
if f6_local7 then
|
||||
f6_local0.currentRankIcon:setImage( f6_local7 )
|
||||
end
|
||||
local f6_local8 = false
|
||||
if not Engine.IsAliensMode() and f6_local3 == f6_local4 and not f6_local6 and f6_arg1.prestige < f6_local5 then
|
||||
f6_local8 = true
|
||||
end
|
||||
if Engine.IsAliensMode() and f6_local3 == LUI.mp_menus.Aliens.AlienRanks.MaxLevel and f6_arg1.prestige < f6_local5 then
|
||||
f6_local8 = true
|
||||
f6_local4 = 0
|
||||
end
|
||||
f6_local0.nextRankText:setText( Rank.GetRankDisplay( f6_local4, f6_local1 ) )
|
||||
local f6_local9 = RegisterMaterial
|
||||
local f6_local10 = Rank.GetRankIcon
|
||||
local f6_local11 = f6_local4
|
||||
local f6_local12
|
||||
if f6_local8 then
|
||||
f6_local12 = f6_arg1.prestige + 1
|
||||
if not f6_local12 then
|
||||
|
||||
else
|
||||
f6_local7 = f6_local9( f6_local10( f6_local11, f6_local12, f6_local1 ) )
|
||||
if f6_local7 then
|
||||
f6_local0.nextRankIcon:setImage( f6_local7 )
|
||||
end
|
||||
f6_local9 = Rank.GetRankMinXP( f6_local3, f6_local1 )
|
||||
f6_local10 = Rank.GetRankMinXP( f6_local4, f6_local1 )
|
||||
f6_local11 = Rank.GetRankXPToNext( f6_local3, f6_local1 )
|
||||
if f6_local11 == nil or f6_local11 == 0 then
|
||||
f6_local11 = 1
|
||||
end
|
||||
f6_local12 = math.min( (f6_arg1.experience - f6_local9) / f6_local11, 1 )
|
||||
if Engine.IsAliensMode() and f6_local3 == LUI.mp_menus.Aliens.AlienRanks.SuperMaxLevel then
|
||||
f6_local12 = 1
|
||||
end
|
||||
f6_local0.xpFillBar:registerAnimationState( "default", {
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = f6_local12 * XP_BAR_WIDTH,
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = false
|
||||
} )
|
||||
f6_local0.xpFillBar:animateToState( "default", 0 )
|
||||
end
|
||||
end
|
||||
f6_local12 = f6_arg1.prestige
|
||||
end
|
||||
end
|
||||
f6_local4 = f6_local3
|
||||
end
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerType( "playercard", LUI.Playercard.new )
|
||||
LockTable( _M )
|
122
lui/common_menus/profilepopup.dec.lua
Normal file
122
lui/common_menus/profilepopup.dec.lua
Normal file
@ -0,0 +1,122 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
function profileMenuOptionsFeeder( f1_arg0 )
|
||||
return {
|
||||
{
|
||||
type = "UIGenericButton",
|
||||
id = "offile_profile_create_btn",
|
||||
properties = {
|
||||
style = GenericButtonSettings.Styles.GlassButton,
|
||||
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
||||
text = Engine.Localize( "@MENU_CREATE_NEW_OFFLINE_PROFILE" ),
|
||||
button_action_func = function ( f2_arg0, f2_arg1 )
|
||||
DebugPrint( "button offile_profile_create_btn press" )
|
||||
Engine.Exec( "newOfflineProfile", f2_arg1.controller )
|
||||
LUI.FlowManager.RequestLeaveMenu( f2_arg0 )
|
||||
end
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIGenericButton",
|
||||
id = "offile_profile_load_btn",
|
||||
properties = {
|
||||
style = GenericButtonSettings.Styles.GlassButton,
|
||||
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
||||
text = Engine.Localize( "@MENU_LOAD_EXISTING_OFFLINE_PROFILE" ),
|
||||
button_action_func = function ( f3_arg0, f3_arg1 )
|
||||
DebugPrint( "button offile_profile_load_btn press" )
|
||||
Engine.Exec( "loadOfflineProfile", f3_arg1.controller )
|
||||
LUI.FlowManager.RequestLeaveMenu( f3_arg0 )
|
||||
end
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIGenericButton",
|
||||
id = "offile_profile_delete_btn",
|
||||
properties = {
|
||||
style = GenericButtonSettings.Styles.GlassButton,
|
||||
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
||||
text = Engine.Localize( "@MENU_DELETE_OFFLINE_PROFILE" ),
|
||||
button_action_func = function ( f4_arg0, f4_arg1 )
|
||||
DebugPrint( "button offile_profile_delete_btn press" )
|
||||
Engine.Exec( "deleteOfflineProfile", f4_arg1.controller )
|
||||
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
|
||||
end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function OnCreatePS3ProfileMenu( f5_arg0, f5_arg1 )
|
||||
DebugPrint( "On Create PS3 profile menu" )
|
||||
Engine.ExecNow( "incnosplitscreencontrol menu_ps3_profile" )
|
||||
end
|
||||
|
||||
function OnClosePS3ProfileMenu( f6_arg0, f6_arg1 )
|
||||
DebugPrint( "On Close PS3 profile menu" )
|
||||
Engine.ExecNow( "decnosplitscreencontrol menu_ps3_profile" )
|
||||
local f6_local0 = Engine.GetLuiRoot()
|
||||
if f6_local0:IsMenuOpenAndVisible( "menu_splitscreensignin" ) and not f6_local0:IsMenuOpenAndVisible( "menu_resetstats_warning" ) and not f6_local0:IsMenuOpenAndVisible( "menu_ps3_savegame_warning" ) then
|
||||
Engine.Exec( "startsplitscreensignin" )
|
||||
end
|
||||
end
|
||||
|
||||
function menu_ps3_profile()
|
||||
return {
|
||||
type = "generic_selectionList_popup",
|
||||
id = "offline_profile_management_popup",
|
||||
properties = {
|
||||
popup_title = Engine.Localize( "@MENU_LOAD_OFFLINE_PROFILE" ),
|
||||
popup_childfeeder = profileMenuOptionsFeeder
|
||||
},
|
||||
handlers = {
|
||||
menu_create = OnCreatePS3ProfileMenu,
|
||||
menu_close = OnClosePS3ProfileMenu
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function SaveErrorContinue( f8_arg0, f8_arg1 )
|
||||
DebugPrint( "Save Error Continue" )
|
||||
if Engine.GetDvarBool( "splitscreen" ) then
|
||||
Engine.Exec( "endsplitscreensignin" )
|
||||
LUI.FlowManager.RequestAddMenu( f8_arg0, "menu_gamesetup_splitscreen", false, f8_arg1.controller, false, {} )
|
||||
else
|
||||
assert( f8_arg0.properties.callback_params.continue_to_menu )
|
||||
LUI.FlowManager.RequestOldMenu( f8_arg0, f8_arg0.properties.callback_params.continue_to_menu, false )
|
||||
end
|
||||
end
|
||||
|
||||
function SaveErrorReturn( f9_arg0, f9_arg1 )
|
||||
DebugPrint( "Save Error Cancel" )
|
||||
if Engine.GetDvarBool( "splitscreen" ) then
|
||||
Engine.Exec( "startsplitscreensignin" )
|
||||
end
|
||||
end
|
||||
|
||||
function GetSomeText()
|
||||
return "my cool text"
|
||||
end
|
||||
|
||||
function menu_ps3_savegame_error()
|
||||
return {
|
||||
type = "generic_yesno_popup",
|
||||
properties = {
|
||||
message_text = Engine.UserWithoutOfflineProfile(),
|
||||
popup_title = Engine.Localize( "@MENU_SAVE_ERROR_MP" ),
|
||||
yes_text = Engine.Localize( "@MENU_RESUMEGAME_NOSAVE_MP" ),
|
||||
no_text = Engine.Localize( "@MENU_RETURN_SIGNIN_MP" ),
|
||||
yes_action = SaveErrorContinue,
|
||||
no_action = SaveErrorReturn
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerDef( "menu_ps3_profile", menu_ps3_profile )
|
||||
LUI.MenuBuilder.registerDef( "menu_ps3_savegame_error", menu_ps3_savegame_error )
|
||||
LockTable( _M )
|
123
lui/common_menus/rankutils.dec.lua
Normal file
123
lui/common_menus/rankutils.dec.lua
Normal file
@ -0,0 +1,123 @@
|
||||
Rank = {}
|
||||
RankTable = {
|
||||
File = "mp/rankTable.csv",
|
||||
AlienFile = "mp/alien/rankTable.csv",
|
||||
Cols = {
|
||||
RankId = 0,
|
||||
Rank = 1,
|
||||
MinXp = 2,
|
||||
XpToNextLevel = 3,
|
||||
ShortRankName = 4,
|
||||
FullRankName = 5,
|
||||
RankIcon = 6,
|
||||
MaxXp = 7,
|
||||
Level = 13,
|
||||
DisplayLevel = 14,
|
||||
InGameRank = 16,
|
||||
UnlockString = 17
|
||||
}
|
||||
}
|
||||
RankIconTable = {
|
||||
File = "mp/rankIconTable.csv",
|
||||
AlienFile = "mp/alien/rankIconTable.csv",
|
||||
Cols = {
|
||||
RankId = 0,
|
||||
Standard = 1,
|
||||
Prestige1 = 2
|
||||
}
|
||||
}
|
||||
Rank.GetMaxRank = function ( f1_arg0 )
|
||||
local f1_local0 = nil
|
||||
if not f1_arg0 or f1_arg0 == CoD.PlayMode.Core or f1_arg0 == CoD.PlayMode.SquadVsSquad then
|
||||
f1_local0 = tonumber( Engine.TableLookup( RankTable.File, 0, "maxrank", 1 ) )
|
||||
assert( f1_local0 ~= nil, "Rank.GetMaxRank() : Could not read max rank (MP)" )
|
||||
elseif f1_arg0 == CoD.PlayMode.Aliens then
|
||||
f1_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, 0, "maxrank", 1 ) )
|
||||
assert( f1_local0 ~= nil, "Rank.GetMaxRank() : Could not read max rank (ALIENS)" )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetMaxRank() : Unsupported CodPlayMode [" .. f1_arg0 .. "]!" )
|
||||
f1_local0 = 0
|
||||
end
|
||||
return f1_local0
|
||||
end
|
||||
|
||||
Rank.GetRankDisplay = function ( f2_arg0, f2_arg1 )
|
||||
local f2_local0 = nil
|
||||
if not f2_arg1 or f2_arg1 == CoD.PlayMode.Core or f2_arg1 == CoD.PlayMode.SquadVsSquad then
|
||||
f2_local0 = Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f2_arg0, RankTable.Cols.DisplayLevel )
|
||||
elseif f2_arg1 == CoD.PlayMode.Aliens then
|
||||
f2_local0 = Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f2_arg0, RankTable.Cols.DisplayLevel )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetRankDisplay() : Unsupported CodPlayMode [" .. f2_arg1 .. "]!" )
|
||||
f2_local0 = ""
|
||||
end
|
||||
return f2_local0
|
||||
end
|
||||
|
||||
Rank.GetRankMinXP = function ( f3_arg0, f3_arg1 )
|
||||
local f3_local0 = nil
|
||||
if not f3_arg1 or f3_arg1 == CoD.PlayMode.Core or f3_arg1 == CoD.PlayMode.SquadVsSquad then
|
||||
f3_local0 = tonumber( Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f3_arg0, RankTable.Cols.MinXp ) )
|
||||
elseif f3_arg1 == CoD.PlayMode.Aliens then
|
||||
f3_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f3_arg0, RankTable.Cols.MinXp ) )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetRankMinXP() : Unsupported CodPlayMode [" .. f3_arg1 .. "]!" )
|
||||
f3_local0 = 0
|
||||
end
|
||||
return f3_local0
|
||||
end
|
||||
|
||||
Rank.GetRankMaxXP = function ( f4_arg0, f4_arg1 )
|
||||
local f4_local0 = nil
|
||||
if not f4_arg1 or f4_arg1 == CoD.PlayMode.Core or f4_arg1 == CoD.PlayMode.SquadVsSquad then
|
||||
f4_local0 = tonumber( Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f4_arg0, RankTable.Cols.MaxXp ) )
|
||||
assert( f4_local0 ~= nil, "Rank.GetRankMaxXP() : Could not read max XP for rank (MP)" )
|
||||
elseif f4_arg1 == CoD.PlayMode.Aliens then
|
||||
f4_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f4_arg0, RankTable.Cols.MaxXp ) )
|
||||
assert( f4_local0 ~= nil, "Rank.GetRankMaxXP() : Could not read max XP for rank (ALIENS)" )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetRankMaxXP() : Unsupported CodPlayMode [" .. f4_arg1 .. "]!" )
|
||||
f4_local0 = 0
|
||||
end
|
||||
return f4_local0
|
||||
end
|
||||
|
||||
Rank.GetRankXPToNext = function ( f5_arg0, f5_arg1 )
|
||||
local f5_local0 = nil
|
||||
if not f5_arg1 or f5_arg1 == CoD.PlayMode.Core or f5_arg1 == CoD.PlayMode.SquadVsSquad then
|
||||
f5_local0 = tonumber( Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f5_arg0, RankTable.Cols.XpToNextLevel ) )
|
||||
elseif f5_arg1 == CoD.PlayMode.Aliens then
|
||||
f5_local0 = tonumber( Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f5_arg0, RankTable.Cols.XpToNextLevel ) )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetRankXPToNext() : Unsupported CodPlayMode [" .. f5_arg1 .. "]!" )
|
||||
f5_local0 = 0
|
||||
end
|
||||
return f5_local0
|
||||
end
|
||||
|
||||
Rank.GetRankIcon = function ( f6_arg0, f6_arg1, f6_arg2 )
|
||||
local f6_local0 = nil
|
||||
if not f6_arg2 or f6_arg2 == CoD.PlayMode.Core or f6_arg2 == CoD.PlayMode.SquadVsSquad then
|
||||
f6_local0 = Engine.TableLookup( RankIconTable.File, RankIconTable.Cols.RankId, f6_arg0, RankIconTable.Cols.Standard + f6_arg1 )
|
||||
elseif f6_arg2 == CoD.PlayMode.Aliens then
|
||||
f6_local0 = Engine.TableLookup( RankIconTable.AlienFile, RankIconTable.Cols.RankId, f6_arg0, RankIconTable.Cols.Standard + f6_arg1 )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetRankIcon() : Unsupported CodPlayMode [" .. f6_arg2 .. "]!" )
|
||||
f6_local0 = ""
|
||||
end
|
||||
return f6_local0
|
||||
end
|
||||
|
||||
Rank.GetFullRank = function ( f7_arg0, f7_arg1 )
|
||||
local f7_local0 = nil
|
||||
if not f7_arg1 or f7_arg1 == CoD.PlayMode.Core or f7_arg1 == CoD.PlayMode.SquadVsSquad then
|
||||
f7_local0 = Engine.Localize( "@" .. Engine.TableLookup( RankTable.File, RankTable.Cols.RankId, f7_arg0, RankTable.Cols.FullRankName ) )
|
||||
elseif f7_arg1 == CoD.PlayMode.Aliens then
|
||||
f7_local0 = Engine.Localize( "@" .. Engine.TableLookup( RankTable.AlienFile, RankTable.Cols.RankId, f7_arg0, RankTable.Cols.FullRankName ) )
|
||||
else
|
||||
DebugPrint( "[WARNING] Rank.GetFullRank() : Unsupported CodPlayMode [" .. f7_arg1 .. "]!" )
|
||||
f7_local0 = ""
|
||||
end
|
||||
return f7_local0
|
||||
end
|
||||
|
129
lui/common_menus/virtualkeyboard.dec.lua
Normal file
129
lui/common_menus/virtualkeyboard.dec.lua
Normal file
@ -0,0 +1,129 @@
|
||||
local f0_local0 = module
|
||||
local f0_local1, f0_local2 = ...
|
||||
f0_local0( f0_local1, package.seeall )
|
||||
CoD.PrintModuleLoad( _NAME )
|
||||
function ExitVirtualKeyboard( f1_arg0, f1_arg1, f1_arg2 )
|
||||
local f1_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f1_arg0 )
|
||||
if f1_local0.exiting then
|
||||
return
|
||||
end
|
||||
f1_local0.exiting = true
|
||||
f1_arg0:dispatchEventToRoot( {
|
||||
name = "exit_virtual_keyboard",
|
||||
immediate = true
|
||||
} )
|
||||
if Engine.TriggerVirtualKeyboardCallback then
|
||||
local f1_local1 = Engine.TriggerVirtualKeyboardCallback
|
||||
local f1_local2 = f1_arg1.controller
|
||||
local f1_local3 = f1_arg2
|
||||
local f1_local4
|
||||
if not f1_arg2 then
|
||||
f1_local4 = f1_local0.input
|
||||
if not f1_local4 then
|
||||
|
||||
else
|
||||
f1_local1( f1_local2, f1_local3, f1_local4, f1_local0.verifyString or false )
|
||||
end
|
||||
end
|
||||
f1_local4 = ""
|
||||
end
|
||||
end
|
||||
|
||||
function input_popup( f2_arg0, f2_arg1 )
|
||||
local f2_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "virtual_keyboard" )
|
||||
local f2_local1 = f2_arg1.keyboardType
|
||||
if not f2_local1 then
|
||||
f2_local1 = CoD.KeyboardInputTypes.Normal
|
||||
end
|
||||
local f2_local2
|
||||
if f2_local1 == CoD.KeyboardInputTypes.Email then
|
||||
f2_local2 = 1000
|
||||
if not f2_local2 then
|
||||
|
||||
else
|
||||
local f2_local3 = f2_local1 == CoD.KeyboardInputTypes.Password
|
||||
local f2_local4 = f2_arg1.use_auto_align or false
|
||||
local f2_local5 = LUI.MenuGenerics.generic_selectionList_popup( {}, {
|
||||
popup_title = f2_arg1.title,
|
||||
popup_width = f2_local2,
|
||||
popup_childfeeder = function ()
|
||||
return {
|
||||
{
|
||||
type = "generic_input_field",
|
||||
id = "not_so_virtual_input",
|
||||
requireFocusType = FocusType.MouseOver,
|
||||
properties = {
|
||||
keyboard_type = f2_local1,
|
||||
password_field = f2_local3,
|
||||
use_auto_align = f2_local4,
|
||||
max_length = f2_local0.maxLength,
|
||||
help_value = f2_local0.input,
|
||||
field_edited_func = function ( f4_arg0, f4_arg1 )
|
||||
local f4_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f4_arg0 )
|
||||
f4_local0.input = f4_arg1.text or ""
|
||||
if f4_local0.exiting then
|
||||
return
|
||||
else
|
||||
f4_arg1.controller = f4_local0.exclusiveController
|
||||
ExitVirtualKeyboard( f4_arg0, f4_arg1, f4_arg1.cancelled )
|
||||
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
|
||||
end
|
||||
end
|
||||
,
|
||||
additional_handlers = {
|
||||
menu_create = MBh.EmitEvent( {
|
||||
name = "button_action",
|
||||
mouse = true
|
||||
} ),
|
||||
exit_virtual_keyboard = function ( f5_arg0, f5_arg1 )
|
||||
f5_arg0:processEvent( {
|
||||
name = "finish_editing"
|
||||
} )
|
||||
end
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIGenericButton",
|
||||
id = "input_ok",
|
||||
audio = {
|
||||
button_over = CoD.SFX.SubMenuMouseOver
|
||||
},
|
||||
properties = {
|
||||
style = GenericButtonSettings.Styles.GlassButton,
|
||||
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
||||
text = Engine.Localize( "MENU_OK" ),
|
||||
button_action_func = function ( f6_arg0, f6_arg1 )
|
||||
ExitVirtualKeyboard( f6_arg0, f6_arg1, false )
|
||||
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
|
||||
end
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
} )
|
||||
f2_local5:registerEventHandler( "popup_back", function ( element, event )
|
||||
ExitVirtualKeyboard( element, event, true )
|
||||
end )
|
||||
f2_local5:dispatchEventToRoot( {
|
||||
name = "virtual_keyboard_popup_active",
|
||||
immediate = true
|
||||
} )
|
||||
return f2_local5
|
||||
end
|
||||
end
|
||||
f2_local2 = nil
|
||||
end
|
||||
|
||||
function virtual_keyboard( f8_arg0, f8_arg1 )
|
||||
local f8_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "virtual_keyboard" )
|
||||
f8_local0.input = f8_arg1.defaultText or ""
|
||||
f8_local0.maxLength = f8_arg1.maxLength or 12
|
||||
f8_local0.verifyString = f8_arg1.verifyString or false
|
||||
return input_popup( f8_arg0, f8_arg1 )
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerType( "virtual_keyboard", virtual_keyboard )
|
||||
LockTable( _M )
|
372
lui/common_menus/whatcanisay.dec.lua
Normal file
372
lui/common_menus/whatcanisay.dec.lua
Normal file
@ -0,0 +1,372 @@
|
||||
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 )
|
||||
Kinect.CloseWhatCanISayMenu( f1_arg0, f1_arg1 )
|
||||
end
|
||||
|
||||
function TitleFactory( f2_arg0, f2_arg1 )
|
||||
return {
|
||||
type = "UIText",
|
||||
id = "text_whatcanisay_" .. tostring( f2_arg0 ),
|
||||
properties = {
|
||||
text = Engine.Localize( f2_arg1 )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
height = CoD.TextSettings.ExtraBigFont.Height,
|
||||
font = CoD.TextSettings.ExtraBigFont.Font,
|
||||
alignment = LUI.Alignment.Left,
|
||||
width = 600,
|
||||
r = 1,
|
||||
g = 1,
|
||||
b = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function BlankFactory( f3_arg0 )
|
||||
return {
|
||||
type = "UIText",
|
||||
id = "text_whatcanisay_" .. tostring( f3_arg0 ),
|
||||
properties = {
|
||||
text = ""
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
height = 20,
|
||||
font = CoD.TextSettings.ExtraBigFont.Font,
|
||||
alignment = LUI.Alignment.Left,
|
||||
width = 600,
|
||||
r = 1,
|
||||
g = 1,
|
||||
b = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function TextFactory( f4_arg0, f4_arg1, f4_arg2 )
|
||||
local f4_local0
|
||||
if f4_arg2 then
|
||||
f4_local0 = 200
|
||||
if not f4_local0 then
|
||||
|
||||
else
|
||||
return {
|
||||
type = "UIText",
|
||||
id = "text_whatcanisay_" .. tostring( f4_arg0 ),
|
||||
properties = {
|
||||
text = Engine.Localize( f4_arg1 )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
height = CoD.TextSettings.NormalFont.Height,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
alignment = LUI.Alignment.Left,
|
||||
width = f4_local0
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
end
|
||||
f4_local0 = 370
|
||||
end
|
||||
|
||||
function BigTextFactory( f5_arg0, f5_arg1 )
|
||||
return {
|
||||
type = "UIText",
|
||||
id = "text_whatcanisay_" .. tostring( f5_arg0 ),
|
||||
properties = {
|
||||
text = Engine.Localize( f5_arg1 )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
height = CoD.TextSettings.BigFont.Height,
|
||||
font = CoD.TextSettings.BigFont.Font,
|
||||
alignment = LUI.Alignment.Left,
|
||||
width = 600
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function DescFactory( f6_arg0, f6_arg1 )
|
||||
return {
|
||||
type = "UIText",
|
||||
id = "text_whatcanisay_" .. tostring( f6_arg0 ),
|
||||
properties = {
|
||||
text = Engine.Localize( f6_arg1 )
|
||||
},
|
||||
states = {
|
||||
default = {
|
||||
height = CoD.TextSettings.NormalFont.Height,
|
||||
font = CoD.TextSettings.NormalFont.Font,
|
||||
alignment = LUI.Alignment.Left,
|
||||
width = 600,
|
||||
red = 0.75,
|
||||
green = 0.75,
|
||||
blue = 0.75
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
function GrammarFeeder( f7_arg0 )
|
||||
local f7_local0 = {}
|
||||
if Engine.InFrontend() then
|
||||
local f7_local1 = false
|
||||
if Kinect.menu_under_what_can_i_say then
|
||||
if string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "main_lockout" ) then
|
||||
f7_local1 = true
|
||||
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "boot_brightness" ) then
|
||||
f7_local1 = true
|
||||
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "boot_screen_margins" ) then
|
||||
f7_local1 = true
|
||||
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "no_profile_warning_popmenu" ) then
|
||||
f7_local1 = true
|
||||
end
|
||||
end
|
||||
if f7_local1 == true then
|
||||
|
||||
elseif Kinect.IsKinectGuideUp() then
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_SAY_GHOSTS_AND_ONE_OF_THE_FOLLOWING" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_KINECT_GUIDE_COMMANDS_CAPS" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_SHORTCUT_1_TO_9", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_SHORTCUT_1_TO_9_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_CANCEL_BACK", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_CANCEL_BACK_COMMAND" )
|
||||
else
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_SAY_GHOSTS_AND_ONE_OF_THE_FOLLOWING" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_GENERAL_COMMANDS_CAPS" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_SHORTCUTS_1", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_SHORTCUTS_COMMAND" )
|
||||
local f7_local2 = false
|
||||
if Kinect.menu_under_what_can_i_say then
|
||||
if string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "menu_xboxlive_lobby" ) then
|
||||
f7_local2 = true
|
||||
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "menu_xboxlive_privatelobby" ) then
|
||||
f7_local2 = true
|
||||
elseif string.lower( Kinect.menu_under_what_can_i_say ) == string.lower( "menu_xboxlive" ) then
|
||||
f7_local2 = true
|
||||
end
|
||||
end
|
||||
if f7_local2 == true then
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_LOBBY_COMMANDS_CAPS" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
if Kinect.DISABLE_CERTAIN_LOBBY_MUTE_AND_COMPARE_OPERATIONS == true then
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL_COMMAND" )
|
||||
else
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_UNMUTE", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_UNMUTE_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_ALL_UNMUTE_ALL_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_NON_FRIENDS", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_NON_FRIENDS_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_MUTE_NON_PARTY", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_MUTE_NON_PARTY_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_COMPARE", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_COMPARE_COMMAND" )
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif not Engine.IsMultiplayer() then
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_GENERAL_COMMANDS_CAPS" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_GHOST_PAUSE_GHOST_PLAY", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_PAUSE_PLAY_COMMAND" )
|
||||
local f7_local1 = Engine.GetDvarString( "mapname" )
|
||||
if f7_local1 == "enemyhq" or f7_local1 == "nml" then
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_ATTACK_1", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_ATTACK_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_CANCEL_1", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_CANCEL_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BARK_1", true )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_BARK_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TitleFactory( #f7_local0, "@SPEECH_SPECIFIC_COMMMAND_CAPS" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = DescFactory( #f7_local0, "@SPEECH_LOCATION_COMMAND" )
|
||||
f7_local0[#f7_local0 + 1] = BlankFactory( #f7_local0 )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_DOOR" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_WINDOW" )
|
||||
if f7_local1 == "enemyhq" then
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_COUNTER" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_STAIRS" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_STATUE" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_WALKWAY" )
|
||||
elseif f7_local1 == "nml" then
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BALCONY" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BRIDGE" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_BUILDING" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_CAR" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_GARAGE" )
|
||||
f7_local0[#f7_local0 + 1] = TextFactory( #f7_local0, "@SPEECH_TRAILER" )
|
||||
end
|
||||
end
|
||||
end
|
||||
if #f7_local0 == 0 then
|
||||
if Engine.InFrontend() then
|
||||
f7_local0[#f7_local0 + 1] = BigTextFactory( #f7_local0, "@SPEECH_NO_VOICE_COMMANDS_FRONT_END" )
|
||||
else
|
||||
f7_local0[#f7_local0 + 1] = BigTextFactory( #f7_local0, "@SPEECH_NO_VOICE_COMMANDS_IN_GAME" )
|
||||
end
|
||||
end
|
||||
return f7_local0
|
||||
end
|
||||
|
||||
function OptionsMainCreate( f8_arg0, f8_arg1 )
|
||||
f8_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
||||
end
|
||||
|
||||
function what_can_i_say_vlist()
|
||||
return {
|
||||
type = "UIGrid",
|
||||
states = {
|
||||
default = {
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
left = 120,
|
||||
right = -120,
|
||||
top = 110,
|
||||
bottom = -60
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
elementsPerRow = 2,
|
||||
hSpacing = 10,
|
||||
rowHeight = 33,
|
||||
hAlign = LUI.Alignment.Left,
|
||||
vAlign = LUI.Alignment.Top
|
||||
},
|
||||
childrenFeeder = GrammarFeeder
|
||||
}
|
||||
end
|
||||
|
||||
function WhatCanISayHandleSpeechActionBack( f10_arg0, f10_arg1, f10_arg2 )
|
||||
if Kinect.IsWhatCanISayMenuUp() then
|
||||
f0_local0( f10_arg0, f10_arg1 )
|
||||
LUI.Speech.PerformingSpeechAction()
|
||||
end
|
||||
end
|
||||
|
||||
if Engine.HasSpeechFeature() then
|
||||
WhatCanISaySpeechGrammarHandlersArray = {
|
||||
{
|
||||
action = "back",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = WhatCanISayHandleSpeechActionBack,
|
||||
extradata = nil
|
||||
},
|
||||
{
|
||||
action = "cancel",
|
||||
confidence = LUI.Speech.defaultConfidence,
|
||||
handler = WhatCanISayHandleSpeechActionBack,
|
||||
extradata = nil
|
||||
}
|
||||
}
|
||||
else
|
||||
WhatCanISaySpeechGrammarHandlersArray = {}
|
||||
end
|
||||
function WhatCanISayHandleSpeechAction( f11_arg0, f11_arg1 )
|
||||
if Engine.HasSpeechFeature() then
|
||||
LUI.Speech.ProcessActionEvent( f11_arg0, f11_arg1, WhatCanISaySpeechGrammarHandlersArray )
|
||||
end
|
||||
end
|
||||
|
||||
function what_can_i_say()
|
||||
return {
|
||||
type = "UIElement",
|
||||
id = "what_can_i_say_id",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0
|
||||
}
|
||||
},
|
||||
handlers = {
|
||||
menu_create = OptionsMainCreate,
|
||||
speech_action = WhatCanISayHandleSpeechAction
|
||||
},
|
||||
children = {
|
||||
{
|
||||
type = "UIWorldBlur",
|
||||
id = "world_blur_id",
|
||||
states = {
|
||||
default = {
|
||||
worldBlur = 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "UIImage",
|
||||
id = "options_background",
|
||||
states = {
|
||||
default = {
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
left = 0,
|
||||
right = 0,
|
||||
alpha = 0.95,
|
||||
material = RegisterMaterial( "black" )
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "generic_menu_title",
|
||||
properties = {
|
||||
menu_title = Engine.Localize( "@SPEECH_WHATCANISAY_CAPS" )
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "what_can_i_say_vlist",
|
||||
id = "what_can_i_say_vlist_id"
|
||||
},
|
||||
{
|
||||
type = "button_helper_text_main",
|
||||
id = "button_helper_text_id"
|
||||
},
|
||||
{
|
||||
type = "UIBindButton",
|
||||
id = "back_button",
|
||||
handlers = {
|
||||
button_start = f0_local0,
|
||||
button_select = f0_local0,
|
||||
button_secondary = f0_local0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerDef( "what_can_i_say_vlist", what_can_i_say_vlist )
|
||||
LUI.MenuBuilder.registerDef( "what_can_i_say", what_can_i_say )
|
||||
LockTable( _M )
|
Reference in New Issue
Block a user