1409 lines
44 KiB
Lua
1409 lines
44 KiB
Lua
Lobby = Lobby or {}
|
|
if Engine.InFrontend() then
|
|
Lobby.MemberListStates = {
|
|
None = 0,
|
|
Prelobby = 1,
|
|
Lobby = 2,
|
|
Teams = 3
|
|
}
|
|
Lobby.MaxMemberListSlots = 18
|
|
Lobby.MemberListRefreshTime = 1000
|
|
Lobby.TransitionTime = 750
|
|
Lobby.MemberListMemberHeight = 26
|
|
Lobby.MemberListSquadMemberHeight = 25
|
|
Lobby.PasswordLength = 24
|
|
Lobby.Teams = {
|
|
Free = 0,
|
|
Bad = 0,
|
|
Axis = 1,
|
|
Allies = 2
|
|
}
|
|
Lobby.BotTeams = {
|
|
Friendly = 0,
|
|
Enemy = 1,
|
|
FFA = 2
|
|
}
|
|
Lobby.CurrGenBotLimit = 12
|
|
Lobby.NextGenBotLimit = 18
|
|
Lobby.BotDifficulties = {
|
|
Recruit = 0,
|
|
Regular = 1,
|
|
Hardened = 2,
|
|
Veteran = 3,
|
|
Mixed = 4
|
|
}
|
|
Lobby.CustomizationTypes = {
|
|
Head = 0,
|
|
Body = 1,
|
|
ViewHands = 2
|
|
}
|
|
local f0_local0 = Lobby
|
|
local f0_local1 = {
|
|
Min = 0,
|
|
Max = 2
|
|
}
|
|
local f0_local2 = {
|
|
[0] = "PATCH_MENU_OPEN"
|
|
}
|
|
local f0_local3 = "PATCH_MENU_FRIENDS_ONLY"
|
|
local f0_local4 = "PATCH_MENU_CLOSED"
|
|
f0_local2[1] = f0_local3
|
|
f0_local2[2] = f0_local4
|
|
f0_local1.Texts = f0_local2
|
|
f0_local0.PrivacySettings = f0_local1
|
|
Lobby.MemberStatTypes = {
|
|
Score = 0,
|
|
Divider = 1,
|
|
Deaths = 2,
|
|
BestWeapon = 3,
|
|
Wins = 4,
|
|
KDRatio = 5,
|
|
CurrentWinStreak = 6,
|
|
GamesPlayed = 7,
|
|
WinLossRatio = 8,
|
|
TimePlayed = 9,
|
|
Revives = 10,
|
|
Escapes = 11,
|
|
NerfEscapes = 12,
|
|
AliensKilled = 13
|
|
}
|
|
MapVoting = {
|
|
MapA = {
|
|
refNum = 0,
|
|
voteIndex = 1
|
|
},
|
|
MapB = {
|
|
refNum = 1,
|
|
voteIndex = 2
|
|
}
|
|
}
|
|
Lobby.UnlockTypes = {
|
|
PERK = "perk",
|
|
FEATURE = "feature",
|
|
PROFILE_FEATURE = "profileFeature",
|
|
TITLE = "title",
|
|
ICON = "icon",
|
|
KILLSTREAK = "killstreak",
|
|
CHALLENGE = "challenge",
|
|
PRESTIGE = "prestige",
|
|
WEAPON = "weapon",
|
|
WEAPON_ATTACHMENT = "weaponAttachment",
|
|
WEAPON_CAMO = "weaponCamo",
|
|
WEAPON_BUFF = "weaponBuff",
|
|
WEAPON_RETICLE = "weaponReticle"
|
|
}
|
|
Lobby.Swatch = {
|
|
axis = Colors.orange,
|
|
allies = Colors.cyan,
|
|
party_member = Colors.seafoam_blue
|
|
}
|
|
f0_local0 = {
|
|
Title = "@LUA_MENU_DOUBLE_XP_REMAINING",
|
|
Visible = function ( f1_arg0, f1_arg1, f1_arg2 )
|
|
if CoD.GetStatsGroupForGameMode() ~= CoD.StatsGroup.Ranked then
|
|
return false
|
|
elseif not Lobby.IsMemberALocalPlayer( f1_arg0, f1_arg1, f1_arg2 ) then
|
|
return false
|
|
else
|
|
local f1_local0 = Lobby.GetMemberControllerIndex( f1_arg0, f1_arg1, f1_arg2 )
|
|
local f1_local1 = Engine.GetPlayerDataEx( f1_local0, CoD.GetStatsGroupForGameMode(), "xpMaxMultiplierTimePlayed", 0 )
|
|
local f1_local2 = Engine.GetPlayerDataEx( f1_local0, CoD.GetStatsGroupForGameMode(), "xpMultiplierTimePlayed", 0 )
|
|
if not f1_local2 or not f1_local1 then
|
|
return false
|
|
else
|
|
return f1_local2 < f1_local1
|
|
end
|
|
end
|
|
end,
|
|
Getter = function ( f2_arg0, f2_arg1, f2_arg2 )
|
|
if CoD.GetStatsGroupForGameMode() ~= CoD.StatsGroup.Ranked then
|
|
return ""
|
|
elseif not Lobby.IsMemberALocalPlayer( f2_arg0, f2_arg1, f2_arg2 ) then
|
|
return ""
|
|
else
|
|
local f2_local0 = Lobby.GetMemberControllerIndex( f2_arg0, f2_arg1, f2_arg2 )
|
|
local f2_local1 = Engine.GetPlayerDataEx( f2_local0, CoD.GetStatsGroupForGameMode(), "xpMaxMultiplierTimePlayed", 0 )
|
|
local f2_local2 = Engine.GetPlayerDataEx( f2_local0, CoD.GetStatsGroupForGameMode(), "xpMultiplierTimePlayed", 0 )
|
|
if not f2_local2 or not f2_local1 then
|
|
return 0
|
|
else
|
|
return Engine.FormatTimeHoursMinutesSeconds( f2_local1 - f2_local2 )
|
|
end
|
|
end
|
|
end
|
|
}
|
|
Lobby.PlayerStatsCategories = {
|
|
{
|
|
Title = "@LUA_MENU_KD_RATIO",
|
|
Type = Lobby.MemberStatTypes.KDRatio
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_PREFERRED_WEAPON",
|
|
Type = Lobby.MemberStatTypes.BestWeapon
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_CURRENT_STREAK",
|
|
Type = Lobby.MemberStatTypes.CurrentWinStreak
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_WINS",
|
|
Type = Lobby.MemberStatTypes.Wins
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_GAMES_PLAYED",
|
|
Type = Lobby.MemberStatTypes.GamesPlayed
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_WL_RATIO",
|
|
Type = Lobby.MemberStatTypes.WinLossRatio
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_TIME_PLAYED",
|
|
Type = Lobby.MemberStatTypes.TimePlayed
|
|
},
|
|
f0_local0
|
|
}
|
|
Lobby.SquadsPlayerStatsCategories = {
|
|
{
|
|
Title = "@LUA_MENU_WINS",
|
|
Type = Lobby.MemberStatTypes.Wins
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_CURRENT_STREAK",
|
|
Type = Lobby.MemberStatTypes.CurrentWinStreak
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_WL_RATIO",
|
|
Type = Lobby.MemberStatTypes.WinLossRatio
|
|
},
|
|
f0_local0
|
|
}
|
|
Lobby.AliensPlayerStatsCategories = {
|
|
{
|
|
Title = "@LUA_MENU_ESCAPES",
|
|
Type = Lobby.MemberStatTypes.Escapes
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_NERFESCAPES",
|
|
Type = Lobby.MemberStatTypes.NerfEscapes
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_REVIVES",
|
|
Type = Lobby.MemberStatTypes.Revives
|
|
},
|
|
{
|
|
Title = "@LUA_MENU_ALIENS_KILLED",
|
|
Type = Lobby.MemberStatTypes.AliensKilled
|
|
},
|
|
f0_local0
|
|
}
|
|
function OpenCoDAnywhere( f3_arg0 )
|
|
if Engine.GetDvarInt( "ca_intra_only" ) == 1 then
|
|
if CoDAnywhere.ShouldShowLinkCreatePopup( f3_arg0, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( nil, "cod_anywhere_popup_menu", true, f3_arg0 )
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( nil, "cod_anywhere_all_done_popup_menu", true, f3_arg0 )
|
|
end
|
|
elseif CoDAnywhere.ShouldShowLinkCreatePopup( f3_arg0, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( nil, "cod_anywhere_popup_menu", true, f3_arg0 )
|
|
elseif CoDAnywhere.ShouldShowLinkUCDPopup( f3_arg0, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( nil, "cod_anywhere_link_ucd_popup_menu", true, f3_arg0 )
|
|
else
|
|
CoDAnywhere.DownloadNonUCDPlatforms( f3_arg0 )
|
|
end
|
|
end
|
|
|
|
function clearMatchData()
|
|
Engine.ClearMatchData()
|
|
Engine.ClearUnlockData()
|
|
end
|
|
|
|
function isNavMenuOnTop()
|
|
local f5_local0 = false
|
|
if LUI.FlowManager.IsTopMenuModal() then
|
|
return false
|
|
end
|
|
local f5_local1 = Engine.GetLuiRoot()
|
|
local f5_local2 = ""
|
|
if f5_local1 then
|
|
local f5_local3 = LUI.FlowManager.GetTopMenuInfo( f5_local1.flowManager.menuInfoStack )
|
|
if f5_local3 and f5_local3.name then
|
|
f5_local2 = f5_local3.name
|
|
end
|
|
end
|
|
local f5_local3
|
|
if f5_local2 ~= "menu_xboxlive" and f5_local2 ~= "menu_xboxlive_privatelobby" and f5_local2 ~= "menu_xboxlive_lobby" then
|
|
f5_local3 = false
|
|
else
|
|
f5_local3 = true
|
|
end
|
|
return f5_local3
|
|
end
|
|
|
|
function RefreshLargeMapImage( f6_arg0, f6_arg1 )
|
|
local f6_local0 = Engine.GetLuiRoot()
|
|
local f6_local1 = LUI.FlowManager.IsInStack( f6_local0.flowManager, "menu_xboxlive_privatelobby" )
|
|
local f6_local2 = LUI.FlowManager.IsInStack( f6_local0.flowManager, "menu_xboxlive_lobby" )
|
|
local f6_local3 = LUI.FlowManager.IsInStack( f6_local0.flowManager, "menu_gamesetup_systemlink" ) or f6_local1 or f6_local2 or LUI.FlowManager.IsInStack( f6_local0.flowManager, "menu_gamesetup_splitscreen" )
|
|
local f6_local4 = Engine.IsAliensMode()
|
|
if f6_local3 then
|
|
local f6_local5 = f6_arg0.properties.map
|
|
local f6_local6
|
|
if f6_local4 then
|
|
f6_local6 = GetLobbyBlurImage()
|
|
if not f6_local6 then
|
|
|
|
elseif f6_local2 then
|
|
if IsVotingFinished() and f6_local6 ~= "" then
|
|
if f6_local6 ~= f6_local5 then
|
|
f6_arg0.properties.map = f6_local6
|
|
f6_arg0:registerAnimationState( "default", {
|
|
material = RegisterMaterial( f6_local6 ),
|
|
alpha = 1
|
|
} )
|
|
f6_arg0:animateToState( "default", 1500 )
|
|
if f6_local4 then
|
|
LUI.mp_menus.Aliens.SwapExtinctionMapMusic( LUI.mp_menus.Aliens.GetExtinctionMapMusic() )
|
|
end
|
|
end
|
|
elseif f6_arg0.properties.map ~= "hidden" then
|
|
f6_arg0.properties.map = "hidden"
|
|
f6_arg0:animateToState( "hidden", 750 )
|
|
if f6_local4 then
|
|
LUI.mp_menus.Aliens.SwapExtinctionMapMusic( CoD.Music.MainExtinctMusic )
|
|
end
|
|
end
|
|
elseif f6_local6 ~= f6_local5 then
|
|
f6_arg0.properties.map = f6_local6
|
|
f6_arg0:registerAnimationState( "default", {
|
|
material = RegisterMaterial( f6_local6 ),
|
|
alpha = 1
|
|
} )
|
|
f6_arg0:animateToState( "default", 1500 )
|
|
if f6_local4 then
|
|
LUI.mp_menus.Aliens.SwapExtinctionMapMusic( LUI.mp_menus.Aliens.GetExtinctionMapMusic() )
|
|
end
|
|
end
|
|
end
|
|
f6_local6 = GetLobbyTransitionMapImage()
|
|
elseif f6_arg0.properties.map ~= "hidden" then
|
|
f6_arg0.properties.map = "hidden"
|
|
f6_arg0:animateToState( "hidden", 750 )
|
|
if f6_local4 then
|
|
LUI.mp_menus.Aliens.SwapExtinctionMapMusic( CoD.Music.MainExtinctMusic )
|
|
end
|
|
end
|
|
end
|
|
|
|
function ShowAliensCleanLobbyBkg( f7_arg0, f7_arg1 )
|
|
if Engine.IsAliensMode() then
|
|
f7_arg0:setImage( RegisterMaterial( GetLobbyTransitionMapImage() ) )
|
|
f7_arg0:animateToState( "visible", Lobby.TransitionTime * 0.7 )
|
|
end
|
|
end
|
|
|
|
function InitLargeMapImage( f8_arg0, f8_arg1 )
|
|
f8_arg0:animateToState( "hidden", 0 )
|
|
f8_arg0.properties.map = "hidden"
|
|
end
|
|
|
|
function GetLobbyTransitionMapImage()
|
|
local f9_local0 = Lobby.GetMapImage()
|
|
local f9_local1
|
|
if f9_local0 and f9_local0 ~= "" then
|
|
f9_local1 = f9_local0 .. "_lobby"
|
|
if not f9_local1 then
|
|
|
|
else
|
|
return f9_local1
|
|
end
|
|
end
|
|
f9_local1 = ""
|
|
end
|
|
|
|
function GetLobbyBlurImage()
|
|
return Lobby.GetMapImage() .. "_blur"
|
|
end
|
|
|
|
function HandleStartTransitionToGame( f11_arg0, f11_arg1 )
|
|
f11_arg0:processEvent( {
|
|
name = "lose_focus"
|
|
} )
|
|
LUI.UIRoot.BlockButtonInput( Engine.GetLuiRoot(), true, "MenuTransition" )
|
|
f11_arg0:dispatchEventToRoot( {
|
|
name = "lobby_transition_to_game",
|
|
dispatchChildren = true,
|
|
immediate = true
|
|
} )
|
|
end
|
|
|
|
function IsGameHost()
|
|
return Lobby.IsGameHost()
|
|
end
|
|
|
|
function IsNotGameHost()
|
|
return not IsGameHost()
|
|
end
|
|
|
|
function AreWePrivatePartyHost()
|
|
return Lobby.IsInPrivateParty() and Lobby.IsPrivatePartyHost()
|
|
end
|
|
|
|
function IsOurPrivatePartyHostInLobby()
|
|
local f15_local0 = Lobby.IsInPrivateParty()
|
|
local f15_local1 = Lobby.IsPrivatePartyHost()
|
|
local f15_local2 = Lobby.IsPrivatePartyHostInLobby()
|
|
local f15_local3 = f15_local0
|
|
local f15_local4
|
|
if not f15_local1 then
|
|
f15_local4 = f15_local2
|
|
else
|
|
f15_local4 = false
|
|
end
|
|
return f15_local4
|
|
end
|
|
|
|
function IsPublicMatch()
|
|
if Engine.GetDvarBool( "onlinegame" ) == true and Engine.GetDvarBool( "xblive_privatematch" ) == false then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function IsOfflineMatch()
|
|
return Engine.GetDvarBool( "onlinegame" ) == false
|
|
end
|
|
|
|
function IsVotingFinished()
|
|
local f18_local0 = Lobby.HasVotePassed()
|
|
local f18_local1 = Engine.GetDvarBool( "party_teamsVisible" )
|
|
if f18_local1 then
|
|
f18_local1 = Engine.GetDvarBool( "party_teamBased" )
|
|
end
|
|
local f18_local2
|
|
if Lobby.GetVoteMapName( MapVoting.MapA.refNum ) ~= Lobby.GetVoteMapName( MapVoting.MapB.refNum ) or Lobby.GetVoteMapGametype( MapVoting.MapA.refNum ) ~= Lobby.GetVoteMapGametype( MapVoting.MapB.refNum ) then
|
|
f18_local2 = false
|
|
else
|
|
f18_local2 = true
|
|
end
|
|
return f18_local1 or f18_local0 or f18_local2
|
|
end
|
|
|
|
function IsOnlineAliens()
|
|
return Engine.GetDvarBool( "onlinegame" ) and Engine.IsAliensMode()
|
|
end
|
|
|
|
function ExitLobby( f20_arg0, f20_arg1 )
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "exit_private_lobby",
|
|
dispatchChildren = true
|
|
} )
|
|
f20_arg0:dispatchEventToRoot( {
|
|
name = "exit_public_lobby"
|
|
} )
|
|
end
|
|
|
|
function TryForceOpenAfterActionReport( f21_arg0, f21_arg1 )
|
|
local f21_local0 = false
|
|
local f21_local1 = Engine.GetDvarBool( "ui_opensummary" )
|
|
local f21_local2 = Engine.IsAliensMode()
|
|
if f21_local1 then
|
|
local f21_local3 = Engine.GetFirstActiveController()
|
|
local f21_local4 = GetAARUnlockCount( f21_local3 ) > 0
|
|
if f21_arg1.controller then
|
|
f21_local3 = f21_arg1.controller
|
|
end
|
|
if IsPublicMatch() and not f21_local2 then
|
|
if f21_local4 then
|
|
OpenAfterActionReport( f21_arg0, {
|
|
name = "open_after_action_report",
|
|
controller = f21_local3
|
|
} )
|
|
else
|
|
ExpandMiniAAR( f21_arg0, f21_arg1, f21_local3 )
|
|
end
|
|
else
|
|
local f21_local5 = LUI.mp_menus.Aliens.ExtinctionLobbyGetOutroVideo( f21_local3 )
|
|
if f21_local5 and f21_local5 ~= "" and not LUI.mp_menus.Aliens.HasSeenVideo( f21_local3, f21_local5 ) then
|
|
LUI.mp_menus.Aliens.SetHasSeenVideo( f21_local3, f21_local5 )
|
|
LUI.mp_menus.Aliens.AliensPlayVideo( f21_local3, f21_local5, {
|
|
name = "open_after_action_report",
|
|
controller = f21_local3,
|
|
notExclusive = true,
|
|
immediate = true,
|
|
target = f21_arg0
|
|
} )
|
|
else
|
|
f21_arg0:dispatchEventToRoot( {
|
|
name = "open_after_action_report",
|
|
controller = f21_local3,
|
|
notExclusive = true,
|
|
immediate = true
|
|
} )
|
|
end
|
|
f21_local0 = true
|
|
end
|
|
Engine.SetDvarBool( "ui_opensummary", false )
|
|
end
|
|
return f21_local0
|
|
end
|
|
|
|
function ExpandMiniAAR( f22_arg0, f22_arg1, f22_arg2 )
|
|
if Engine.IsAliensMode() then
|
|
return
|
|
else
|
|
f22_arg0:dispatchEventToRoot( {
|
|
name = "expand_mini_aar",
|
|
controller = f22_arg2,
|
|
num_unlocks = #getUnlocksData( f22_arg2 ),
|
|
dispatchChildren = true
|
|
} )
|
|
end
|
|
end
|
|
|
|
function OpenAfterActionReport( f23_arg0, f23_arg1 )
|
|
local f23_local0 = true
|
|
if f23_arg1.notExclusive then
|
|
f23_local0 = false
|
|
end
|
|
LUI.FlowManager.RequestPopupMenu( f23_arg0, "aar_summary_main", f23_local0, f23_arg1.controller, false, {
|
|
controller = f23_arg1.controller
|
|
}, nil, false, true )
|
|
end
|
|
|
|
function getUnlocksData( f24_arg0 )
|
|
local f24_local0 = {}
|
|
local f24_local1 = Lobby.GetItemsUnlockedLastGame( f24_arg0 )
|
|
if f24_local1 then
|
|
for f24_local2 = 1, #f24_local1, 1 do
|
|
local f24_local5 = Engine.TableLookupByRow( UnlockTable.File, f24_local1[f24_local2], UnlockTable.Cols.ItemId )
|
|
local f24_local6 = Engine.TableLookupByRow( UnlockTable.File, f24_local1[f24_local2], UnlockTable.Cols.Type )
|
|
local f24_local7, f24_local8 = getUnlockReqsForRow( f24_local1[f24_local2] )
|
|
local f24_local9 = f24_local7.rank
|
|
local f24_local10 = f24_local7.prestige
|
|
local f24_local11 = f24_local7.rankExt
|
|
local f24_local12 = f24_local7.chalAndTier
|
|
local f24_local13 = f24_local7.dlc
|
|
local f24_local14 = ""
|
|
if f24_local12 ~= "" then
|
|
local f24_local15, f24_local16 = parseChallengeName( f24_local12 )
|
|
local f24_local17 = operationGetTargetForTier( f24_local15, f24_local16 )
|
|
local f24_local18 = 528
|
|
if f24_local15 == "ch_longersprint_pro" then
|
|
f24_local17 = math.floor( f24_local17 / f24_local18 )
|
|
end
|
|
f24_local14 = operationGetDesc( f24_local15, f24_local17 )
|
|
elseif f24_local10 ~= "" then
|
|
f24_local14 = Engine.Localize( "@LUA_MENU_UNLOCK_PRESTIGE", f24_local10 )
|
|
end
|
|
if f24_local13 == "" then
|
|
if Engine.IsAliensMode() and f24_local8 then
|
|
if IsOnlineMatch() or f24_local6 == "AlienAbility" or f24_local6 == "AlienPerk" or f24_local6 == "AlienPrestige" then
|
|
table.insert( f24_local0, {
|
|
item = f24_local5,
|
|
type = f24_local6,
|
|
ch_desc = f24_local14,
|
|
rankReq = f24_local9,
|
|
rankReqExt = f24_local11
|
|
} )
|
|
end
|
|
end
|
|
if not Engine.IsAliensMode() and not f24_local8 then
|
|
if f24_local10 ~= "" then
|
|
table.insert( f24_local0, 1, {
|
|
item = f24_local5,
|
|
type = f24_local6,
|
|
ch_desc = f24_local14,
|
|
rankReq = f24_local9,
|
|
rankReqExt = f24_local11
|
|
} )
|
|
else
|
|
table.insert( f24_local0, {
|
|
item = f24_local5,
|
|
type = f24_local6,
|
|
ch_desc = f24_local14,
|
|
rankReq = f24_local9,
|
|
rankReqExt = f24_local11
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
if not Engine.IsAliensMode() then
|
|
local f24_local2, f24_local3, f24_local4 = getRankIncreaseForRoundSquadMember( f24_arg0 )
|
|
if f24_local2 < f24_local3 then
|
|
local f24_local19 = getPerksUnlockedAtRankRange( f24_local2 + 1, f24_local3 )
|
|
for f24_local5 = 1, #f24_local19, 1 do
|
|
local f24_local9 = f24_local19[f24_local5].purchaseReq
|
|
local f24_local10 = false
|
|
if f24_local9 and f24_local9 ~= "" and tonumber( Engine.GetPlayerDataEx( f24_arg0, CoD.StatsGroup.Ranked, "squadMembers", f24_local4, "challengeState", f24_local9 ) ) > 1 then
|
|
f24_local10 = true
|
|
end
|
|
if not f24_local10 then
|
|
table.insert( f24_local0, f24_local19[f24_local5] )
|
|
end
|
|
end
|
|
end
|
|
local f24_local19 = determineCamosUnlocked( f24_arg0 )
|
|
for f24_local5 = 1, #f24_local19, 1 do
|
|
table.insert( f24_local0, f24_local19[f24_local5] )
|
|
end
|
|
local f24_local5 = determineReticlesUnlocked( f24_arg0 )
|
|
for f24_local6 = 1, #f24_local5, 1 do
|
|
table.insert( f24_local0, f24_local5[f24_local6] )
|
|
end
|
|
end
|
|
return f24_local0
|
|
end
|
|
|
|
function getUnlockReqsForItemOfType( f25_arg0, f25_arg1 )
|
|
local f25_local0 = {}
|
|
local f25_local1, f25_local2 = nil
|
|
local f25_local3 = 0
|
|
repeat
|
|
f25_local1 = Engine.TableLookupByRow( UnlockTable.File, f25_local3, UnlockTable.Cols.ItemId )
|
|
if f25_arg0 == f25_local1 and f25_arg1 == Engine.TableLookupByRow( UnlockTable.File, f25_local3, UnlockTable.Cols.Type ) then
|
|
f25_local0 = getUnlockReqsForRow( f25_local3 )
|
|
break
|
|
else
|
|
f25_local3 = f25_local3 + 1
|
|
end
|
|
until f25_local1 == ""
|
|
return f25_local0
|
|
end
|
|
|
|
function getUnlockReqsForRow( f26_arg0 )
|
|
local f26_local0 = {
|
|
entitlement = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.Entitlement ),
|
|
rank = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.Rank ),
|
|
rankExt = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.ExtRank ),
|
|
chalAndTier = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.Challenge ),
|
|
prestigeExt = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.ExtinctionPrestige ),
|
|
escapesExt = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.ExtinctionEscapes ),
|
|
highestRelicEscapeExt = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.HighestRelicEscape ),
|
|
killsExt = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.ExtinctionKills ),
|
|
revivesExt = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.ExtinctionRevives ),
|
|
prestige = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.Prestige ),
|
|
dlc = Engine.TableLookupByRow( UnlockTable.File, f26_arg0, UnlockTable.Cols.DLCOffer )
|
|
}
|
|
local f26_local1
|
|
if f26_local0.rankExt == "" and f26_local0.prestigeExt == "" and f26_local0.escapesExt == "" and f26_local0.highestRelicEscapeExt == "" and f26_local0.killsExt == "" and f26_local0.revivesExt == "" then
|
|
f26_local1 = false
|
|
else
|
|
f26_local1 = true
|
|
end
|
|
return f26_local0, f26_local1
|
|
end
|
|
|
|
function getPerksUnlockedAtRankRange( f27_arg0, f27_arg1 )
|
|
if f27_arg1 < f27_arg0 then
|
|
return
|
|
end
|
|
local f27_local0 = {}
|
|
local f27_local1 = getProperUnlockTable( item )
|
|
for f27_local2 = 0, 2500, 1 do
|
|
local f27_local5 = Engine.TableLookupByRow( f27_local1, f27_local2, 0 )
|
|
local f27_local6 = Engine.TableLookupByRow( f27_local1, f27_local2, 1 )
|
|
if f27_local5 == "" and f27_local6 == "" then
|
|
break
|
|
elseif f27_local6 == "perk" then
|
|
local f27_local7 = Engine.TableLookupByRow( f27_local1, f27_local2, 2 )
|
|
local f27_local8 = Engine.TableLookupByRow( f27_local1, f27_local2, 3 )
|
|
if f27_local7 ~= "" and f27_arg0 <= tonumber( f27_local7 ) and tonumber( f27_local7 ) <= f27_arg1 then
|
|
table.insert( f27_local0, {
|
|
item = f27_local5,
|
|
type = f27_local6,
|
|
rankReq = f27_local7,
|
|
purchaseReq = f27_local8
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
return f27_local0
|
|
end
|
|
|
|
function getRankIncreaseForRoundSquadMember( f28_arg0 )
|
|
local f28_local0 = AAR.GetRoundSquadMember( f28_arg0 )
|
|
local f28_local1 = AAR.GetCareerExperienceForSquadMember( f28_arg0, f28_local0 )
|
|
return tonumber( Rank.GetRankDisplay( Lobby.GetRankForXP( f28_local1 - AAR.GetRoundTotalXP( f28_arg0 ) ) ) ), tonumber( Rank.GetRankDisplay( Lobby.GetRankForXP( f28_local1 ) ) ), f28_local0
|
|
end
|
|
|
|
function checkIsReticleChallenge( f29_arg0 )
|
|
local f29_local0 = {
|
|
acog = 1,
|
|
eotech = 1,
|
|
hybrid = 1,
|
|
reflex = 1
|
|
}
|
|
local f29_local1 = {
|
|
longshot = 1,
|
|
prone = 1,
|
|
headshot = 1,
|
|
double = 1,
|
|
oneshot = 1,
|
|
burst = 1,
|
|
lean = 1,
|
|
consecutive = 1,
|
|
zoomin = 1,
|
|
zoomout = 1,
|
|
penetrate = 1,
|
|
moving = 1,
|
|
crouch = 1,
|
|
ammoslug = 1,
|
|
crouch = 1,
|
|
altshotgun = 1
|
|
}
|
|
local f29_local2 = {}
|
|
for f29_local6 in string.gmatch( f29_arg0, "%w+" ) do
|
|
f29_local2[#f29_local2 + 1] = f29_local6
|
|
end
|
|
if #f29_local2 == 3 and f29_local2[1] == "ch" and f29_local0[f29_local2[2]] == 1 and f29_local1[f29_local2[3]] == 1 then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function determineReticlesUnlocked( f30_arg0 )
|
|
local f30_local0 = {}
|
|
local f30_local1 = Engine.GetPlayerDataEx( f30_arg0, CoD.StatsGroup.Common, "round", "challengeNumCompleted" )
|
|
for f30_local2 = 1, f30_local1, 1 do
|
|
local f30_local5 = Engine.GetPlayerDataEx( f30_arg0, CoD.StatsGroup.Common, "round", "challengesCompleted", f30_local2 - 1 )
|
|
local f30_local6 = Engine.GetPlayerDataEx( f30_arg0, CoD.StatsGroup.Ranked, "challengeState", f30_local5 )
|
|
if checkIsReticleChallenge( f30_local5 ) then
|
|
for f30_local7 = 0, CamoReticleUnlockTable.MaxRows, 1 do
|
|
local f30_local10 = Engine.TableLookupByRow( CamoReticleUnlockTable.File, f30_local7, CamoReticleUnlockTable.Cols.CamoReticleRef )
|
|
local f30_local11 = Engine.TableLookupByRow( CamoReticleUnlockTable.File, f30_local7, CamoReticleUnlockTable.Cols.ChallengeRef )
|
|
local f30_local12 = tonumber( Engine.TableLookupByRow( CamoReticleUnlockTable.File, f30_local7, CamoReticleUnlockTable.Cols.Tier ) )
|
|
if f30_local10 == "" then
|
|
|
|
end
|
|
if f30_local5 == f30_local11 and f30_local12 and f30_local6 == f30_local12 + 1 then
|
|
local f30_local13 = {}
|
|
for f30_local17 in string.gmatch( f30_local10, "%w+" ) do
|
|
f30_local13[#f30_local13 + 1] = f30_local17
|
|
end
|
|
if #f30_local13 == 2 then
|
|
table.insert( f30_local0, {
|
|
type = "reticle",
|
|
item = f30_local13[2],
|
|
sight = f30_local13[1],
|
|
ch_desc = operationGetDesc( f30_local5, operationGetTargetForTier( f30_local5, f30_local12 ) )
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
return f30_local0
|
|
end
|
|
|
|
function parseCamoChallengeName( f31_arg0 )
|
|
local f31_local0 = {}
|
|
for f31_local4 in string.gmatch( f31_arg0, "%w+" ) do
|
|
f31_local0[#f31_local0 + 1] = f31_local4
|
|
end
|
|
if f31_local0[1] ~= "ch" or f31_local0[2] ~= "iw6" or #f31_local0 < 3 then
|
|
DebugPrint( "challenge_ref does not begin with ch_iw6, or contains less then 3 tokens" )
|
|
return false
|
|
end
|
|
f31_local1 = f31_local0[2] .. "_" .. f31_local0[3]
|
|
f31_local2 = Cac.GetWeaponClass( f31_local1 )
|
|
if f31_local1 == "iw6_knifeonly" then
|
|
return false
|
|
elseif not f31_local2 or f31_local2 == "" then
|
|
DebugPrint( "Invalid Weapon Or Weapon Class" )
|
|
return false
|
|
end
|
|
f31_local3 = nil
|
|
if #f31_local0 == 3 then
|
|
f31_local3 = ""
|
|
elseif #f31_local0 == 4 then
|
|
f31_local3 = f31_local0[4]
|
|
if not CamoReticleUnlockTable.ChallengeIDList[f31_local3] then
|
|
DebugPrint( "unknown challenge postfix" )
|
|
return false
|
|
end
|
|
f31_local3 = "_" .. f31_local3
|
|
else
|
|
DebugPrint( "unknown challenge postfix" )
|
|
return false
|
|
end
|
|
return true, f31_local1, f31_local2, f31_local3
|
|
end
|
|
|
|
function determineCamosUnlocked( f32_arg0 )
|
|
local f32_local0 = {}
|
|
local f32_local1 = {}
|
|
local f32_local2 = Engine.GetPlayerDataEx( f32_arg0, CoD.StatsGroup.Common, "round", "challengeNumCompleted" )
|
|
for f32_local3 = 1, f32_local2, 1 do
|
|
local f32_local6 = Engine.GetPlayerDataEx( f32_arg0, CoD.StatsGroup.Common, "round", "challengesCompleted", f32_local3 - 1 )
|
|
local f32_local7 = Engine.GetPlayerDataEx( f32_arg0, CoD.StatsGroup.Ranked, "challengeState", f32_local6 )
|
|
local f32_local8, f32_local9, f32_local10, f32_local11 = parseCamoChallengeName( f32_local6 )
|
|
if f32_local8 then
|
|
for f32_local12 = 0, CamoReticleUnlockTable.MaxRows, 1 do
|
|
local f32_local15 = Engine.TableLookupByRow( CamoReticleUnlockTable.File, f32_local12, CamoReticleUnlockTable.Cols.CamoReticleRef )
|
|
local f32_local16 = Engine.TableLookupByRow( CamoReticleUnlockTable.File, f32_local12, CamoReticleUnlockTable.Cols.ChallengeRef )
|
|
local f32_local17 = tonumber( Engine.TableLookupByRow( CamoReticleUnlockTable.File, f32_local12, CamoReticleUnlockTable.Cols.Tier ) )
|
|
if f32_local15 == "" then
|
|
|
|
end
|
|
local f32_local18 = {}
|
|
for f32_local22 in string.gmatch( f32_local15, "%w+" ) do
|
|
f32_local18[#f32_local18 + 1] = f32_local22
|
|
end
|
|
if #f32_local18 == 3 and Cac.WeaponTypes.WeaponTypeStrings[f32_local18[1] .. "_" .. f32_local18[2]] then
|
|
f32_local19 = f32_local18[3]
|
|
if f32_local11 == f32_local16 and f32_local10 == f32_local18[1] .. "_" .. f32_local18[2] and f32_local17 and f32_local7 == f32_local17 + 1 then
|
|
table.insert( f32_local1, {
|
|
type = "camo",
|
|
item = f32_local19,
|
|
weapon = f32_local9,
|
|
ch_desc = operationGetDesc( f32_local6, operationGetTargetForTier( f32_local6, f32_local17 ) )
|
|
} )
|
|
if Cac.UpdateCamoGoldChallenge( f32_arg0, f32_local9, false ) and f32_local0[f32_local9] ~= 1 then
|
|
table.insert( f32_local1, {
|
|
type = "camo",
|
|
item = "gold",
|
|
weapon = f32_local9,
|
|
ch_desc = Engine.Localize( "@OPERATIONS_KILLS_ALLCAMO_DESC" )
|
|
} )
|
|
f32_local0[f32_local9] = 1
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
return f32_local1
|
|
end
|
|
|
|
function GetAARUnlockCount( f33_arg0 )
|
|
return #getUnlocksData( f33_arg0 )
|
|
end
|
|
|
|
function TryForceOpenUnlocksScreens( f34_arg0, f34_arg1, f34_arg2 )
|
|
local f34_local0 = getUnlocksData( f34_arg2 )
|
|
if #f34_local0 > 0 then
|
|
f34_arg0:dispatchEventToRoot( {
|
|
name = "open_after_action_report_unlocks",
|
|
controller = f34_arg2,
|
|
data = {
|
|
unlockData = f34_local0,
|
|
num_pages = math.ceil( #f34_local0 / AAR.NumUnlocksPerPage )
|
|
}
|
|
} )
|
|
end
|
|
end
|
|
|
|
function OpenUnlockScreens( f35_arg0, f35_arg1 )
|
|
LUI.FlowManager.RequestPopupMenu( f35_arg0, "aar_unlock_main", true, f35_arg1.controller, false, f35_arg1.data )
|
|
end
|
|
|
|
function SplitScreenSignInExit( f36_arg0 )
|
|
Engine.Exec( "splitscreen 0" )
|
|
Engine.Exec( "forcesplitscreencontrol menu_splitscreensignin_EXIT" )
|
|
Engine.Exec( "endsplitscreensignin" )
|
|
Engine.Exec( "clearcontrollermap" )
|
|
clearMatchData()
|
|
end
|
|
|
|
function GetMemberListSpacing( f37_arg0 )
|
|
if SvS.IsSvS() and SvS.GetCurrentSquadModeInfo() == SvS.SquadModes.SquadVsSquad and not f37_arg0 then
|
|
return 25
|
|
else
|
|
return Engine.IsAliensMode() and LUI.mp_menus.Aliens.AliensMemberListSpacing or 2
|
|
end
|
|
end
|
|
|
|
function LobbyMemberListGetState( f38_arg0 )
|
|
local f38_local0 = Engine.GetDvarBool( "party_teamsVisible" )
|
|
if f38_local0 then
|
|
f38_local0 = Engine.GetDvarBool( "party_teamBased" )
|
|
end
|
|
if f38_arg0 == Lobby.MemberListStates.Lobby and f38_local0 then
|
|
return Lobby.MemberListStates.Teams
|
|
elseif f38_arg0 == Lobby.MemberListStates.Teams and not f38_local0 then
|
|
return Lobby.MemberListStates.Lobby
|
|
else
|
|
return f38_arg0
|
|
end
|
|
end
|
|
|
|
function LobbyMemberIsBot( f39_arg0, f39_arg1, f39_arg2 )
|
|
return Lobby.IsMemberABot( f39_arg0, f39_arg1, f39_arg2 )
|
|
end
|
|
|
|
function GetLobbyMemberUniqueId( f40_arg0, f40_arg1, f40_arg2 )
|
|
return Lobby.GetMemberName( f40_arg0, f40_arg1, f40_arg2 )
|
|
end
|
|
|
|
function GetUpperGradient()
|
|
return {
|
|
type = "UIImage",
|
|
id = "upper_gradient_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 0,
|
|
top = -360,
|
|
bottom = 360,
|
|
material = RegisterMaterial( "gradient_top" ),
|
|
alpha = 0
|
|
},
|
|
visible = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
lobby_transition_to_game = MBh.AnimateToState( "visible", Lobby.TransitionTime ),
|
|
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
|
|
}
|
|
}
|
|
end
|
|
|
|
function GetLowerGradient()
|
|
return {
|
|
type = "UIImage",
|
|
id = "lower_gradient_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = -320,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "gradient_bottom" ),
|
|
alpha = 0
|
|
},
|
|
visible = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
lobby_transition_to_game = MBh.AnimateToState( "visible", Lobby.TransitionTime ),
|
|
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime )
|
|
}
|
|
}
|
|
end
|
|
|
|
function GetMaxBotLimit()
|
|
local f43_local0 = Lobby.CurrGenBotLimit
|
|
if Engine.IsPS4() or Engine.IsXB3() or not Engine.IsConsoleGame() then
|
|
f43_local0 = Lobby.NextGenBotLimit
|
|
end
|
|
if Engine.GetDvarBool( "onlinegame" ) == false and Engine.GetDvarBool( "splitscreen" ) == true then
|
|
f43_local0 = f43_local0 - Engine.SplitscreenPlayerCount()
|
|
end
|
|
if Engine.GetDvarBool( "xblive_privatematch" ) == true then
|
|
f43_local0 = math.max( math.min( Lobby.HowManyPlayersCanWeHost(), Engine.GetDvarInt( "party_maxplayers" ) ) - Lobby.GetMemberCount( Lobby.MemberListStates.Lobby ), 0 )
|
|
end
|
|
if Engine.GetDvarBool( "systemlink" ) == true then
|
|
f43_local0 = f43_local0 - 1
|
|
end
|
|
return f43_local0
|
|
end
|
|
|
|
function BotButtonDisplayText( f44_arg0 )
|
|
local f44_local0 = 0
|
|
if Lobby.GetBotsTeamLimit then
|
|
f44_local0 = Lobby.GetBotsTeamLimit( f44_arg0 )
|
|
end
|
|
return tostring( f44_local0 )
|
|
end
|
|
|
|
function FriendlyBotButtonDisplayText( f45_arg0, f45_arg1 )
|
|
return BotButtonDisplayText( Lobby.BotTeams.Friendly )
|
|
end
|
|
|
|
function EnemyBotButtonDisplayText( f46_arg0, f46_arg1 )
|
|
return BotButtonDisplayText( Lobby.BotTeams.Enemy )
|
|
end
|
|
|
|
function FFABotButtonDisplayText( f47_arg0, f47_arg1 )
|
|
return BotButtonDisplayText( Lobby.BotTeams.FFA )
|
|
end
|
|
|
|
function BotButtonLeft( f48_arg0 )
|
|
if Lobby.GetBotsTeamLimit then
|
|
local f48_local0 = Lobby.GetBotsTeamLimit( f48_arg0 ) - 1
|
|
if Lobby.SetBotsTeamLimit then
|
|
if f48_local0 < 0 then
|
|
Lobby.SetBotsTeamLimit( f48_arg0, 0 )
|
|
else
|
|
Lobby.SetBotsTeamLimit( f48_arg0, f48_local0 )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
function FriendlyBotButtonLeft( f49_arg0, f49_arg1 )
|
|
BotButtonLeft( Lobby.BotTeams.Friendly )
|
|
end
|
|
|
|
function EnemyBotButtonLeft( f50_arg0, f50_arg1 )
|
|
BotButtonLeft( Lobby.BotTeams.Enemy )
|
|
end
|
|
|
|
function FFABotButtonLeft( f51_arg0, f51_arg1 )
|
|
BotButtonLeft( Lobby.BotTeams.FFA )
|
|
end
|
|
|
|
function BotButtonRight( f52_arg0, f52_arg1, f52_arg2 )
|
|
if Lobby.GetBotsTeamLimit and Lobby.SetBotsTeamLimit then
|
|
local f52_local0 = Lobby.GetBotsTeamLimit( f52_arg0 ) + 1
|
|
if f52_arg1 == Lobby.BotTeams.FFA then
|
|
if f52_arg2 < f52_local0 then
|
|
Lobby.SetBotsTeamLimit( f52_arg0, f52_arg2 )
|
|
else
|
|
Lobby.SetBotsTeamLimit( f52_arg0, f52_local0 )
|
|
end
|
|
else
|
|
local f52_local1 = Lobby.GetBotsTeamLimit( f52_arg1 )
|
|
if f52_arg2 < f52_local0 + f52_local1 then
|
|
if f52_local1 > 0 then
|
|
Lobby.SetBotsTeamLimit( f52_arg0, f52_local0 )
|
|
Lobby.SetBotsTeamLimit( f52_arg1, f52_local1 - 1 )
|
|
else
|
|
Lobby.SetBotsTeamLimit( f52_arg0, f52_arg2 )
|
|
end
|
|
else
|
|
Lobby.SetBotsTeamLimit( f52_arg0, f52_local0 )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
function FriendlyBotButtonRight( f53_arg0, f53_arg1 )
|
|
BotButtonRight( Lobby.BotTeams.Friendly, Lobby.BotTeams.Enemy, GetMaxBotLimit() )
|
|
f53_arg0:dispatchEventToParent( {
|
|
name = "bot_button_refresh"
|
|
} )
|
|
end
|
|
|
|
function EnemyBotButtonRight( f54_arg0, f54_arg1 )
|
|
BotButtonRight( Lobby.BotTeams.Enemy, Lobby.BotTeams.Friendly, GetMaxBotLimit() )
|
|
f54_arg0:dispatchEventToParent( {
|
|
name = "bot_button_refresh"
|
|
} )
|
|
end
|
|
|
|
function FFABotButtonRight( f55_arg0, f55_arg1 )
|
|
BotButtonRight( Lobby.BotTeams.FFA, Lobby.BotTeams.FFA, GetMaxBotLimit() )
|
|
end
|
|
|
|
function BotButtonRefresh( f56_arg0, f56_arg1 )
|
|
local f56_local0 = MatchRules.GetData( "gametype" )
|
|
if f56_local0 ~= nil and SvS.IsSvS() == false then
|
|
local f56_local1 = tonumber( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f56_local0, GameTypesTable.Cols.TeamChoice ) )
|
|
if f56_local1 and f56_local1 == 1 then
|
|
local f56_local2 = Lobby.GetBotsTeamLimit( Lobby.BotTeams.Friendly )
|
|
local f56_local3 = Lobby.GetBotsTeamLimit( Lobby.BotTeams.Enemy )
|
|
while f56_local2 + f56_local3 > GetMaxBotLimit() do
|
|
if f56_local2 < f56_local3 then
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, f56_local3 - 1 )
|
|
end
|
|
if f56_local3 < f56_local2 then
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Friendly, f56_local2 - 1 )
|
|
else
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, f56_local3 - 1 )
|
|
end
|
|
end
|
|
elseif Lobby.GetBotsTeamLimit( Lobby.BotTeams.FFA ) > GetMaxBotLimit() then
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.FFA, GetMaxBotLimit() )
|
|
end
|
|
end
|
|
f56_arg0:processEvent( {
|
|
name = "content_refresh"
|
|
} )
|
|
end
|
|
|
|
function BotsDifficultyButtonDisplayText( f57_arg0 )
|
|
local f57_local0 = Lobby.BotDifficulties.Regular
|
|
if Lobby.GetBotsDifficulty then
|
|
f57_local0 = Lobby.GetBotsDifficulty( f57_arg0 )
|
|
end
|
|
if f57_local0 == Lobby.BotDifficulties.Recruit then
|
|
return Engine.Localize( "@LUA_MENU_BOTS_RECRUIT" )
|
|
elseif f57_local0 == Lobby.BotDifficulties.Regular then
|
|
return Engine.Localize( "@LUA_MENU_BOTS_REGULAR" )
|
|
elseif f57_local0 == Lobby.BotDifficulties.Hardened then
|
|
return Engine.Localize( "@LUA_MENU_BOTS_HARDENED" )
|
|
elseif f57_local0 == Lobby.BotDifficulties.Veteran then
|
|
return Engine.Localize( "@LUA_MENU_BOTS_VETERAN" )
|
|
elseif f57_local0 == Lobby.BotDifficulties.Mixed then
|
|
return Engine.Localize( "@LUA_MENU_BOTS_MIXED" )
|
|
else
|
|
return "FIXME Missing option"
|
|
end
|
|
end
|
|
|
|
function FriendlyBotsDifficultyButtonDisplayText( f58_arg0, f58_arg1 )
|
|
return BotsDifficultyButtonDisplayText( Lobby.BotTeams.Friendly )
|
|
end
|
|
|
|
function EnemyBotsDifficultyButtonDisplayText( f59_arg0, f59_arg1 )
|
|
return BotsDifficultyButtonDisplayText( Lobby.BotTeams.Enemy )
|
|
end
|
|
|
|
function FFABotsDifficultyButtonDisplayText( f60_arg0, f60_arg1 )
|
|
return BotsDifficultyButtonDisplayText( Lobby.BotTeams.FFA )
|
|
end
|
|
|
|
function BotsDifficultyButtonLeft( f61_arg0 )
|
|
if Lobby.GetBotsDifficulty then
|
|
local f61_local0 = Lobby.GetBotsDifficulty( f61_arg0 ) - 1
|
|
if Lobby.GetBotsDifficultyCount then
|
|
if f61_local0 < 0 then
|
|
f61_local0 = Lobby.GetBotsDifficultyCount() - 1
|
|
end
|
|
else
|
|
f61_local0 = 0
|
|
end
|
|
if Lobby.SetBotsDifficulty then
|
|
Lobby.SetBotsDifficulty( f61_arg0, f61_local0 )
|
|
end
|
|
end
|
|
end
|
|
|
|
function FriendlyBotsDifficultyButtonLeft( f62_arg0, f62_arg1 )
|
|
BotsDifficultyButtonLeft( Lobby.BotTeams.Friendly )
|
|
end
|
|
|
|
function EnemyBotsDifficultyButtonLeft( f63_arg0, f63_arg1 )
|
|
BotsDifficultyButtonLeft( Lobby.BotTeams.Enemy )
|
|
end
|
|
|
|
function FFABotsDifficultyButtonLeft( f64_arg0, f64_arg1 )
|
|
BotsDifficultyButtonLeft( Lobby.BotTeams.FFA )
|
|
end
|
|
|
|
function BotsDifficultyButtonRight( f65_arg0 )
|
|
if Lobby.GetBotsDifficulty then
|
|
local f65_local0 = Lobby.GetBotsDifficulty( f65_arg0 ) + 1
|
|
if Lobby.GetBotsDifficultyCount then
|
|
if Lobby.GetBotsDifficultyCount() <= f65_local0 then
|
|
f65_local0 = 0
|
|
end
|
|
else
|
|
f65_local0 = 0
|
|
end
|
|
if Lobby.SetBotsDifficulty then
|
|
Lobby.SetBotsDifficulty( f65_arg0, f65_local0 )
|
|
end
|
|
end
|
|
end
|
|
|
|
function FriendlyBotsDifficultyButtonRight( f66_arg0, f66_arg1 )
|
|
BotsDifficultyButtonRight( Lobby.BotTeams.Friendly )
|
|
end
|
|
|
|
function EnemyBotsDifficultyButtonRight( f67_arg0, f67_arg1 )
|
|
BotsDifficultyButtonRight( Lobby.BotTeams.Enemy )
|
|
end
|
|
|
|
function FFABotsDifficultyButtonRight( f68_arg0, f68_arg1 )
|
|
BotsDifficultyButtonRight( Lobby.BotTeams.FFA )
|
|
end
|
|
|
|
function FixTeamLimitsAndDifficultiesIfNecessary( f69_arg0, f69_arg1 )
|
|
local f69_local0 = tonumber( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f69_arg0, GameTypesTable.Cols.TeamChoice ) )
|
|
local f69_local1 = tonumber( Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f69_arg1, GameTypesTable.Cols.TeamChoice ) )
|
|
if f69_local0 == 1 and f69_local1 == 0 then
|
|
if Lobby.SetBotsTeamLimit and Lobby.GetBotsTeamLimit then
|
|
local f69_local2 = Lobby.GetBotsTeamLimit( Lobby.BotTeams.Friendly )
|
|
local f69_local3 = Lobby.GetBotsTeamLimit( Lobby.BotTeams.Enemy )
|
|
if f69_local2 + f69_local3 > GetMaxBotLimit() then
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Friendly, 0 )
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, 0 )
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.FFA, GetMaxBotLimit() )
|
|
else
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Friendly, 0 )
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, 0 )
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.FFA, f69_local2 + f69_local3 )
|
|
end
|
|
end
|
|
if Lobby.SetBotsDifficulty and Lobby.GetBotsDifficulty then
|
|
Lobby.SetBotsDifficulty( Lobby.BotTeams.FFA, Lobby.GetBotsDifficulty( Lobby.BotTeams.Enemy ) )
|
|
end
|
|
end
|
|
if f69_local0 == 0 and f69_local1 == 1 then
|
|
if Lobby.SetBotsTeamLimit and Lobby.GetBotsTeamLimit then
|
|
local f69_local2 = GetMaxBotLimit()
|
|
local f69_local3 = Lobby.GetBotsTeamLimit( Lobby.BotTeams.FFA )
|
|
if f69_local2 < f69_local3 then
|
|
f69_local3 = f69_local2
|
|
end
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.FFA, 0 )
|
|
local f69_local4 = math.floor( f69_local3 / 2 )
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Friendly, f69_local4 )
|
|
if f69_local3 % 2 == 1 then
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, f69_local4 + 1 )
|
|
else
|
|
Lobby.SetBotsTeamLimit( Lobby.BotTeams.Enemy, f69_local4 )
|
|
end
|
|
end
|
|
if Lobby.SetBotsDifficulty and Lobby.GetBotsDifficulty then
|
|
local f69_local2 = Lobby.GetBotsDifficulty( Lobby.BotTeams.FFA )
|
|
Lobby.SetBotsDifficulty( Lobby.BotTeams.Friendly, f69_local2 )
|
|
Lobby.SetBotsDifficulty( Lobby.BotTeams.Enemy, f69_local2 )
|
|
end
|
|
end
|
|
end
|
|
|
|
function SetIsAliensSolo( f70_arg0 )
|
|
if f70_arg0 then
|
|
Engine.SetDvarBool( "xblive_privatematch_solo", true )
|
|
else
|
|
Engine.SetDvarBool( "xblive_privatematch_solo", false )
|
|
end
|
|
end
|
|
|
|
function GetGameTypeIcon( f71_arg0 )
|
|
return Engine.TableLookup( GameTypesTable.File, GameTypesTable.Cols.Ref, f71_arg0, GameTypesTable.Cols.Image )
|
|
end
|
|
|
|
function IsFirstTimeFlowRequired( f72_arg0 )
|
|
local f72_local0 = true
|
|
if not Engine.IsAliensMode() then
|
|
f72_local0 = Engine.GetPlayerDataEx( f72_arg0, CoD.GetStatsGroupForGameMode(), "squadMembers", Cac.GetActiveSquadMember( f72_arg0 ), "defaultSet" )
|
|
end
|
|
local f72_local1
|
|
if f72_local0 ~= nil and f72_local0 ~= false then
|
|
f72_local1 = false
|
|
else
|
|
f72_local1 = true
|
|
end
|
|
return f72_local1
|
|
end
|
|
|
|
function getXPIcon( f73_arg0 )
|
|
if not f73_arg0 then
|
|
f73_arg0 = Engine.GetDvarString( "playlist_name" )
|
|
end
|
|
local f73_local0, f73_local1, f73_local2 = GetTextDimensions( f73_arg0, CoD.TextSettings.ExtraBigFont.Font, CoD.TextSettings.ExtraBigFont.Height )
|
|
return {
|
|
type = "UIElement",
|
|
id = "double_xp_container_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = 0
|
|
},
|
|
visible = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
update_double_xp_icon = function ( f74_arg0, f74_arg1 )
|
|
local f74_local0 = false
|
|
if Engine.IsAliensMode() then
|
|
local self = Engine.GetDvarInt( "scr_aliens_xpscale" )
|
|
if self and self > 1 then
|
|
f74_local0 = true
|
|
end
|
|
else
|
|
for self = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
|
if Engine.HasActiveLocalClient( self ) then
|
|
local f74_local4 = Engine.GetPlayerDataEx( self, CoD.StatsGroup.Ranked, "xpMaxMultiplierTimePlayed", 0 )
|
|
local f74_local5 = Engine.GetPlayerDataEx( self, CoD.StatsGroup.Ranked, "xpMultiplierTimePlayed", 0 )
|
|
local f74_local6 = f74_local5 and f74_local4 and f74_local5 < f74_local4
|
|
local f74_local7 = Engine.GetDvarInt( "scr_xpscale" )
|
|
if f74_local7 then
|
|
f74_local7 = Engine.GetDvarInt( "scr_xpscale" ) > 1
|
|
end
|
|
if f74_local6 or f74_local7 then
|
|
f74_local0 = true
|
|
break
|
|
end
|
|
end
|
|
end
|
|
end
|
|
if f74_local0 then
|
|
if not f74_arg0:getFirstDescendentById( "doubleXpTimer" ) then
|
|
local self = LUI.UITimer.new( 2000, {
|
|
name = "animate_double_xp"
|
|
} )
|
|
self.id = "doubleXpTimer"
|
|
f74_arg0:addElement( self )
|
|
end
|
|
f74_arg0:animateToState( "visible" )
|
|
else
|
|
f74_arg0:animateToState( "default" )
|
|
end
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "double_xp_icon_id",
|
|
priority = 10,
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = f73_local2 + 116 + 10,
|
|
right = f73_local2 + 180 + 10,
|
|
top = 35,
|
|
bottom = 99,
|
|
material = RegisterMaterial( "icon_xp" ),
|
|
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or 1,
|
|
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or 1,
|
|
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or 1
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "double_xp_icon_id",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "icon_xp" ),
|
|
red = Engine.IsAliensMode() and Colors.alien_frontend_hilite.r or 1,
|
|
green = Engine.IsAliensMode() and Colors.alien_frontend_hilite.g or 1,
|
|
blue = Engine.IsAliensMode() and Colors.alien_frontend_hilite.b or 1,
|
|
alpha = 0
|
|
},
|
|
visible = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = 1
|
|
},
|
|
expanded = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = -5,
|
|
right = 5,
|
|
top = -5,
|
|
bottom = 5,
|
|
alpha = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
animate_double_xp = function ( f75_arg0, f75_arg1 )
|
|
local f75_local0 = MBh.AnimateSequence( {
|
|
{
|
|
"visible",
|
|
200
|
|
},
|
|
{
|
|
"expanded",
|
|
0
|
|
}
|
|
} )
|
|
f75_local0( f75_arg0 )
|
|
end
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function ShouldShowEliteIcon( f76_arg0, f76_arg1, f76_arg2 )
|
|
local f76_local0 = Lobby.ShowMemberInfo( f76_arg0, f76_arg1, f76_arg2 )
|
|
if f76_local0 then
|
|
if not LobbyMemberIsBot( f76_arg0, f76_arg1, f76_arg2 ) and not Engine.IsAliensMode() then
|
|
f76_local0 = Lobby.IsUsingSecondScreen( f76_arg0, f76_arg1, f76_arg2 )
|
|
else
|
|
f76_local0 = false
|
|
end
|
|
end
|
|
return f76_local0
|
|
end
|
|
|
|
function GetCurrentGameType()
|
|
local f77_local0 = Engine.GetDvarString( "ui_gametype" )
|
|
if MatchRules.IsUsingMatchRulesData() then
|
|
f77_local0 = MatchRules.GetData( "gametype" )
|
|
end
|
|
return f77_local0
|
|
end
|
|
|
|
function IsCurrentGameTypeteamBased()
|
|
local f78_local0 = GetCurrentGameType()
|
|
local f78_local1
|
|
if f78_local0 == "dm" or f78_local0 == "mugger" or f78_local0 == "sotf_ffa" or f78_local0 == "gun" then
|
|
f78_local1 = false
|
|
else
|
|
f78_local1 = true
|
|
end
|
|
return f78_local1
|
|
end
|
|
|
|
function RefreshMLGRules( f79_arg0, f79_arg1 )
|
|
if Engine.GetDvarBool( "remove_mlg_rules" ) and not Engine.IsAliensMode() then
|
|
MatchRules.LoadMatchRulesDataDefault()
|
|
Engine.SetDvarBool( "remove_mlg_rules", false )
|
|
f79_arg0:processEvent( {
|
|
name = "create_class_update_restrictions",
|
|
controller = f79_arg1
|
|
} )
|
|
end
|
|
end
|
|
|
|
end
|
|
function IsOnlineMatch()
|
|
return Engine.GetDvarBool( "onlinegame" ) == true
|
|
end
|
|
|
|
function IsPrivateMatch()
|
|
if Engine.GetDvarBool( "onlinegame" ) == true and Engine.GetDvarBool( "xblive_privatematch" ) == true then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function isAliensSolo()
|
|
return Engine.GetDvarBool( "xblive_privatematch" ) and Engine.IsAliensMode() and Engine.GetDvarBool( "xblive_privatematch_solo" )
|
|
end
|
|
|
|
function TriggerUpdateRestrictionsIcon( f83_arg0, f83_arg1 )
|
|
if MatchRules.AllowCustomClasses( "loadouts" ) then
|
|
f83_arg0:processEvent( {
|
|
name = "update_restrictions_icon",
|
|
controller = f83_arg1.controller,
|
|
inFocus = f83_arg0:isInFocus()
|
|
} )
|
|
end
|
|
end
|
|
|