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 |
// ============================================================================ // JBAddon // Copyright 2003 by Mychaeel <mychaeel@planetjailbreak.com> // $Id: JBAddon.uc,v 1.13 2007-05-04 14:36:27 jrubzjeknf Exp $ // // Base class for Jailbreak Add-On mutators. Introduced only for the sake of // distinguishing them from regular mutators in the user interface, but also // provides some useful tool functions. // // See http://www.planetjailbreak.com/jdn/Jailbreak_Add-Ons for details. // ============================================================================ class JBAddon extends Mutator abstract; // ============================================================================ // Properties // ============================================================================ var const bool bIsOverlay; // set to have RenderOverlays called client-side // ============================================================================ // Variables // ============================================================================ var JBGameReplicationInfo JBGameReplicationInfo; var PlayerController PlayerControllerLocal; // ============================================================================ // MutatorIsAllowed // // Disallows this add-on unless it is run for a Jailbreak game. // ============================================================================ function bool MutatorIsAllowed() { return (Jailbreak(Level.Game) != None); } // ============================================================================ // state Startup // // Waits for a tick to ensure that the local player controller has been // spawned if any is spawned at all, then registers this actor as an overlay. // ============================================================================ auto simulated state Startup { Begin: Sleep(0.0); if (PlayerControllerLocal == None) PlayerControllerLocal = Level.GetLocalPlayerController(); if (bIsOverlay && PlayerControllerLocal != None) JBInterfaceHud(PlayerControllerLocal.myHud).RegisterOverlay(Self); } // state Startup // ============================================================================ // InitAddon // // Called server- and client-side when the game type has finished its own // initialization. Sets the JBGameReplicationInfo reference. // ============================================================================ simulated function InitAddon() { PlayerControllerLocal = Level.GetLocalPlayerController(); if (Level.Game != None) JBGameReplicationInfo = JBGameReplicationInfo(Level.Game.GameReplicationInfo); else JBGameReplicationInfo = JBGameReplicationInfo(PlayerControllerLocal.GameReplicationInfo); } // ============================================================================ // PostNetBeginPlay // // Calls the InitAddon function client-side. Server-side, InitAddon is called // by the game type PostBeginPlay event itself. // ============================================================================ simulated event PostNetBeginPlay() { if (Role < ROLE_Authority) InitAddon(); } // ============================================================================ // RenderOverlays // // If bIsOverlay is set to True, called client-side once per frame to allow // the add-on to draw on the screen. // ============================================================================ simulated function RenderOverlays(Canvas Canvas); // ============================================================================ // NotifyLevelChange // // Called client-side and on listen servers when the level changes. // ============================================================================ simulated function NotifyLevelChange(); // ============================================================================ // PlayInfoGroup // // Returns the name to be used for this add-on in FillPlayInfo. // ============================================================================ static function string PlayInfoGroup() { return Class'Jailbreak'.Default.TextWebAdminPrefixAddon @ Default.FriendlyName; } // ============================================================================ // GetServerDetails // // Puts Jailbreak add-ons into a separate list so that Jailbreak servers show // up in the server browser even if Standard Servers Only is checked. // ============================================================================ function GetServerDetails(out GameInfo.ServerResponseLine ServerState) { local int iServerInfo; iServerInfo = ServerState.ServerInfo.Length; ServerState.ServerInfo.Insert(iServerInfo, 1); ServerState.ServerInfo[iServerInfo].Key = "AddOn"; ServerState.ServerInfo[iServerInfo].Value = GetHumanReadableName(); } // ============================================================================ // Destroyed // // Automatically unregisters this actor if bIsOverlay is set to True. // ============================================================================ simulated event Destroyed() { if (bIsOverlay && PlayerControllerLocal != None) JBInterfaceHud(PlayerControllerLocal.myHud).UnregisterOverlay(Self); if (Role == ROLE_Authority) Super.Destroyed(); } // ============================================================================ // Defaults // ============================================================================ defaultproperties { bAddToServerPackages = True; } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |