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

JBAddonJailCard.JBGUIPanelConfigJailCard


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
//=============================================================================
// JBGUIPanelConfigJailCard
// Copyright 2007 by [GSF]JohnDoe <gsfjohndoe@hotmail.com>
// Created by tarquin <tarquin@planetjailbreak.com>
// $Id: JBGUIPanelConfigJailCard.uc,v 1.6 2007-05-19 15:06:55 johndoe Exp $
//
// GUI options for the Get Out of Jail Free Card Addon
//
// CHANGELOG:
// 15 jan 2007 - Fixed GUI page to correctly communicate its changed variables
//               to the main addon class
//               Changed code to use the 'var automated' UT2004 exclusive
//               syntax
//=============================================================================


class JBGUIPanelConfigJailCard extends JBGUIPanelConfig;


//=============================================================================
// Constants
//=============================================================================
/*
Add-on class vars and defaults for reference:

var config bool bAutoUseCard;     // the GOOJF card is used automatically when jailed
  const DEFAULT_AUTOUSE_CARD      = False;

var config bool bAllowDropCard;   // can the GOOJF card be dropped?
  const DEFAULT_ALLOW_DROP        = True;

var config int  SpawnDelay;       // delay at round start before spawning card
  const DEFAULT_SPAWN_DELAY       = 0;

var config int  NumCards;         // number of cards to spawn
  const DEFAULT_NUM_CARDS         = 1;
*/

//=============================================================================
// Variables
//=============================================================================

var automated JBGUIComponentTrackbar ctbSliderSpawnDelay;
var automated JBGUIComponentTrackbar ctbSliderNumCards;
var automated moCheckBox  cbAutoUseCard;
var automated moCheckBox  cbAllowDropCard;
var private bool bInitialized;  // used to prevent executing SaveINISettings() during initialization


//=============================================================================
// InitComponent
//
// Loads the configurable values.
//=============================================================================

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

    LoadINISettings();
}


//=============================================================================
// LoadINISettings
//
// Loads the values of all config GUI controls.
//=============================================================================

function LoadINISettings()
{
  bInitialized = False;
  cbAutoUseCard.Checked(class'JBAddonJailCard'.default.bAutoUseCard);
  cbAllowDropCard.Checked(class'JBAddonJailCard'.default.bAllowDropCard);
  ctbSliderSpawnDelay.SetValue(class'JBAddonJailCard'.default.SpawnDelay);
  ctbSliderNumCards.SetValue(class'JBAddonJailCard'.default.NumCards);
  bInitialized = True;
}


//=============================================================================
// SaveINISettings
//
// Called when a value of a control changed.
// Saves the values of all config GUI controls.
//=============================================================================

function SaveINISettings(GUIComponent Sender)
{
if ( !bInitialized )
    return;

  class'JBAddonJailCard'.default.SpawnDelay = int(ctbSliderSpawnDelay.GetValue());
  class'JBAddonJailCard'.default.NumCards = int(ctbSliderNumCards.GetValue());
  class'JBAddonJailCard'.default.bAutoUseCard = cbAutoUseCard.IsChecked();
  class'JBAddonJailCard'.default.bAllowDropCard = cbAllowDropCard.IsChecked();

  class'JBAddonJailCard'.static.StaticSaveConfig();
}


//=============================================================================
// ResetConfiguration
//
// Resets the configurable properties to their default values.
//=============================================================================

function ResetConfiguration()
{
  class'JBAddonJailCard'.static.ResetConfiguration();
  LoadINISettings();
}


//=============================================================================
// Default properties
//=============================================================================

defaultproperties
{
  Begin Object Class=moCheckBox Name=CheckBoxAutoUseCard
    WinTop    = 0.01; // Check box text is a tiny bit too high at 0.
    WinLeft   = 0.0;
    WinHeight = 0.07; // for button to be right size
    WinWidth  = 0.667; // sets how far button is from left edge
    bHeightFromComponent = False;
    CaptionWidth  = 0.9;
    bSquare = True; // makes button round
    Caption="Use card automatically"
    Hint="You are freed as soon as you are jailed!"
    OnChange=SaveINISettings
  End Object
  cbAutoUseCard = CheckBoxAutoUseCard

  Begin Object Class=moCheckBox Name=CheckBoxAllowDropCard
    WinTop    = 0.21;
    WinLeft   = 0.0;
    WinHeight = 0.07; // for button to be right size
    WinWidth  = 0.667; // sets how far button is from left edge
    bHeightFromComponent = False;
    CaptionWidth  = 0.9;
    bSquare = True; // makes button round
    Caption="Card can be dropped (shieldgun frag)"
    Hint="You may drop the card for another player to pick up."
    OnChange=SaveINISettings
  End Object
  cbAllowDropCard = CheckBoxAllowDropCard

  Begin Object Class=JBGUIComponentTrackbar Name=SliderSpawnDelay
    WinTop    =0.4 // row 3
    WinLeft   =0.0
    WinHeight =0.1
    WinWidth  =1.0
    CaptionWidth  = -1;
    SliderWidth   = 0.34;
    EditBoxWidth  = 0.18;
    Caption="Spawn delay"
    Hint="Seconds after round start before card spawns."
    MinValue=0
    MaxValue=180
    bIntegerOnly=True
    OnChange=SaveINISettings
  End Object
  ctbSliderSpawnDelay = SliderSpawnDelay

  Begin Object Class=JBGUIComponentTrackbar Name=SliderNumCards
    WinTop    =0.6 // row 4
    WinLeft   =0.0
    WinHeight =0.1
    WinWidth  =1.0
    CaptionWidth  = -1;
    SliderWidth   = 0.34;
    EditBoxWidth  = 0.18;
    Caption="Number of cards"
    Hint="How many cards are spawned in the game."
    MinValue=1
    MaxValue=4  // only for testing, not sure if a game should have more than 1 JailCard
    bIntegerOnly=True
    OnChange=SaveINISettings
  End Object
  ctbSliderNumCards = SliderNumCards
}












Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: So 16.3.2008 13:48:06.000 - Creation time: Do 14.8.2014 09:58:42.399 - Created with UnCodeX