iw6-lui/lui/mp_hud/muteplayers.dec.lua
2024-09-12 17:25:45 +02:00

1081 lines
27 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
f0_local0 = 32
f0_local1 = function ( f1_arg0 )
local f1_local0
if f1_arg0 ~= Game.GetPlayerClientnum() then
f1_local0 = Game.CanChangePlayerMute( f1_arg0 )
else
f1_local0 = false
end
return f1_local0
end
f0_local2 = function ( f2_arg0 )
local f2_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f2_arg0 )
f2_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = "",
side = "left",
clickable = true
} )
f2_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = "",
side = "left",
clickable = true
} )
f2_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt2",
helper_text = "",
side = "left",
clickable = true
} )
if f2_local0.activeClientNum and f0_local1( f2_local0.activeClientNum ) and (Engine.IsConsoleGame() or Engine.IsGamepadEnabled() == 1) then
f2_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_action",
helper_text = Engine.Localize( "XBOXLIVE_PLAYER_MUTE" ),
side = "left",
clickable = true
} )
end
f2_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt1",
helper_text = Engine.Localize( "LUA_MENU_UNMUTE_ALL" ),
side = "left",
clickable = true
} )
f2_arg0:processEvent( {
name = "add_button_helper_text",
button_ref = "button_alt2",
helper_text = Engine.Localize( "PATCH_MENU_MUTE_GROUPS" ),
side = "left",
clickable = true
} )
end
local f0_local3 = function ( f3_arg0, f3_arg1 )
f3_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
f0_local2( f3_arg0 )
end
local f0_local4 = function ( f4_arg0, f4_arg1 )
LUI.FlowManager.RequestLeaveMenu( f4_arg0 )
end
local f0_local5 = function ( f5_arg0, f5_arg1 )
Game.MuteAllPlayers()
LUI.FlowManager.RequestLeaveMenu( f5_arg0 )
end
local f0_local6 = function ( f6_arg0, f6_arg1 )
Game.UnmuteAllPlayers()
Game.MuteAllPlayersButParty()
LUI.FlowManager.RequestLeaveMenu( f6_arg0 )
end
local f0_local7 = function ( f7_arg0, f7_arg1 )
Game.UnmuteAllPlayers()
Game.MuteAllPlayersButFriends()
LUI.FlowManager.RequestLeaveMenu( f7_arg0 )
end
local f0_local8 = function ( f8_arg0, f8_arg1 )
Game.UnmuteAllPlayers()
LUI.FlowManager.RequestLeaveMenu( f8_arg0 )
end
local f0_local9 = function ( f9_arg0, f9_arg1 )
local f9_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f9_arg0 )
if f9_local0.activeClientNum then
Game.TogglePlayerMute( f9_local0.activeClientNum )
f9_arg0:dispatchEventToRoot( {
name = "refresh_mute_status"
} )
f9_arg0:dispatchEventToAllOtherRoots( {
name = "refresh_mute_status"
} )
else
Engine.PlaySound( CoD.SFX.DenySelect )
end
end
local f0_local10 = function ( f10_arg0, f10_arg1 )
local f10_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f10_arg0 )
if f0_local1( f10_arg0.properties.clientNum ) then
f10_local0.activeClientNum = f10_arg0.properties.clientNum
else
f10_local0.activeClientNum = nil
end
f10_arg0:dispatchEventToRoot( {
name = "update_arrows",
firstItem = f10_arg0.properties.firstItem,
lastItem = f10_arg0.properties.lastItem
} )
f10_arg0:dispatchEventToRoot( {
name = "update_mute_button_helpers"
} )
end
local f0_local11 = function ( f11_arg0, f11_arg1 )
local f11_local0 = f11_arg0.properties
if f11_local0 then
f11_local0 = f11_arg0.properties.shouldHideArrowFunc
if f11_local0 then
f11_local0 = f11_arg0.properties:shouldHideArrowFunc( f11_arg1 )
end
end
if f11_local0 then
if not f11_arg0.arrowHidden then
f11_arg0:animateToState( "default", 0 )
f11_arg0.arrowHidden = true
end
elseif f11_arg0.arrowHidden then
local f11_local1 = MBh.AnimateLoop( {
{
"shifted",
500,
true,
true
},
{
"visible",
500,
true,
true
}
} )
f11_local1( f11_arg0, f11_arg1 )
f11_arg0.arrowHidden = false
end
end
local f0_local12 = function ( f12_arg0, f12_arg1 )
local f12_local0 = f12_arg0.properties.clientNum
local f12_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f12_arg0 )
local f12_local2
if f12_arg1.name == "button_up" or f12_local1.activeClientNum ~= f12_local0 and f12_arg1.name ~= "button_over" then
f12_local2 = false
else
f12_local2 = true
end
local f12_local3
if f12_local2 then
f12_local3 = "_button_over"
if not f12_local3 then
else
if f0_local1( f12_local0 ) then
f12_arg0:animateToState( (Game.IsPlayerMuted( f12_local0 ) and "muted" or "enabled") .. f12_local3, 0 )
else
f12_arg0:animateToState( "default", 0 )
end
end
end
f12_local3 = "_button_off"
end
local f0_local13 = function ( menu, controller )
local self = LUI.UIButton.new()
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
bottom = f0_local0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
self.properties = controller
self:registerEventHandler( "button_over", f0_local10 )
local f13_local1 = LUI.UIImage.new()
f13_local1:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
red = controller.isLight and 0.1 or 0.24,
green = controller.isLight and 0.1 or 0.24,
blue = controller.isLight and 0.1 or 0.24,
material = RegisterMaterial( "white" )
} )
f13_local1:registerAnimationState( "button_over", {
red = 0.75,
green = 0.75,
blue = 0.75
} )
f13_local1:animateToState( "default", 0 )
f13_local1:registerEventHandler( "button_over", MBh.AnimateToState( "button_over", 0 ) )
f13_local1:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
f13_local1:registerEventHandler( "button_action", f0_local9 )
local f13_local2 = LUI.UIHorizontalList.new()
f13_local2:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
bottom = 32,
right = 0,
alpha = 1
} )
f13_local2:animateToState( "default", 0 )
local f13_local3 = LUI.UIElement.new()
f13_local3:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
width = 65,
alpha = 1
} )
f13_local3:animateToState( "default", 0 )
local f13_local4 = LUI.UIImage.new()
f13_local4:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = false,
top = 0,
left = 5,
bottom = 0,
width = 32,
red = 1,
green = 1,
blue = 1,
material = controller.rankIcon or ""
} )
f13_local4:animateToState( "default", 0 )
f13_local4:registerEventHandler( "button_over", MBh.AnimateToState( "button_over", 0 ) )
f13_local4:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
local f13_local5 = LUI.UIText.new()
f13_local5:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 6,
left = 35,
height = CoD.TextSettings.NormalFont.Height,
width = 30,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b,
alpha = 1,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Center
} )
f13_local5:registerAnimationState( "button_over", {
red = Colors.generic_button_text_focus_color.r,
green = Colors.generic_button_text_focus_color.g,
blue = Colors.generic_button_text_focus_color.b
} )
f13_local5:setText( controller.rankNumber or 0 )
f13_local5:animateToState( "default", 0 )
f13_local5:registerEventHandler( "button_over", MBh.AnimateToState( "button_over", 0 ) )
f13_local5:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
local f13_local6 = LUI.UIText.new()
local f13_local7 = controller.isPlayer and Colors.frontend_hilite or Colors.primary_text_color
f13_local6:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 6,
left = 0,
height = CoD.TextSettings.NormalFont.Height,
width = 600,
red = f13_local7.r,
green = f13_local7.g,
blue = f13_local7.b,
alpha = 1,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Left
} )
f13_local6:registerAnimationState( "button_over", {
red = Colors.generic_button_text_focus_color.r,
green = Colors.generic_button_text_focus_color.g,
blue = Colors.generic_button_text_focus_color.b
} )
f13_local6:setText( controller.name or "" )
f13_local6:animateToState( "default", 0 )
f13_local6:registerEventHandler( "button_over", MBh.AnimateToState( "button_over", 0 ) )
f13_local6:registerEventHandler( "button_up", MBh.AnimateToState( "default", 0 ) )
local f13_local8 = LUI.UIImage.new()
f13_local8.properties = f13_local8.properties or {}
f13_local8.properties.clientNum = controller.clientNum
f13_local8.properties.listIndex = controller.listIndex
f13_local8.properties.isPlayer = controller.isPlayer
f13_local8:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = false,
top = 4,
left = 4,
width = 24,
height = 24,
red = 1,
green = 1,
blue = 1,
alpha = 0,
material = RegisterMaterial( "white" )
} )
f13_local8:registerAnimationState( "enabled_button_off", {
material = RegisterMaterial( "scoreboard_mic_talk_wht" ),
alpha = 1
} )
f13_local8:registerAnimationState( "muted_button_off", {
material = RegisterMaterial( "scoreboard_mic_mute_wht" ),
alpha = 1
} )
f13_local8:registerAnimationState( "enabled_button_over", {
material = RegisterMaterial( "scoreboard_mic_talk_blk" ),
alpha = 1
} )
f13_local8:registerAnimationState( "muted_button_over", {
material = RegisterMaterial( "scoreboard_mic_mute_blk" ),
alpha = 1
} )
f13_local8:animateToState( "default", 0 )
f13_local8:registerEventHandler( "refresh_mute_status", f0_local12 )
f13_local8:registerEventHandler( "button_over", f0_local12 )
f13_local8:registerEventHandler( "button_up", f0_local12 )
f13_local8:processEvent( {
name = "refresh_mute_status"
} )
f13_local3:addElement( f13_local4 )
f13_local3:addElement( f13_local5 )
f13_local2:addElement( f13_local3 )
f13_local2:addSpacer( 10 )
f13_local2:addElement( f13_local6 )
f13_local2:addSpacer( 10 )
f13_local2:addElement( f13_local8 )
self:addElement( f13_local1 )
self:addElement( f13_local2 )
return self
end
function buildTeamLists()
local f14_local0 = {}
local f14_local1 = Engine.GetDvarInt( "party_maxplayers" )
local f14_local2 = Game.GetPlayerClientnum()
local f14_local3 = Game.GetPlayerTeam()
local f14_local4 = assert
local f14_local5
if f14_local3 ~= Teams.allies and f14_local3 ~= Teams.axis then
f14_local5 = false
else
f14_local5 = true
end
f14_local4( f14_local5 )
for f14_local13, f14_local14 in ipairs( {
f14_local3,
otherTeamLookup[f14_local3]
} ) do
local f14_local15 = {}
for f14_local8 = 1, f14_local1, 1 do
f14_local15[f14_local8] = {}
f14_local15[f14_local8].isActive = false
end
for f14_local8 = 1, f14_local1, 1 do
local f14_local11 = Game.GetPlayerScoreInfoAtRank( f14_local14, f14_local8 )
if f14_local11 then
local f14_local12 = f14_local15[f14_local11.client + 1]
f14_local12.isActive = true
f14_local12.scoreInfo = f14_local11
f14_local12.isPlayer = f14_local11.client == f14_local2
end
end
f14_local0[f14_local13] = f14_local15
end
return f14_local0
end
function buildFFAList()
local f15_local0 = {}
local f15_local1 = {
f15_local0
}
local f15_local2 = Engine.GetDvarInt( "party_maxplayers" )
local f15_local3 = Game.GetPlayerClientnum()
for f15_local4 = 1, f15_local2, 1 do
f15_local0[f15_local4] = {}
f15_local0[f15_local4].isActive = false
end
for f15_local11, f15_local12 in pairs( {
Teams.free,
Teams.allies,
Teams.axis
} ) do
for f15_local10 = 1, f15_local2, 1 do
local f15_local8 = Game.GetPlayerScoreInfoAtRank( f15_local12, f15_local10 )
if f15_local8 then
local f15_local9 = f15_local0[f15_local8.client + 1]
f15_local9.scoreInfo = f15_local8
f15_local9.isActive = true
f15_local9.isPlayer = f15_local8.client == f15_local3
end
end
end
return f15_local1
end
function buildPlayerLists()
local f16_local0 = Engine.GetDvarString( "ui_gametype" )
if GameX.gameModeIsFFA( f16_local0 ) or f16_local0 == "horde" or f16_local0 == "infect" or Game.GetPlayerTeam() == Teams.spectator or Engine.IsAliensMode() then
return buildFFAList()
else
return buildTeamLists()
end
end
function countListEntries()
local f17_local0 = 0
local f17_local1 = buildPlayerLists()
for f17_local2 = 1, #f17_local1, 1 do
local f17_local5 = f17_local1[f17_local2]
for f17_local6 = 1, #f17_local5, 1 do
if f17_local5[f17_local6].isActive then
f17_local0 = f17_local0 + 1
end
end
end
if #f17_local1 > 1 then
f17_local0 = f17_local0 + #f17_local1 - 1
end
return f17_local0
end
function buildListRow( f18_arg0, f18_arg1, f18_arg2, f18_arg3, f18_arg4, f18_arg5 )
local f18_local0 = f18_arg3.rankIcon
if not Engine.IsAliensMode() and f18_arg3.rank and f18_arg3.prestige and f18_arg3.prestige > 0 then
f18_local0 = RegisterMaterial( Rank.GetRankIcon( f18_arg3.rank, f18_arg3.prestige ) )
end
return {
type = "mute_players_button",
id = "mute_player_button_" .. f18_arg2,
properties = {
isLight = f18_arg4,
name = f18_arg3.name,
rankNumber = Rank.GetRankDisplay( f18_arg3.rank ),
rankIcon = f18_local0,
clientNum = f18_arg3.client,
listIndex = f18_arg2,
firstItem = f18_arg2 == 1,
isPlayer = f18_arg5
}
}
end
function mutePlayersListFeeder( f19_arg0 )
local f19_local0 = buildPlayerLists()
local f19_local1 = assert
local f19_local2
if #f19_local0 <= 0 or #f19_local0 >= 3 then
f19_local2 = false
else
f19_local2 = true
end
f19_local1( f19_local2 )
f19_local1 = {}
f19_local2 = true
local f19_local3 = f19_local0[1]
for f19_local4 = 1, #f19_local3, 1 do
local f19_local7 = f19_local3[f19_local4]
if f19_local7.isActive then
f19_local1[#f19_local1 + 1] = buildListRow( f19_arg0, scoped, #f19_local1 + 1, f19_local7.scoreInfo, not f19_local2, f19_local7.isPlayer )
end
end
f19_local3 = f19_local0[2]
if f19_local3 then
f19_local2 = not f19_local2
local f19_local4 = #f19_local1 + 1
local f19_local5 = {
type = "UIImage",
id = "mute_players_enemy_banner"
}
local f19_local6 = {}
local f19_local8 = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 0,
left = 0,
bottom = 32,
right = 0
}
local f19_local7
if f19_local2 then
f19_local7 = 0.1
if not f19_local7 then
else
f19_local8.red = f19_local7
if f19_local2 then
f19_local7 = 0.1
if not f19_local7 then
else
f19_local8.green = f19_local7
if f19_local2 then
f19_local7 = 0.1
if not f19_local7 then
else
f19_local8.blue = f19_local7
f19_local8.material = RegisterMaterial( "white" )
f19_local6.default = f19_local8
f19_local5.states = f19_local6
f19_local5.children = {
{
type = "UIText",
id = "mute_players_enemy_banner_text",
properties = {
text = Engine.Localize( "LUA_MENU_OPPOSING_TEAM_CAPS" )
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 6,
left = 0,
height = CoD.TextSettings.NormalFont.Height,
right = -10,
red = Colors.primary_text_color.r,
green = Colors.primary_text_color.g,
blue = Colors.primary_text_color.b,
font = CoD.TextSettings.NormalFont.Font,
alignment = LUI.Alignment.Right
}
}
}
}
f19_local1[f19_local4] = f19_local5
for f19_local4 = 1, #f19_local3, 1 do
f19_local7 = f19_local3[f19_local4]
if f19_local7.isActive then
f19_local1[#f19_local1 + 1] = buildListRow( f19_arg0, scoped, #f19_local1 + 1, f19_local7.scoreInfo, not f19_local2, f19_local7.isPlayer )
end
end
end
end
f19_local7 = 0.24
end
end
f19_local7 = 0.24
end
end
f19_local7 = 0.24
end
if #f19_local1 > 0 and f19_local1[#f19_local1].properties then
f19_local1[#f19_local1].properties.lastItem = true
end
return f19_local1
end
function ListElementsFeeder( f20_arg0, f20_arg1 )
local f20_local0 = 24
local f20_local1 = 48
local f20_local2 = {}
if f20_arg0.useCompactWindow then
f20_local2[#f20_local2 + 1] = {
type = "UIImage",
id = "mute_options_popup_up_arrow_id",
properties = {
shouldHideArrowFunc = function ( f21_arg0, f21_arg1 )
return f21_arg1.firstItem
end
},
states = {
default = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
height = f20_local0,
width = f20_local1,
material = RegisterMaterial( "widg_margin_arrow_top" ),
alpha = 0
},
visible = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = 0,
height = f20_local0,
width = f20_local1,
material = RegisterMaterial( "widg_margin_arrow_top" ),
alpha = 1
},
shifted = {
topAnchor = true,
leftAnchor = false,
bottomAnchor = false,
rightAnchor = false,
top = -5,
height = f20_local0,
width = f20_local1,
material = RegisterMaterial( "widg_margin_arrow_top" ),
alpha = 1
}
},
handlers = {
menu_create = MBh.AnimateLoop( {
{
"shifted",
500,
true,
true
},
{
"visible",
500,
true,
true
}
} ),
update_arrows = f0_local11
}
}
end
local f20_local3 = #f20_local2 + 1
local f20_local4 = {
type = "UIStencil",
id = "mute_options_popup_content_stencil_id"
}
local f20_local5 = {}
local f20_local6 = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true
}
if f20_arg0.useCompactWindow then
local f20_local7 = f20_local0
end
f20_local6.top = f20_local7 or 0
f20_local6.bottom = f20_arg0.useCompactWindow and -f20_local0 or 0
f20_local6.left = 0
f20_local6.right = 0
f20_local5.default = f20_local6
f20_local4.states = f20_local5
f20_local4.children = {
{
type = "UIVerticalList",
id = "mute_options_popup_content_id",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
childrenFeeder = mutePlayersListFeeder
}
}
f20_local2[f20_local3] = f20_local4
if f20_arg0.useCompactWindow then
f20_local2[#f20_local2 + 1] = {
type = "UIImage",
id = "mute_options_popup_down_arrow_id",
properties = {
shouldHideArrowFunc = function ( f22_arg0, f22_arg1 )
return f22_arg1.lastItem
end
},
states = {
default = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
top = -f20_local0,
height = f20_local0,
width = f20_local1,
material = RegisterMaterial( "widg_margin_arrow_bot" ),
alpha = 0
},
visible = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
top = -f20_local0,
height = f20_local0,
width = f20_local1,
material = RegisterMaterial( "widg_margin_arrow_bot" ),
alpha = 1
},
shifted = {
topAnchor = false,
leftAnchor = false,
bottomAnchor = true,
rightAnchor = false,
top = -f20_local0 + 5,
height = f20_local0,
width = f20_local1,
material = RegisterMaterial( "widg_margin_arrow_bot" ),
alpha = 1
}
},
handlers = {
menu_create = MBh.AnimateLoop( {
{
"shifted",
500,
true,
true
},
{
"visible",
500,
true,
true
}
} ),
update_arrows = f0_local11
}
}
end
return f20_local2
end
function popup_mute_players()
local f23_local0 = 760
local f23_local1 = 90
local f23_local2 = 0
local f23_local3 = GameX.IsSplitscreen() and 250 or 600
local f23_local4 = f0_local0 * countListEntries()
local f23_local5 = f23_local3 < f23_local4
f23_local4 = math.min( f23_local4, f23_local3 )
local f23_local6 = f23_local4 + f23_local1
return {
type = "UIElement",
id = "mute_options_popup_container_id",
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = f0_local3,
update_mute_button_helpers = f0_local2
},
children = {
{
type = "UIImage",
id = "mute_options_popup_overlay_id",
states = {
default = CoD.ColorizeState( Swatches.Overlay.Color, {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0,
material = RegisterMaterial( "white" ),
alpha = Swatches.Overlay.AlphaMore
} )
}
},
{
type = "UIImage",
id = "black_bar_1",
states = {
default = {
leftAnchor = true,
topAnchor = true,
rightAnchor = true,
bottomAnchor = false,
left = 0,
bottom = 0,
right = 0,
height = 300,
red = 0,
green = 0,
blue = 0,
alpha = 1,
material = RegisterMaterial( "white" )
}
}
},
{
type = "UIImage",
id = "black_bar_2",
states = {
default = {
leftAnchor = true,
topAnchor = false,
rightAnchor = true,
bottomAnchor = true,
left = 0,
top = 0,
right = 0,
height = 300,
red = 0,
green = 0,
blue = 0,
alpha = 1,
material = RegisterMaterial( "white" )
}
}
},
{
type = "UIWorldBlur",
id = "optionsWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
},
{
type = "UIElement",
id = "mute_options_popup_id",
states = {
default = {
topAnchor = false,
bottomAnchor = false,
leftAnchor = false,
rightAnchor = false,
bottom = f23_local6 / 2 - f23_local2,
top = -(f23_local6 / 2 + f23_local2),
width = f23_local0
}
},
children = {
{
type = "generic_drop_shadow",
id = "mute_options_popup_dropshadow_id",
properties = {
offset_shadow = 0
}
},
{
type = "generic_menu_titlebar",
id = "mute_options_popup_titlebar_id",
properties = {
title_bar_text = Engine.Localize( "LUA_MENU_MUTE_PLAYERS_CAPS" ),
fill_alpha = 1
}
},
{
type = "generic_menu_background",
id = "mute_options_background_id",
properties = {
fill_alpha = 1
},
children = {
{
type = "UIElement",
id = "mute_options_popup_content_container_id",
properties = {
useCompactWindow = f23_local5
},
states = {
default = {
topAnchor = true,
leftAnchor = true,
bottomAnchor = false,
rightAnchor = true,
top = 5,
height = f23_local4,
left = 5,
right = -5
}
},
childrenFeeder = ListElementsFeeder
},
{
type = "button_helper_text_main",
id = "mute_players_button_helpers",
states = {
default = {
topAnchor = false,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = -50,
bottom = 0,
left = 5,
right = -5,
alpha = 1
}
},
properties = {
height = 40,
spacing = 0,
right_inset = 0,
left_inset = 0,
background_alpha = 0,
bottom_margin = 0,
top_margin = -40
}
}
}
}
}
},
{
type = "UIBindButton",
handlers = {
button_secondary = function ( f24_arg0, f24_arg1 )
LUI.FlowManager.RequestLeaveMenu( f24_arg0 )
end
,
button_alt1 = function ( f25_arg0, f25_arg1 )
Game.UnmuteAllPlayers()
f25_arg0:dispatchEventToRoot( {
name = "refresh_mute_status"
} )
end
,
button_alt2 = function ( f26_arg0, f26_arg1 )
LUI.FlowManager.RequestAddMenu( f26_arg0, "popup_mute_groups", true, f26_arg1.controller )
end
}
}
}
}
end
function muteGroupsListFeeder( f27_arg0, f27_arg1 )
local f27_local0 = {}
local f27_local1 = {
type = "UIGenericButton",
id = "mute_all_button_id"
}
local f27_local2 = {
style = GenericButtonSettings.Styles.GlassButton,
text = Engine.Localize( "@LUA_MENU_MUTE_ALL" ),
button_action_func = f0_local5
}
local f27_local3 = Game.GetMuteStrategy()
local f27_local4 = CoD.MuteStrategies.MuteStrategyMuteAll
f27_local2.text_default_color = REG10 and Colors.yellow or Colors.generic_button_text_default_color
f27_local1.properties = f27_local2
f27_local2 = {
type = "UIGenericButton",
id = "mute_all_but_friends_id"
}
f27_local3 = {
style = GenericButtonSettings.Styles.GlassButton,
text = Engine.Localize( "@LUA_MENU_MUTE_ALL_BUT_FRIENDS" ),
button_action_func = f0_local7
}
f27_local4 = Game.GetMuteStrategy()
local f27_local5 = CoD.MuteStrategies.MuteStrategyMuteAllButFriends
f27_local3.text_default_color = REG13 and Colors.yellow or Colors.generic_button_text_default_color
f27_local2.properties = f27_local3
f27_local3 = {
type = "UIGenericButton",
id = "mute_all_but_party_id"
}
f27_local4 = {
style = GenericButtonSettings.Styles.GlassButton,
text = Engine.Localize( "@MENU_MUTE_ALL_BUT_PARTY" ),
button_action_func = f0_local6
}
f27_local5 = Game.GetMuteStrategy()
local f27_local6 = CoD.MuteStrategies.MuteStrategyMuteAllButParty
f27_local4.text_default_color = REG16 and Colors.yellow or Colors.generic_button_text_default_color
f27_local3.properties = f27_local4
f27_local4 = {
type = "UIGenericButton",
id = "unmute_all_button_id",
properties = {
style = GenericButtonSettings.Styles.GlassButton,
text = Engine.Localize( "@LUA_MENU_TURN_OFF_MUTE" ),
button_action_func = f0_local8
}
}
f27_local0[1] = f27_local1
f27_local0[2] = f27_local2
f27_local0[3] = f27_local3
f27_local0[4] = f27_local4
return f27_local0
end
function popup_mute_groups()
local self = LUI.UIElement.new()
self.id = "mute_options_popup_id"
self:registerAnimationState( "default", {
topAnchor = true,
leftAnchor = true,
bottomAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
bottom = 0,
right = 0,
alpha = 1
} )
self:animateToState( "default", 0 )
LUI.MenuBuilder.BuildAddChild( self, {
type = "generic_selectionList_popup",
id = "mute_options_list_id",
properties = {
popup_title = Engine.Localize( "@LUA_MENU_MUTE_PLAYERS_CAPS" ),
padding_top = 10,
default_focus_index = 1,
popup_childfeeder = muteGroupsListFeeder,
popup_width = 400,
popup_stop_background_fade_in = true
}
} )
LUI.MenuBuilder.BuildAddChild( self, {
type = "UIWorldBlur",
id = "optionsWorldBlurOverlay",
states = {
default = {
worldBlur = 5
}
}
} )
return self
end
LUI.MenuBuilder.registerDef( "popup_mute_players", popup_mute_players )
LUI.MenuBuilder.registerType( "mute_players_button", f0_local13 )
LUI.MenuBuilder.registerType( "popup_mute_groups", popup_mute_groups )
LockTable( _M )