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

GUI2K4.UT2K4SP_CGBRTrade


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
//==============================================================================
// Single Player Challenge Bloodrite Trade page
// Message that you won a player and have to assign it to your team
//
// Written by Michiel Hendriks
// (c) 2003, 2004, Epic Games, Inc. All Rights Reserved
//==============================================================================

class UT2K4SP_CGBRTrade extends UT2K4SP_CGBRUnTrade;

var automated GUICharacterListTeam clSelChar;
var automated GUIButton btnNextChar, btnPrevChar;

/** Warn the player that there's no empty spot */
var localized string FullTeamWarning;
/** Info about the player being fires */
var localized string FireInfo;
/** true if the player has afull team */
var bool bHasFullTeam;

var UT2K4GameProfile GP;

event InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    lblTitle.WinWidth=0.762501;
    lblTitle.WinHeight=0.058750;
    lblTitle.WinLeft=0.024063;
    lblTitle.WinTop=0.067846;

    imgPictureBg.WinWidth=0.121667;
    imgPictureBg.WinHeight=0.326250;
    imgPictureBg.WinLeft=0.044722;
    imgPictureBg.WinTop=0.149198;

    imgPicture.WinWidth=0.116667;
    imgPicture.WinHeight=0.312500;
    imgPicture.WinLeft=0.048472;
    imgPicture.WinTop=0.164198;

    btnOk.WinWidth=0.222222;
    btnOk.WinHeight=0.050694;
    btnOk.WinLeft=0.360070;
    btnOk.WinTop=0.821064;

    sbMessage.WinWidth=0.458332;
    sbMessage.WinHeight=0.306111;
    sbMessage.WinLeft=0.213542;
    sbMessage.WinTop=0.182976;

    super.InitComponent(MyController, MyOwner);
    GP = UT2K4GameProfile(PlayerOwner().Level.Game.CurrentGameProfile);
    bHasFullTeam = GP.HasFullTeam();
    clSelChar.PopulateList(GP.PlayerTeam);
    clSelChar.Index = 0;
    if (!bHasFullTeam)
    {
        btnNextChar.DisableMe();
        btnPrevChar.DisableMe();
        clSelChar.DisableMe();
    }
}

function SetDescription()
{
    local string tmp;
    if (bHasFullTeam)
    {
        tmp = Message$"||"$FullTeamWarning$"||"$FireInfo;

        tmp = repl(tmp, "%player%", TargetPlayerName);
        tmp = repl(tmp, "%enemyteam%", ETI.default.TeamName);

        tmp = repl(tmp, "%fireplayer%", clSelChar.GetName());
        tmp = repl(tmp, "%refund%", GP.MoneyToString(GP.GetBotPrice(clSelChar.GetName())));

        sbMessage.SetContent(tmp);
    }
    else super.SetDescription();
}

function UpdateDetails(GUIComponent Sender)
{
    SetDescription();
}

function bool onSelectChar(GUIComponent Sender)
{
    if ( Sender == btnPrevChar )
    {
        clSelChar.ScrollLeft();
    }
    else if ( Sender == btnNextChar )
    {
        clSelChar.ScrollRight();
    }
    return true;
}

function OnClose(optional bool bCancel)
{
    if (bHasFullTeam) GP.ReleaseTeammate(clSelChar.GetName());
    GP.AddTeammate(TargetPlayerName);
}

defaultproperties
{
     Begin Object Class=GUICharacterListTeam Name=CGBclSelChar
         FixedItemsPerPage=1
         StyleName="CharButton"
         Hint="You will fire this team mate"
         WinTop=0.149584
         WinLeft=0.807213
         WinWidth=0.124694
         WinHeight=0.325000
         TabOrder=0
         bBoundToParent=True
         OnClick=CGBclSelChar.InternalOnClick
         OnRightClick=CGBclSelChar.InternalOnRightClick
         OnMousePressed=CGBclSelChar.InternalOnMousePressed
         OnMouseRelease=CGBclSelChar.InternalOnMouseRelease
         OnChange=UT2K4SP_CGBRTrade.UpdateDetails
         OnKeyEvent=CGBclSelChar.InternalOnKeyEvent
         OnBeginDrag=CGBclSelChar.InternalOnBeginDrag
         OnEndDrag=CGBclSelChar.InternalOnEndDrag
         OnDragDrop=CGBclSelChar.InternalOnDragDrop
         OnDragEnter=CGBclSelChar.InternalOnDragEnter
         OnDragLeave=CGBclSelChar.InternalOnDragLeave
         OnDragOver=CGBclSelChar.InternalOnDragOver
     End Object
     clSelChar=GUICharacterListTeam'GUI2K4.UT2K4SP_CGBRTrade.CGBclSelChar'

     Begin Object Class=GUIButton Name=CGBbtnNextChar
         StyleName="ArrowRight"
         Hint="Select the team mate you want to fire"
         WinTop=0.806667
         WinLeft=0.898438
         WinWidth=0.048750
         WinHeight=0.061250
         bBoundToParent=True
         bNeverFocus=True
         bRepeatClick=True
         OnClickSound=CS_Up
         OnClick=UT2K4SP_CGBRTrade.onSelectChar
         OnKeyEvent=CGBbtnNextChar.InternalOnKeyEvent
     End Object
     btnNextChar=GUIButton'GUI2K4.UT2K4SP_CGBRTrade.CGBbtnNextChar'

     Begin Object Class=GUIButton Name=CGBbtnPrevChar
         StyleName="ArrowLeft"
         Hint="Select the team mate you want to fire"
         WinTop=0.806667
         WinLeft=0.805001
         WinWidth=0.048750
         WinHeight=0.061250
         bBoundToParent=True
         bNeverFocus=True
         bRepeatClick=True
         OnClickSound=CS_Down
         OnClick=UT2K4SP_CGBRTrade.onSelectChar
         OnKeyEvent=CGBbtnPrevChar.InternalOnKeyEvent
     End Object
     btnPrevChar=GUIButton'GUI2K4.UT2K4SP_CGBRTrade.CGBbtnPrevChar'

     FullTeamWarning="However your team is already at capacity. You will have to fire one of your team mates first. You will be refunded for the loss of the selected player."
     FireInfo="You have selected to fire %fireplayer%, the refund will be %refund%."
     Message="You have won the challenge against %enemyteam%. %player% will now become part of your team."
     DefaultLeft=0.100000
     DefaultWidth=0.800000
     WinLeft=0.100000
     WinWidth=0.800000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Tue 24/10/2006 17:13:16.000 - Creation time: Wed 7/2/2007 19:16:57.093 - Created with UnCodeX