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

GUI2K4.UT2K4Tab_RulesBase


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
//==============================================================================
//  Created on: 12/11/2003
//  Description
//
//  Written by Ron Prestenback
//  © 2003, Epic Games, Inc. All Rights Reserved
//==============================================================================

class UT2K4Tab_RulesBase extends UT2K4GameTabBase;

var automated   GUITabControl           c_Rules;
//var automated	PlayInfoListBox			lb_Summary;
//var				PlayInfoList			li_Summary;

var config array<float>                 HeaderColumnPerc;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    Super.InitComponent(MyController, MyOwner);

    Assert(p_Anchor != None && p_Anchor.RuleInfo != None);
}

event Opened(GUIComponent Sender)
{
//log(Self@"Opened");
    Refresh();
    Super.Opened(Sender);
}

// Playinfo has been refreshed - update tabs and controls
function Refresh()
{
    local int i, j;
    Super.Refresh();

    // Update the summary list when the new settings
//	li_Summary.GamePI = p_Anchor.RuleInfo;
//	li_Summary.Refresh();

    // First, find out if we need to remove any tabs
    // This is likely to be the case if we have mutators have been removed which were adding new groups to playinfo
    for (i = 0; i < c_Rules.TabStack.Length; i++)
    {
        j = FindGroupIndex(c_Rules.TabStack[i].Caption);
        if (j < 0)
            c_Rules.RemoveTab(,c_Rules.TabStack[i--]);
    }

    // Then, go through and tag all panels to refresh themselves the next time they are shown
    for (i = 0; i < c_Rules.TabStack.Length; i++)
        if (InstantActionRulesPanel(c_Rules.TabStack[i].MyPanel) != None)
        {
            InstantActionRulesPanel(c_Rules.TabStack[i].MyPanel).GamePI = p_Anchor.RuleInfo;
            InstantActionRulesPanel(c_Rules.TabStack[i].MyPanel).bRefresh = True;
        }

    // Next, find out if we need to add any tabs
    for (i = 0; i < p_Anchor.RuleInfo.Groups.Length; i++)
    {
        j = c_Rules.TabIndex(p_Anchor.RuleInfo.Groups[i]);
        if (j < 0)
            c_Rules.AddTab(p_Anchor.RuleInfo.Groups[i], "GUI2K4.InstantActionRulesPanel",,p_Anchor.RuleInfo.Groups[i]@"Settings");
    }

    // Finally, go through and tag all panels to update themselves with the fresh
    // information from PlayInfo
    for (i = 0; i < c_Rules.TabStack.Length; i++)
        if (InstantActionRulesPanel(c_Rules.TabStack[i].MyPanel) != None)
            InstantActionRulesPanel(c_Rules.TabStack[i].MyPanel).bUpdate = True;
}

function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender)
{
    if (Sender == c_Rules)
    {
        if (InstantActionRulesPanel(NewComp) != None)
        {
            InstantActionRulesPanel(NewComp).tp_Anchor = Self;
            InstantActionRulesPanel(NewComp).GamePI = p_Anchor.RuleInfo;
        }
    }

//	else if (Sender == lb_Summary)
//	{
//		li_Summary = PlayInfoList(NewComp);
//		lb_Summary.InternalOnCreateComponent(NewComp, Sender);
//	}
}


function int FindGroupIndex(string Group)
{
    local int i;

    Assert(p_Anchor != None && p_Anchor.RuleInfo != None);
    for (i = 0; i < p_Anchor.RuleInfo.Groups.Length; i++)
        if (p_Anchor.RuleInfo.Groups[i] ~= Group)
            return i;

    return -1;
}
/*
function string InternalOnSaveINI(GUIComponent Sender)
{
    HeaderColumnPerc = lb_Summary.HeaderColumnPerc;
    SaveConfig();
    return "";
}
*/

defaultproperties
{
     Begin Object Class=GUITabControl Name=RuleTabControl
         bFillSpace=Wahr
         bDockPanels=Wahr
         bDrawTabAbove=Falsch
         TabHeight=0.040000
         BackgroundStyleName="TabBackground"
         OnCreateComponent=UT2K4Tab_RulesBase.InternalOnCreateComponent
         WinHeight=1.000000
         TabOrder=0
         bBoundToParent=Wahr
         bScaleToParent=Wahr
         OnActivate=RuleTabControl.InternalOnActivate
     End Object
     c_Rules=GUITabControl'GUI2K4.UT2K4Tab_RulesBase.RuleTabControl'

     HeaderColumnPerc(0)=0.750000
     HeaderColumnPerc(1)=0.250000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:44:00.000 - Creation time: Mo 16.4.2007 11:20:56.796 - Created with UnCodeX