Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
//============================================================================== // Created on: 09/14/2003 // Configures a keybind and channel name for quickly switching active voice chat room // // Written by Ron Prestenback // © 2003, Epic Games, Inc. All Rights Reserved //============================================================================== class VoiceChatKeyBindPage extends LargeWindow; var automated GUILabel l_PageTitle, l_KeyLabel1, l_KeyLabel2, l_Key1, l_Key2; var automated moEditBox ed_ChannelName; var automated GUIButton b_OK/*, b_Cancel*/; var localized string NoneText, AnyKeyText; var string Channel; var array<string> Keys, LocalizedKeys; function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.InitComponent(MyController, MyOwner); l_Key1.Caption = NoneText; l_Key2.Caption = NoneText; } function HandleParameters(string Value, string Nothing) { Channel = Value; ed_ChannelName.SetText(Channel); GetBinds(); } function GetBinds() { UpdateLabel(l_Key1, False); UpdateLabel(l_Key2, False); Controller.GetAssignedKeys("Speak" @ Channel, Keys, LocalizedKeys); if ( LocalizedKeys.Length > 0 ) l_Key1.Caption = LocalizedKeys[0]; if ( LocalizedKeys.Length > 1 ) l_Key2.Caption = LocalizedKeys[1]; } function bool CloseClick(GUIComponent Sender) { Controller.CloseMenu(False); return true; } function InternalOnChange(GUIComponent Sender) { switch ( Sender ) { case ed_ChannelName: Channel = ed_ChannelName.GetText(); break; } } function bool KeyClick(GUIComponent Sender) { if ( GUILabel(Sender) != None ) { UpdateLabel( GUILabel(Sender), True ); Controller.OnNeedRawKeyPress = RawKeyPress; Controller.Master.bRequireRawJoystick = True; PlayerOwner().ConsoleCommand("toggleime 0"); return true; } return false; } function UpdateLabel( GUILabel Label, bool bWaitingForRawInput ) { if ( Label == None ) return; if ( bWaitingForRawInput ) { Label.Caption = AnyKeyText; Label.FontScale = FNS_Small; } else { Label.FontScale = FNS_Medium; Label.Caption = NoneText; } } function bool RawKeyPress(byte NewKey) { local string NewKeyName, LocalizedKeyName; Controller.OnNeedRawKeyPress = None; Controller.Master.bRequireRawJoystick = False; PlayerOwner().ConsoleCommand("toggleime 1"); if ( NewKey == 0x1B ) { GetBinds(); return true; } Controller.KeyNameFromIndex( NewKey, NewKeyName, LocalizedKeyName ); Controller.SetKeyBind( NewKeyName, "Speak" @ Channel ); PlayerOwner().ClientPlaySound(Controller.ClickSound); GetBinds(); return true; } defaultproperties { Begin Object Class=GUILabel Name=Title Caption="Modify Quick Switch KeyBind" FontScale=FNS_Large StyleName="TextLabel" WinTop=0.388802 WinLeft=0.185352 WinWidth=0.629687 WinHeight=0.068164 End Object l_PageTitle=GUILabel'GUI2K4.VoiceChatKeyBindPage.Title' Begin Object Class=GUILabel Name=KeyLabel1 Caption="Key 1" StyleName="TextLabel" WinTop=0.487760 WinLeft=0.464649 WinWidth=0.082813 WinHeight=0.038867 End Object l_KeyLabel1=GUILabel'GUI2K4.VoiceChatKeyBindPage.KeyLabel1' Begin Object Class=GUILabel Name=KeyLabel2 Caption="Key 2" StyleName="TextLabel" WinTop=0.487760 WinLeft=0.654102 WinWidth=0.200000 WinHeight=0.038867 End Object l_KeyLabel2=GUILabel'GUI2K4.VoiceChatKeyBindPage.KeyLabel2' Begin Object Class=GUILabel Name=Key1 bMultiLine=Wahr StyleName="TextLabel" WinTop=0.529427 WinLeft=0.463673 WinWidth=0.163867 WinHeight=0.082813 bAcceptsInput=Wahr OnClick=VoiceChatKeyBindPage.KeyClick End Object l_Key1=GUILabel'GUI2K4.VoiceChatKeyBindPage.Key1' Begin Object Class=GUILabel Name=Key2 bMultiLine=Wahr StyleName="TextLabel" WinTop=0.529427 WinLeft=0.654102 WinWidth=0.130664 WinHeight=0.082813 bAcceptsInput=Wahr OnClick=VoiceChatKeyBindPage.KeyClick End Object l_Key2=GUILabel'GUI2K4.VoiceChatKeyBindPage.Key2' Begin Object Class=moEditBox Name=ChannelName bVerticalLayout=Wahr LabelJustification=TXTA_Center Caption="Channel Name" OnCreateComponent=ChannelName.InternalOnCreateComponent WinTop=0.486458 WinLeft=0.142383 WinWidth=0.278125 WinHeight=0.087695 OnChange=VoiceChatKeyBindPage.InternalOnChange End Object ed_ChannelName=moEditBox'GUI2K4.VoiceChatKeyBindPage.ChannelName' Begin Object Class=GUIButton Name=OkButton Caption="Apply" WinTop=0.616667 WinLeft=0.673633 WinWidth=0.116992 OnClick=VoiceChatKeyBindPage.CloseClick OnKeyEvent=OkButton.InternalOnKeyEvent End Object b_OK=GUIButton'GUI2K4.VoiceChatKeyBindPage.OkButton' NoneText="None" AnyKeyText="Press Any Key|To Bind Command" WinTop=0.375000 WinLeft=0.000000 WinWidth=1.000000 WinHeight=0.300000 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |