KF2-Server-Extension/ServerExt/Classes/ExtMoviePlayer_Manager.uc

129 lines
3.7 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class ExtMoviePlayer_Manager extends KFGFxMoviePlayer_Manager;
var ExtMenu_Gear EGearMenu;
var transient KFGUI_Page PerksPage;
2017-10-20 02:00:49 +00:00
event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
{
local PlayerController PC;
2020-11-28 20:04:55 +00:00
switch (WidgetName)
2017-10-20 02:00:49 +00:00
{
case 'gearMenu':
PC = GetPC();
2020-11-28 20:12:58 +00:00
if (PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun)
2017-10-20 02:00:49 +00:00
return true;
if (EGearMenu == none)
{
EGearMenu = ExtMenu_Gear(Widget);
EGearMenu.InitializeMenu(self);
}
2020-11-28 20:04:55 +00:00
OnMenuOpen(WidgetPath, EGearMenu);
2017-10-20 02:00:49 +00:00
return true;
default:
return Super.WidgetInitialized(WidgetName,WidgetPath,Widget);
}
}
2020-11-28 21:54:57 +00:00
2020-11-28 20:04:55 +00:00
function LaunchMenus(optional bool bForceSkipLobby)
2017-10-20 02:00:49 +00:00
{
local GFxWidgetBinding WidgetBinding;
local bool bSkippedLobby;
// Add either the in game party or out of game party widget
WidgetBinding.WidgetName = 'partyWidget';
bSkippedLobby = bForceSkipLobby || CheckSkipLobby();
WidgetBinding.WidgetClass = class'ExtWidget_PartyInGame';
ManagerObject.SetBool("backgroundVisible", false);
ManagerObject.SetBool("IISMovieVisible", false);
2020-11-28 20:12:58 +00:00
if (bSkippedLobby)
2017-10-20 02:00:49 +00:00
CurrentBackgroundMovie.Stop();
WidgetBindings.AddItem(WidgetBinding);
// Load the platform-specific graphics options menu
2020-11-28 20:12:58 +00:00
switch (class'KFGameEngine'.static.GetPlatform())
2017-10-20 02:00:49 +00:00
{
case PLATFORM_PC_DX10:
WidgetBinding.WidgetName = 'optionsGraphicsMenu';
WidgetBinding.WidgetClass = class'KFGFxOptionsMenu_Graphics_DX10';
WidgetBindings.AddItem(WidgetBinding);
break;
default:
WidgetBinding.WidgetName = 'optionsGraphicsMenu';
WidgetBinding.WidgetClass = class'KFGFxOptionsMenu_Graphics';
WidgetBindings.AddItem(WidgetBinding);
}
if (!bSkippedLobby)
{
LoadWidgets(WidgetPaths);
OpenMenu(UI_Start);
AllowCloseMenu();
}
// do this stuff in case CheckSkipLobby failed
2020-11-28 20:12:58 +00:00
if (bForceSkipLobby)
2017-10-20 02:00:49 +00:00
{
bAfterLobby = true;
CloseMenus(true);
}
}
2020-11-28 20:04:55 +00:00
function OpenMenu(byte NewMenuIndex, optional bool bShowWidgets = true)
{
local KF2GUIController GUIController;
2023-05-14 02:49:12 +00:00
GUIController = class'KF2GUIController'.Static.GetGUIController(GetPC());
2023-05-14 02:49:12 +00:00
Super.OpenMenu(NewMenuIndex, bShowWidgets);
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (bAfterLobby)
return;
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (NewMenuIndex == UI_Perks)
{
PerksPage = GUIController.OpenMenu(class'ExtGUI_PerkSelectionPage');
SetMovieCanReceiveInput(false);
PerksMenu.ActionScriptVoid("closeContainer");
}
else GUIController.CloseMenu(class'ExtGUI_PerkSelectionPage');
}
function CloseMenus(optional bool bForceClose=false)
{
local KF2GUIController GUIController;
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (PerksPage != None)
{
GUIController = class'KF2GUIController'.Static.GetGUIController(GetPC());
GUIController.CloseMenu(class'ExtGUI_PerkSelectionPage');
}
2023-05-14 02:49:12 +00:00
Super.CloseMenus(bForceClose);
}
2020-11-28 20:04:55 +00:00
function OnMenuOpen(name WidgetPath, KFGFxObject_Menu Widget)
{
Super.OnMenuOpen(WidgetPath, Widget);
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (!bAfterLobby && Widget == PerksMenu)
PerksMenu.ActionScriptVoid("closeContainer");
}
2017-10-20 02:00:49 +00:00
defaultproperties
{
InGamePartyWidgetClass=class'ExtWidget_PartyInGame'
2023-05-14 02:49:12 +00:00
WidgetPaths.Remove("../UI_Widgets/PartyWidget_SWF.swf")
WidgetPaths.Add("../UI_Widgets/VersusLobbyWidget_SWF.swf")
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
WidgetBindings.Remove((WidgetName="PerksMenu",WidgetClass=class'KFGFxMenu_Perks'))
WidgetBindings.Add((WidgetName="PerksMenu",WidgetClass=class'ExtMenu_Perks'))
WidgetBindings.Remove((WidgetName="gearMenu",WidgetClass=class'KFGFxMenu_Gear'))
WidgetBindings.Add((WidgetName="gearMenu",WidgetClass=class'ExtMenu_Gear'))
WidgetBindings.Remove((WidgetName="traderMenu",WidgetClass=class'KFGFxMenu_Trader'))
WidgetBindings.Add((WidgetName="traderMenu",WidgetClass=class'ExtMenu_Trader'))
//WidgetBindings.Remove((WidgetName="inventoryMenu",WidgetClass=class'KFGFxMenu_Inventory'))
//WidgetBindings.Add((WidgetName="inventoryMenu",WidgetClass=class'ExtMenu_Inventory'))
2017-10-20 02:00:49 +00:00
}