Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

ROInterface.ROCommunicationPage


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
//-----------------------------------------------------------
// ROCommunicationPage
// Programmed by Puma
// Last change: 05.16.2004
//
// Contains the main menu for Voice Communication
// Copyright 2004 by Red Orchestra
///-----------------------------------------------------------
class ROCommunicationPage extends LargeWindow;

var(MidGame) array<GUITabItem> Panels;
var(MidGame) GUITabItem        SPRulesPanel;
var(MidGame) GUITabItem        IARulesPanel;

var(MidGame) automated GUITabControl c_Main;

var automated GUIButton b_Reset, b_Close;

var ROUT2K4Tab_MidGameVoiceChat mainpanel;

function InitComponent(GUIController MyController, GUIComponent MyComponent)
{
	local PlayerController PC;
	local string saved_caption;

	Super.InitComponent(MyController, MyComponent);

    class'ROInterfaceUtil'.static.SetROStyle(MyController, Controls);

	// rjp -- when playing SinglePlayer or InstantAction game, remove tabs which only apply to multiplayer
	PC = PlayerOwner();
//    if ( PC != None && PC.Level.NetMode == NM_StandAlone )
//		RemoveMultiplayerTabs(PC.Level.Game);
	// -- rjp

    saved_caption = Panels[0].Caption;

	if ( Panels.Length > 0 )
		AddPanels();

	SetTitle();
	//T_WindowTitle.DockedTabs = c_Main;

    /*myStyleName = "ROTitleBar";
    T_WindowTitle.StyleName = myStyleName;
    T_WindowTitle.Style = MyController.GetStyle(myStyleName,t_WindowTitle.FontScale);

    c_Main.bFillSpace = True;
	// Change the Style of the Tabs; Puma 05-11-2004
    */
    /*myStyleName = "ROTabButton";
	for ( i = 0; i < c_Main.TabStack.Length; i++ )
	{
		if ( c_Main.TabStack[i] != None )
		{
			c_Main.TabStack[i].FontScale=FNS_Small;
			c_Main.TabStack[i].bAutoSize=True;
			c_Main.TabStack[i].bAutoShrink=False;
            //c_Main.TabStack[i].StyleName = myStyleName;
            //c_Main.TabStack[i].Style = MyController.GetStyle(myStyleName,c_Main.FontScale);
        }
	} */

	c_Main.TabStack[0].SetVisibility(false);
	mainpanel = ROUT2K4Tab_MidGameVoiceChat(c_Main.BorrowPanel(saved_caption));
	mainpanel.b_Reset = b_Reset;
}

function bool FloatingPreDraw( Canvas C )
{
	if (PlayerOwner().GameReplicationInfo!=None)
		SetVisibility(true);
	else
		SetVisibility(false);

	return false;
}

function bool InternalOnClick(GUIComponent Sender)
{
	if ( Sender == b_Reset )
	{
	    return mainpanel.InternalOnClick(Sender);
	}
    else if (Sender == b_Close)
    {
        Controller.CloseMenu(False);
    }

    return false;
}


function InternalOnClose(optional Bool bCanceled)
{
	local PlayerController PC;

	PC = PlayerOwner();

	// Turn pause off if currently paused
	if(PC != None && PC.Level.Pauser != None)
		PC.SetPause(false);

	Super.OnClose(bCanceled);
}

function AddPanels()
{
	local int i;
	local MidGamePanel Panel;

	for ( i = 0; i < Panels.Length; i++ )
	{
		Panel = MidGamePanel(c_Main.AddTabItem(Panels[i]));
		if ( Panel != None )
			Panel.ModifiedChatRestriction = UpdateChatRestriction;
	}
}

// Called via delegate by a MidGamePanel when a player chat restriction has been updated
// this notifies all other panels about the change
function UpdateChatRestriction( MidGamePanel Sender, int PlayerID )
{
	local int i;

	if ( Sender == None )
		return;

	for ( i = 0; i < c_Main.TabStack.Length; i++ )
	{
		if ( c_Main.TabStack[i] != None && MidGamePanel(c_Main.TabStack[i].MyPanel) != None &&
			c_Main.TabStack[i].MyPanel != Sender )
			MidGamePanel(c_Main.TabStack[i].MyPanel).UpdateChatRestriction(PlayerID);
	}
}

function SetTitle()
{
	local PlayerController PC;

	PC = PlayerOwner();
	if ( PC.Level.NetMode == NM_StandAlone || PC.GameReplicationInfo == None || PC.GameReplicationInfo.ServerName == "" )
		WindowName = PC.Level.GetURLMap();
	else WindowName = PC.GameReplicationInfo.ServerName;

	t_WindowTitle.SetCaption(WindowName);
}

function RemoveMultiplayerTabs(GameInfo Game)
{

	Panels.Remove(0,1);
/****\
	if (Game.CurrentGameProfile != none)
		Panels[2] = SPRulesPanel; //there's no map rotation in a single player tournament

	Panels.Remove(3,1);
	Panels.Remove(1,1);
\*****/
}

event bool NotifyLevelChange()
{
	bPersistent = false;
	LevelChanged();
	return true;
}

/*function bool SystemMenuPreDraw(canvas Canvas)
{
	b_ExitButton.SetPosition( t_WindowTitle.ActualLeft() + (t_WindowTitle.ActualWidth()-35), t_WindowTitle.ActualTop()+10, 24, 24, true);
	return true;
}*/

defaultproperties
{
     Panels(0)=(ClassName="ROInterface.ROUT2K4Tab_MidGameVoiceChat",Caption="Communication",Hint="Manage communication with other players")
     SPRulesPanel=(ClassName="ROInterface.ROUT2K4Tab_ServerInfo",Caption="Rules",Hint="Game settings")
     Begin Object Class=GUITabControl Name=LoginMenuTC
         bFillSpace=True
         bDockPanels=True
         TabHeight=0.000000
         WinTop=0.050000
         WinLeft=0.012500
         WinWidth=0.974999
         WinHeight=0.900000
         bBoundToParent=True
         bScaleToParent=True
         bAcceptsInput=True
         OnActivate=LoginMenuTC.InternalOnActivate
     End Object
     c_Main=GUITabControl'ROInterface.ROCommunicationPage.LoginMenuTC'

     Begin Object Class=GUIButton Name=ResetButton
         Caption="Reset"
         MenuState=MSAT_Disabled
         Hint="Reset & reload all player chat restrictions"
         WinTop=0.841335
         WinLeft=0.607745
         WinWidth=0.120067
         TabOrder=7
         bStandardized=True
         OnClick=ROCommunicationPage.InternalOnClick
         OnKeyEvent=ResetButton.InternalOnKeyEvent
     End Object
     b_Reset=GUIButton'ROInterface.ROCommunicationPage.ResetButton'

     Begin Object Class=GUIButton Name=CloseButton
         Caption="Close"
         Hint="Close this window"
         WinTop=0.841335
         WinLeft=0.738995
         WinWidth=0.120067
         TabOrder=8
         bStandardized=True
         OnClick=ROCommunicationPage.InternalOnClick
         OnKeyEvent=CloseButton.InternalOnKeyEvent
     End Object
     b_Close=GUIButton'ROInterface.ROCommunicationPage.CloseButton'

     DefaultLeft=0.110313
     DefaultTop=0.057916
     DefaultWidth=0.779688
     DefaultHeight=0.847083
     bPersistent=True
     bAllowedAsLast=True
     WinTop=0.057916
     WinLeft=0.110313
     WinWidth=0.779688
     WinHeight=0.847083
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:28.000 - Creation time: Fri 13-10-2023 03:19:06.837 - Created with UnCodeX