Skip to content

Commit

Permalink
small improvements to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelrau committed Aug 3, 2024
1 parent 21a87db commit 496537d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
13 changes: 12 additions & 1 deletion data/cdata/ui_scripts/MainMenu/CPMainMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local f0_local0 = function ( f1_arg0, f1_arg1 )
end

local f0_local1 = function ( f2_arg0, f2_arg1 )
print ("Are we running?!?")
f0_local0( f2_arg0, f2_arg1 )
end

Expand Down Expand Up @@ -183,4 +182,16 @@ function CPMainMenuButtons( menu, controller )
return VNavigator
end

CPMainMenu_original = MenuBuilder.m_types["CPMainMenu"]
function CPMainMenuStub( menu, controller )
ret = CPMainMenu_original( menu, controller )

-- play music immediately
Engine.PlayMusic( CoD.Music.MainCPMusic )

return ret
end

MenuBuilder.m_types["CPMainMenu"] = CPMainMenuStub

MenuBuilder.m_types["CPMainMenuButtons"] = CPMainMenuButtons
2 changes: 2 additions & 0 deletions data/cdata/ui_scripts/SystemLinkMenu/ServerButtons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function SystemLinkMenuButtons( menu, controller )
if CONDITIONS.IsCoreMultiplayer( self ) then
f1_local5:addEventHandler( "button_action", function ( f2_arg0, f2_arg1 )
local f2_local0 = f2_arg1.controller or f1_local1
ClientWeapon.SetWeaponVisible( 0, true )
ClientCharacter.SetCharacterVisible( 0, true )
ACTIONS.OpenCreateAClass( self, f2_arg1 )
end )
end
Expand Down
32 changes: 8 additions & 24 deletions data/cdata/ui_scripts/SystemLinkMenu/SysLinkBrowser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ serverBrowserOffsets = {
}

local f0_local4 = function ( f5_arg0, f5_arg1 )
Engine.ExecNow( "xstopprivateparty", f5_arg1.controller )
Engine.SetDvarBool( "systemlink", false )
Engine.SetDvarBool( "systemlink_host", false )
Engine.StopGameMode()
--Engine.StopGameMode()
LUI.FlowManager.RequestLeaveMenu( f5_arg0, true )
end

Expand Down Expand Up @@ -58,9 +55,6 @@ local f0_local7 = function ( f11_arg0, f11_arg1, f11_arg2 )
else
Engine.ExecNow( MPConfig.default_systemlink, f11_arg1 )
end
if not Lobby.IsInPrivateParty() then
Engine.ExecNow( "xstartprivateparty", f11_arg1 )
end

Engine.Exec( MPConfig.default_dvars )

Expand Down Expand Up @@ -99,26 +93,11 @@ local f0_local7 = function ( f11_arg0, f11_arg1, f11_arg2 )
end
end
end )


Engine.PLMRefreshData()
if Engine.IsCoreMode() then
FrontEndScene.CurrentMissionTeam = MissionDirector.InvalidTeamID
FrontEndScene.SetScene( "private_lobby_menu" )
ClientCharacter.SetCharacterVisible( FrontEndScene.ClientCharacters.Self, true )
if Fences.OfflineDataFetched( f11_arg1 ) then
local f11_local1 = CoD.GetPrivateLoadoutDataSource()
local f11_local2 = f11_local1.squadMembers.head:GetValue( f11_arg1 )
local f11_local3 = f11_local1.squadMembers.body:GetValue( f11_arg1 )
local f11_local4 = f11_local1.squadMembers.archetype:GetValue( f11_arg1 )
local f11_local5 = f11_local1.squadMembers.archetypeSuper:GetValue( f11_arg1 )
FrontEndScene.SetCharacterModelsByIndex( FrontEndScene.ClientCharacters.Self, f11_local3, f11_local2 )
FrontEndScene.SetWeaponForSuper( FrontEndScene.ClientCharacters.Self, f11_local5, f11_local4 )
FrontEndScene.PlayIdleForSuper( FrontEndScene.ClientCharacters.Self, f11_local5, f11_local4 )
ClientWeapon.SetWeaponIsViewModel( 0, true )
ClientWeapon.SetWeaponVisible( 0, false )
ClientCharacter.SetCharacterVisible( 0, true )
end
ClientWeapon.SetWeaponVisible( 0, false )
ClientCharacter.SetCharacterVisible( 0, false )
end
Lobby.SetPartyUIRoot( PartyUIRoot.SYSTEM_LINK )
local f11_local1 = LUI.FlowManager.GetScopedData( f11_arg0 )
Expand Down Expand Up @@ -844,5 +823,10 @@ MenuBuilder.m_types["SystemLinkMenu"] = function ( menu, controller )
return self
end

local f0_local3 = function ()
clearMatchData()
WipeGlobalModelsAtPath( f0_local0 )
end

LUI.FlowManager.RegisterStackPushBehaviour( "SystemLinkMenu", PushFunc )
LUI.FlowManager.RegisterStackPopBehaviour( "SystemLinkMenu", f0_local3 )

0 comments on commit 496537d

Please sign in to comment.