Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SRSettingsTab extends UT2K4TabPanel
- editinlinenew
- instanced;
- var() automated GUICheckBoxButton ch_ShowDamages;
- var() automated GUILabel ShowdamagesLabel;
- var SRPlayerReplicationInfo SRPRI;
- function InitComponent(GUIController MyController, GUIComponent MyOwner)
- {
- Super.InitComponent(MyController, MyOwner);
- SRPRI = SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);
- ...
- ch_ShowDamages.bChecked = bool(class'SRMySettings'.static.Get("bShowDamage"));
- SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).SendSettingsToServer("bShowDamage", string(int(ch_ShowDamages.bChecked)));
- SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).bShowDamage = ch_ShowDamages.bChecked;
- ReSizeButtons();
- }
- //Следующие 2 функции я использую, чтобы элемент управления GUICheckBoxButton был квадратный независимо от разрешения монитора
- function ResolutionChanged(int ResX, int ResY)
- {
- Super.ResolutionChanged(ResX,ResY);
- ReSizeButtons();
- }
- function ReSizeButtons()
- {
- local float bSize;
- bSize=i_BGSec.ActualWidth() / 25.0;
- ...
- ch_ShowDamages.WinHeight = bSize;
- ch_ShowDamages.WinWidth = bSize;
- }
- //Если мы нажимаем на GUICheckBoxButton и разрешаем или запрещаем поднимать пушки - переменная bAllowPickup в SRPlayerReplicationInfo изменяется. И на клиенте и на сервере.
- function InternalOnChange( GUIComponent C )
- {
- if((PlayerOwner().PlayerReplicationInfo != none) && SRPRI == none)
- {
- SRPRI = SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);
- }
- if ( C == checkBoxAllowPickup )
- {
- ...
- }
- if ( C == ch_NoobCrosshair )
- {
- ...
- }
- if(C==checkBoxChangeView)
- {
- Stuff here...
- }
- if ( C == ch_ShowDamages )
- {
- class'SRMySettings'.static.Set("bShowDamage", string(int(ch_ShowDamages.bChecked)));
- SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).SendSettingsToServer("bShowDamage", string(int(ch_ShowDamages.bChecked)));
- SRPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo).bShowDamage = ch_ShowDamages.bChecked;
- }
- }
- defaultproperties
- {
- ...
- //CheckBox Button
- //Checked
- Begin Object Class=GUICheckBoxButton Name=ShowDamages
- Hint="If checked, the damage you're doing to zeds will pop up on your screen"
- WinTop=0.30
- WinLeft=0.680
- WinWidth=0.050
- OnChange=SRSettingsTab.InternalOnChange
- OnKeyEvent=ShowDamages.InternalOnKeyEvent
- End Object
- ch_ShowDamages=ShowDamages
- //Text
- //Checked
- Begin Object Class=GUILabel Name=ShowdamagesLabelD
- Caption="Show Damages [In testing period]"
- VertAlign=1
- StyleName="TextLabel"
- WinTop=0.30
- WinLeft=0.30
- WinWidth=0.40
- WinHeight=0.040
- End Object
- ShowdamagesLabel=ShowdamagesLabelD
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement