Prepare fixtures

This commit is contained in:
dkanus 2026-07-14 20:27:09 +07:00
commit 9c94356263
6021 changed files with 722805 additions and 22 deletions

View file

@ -0,0 +1,16 @@
class ActortList extends Object
PerObjectConfig
Config(HideMut);
var config array<string> uselessStaticMeshes;
var config array<string> uselessEmitters;
var config array<string> uselessLights;
var config array<string> uselessDecorations;
var config array<string> uselessMovers;
var config array<string> uselessProjectors;
var config array<string> uselessRotatingMeshActors;
defaultproperties
{
}

View file

@ -0,0 +1,78 @@
class ActortListController extends object;
simulated function array<string> getUselessStaticMeshes(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessStaticMeshes;
}
simulated function array<string> getUselessEmitters(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessEmitters;
}
simulated function array<string> getUselessLights(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessLights;
}
simulated function array<string> getUselessDecorations(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessDecorations;
}
simulated function array<string> getUselessMovers(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessMovers;
}
simulated function array<string> getUselessProjectors(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessProjectors;
}
simulated function array<string> getUselessRotatingMeshActors(string listName)
{
local ActortList currentActortList;
currentActortList = new(none, listName) class'ActortList';
return currentActortList.uselessRotatingMeshActors;
}
simulated function array<string> GetAllActortLists()
{
local array<string> Names;
// local int i;
Names = GetPerObjectNames("HideMut", string(class'ActortList'.name));
return Names;
}
defaultproperties
{
}

View file

@ -0,0 +1,8 @@
class BackgroundArea extends GUIImage;
defaultproperties
{
Image=Texture'KF_InterfaceArt_tex.Menu.Thin_border_SlightTransparent'
ImageStyle=ISTY_Stretched
ImageRenderStyle=MSTY_Normal
}

View file

@ -0,0 +1,36 @@
class ChatAnimator extends Object;
// var KFPlayerController pc;
// var string chatMessage;
var int spamLoops;
static function textspam(KFPlayerController pc, string msg)
{
local int i;
// local float f;
while (pc != none && i <= default.spamLoops)
{
pc.serverSay(msg);
i++;
}
}
// function timer()
// {
// local int i;
// while
// // pc.myHUD.AddTextMessage(chatMessage, class'LocalMessage', pc.playerReplicationInfo);
// spamLoops++;
// if(spamLoops > 100)
// {
// }
// }
defaultproperties
{
spamLoops=100
}

View file

@ -0,0 +1,13 @@
class Halo extends Light
transient;
defaultproperties
{
LightBrightness=60.000000
LightRadius=50.000000
bStatic=False
bNoDelete=False
bDynamicLight=True
RemoteRole=ROLE_None
bMovable=True
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,242 @@
// base class, not vanilla
class HideLobbyChat extends FloatingWindow;
var automated GUISectionBackground sB_Main;
var automated moEditBox eb_Send;
var automated GUIScrollTextBox lb_Chat;
var bool bVoiceRepeat;
var() editinline array<byte> CloseKey;
var() editinlinenotify color TextColor[3];
// Marco SP, don't keep this one around..
function bool NotifyLevelChange()
{
bPersistent = false;
return true;
}
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
super(PopupPageBase).InitComponent(MyController, MyOwner);
TextColor[0] = class'SayMessagePlus'.default.RedTeamColor;
TextColor[1] = class'SayMessagePlus'.default.BlueTeamColor;
TextColor[2] = class'SayMessagePlus'.default.DrawColor;
eb_Send.MyEditBox.OnKeyEvent = InternalOnKeyEvent;
lb_Chat.MyScrollText.bNeverFocus = true;
// Marco SP: Why the fuck we handle text from console in this class? REMOVED!!!
}
event Opened(GUIComponent Sender)
{
local int i;
local string KeyName;
local array<string> KeyNames;
local PlayerController PC;
super.Opened(Sender);
PC = PlayerOwner();
CloseKey.Remove(0, CloseKey.Length);
KeyName = PC.ConsoleCommand("BINDINGTOKEY InGameChat");
Split(KeyName, ",", KeyNames);
for ( i = 0; i < KeyNames.Length; i++ )
CloseKey[CloseKey.Length] = byte(PC.ConsoleCommand("KEYNUMBER"@KeyNames[i]));
// Advance the cursor position to the end of the text
lb_Chat.MyScrollText.End();
FocusFirst(none);
}
function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
local string cmd;
local int i;
local bool bVoiceChatKey;
local array<string> BindKeyNames, LocalizedBindKeyNames;
local string TempString;
Controller.GetAssignedKeys("VoiceTalk", BindKeyNames, LocalizedBindKeyNames);
for (i = 0; i < BindKeyNames.Length; i++)
{
if (Mid(GetEnum(enum'EInputKey', Key), 3) ~= BindKeyNames[i])
{
bVoiceChatKey = true;
break;
}
}
if (bVoiceChatKey)
{
if (bVoiceRepeat)
{
TempString = left(eb_send.MyEditBox.TextStr, len(eb_send.MyEditBox.TextStr) - 1);
}
if (State == 1)
{
if (PlayerOwner() != none)
{
PlayerOwner().bVoiceTalk = 1;
if (bVoiceRepeat)
{
eb_send.MyEditBox.TextStr = TempString;
eb_send.MyEditBox.CaretPos = len(eb_send.MyEditBox.TextStr);
}
bVoiceRepeat = true;
return true;
}
}
else if (State == 2)
{
if (PlayerOwner() != none)
{
PlayerOwner().bVoiceTalk = 1;
return true;
}
bVoiceRepeat = false;
}
else
{
if (PlayerOwner() != none)
{
PlayerOwner().bVoiceTalk = 0;
}
bVoiceRepeat = false;
}
}
if (state == 1)
{
for (i = 0; i < CloseKey.Length; i++)
{
if (Key == CloseKey[i])
{
Controller.CloseMenu(false);
return true;
}
}
}
if (state == 3)
{
if (Key == 0x0D)
{
cmd = eb_Send.GetText();
if (cmd == "")
{
return true;
}
if (Left(cmd, 1) == "/")
{
cmd = Mid(cmd, 1);
}
else if (Left(cmd, 1) == ".")
{
cmd = "teamsay" @ Mid(cmd, 1);
}
else
{
cmd = "say" @ cmd;
}
PlayerOwner().ConsoleCommand(cmd);
eb_Send.SetText("");
return true;
}
}
return eb_Send.MyEditBox.InternalOnKeyEvent(key, state, delta);
}
function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender)
{
if (NewComp != eb_Send)
NewComp.bNeverFocus = true;
super.InternalOnCreateComponent(NewComp, Sender);
}
defaultproperties
{
Begin Object Class=moEditBox Name=ebSend
CaptionWidth=0.100000
Caption="Say: "
OnCreateComponent=ebSend.InternalOnCreateComponent
Hint="Prefix a message with a dot (.) to send a team message or a slash (/) to send a command."
WinTop=0.973152
WinLeft=0.044128
WinWidth=0.920000
WinHeight=0.060000
TabOrder=0
bBoundToParent=True
bScaleToParent=True
ToolTip=None
End Object
eb_Send=moEditBox'HideMut.HideLobbyChat.ebSend'
Begin Object Class=GUIScrollTextBox Name=lbChat
bNoTeletype=True
CharDelay=0.002500
EOLDelay=0.000000
Separator="<22>"
OnCreateComponent=lbChat.InternalOnCreateComponent
FontScale=FNS_Small
StyleName="none"
WinWidth=0.000000
bBoundToParent=True
bScaleToParent=True
bNeverFocus=True
ToolTip=None
End Object
lb_Chat=GUIScrollTextBox'HideMut.HideLobbyChat.lbChat'
Begin Object Class=GUIHeader Name=TitleBar
bUseTextHeight=True
WinWidth=0.000000
RenderWeight=0.010000
bBoundToParent=True
bScaleToParent=True
bVisible=False
bNeverFocus=False
ScalingType=SCALE_X
End Object
t_WindowTitle=GUIHeader'HideMut.HideLobbyChat.TitleBar'
bResizeWidthAllowed=False
bResizeHeightAllowed=False
bMoveAllowed=False
DefaultLeft=0.025000
DefaultTop=0.460000
DefaultWidth=0.400000
DefaultHeight=0.050000
i_FrameBG=None
bPersistent=True
bAllowedAsLast=True
WinTop=0.430000
WinLeft=0.025000
WinWidth=0.400000
WinHeight=0.050000
}

View file

@ -0,0 +1,437 @@
// base class, not vanilla
class HideLobbyFooter extends ButtonFooter;
var automated GUIButton b_Menu, b_MapVote, b_KickVote, b_Ready, b_ViewMap, b_Cancel;
var string ReadyString, UnreadyString;
var string MidGameMenuString;
function bool InternalOnPreDraw(Canvas C)
{
// disable view map if its not a lobby state
if (!PlayerOwner().GameReplicationInfo.bMatchHasBegun)
b_ViewMap.EnableMe();
else
b_ViewMap.DisableMe();
// ready-unready text switch
if (PlayerOwner().PlayerReplicationInfo != none && PlayerOwner().PlayerReplicationInfo.bReadyToPlay)
b_Ready.Caption = UnreadyString;
else
b_Ready.Caption = ReadyString;
return super.InternalOnPreDraw(C);
}
// took poosh ScrnLobbyFooter as a reference
// 1. overrided to position buttons by TabOrder
// 2. moved some buttons to left side
function PositionButtons(Canvas C)
{
local int j;
local GUIButton b;
local array<GUIButton> buttonsLEFT, buttonsRIGHT;
local float x, s, m;
s = GetSpacer();
m = GetMargin() / 2;
x = ActualLeft() + ActualWidth() - m;
// position the Disconnect button on the left, others on the right
// right buttons
buttonsRIGHT = GetButtons(false);
for (j = buttonsRIGHT.length - 1; j >= 0; --j)
{
b = buttonsRIGHT[j];
x -= b.ActualWidth();
b.WinLeft = b.RelativeLeft(x, true);
x -= s;
}
// left buttons
buttonsLEFT = GetButtons(true);
for (j = 0; j < buttonsLEFT.length; j++)
{
b = buttonsLEFT[j];
b.WinLeft = b.RelativeLeft(m, true);
m += b.ActualWidth();
m += s;
}
}
final private function array<GUIButton> GetButtons(optional bool bLEFTSIDED)
{
local int i, j;
local GUIButton b;
local array<GUIButton> buttons;
if (bLEFTSIDED)
{
for (i = 0; i < Controls.Length; ++i)
{
b = GUIButton(Controls[i]);
if (b != none && bIsButtonLeft(b) && b.bVisible)
{
// compare tab orders and kepp the array sorted
for (j = 0; j < buttons.length; ++j)
{
if (buttons[j].TabOrder >= b.TabOrder)
break;
}
// fill the array
buttons.insert(j, 1);
buttons[j] = b;
}
}
}
else
{
for (i = 0; i < Controls.Length; ++i)
{
b = GUIButton(Controls[i]);
if (b != none && !bIsButtonLeft(b) && b.bVisible)
{
// compare tab orders and kepp the array sorted
for (j = 0; j < buttons.length; ++j)
{
if (buttons[j].TabOrder >= b.TabOrder)
break;
}
// fill the array
buttons.insert(j, 1);
buttons[j] = b;
}
}
}
return buttons;
}
// which buttons are left sided
final private function bool bIsButtonLeft(GUIButton b)
{
// mapvote, kickvote and main menu must be on left side
if (b == b_MapVote || b == b_KickVote || b == b_Menu)
return true;
return false;
}
function bool ButtonsSized(Canvas C)
{
local int i;
local GUIButton b;
local bool bResult;
local string str;
local float T, AH, AT;
if (!bPositioned)
return false;
bResult = true;
str = GetLongestCaption(C);
AH = ActualHeight();
AT = ActualTop();
for (i = 0; i < Controls.Length; i++)
{
b = GUIButton(Controls[i]);
if (b != none)
{
if (bAutoSize && bFixedWidth)
{
if (b.Caption == "")
b.SizingCaption = Left(str, Len(str) / 2);
else
b.SizingCaption = str;
}
else
b.SizingCaption = "";
bResult = bResult && b.bPositioned;
if (bFullHeight)
b.WinHeight = b.RelativeHeight(AH, true);
else b.WinHeight = b.RelativeHeight(ActualHeight(ButtonHeight), true);
switch ( Justification )
{
case TXTA_Left:
T = ClientBounds[1];
break;
case TXTA_Center:
T = (AT + AH / 2) - (b.ActualHeight() / 2);
break;
case TXTA_Right:
T = ClientBounds[3] - b.ActualHeight();
break;
}
//b.WinTop = AT + ((AH - ActualHeight(ButtonHeight)) / 2);
b.WinTop = b.RelativeTop(T, true ) + ((WinHeight - ButtonHeight) / 2);
}
}
return bResult;
}
function float GetButtonLeft()
{
local int i;
local GUIButton b;
local float TotalWidth, AW, AL;
local float FooterMargin;
AL = ActualLeft();
AW = ActualWidth();
FooterMargin = GetMargin();
for (i = 0; i < Controls.Length; i++)
{
b = GUIButton(Controls[i]);
if (b != none)
{
if (TotalWidth > 0)
TotalWidth += GetSpacer();
TotalWidth += b.ActualWidth();
}
}
if (Alignment == TXTA_Center)
return (AL + AW) / 2 - FooterMargin / 2 - TotalWidth / 2;
if (Alignment == TXTA_Right)
return (AL + AW - FooterMargin / 2) - TotalWidth;
return AL + (FooterMargin / 2);
}
// Finds the longest caption of all the buttons
function string GetLongestCaption(Canvas C)
{
local int i;
local float XL, YL, LongestW;
local string str;
local GUIButton b;
if (C == none)
return "";
for (i = 0; i < Controls.Length; i++)
{
b = GUIButton(Controls[i]);
if (b != none)
{
if (b.Style != none)
b.Style.TextSize(C, b.MenuState, b.Caption, XL, YL, b.FontScale);
else
C.StrLen( b.Caption, XL, YL );
if (LongestW == 0 || XL > LongestW)
{
str = b.Caption;
LongestW = XL;
}
}
}
return str;
}
function bool OnFooterClick(GUIComponent Sender)
{
local GUIController C;
local PlayerController PC;
PC = PlayerOwner();
C = Controller;
// midgame menu
if (Sender == b_Menu)
{
PC.ClientOpenMenu(MidGameMenuString, false);
}
// ready-unready us
else if (Sender == b_Ready)
{
if (PC.Level.NetMode == NM_Standalone || !PC.PlayerReplicationInfo.bReadyToPlay)
{
if (KFPlayerController(PC) != none)
KFPlayerController(PC).SendSelectedVeterancyToServer(true);
// Set Ready
PC.ServerRestartPlayer();
PC.PlayerReplicationInfo.bReadyToPlay = True;
if (PC.Level.GRI.bMatchHasBegun)
PC.ClientCloseMenu(true, false);
b_Ready.Caption = UnreadyString;
}
else
{
if (KFPlayerController(PC) != none)
{
KFPlayerController(PC).ServerUnreadyPlayer();
PC.PlayerReplicationInfo.bReadyToPlay = false;
b_Ready.Caption = ReadyString;
}
}
}
// Kill Window and exit game / disconnect from server
else if (Sender == b_Cancel)
{
// change class to ours
HideLobbyMenu(PageOwner).bAllowClose = true;
C.ViewportOwner.Console.ConsoleCommand("DISCONNECT");
// Marco SP
PC.ClientCloseMenu(true, false);
C.AutoLoadMenus();
}
// Spectate map while waiting for players to get ready
else if (Sender == b_ViewMap)
{
// change class to ours
HideLobbyMenu(PageOwner).bAllowClose = true;
PC.ClientCloseMenu(true, false);
}
// open kick vote
else if (Sender == b_KickVote)
{
Controller.OpenMenu(Controller.KickVotingMenu);
}
// open map vote
else if (Sender == b_MapVote)
{
PC.ShowVoteMenu();
}
return false;
}
function OnSteamStatsAndAchievementsReady()
{
PlayerOwner().ClientOpenMenu("KFGUI.KFProfilePage", false);
}
defaultproperties
{
Begin Object Class=GUIButton Name=MenuButton
Caption="Main Menu"
Hint="Open midgame menu."
WinTop=0.966146
WinLeft=0.280000
WinWidth=0.120000
WinHeight=0.033203
RenderWeight=2.000000
TabOrder=0
bBoundToParent=True
ToolTip=None
OnClick=HideLobbyFooter.OnFooterClick
OnKeyEvent=Cancel.InternalOnKeyEvent
End Object
b_Menu=GUIButton'HideMut.HideLobbyFooter.MenuButton'
Begin Object Class=GUIButton Name=MapVote
Caption="Map Vote"
Hint="Shortcut to map vote."
WinTop=0.966146
WinLeft=1.500000
WinWidth=0.120000
WinHeight=0.033203
RenderWeight=2.000000
TabOrder=1
bBoundToParent=True
ToolTip=None
OnClick=HideLobbyFooter.OnFooterClick
OnKeyEvent=Cancel.InternalOnKeyEvent
End Object
b_MapVote=GUIButton'HideMut.HideLobbyFooter.MapVote'
Begin Object Class=GUIButton Name=KickVote
Caption="Kick Vote"
Hint="Shortcut to kick vote."
WinTop=0.966146
WinLeft=-0.500000
WinWidth=0.120000
WinHeight=0.033203
RenderWeight=2.000000
TabOrder=2
bBoundToParent=True
ToolTip=None
OnClick=HideLobbyFooter.OnFooterClick
OnKeyEvent=Cancel.InternalOnKeyEvent
End Object
b_KickVote=GUIButton'HideMut.HideLobbyFooter.KickVote'
Begin Object Class=GUIButton Name=ReadyButton
Caption="Ready"
Hint="Click to indicate you are ready to play"
WinTop=0.966146
WinLeft=0.280000
WinWidth=0.120000
WinHeight=0.033203
RenderWeight=2.000000
TabOrder=3
bBoundToParent=True
ToolTip=None
OnClick=HideLobbyFooter.OnFooterClick
OnKeyEvent=ReadyButton.InternalOnKeyEvent
End Object
b_Ready=GUIButton'HideMut.HideLobbyFooter.ReadyButton'
Begin Object Class=GUIButton Name=ViewMap
Caption="View Map"
Hint="Hover around while other players afk to death."
WinTop=0.966146
WinLeft=-0.500000
WinWidth=0.120000
WinHeight=0.033203
RenderWeight=2.000000
TabOrder=4
bBoundToParent=True
ToolTip=None
OnClick=HideLobbyFooter.OnFooterClick
OnKeyEvent=Cancel.InternalOnKeyEvent
End Object
b_ViewMap=GUIButton'HideMut.HideLobbyFooter.ViewMap'
Begin Object Class=GUIButton Name=Cancel
Caption="Disconnect"
Hint="Disconnect From This Server"
WinTop=0.966146
WinLeft=-0.500000
WinWidth=0.120000
WinHeight=0.033203
RenderWeight=2.000000
TabOrder=5
bBoundToParent=True
ToolTip=None
OnClick=HideLobbyFooter.OnFooterClick
OnKeyEvent=Cancel.InternalOnKeyEvent
End Object
b_Cancel=GUIButton'HideMut.HideLobbyFooter.Cancel'
ReadyString="Ready"
UnreadyString="Unready"
MidGameMenuString="KFGUI.KFInvasionLoginMenu"
OnPreDraw=HideLobbyFooter.InternalOnPreDraw
}

View file

@ -0,0 +1,875 @@
class HideLobbyMenu extends UT2k4MainPage;
struct FPlayerBoxEntry
{
var moCheckBox ReadyBox;
var KFPlayerReadyBar PlayerBox;
var GUIImage PlayerPerk;
var GUILabel PlayerVetLabel;
var bool bIsEmpty;
};
var array<FPlayerBoxEntry> PlayerBoxes;
var const int MaxPlayersOnList;
var const string str_Beginner, str_Normal, str_Hard, str_Sui, str_HOE;
var const string str_LvlAbbr;
var const string str_CurrentMap;
var const string str_Difficulty;
var const string SelectPerkInformationString;
var const string PerksDisabledString;
var bool bShowProfilePage;
var automated HideLobbyChat t_ChatBox;
var automated KFMapStoryLabel l_StoryBox;
var automated AltSectionBackground StoryBoxBG;
var automated AltSectionBackground GameInfoBG;
var automated GUILabel CurrentMapLabel;
var automated GUILabel DifficultyLabel;
var automated GUIImage WaveBG;
var automated GUILabel WaveLabel;
var automated GUILabel label_TimeOutCounter;
var automated GUILabel PerkClickLabel;
var bool bStoryBoxFilled;
var bool bAllowClose;
// Perks / Profile
var() string sChar, sCharD;
var() int nFOV;
var() xUtil.PlayerRecord PlayerRec;
var automated GUISectionBackground i_BGPerks;
var automated GUISectionBackground i_BGPerk;
var automated GUISectionBackground i_BGPerkEffects;
var automated GUIScrollTextBox lb_PerkEffects;
var automated GUIImage i_Portrait;
var automated GUISectionBackground PlayerPortraitBG;
var float IconBorder; // Percent of Height to leave blank inside Icon Background
var float ItemBorder; // Percent of Height to leave blank inside Item Background
var float ItemSpacing; // Number of Pixels between Items
var float ProgressBarHeight; // Percent of Height to make Progress Bar's Height
var float TextTopOffset; // Percent of Height to off Progress String from top of Progress Bar(typically negative)
var float IconToInfoSpacing; // Percent of Width to offset Info from right side of Icon
var texture ItemBackground;
var texture ProgressBarBackground;
var texture ProgressBarForeground;
var texture PerkBackground;
var texture InfoBackground;
//var bool bAdminUse; // If you're not an admin, gtfo!
var int ActivateTimeoutTime; // When was the lobby timeout turned on?
var bool bTimeoutTimeLogged; // Was it already logged once?
var bool bTimedOut; // Have we timed out out successfully?
var const string WaitingForServerStatus;
var const string WaitingForOtherPlayers;
var const string AutoCommence;
var bool bShouldUpdateVeterancy;
var class<KFVeterancyTypes> CurrentVeterancy;
var int CurrentVeterancyLevel;
function InitComponent(GUIController MyC, GUIComponent MyO)
{
super(UT2k4MainPage).InitComponent(MyC, MyO);
i_Portrait.WinTop = PlayerPortraitBG.ActualTop() + 30;
i_Portrait.WinHeight = PlayerPortraitBG.ActualHeight() - 36;
t_ChatBox.FocusInstead = PerkClickLabel;
}
// if we don't reset persistence, playerboxes will continue to pile
function bool NotifyLevelChange()
{
bPersistent = false;
bAllowClose = true;
Controller.CloseMenu(true);
return true;
}
function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
local int i;
local bool bVoiceChatKey;
local array<string> BindKeyNames, LocalizedBindKeyNames;
Controller.GetAssignedKeys("VoiceTalk", BindKeyNames, LocalizedBindKeyNames);
for (i = 0; i < BindKeyNames.Length; i++)
{
if (Mid(GetEnum(enum'EInputKey', Key), 3) ~= BindKeyNames[i])
{
bVoiceChatKey = true;
break;
}
}
if (bVoiceChatKey)
{
if (state == 1 || state == 2)
{
if (PlayerOwner() != none)
{
PlayerOwner().bVoiceTalk = 1;
}
}
else
{
if (PlayerOwner() != none)
{
PlayerOwner().bVoiceTalk = 0;
return false;
}
}
return true;
}
return false;
}
function ClearChatBox()
{
t_ChatBox.lb_Chat.SetContent("");
}
function TimedOut()
{
bTimedOut = true;
PlayerOwner().ServerRestartPlayer();
bAllowClose = true;
}
function bool InternalOnPreDraw(Canvas C)
{
local int i, j;
local string StoryString;
local String SkillString;
local KFGameReplicationInfo KFGRI;
local PlayerController PC;
PC = PlayerOwner();
if (PC == none || PC.Level == none) // Error?
return false;
if ((PC.PlayerReplicationInfo != none && (!PC.PlayerReplicationInfo.bWaitingPlayer || PC.PlayerReplicationInfo.bOnlySpectator)) || PC.Outer.Name == 'Entry')
{
bAllowClose = true;
PC.ClientCloseMenu(true,false);
return false;
}
t_Footer.InternalOnPreDraw(C);
KFGRI = KFGameReplicationInfo(PC.GameReplicationInfo);
if (KFGRI != none)
{
WaveLabel.Caption = string(KFGRI.WaveNumber + 1) $ "/" $ string(KFGRI.FinalWave);
}
else
{
WaveLabel.Caption = "?/?";
return false;
}
C.DrawColor.A = 255;
// CHECK ME LATER
if (KFPlayerController(PC) != none && bShouldUpdateVeterancy)
{
if (KFPlayerController(PC).SelectedVeterancy == none)
{
bShowProfilePage = true;
if (PC.SteamStatsAndAchievements == none)
{
if (PC.Level.NetMode != NM_Client)
{
PC.SteamStatsAndAchievements = PC.Spawn(PC.default.SteamStatsAndAchievementsClass, PC);
if (!PC.SteamStatsAndAchievements.Initialize(PC))
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(class'KFMainMenu'.default.UnknownSteamErrorText, QBTN_Ok, QBTN_Ok);
PC.SteamStatsAndAchievements.Destroy();
PC.SteamStatsAndAchievements = none;
}
else
{
PC.SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
}
}
bShowProfilePage = false;
}
else if (!PC.SteamStatsAndAchievements.bInitialized)
{
PC.SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
PC.SteamStatsAndAchievements.GetStatsAndAchievements();
bShowProfilePage = false;
}
if (KFSteamStatsAndAchievements(PC.SteamStatsAndAchievements) != none)
{
for (i = 0; i < class'KFGameType'.default.LoadedSkills.Length; i++)
{
if (KFSteamStatsAndAchievements(PC.SteamStatsAndAchievements).GetPerkProgress(i) < 0.0)
{
PC.SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
PC.SteamStatsAndAchievements.GetStatsAndAchievements();
bShowProfilePage = false;
}
}
}
if (bShowProfilePage)
{
OnSteamStatsAndAchievementsReady();
}
bShouldUpdateVeterancy = false;
}
else if (PC.SteamStatsAndAchievements != none && PC.SteamStatsAndAchievements.bInitialized)
{
KFPlayerController(PC).SendSelectedVeterancyToServer();
bShouldUpdateVeterancy = false;
}
}
// First fill in non-ready players.
for (i = 0; i < KFGRI.PRIArray.Length; i++)
{
if (!bValidPRI(KFGRI.PRIArray[i]) || KFGRI.PRIArray[i].bReadyToPlay)
continue;
// start from 0
AddPlayer(KFPlayerReplicationInfo(KFGRI.PRIArray[i]), j, C);
if (++j >= MaxPlayersOnList)
GoTo'DoneIt';
}
// Then comes rest.
for (i = 0; i < KFGRI.PRIArray.Length; i++)
{
if (!bValidPRI(KFGRI.PRIArray[i]) || !KFGRI.PRIArray[i].bReadyToPlay)
continue;
if (KFGRI.PRIArray[i].bReadyToPlay)
{
if (!bTimeoutTimeLogged)
{
ActivateTimeoutTime = PC.Level.TimeSeconds;
bTimeoutTimeLogged = true;
}
}
// continue from last idx
AddPlayer(KFPlayerReplicationInfo(KFGRI.PRIArray[i]), j, C);
if (++j >= MaxPlayersOnList)
GoTo'DoneIt';
}
if (j < MaxPlayersOnList)
EmptyPlayers(j);
DoneIt:
StoryString = PC.Level.Description;
if (!bStoryBoxFilled)
{
l_StoryBox.LoadStoryText();
bStoryBoxFilled = true;
}
if (KFGRI.BaseDifficulty <= 1)
SkillString = str_Beginner;
else if (KFGRI.BaseDifficulty <= 2)
SkillString = str_Normal;
else if (KFGRI.BaseDifficulty <= 4)
SkillString = str_Hard;
else if (KFGRI.BaseDifficulty <= 5)
SkillString = str_Sui;
else
SkillString = str_HOE;
CurrentMapLabel.Caption = str_CurrentMap @ PC.Level.Title;
DifficultyLabel.Caption = str_Difficulty @ SkillString;
return false;
}
// filter none, spectators, non-KFPRI ones
final private function bool bValidPRI(PlayerReplicationInfo PRI)
{
if (PRI == none || PRI.bOnlySpectator || KFPlayerReplicationInfo(PRI) == none)
return false;
else
return true;
}
final private function AddPlayer(KFPlayerReplicationInfo PRI, int Index, Canvas C)
{
local float Top;
if (Index >= PlayerBoxes.Length)
{
Top = Index * 0.045;
PlayerBoxes.Length = Index + 1;
// create GUIComponents and set defaults
PlayerBoxes[Index].ReadyBox = new (none) Class'moCheckBox';
PlayerBoxes[Index].ReadyBox.bValueReadOnly = true;
PlayerBoxes[Index].ReadyBox.ComponentJustification = TXTA_Left;
PlayerBoxes[Index].ReadyBox.CaptionWidth = 0.82;
PlayerBoxes[Index].ReadyBox.LabelColor.B = 0;
PlayerBoxes[Index].ReadyBox.WinTop = 0.0475+Top;
PlayerBoxes[Index].ReadyBox.WinLeft = 0.075;
PlayerBoxes[Index].ReadyBox.WinWidth = 0.4;
PlayerBoxes[Index].ReadyBox.WinHeight = 0.045;
PlayerBoxes[Index].ReadyBox.RenderWeight = 0.55;
PlayerBoxes[Index].ReadyBox.bAcceptsInput = false;
PlayerBoxes[Index].PlayerBox = new (none) Class'KFPlayerReadyBar';
PlayerBoxes[Index].PlayerBox.WinTop = 0.04+Top;
PlayerBoxes[Index].PlayerBox.WinLeft = 0.04;
PlayerBoxes[Index].PlayerBox.WinWidth = 0.35;
PlayerBoxes[Index].PlayerBox.WinHeight = 0.045;
PlayerBoxes[Index].PlayerBox.RenderWeight = 0.35;
PlayerBoxes[Index].PlayerPerk = new (none) Class'GUIImage';
PlayerBoxes[Index].PlayerPerk.ImageStyle = ISTY_Justified;
PlayerBoxes[Index].PlayerPerk.WinTop = 0.043+Top;
PlayerBoxes[Index].PlayerPerk.WinLeft = 0.0418;
PlayerBoxes[Index].PlayerPerk.WinWidth = 0.039;
PlayerBoxes[Index].PlayerPerk.WinHeight = 0.039;
PlayerBoxes[Index].PlayerPerk.RenderWeight = 0.56;
PlayerBoxes[Index].PlayerVetLabel = new (none) Class'GUILabel';
PlayerBoxes[Index].PlayerVetLabel.TextAlign = TXTA_Right;
PlayerBoxes[Index].PlayerVetLabel.TextColor = Class'Canvas'.Static.MakeColor(19,19,19);
PlayerBoxes[Index].PlayerVetLabel.TextFont = "UT2SmallFont";
PlayerBoxes[Index].PlayerVetLabel.WinTop = 0.04+Top;
PlayerBoxes[Index].PlayerVetLabel.WinLeft = 0.22907;
PlayerBoxes[Index].PlayerVetLabel.WinWidth = 0.151172;
PlayerBoxes[Index].PlayerVetLabel.WinHeight = 0.045;
PlayerBoxes[Index].PlayerVetLabel.RenderWeight = 0.5;
// finally add the GUIComponents
AppendComponent(PlayerBoxes[Index].ReadyBox, true);
AppendComponent(PlayerBoxes[Index].PlayerBox, true);
AppendComponent(PlayerBoxes[Index].PlayerPerk, true);
AppendComponent(PlayerBoxes[Index].PlayerVetLabel, true);
Top = (PlayerBoxes[Index].PlayerBox.WinTop + PlayerBoxes[Index].PlayerBox.WinHeight);
}
PlayerBoxes[Index].ReadyBox.Checked(PRI.bReadyToPlay);
PlayerBoxes[Index].ReadyBox.SetCaption(" "$Left(PRI.PlayerName,20));
if (PRI.ClientVeteranSkill != none)
{
PlayerBoxes[Index].PlayerVetLabel.Caption = str_LvlAbbr @ PRI.ClientVeteranSkillLevel @ PRI.ClientVeteranSkill.default.VeterancyName;
PlayerBoxes[Index].PlayerPerk.Image = PRI.ClientVeteranSkill.default.OnHUDIcon;
PlayerBoxes[Index].PlayerPerk.ImageColor = class'Canvas'.Static.MakeColor(255, 255, 255);
}
else
{
// REVERT!
PlayerBoxes[Index].PlayerPerk.Image = none;
PlayerBoxes[Index].PlayerVetLabel.Caption = "";
// // try KFPC
// PlayerBoxes[Index].PlayerVetLabel.Caption = str_LvlAbbr @ PRI.ClientVeteranSkillLevel @ PRI.ClientVeteranSkill.default.VeterancyName;
// PlayerBoxes[Index].PlayerPerk.Image = KFPlayerController(PRI.Owner).SelectedVeterancy.default.OnHUDIcon;
// PlayerBoxes[Index].PlayerPerk.ImageColor = class'Canvas'.Static.MakeColor(255, 255, 255);
}
PlayerBoxes[Index].bIsEmpty = false;
}
final private function EmptyPlayers(int Index)
{
local int i;
while (Index < PlayerBoxes.Length && !PlayerBoxes[Index].bIsEmpty)
{
PlayerBoxes[Index].ReadyBox.Checked(false);
PlayerBoxes[Index].PlayerPerk.Image = none;
PlayerBoxes[Index].PlayerVetLabel.Caption = "";
PlayerBoxes[Index].ReadyBox.SetCaption("");
PlayerBoxes[Index].bIsEmpty = true;
++Index;
}
for (i = 0; i < PlayerBoxes.Length; i++)
{
if (PlayerBoxes[i].bIsEmpty)
{
// remove GUIComponents
RemoveComponent(PlayerBoxes[i].ReadyBox, false);
RemoveComponent(PlayerBoxes[i].PlayerBox, false);
RemoveComponent(PlayerBoxes[i].PlayerPerk, false);
RemoveComponent(PlayerBoxes[i].PlayerVetLabel, false);
// remove refs
PlayerBoxes[i].ReadyBox = none;
PlayerBoxes[i].PlayerBox = none;
PlayerBoxes[i].PlayerPerk = none;
PlayerBoxes[i].PlayerVetLabel = none;
// remove from array
PlayerBoxes.remove(i, 1);
log(">>> HideLobbyMenu: EmptyPlayers executed.");
}
}
}
function bool StopClose(optional bool bCancelled)
{
bStoryBoxFilled = false;
ClearChatBox();
// this is for the OnCanClose delegate
// can't close now unless done by call to CloseAll,
// or the bool has been set to true by LobbyFooter
return false;
}
// Called when the Menu Owner is opened
event Opened(GUIComponent Sender)
{
bShouldUpdateVeterancy = true;
SetTimer(1, true);
}
function InternalOnClosed(bool bCancelled)
{
if (PlayerOwner() != none)
{
PlayerOwner().Advertising_ExitZone();
}
}
event Timer()
{
local KFGameReplicationInfo KF;
if (PlayerOwner().PlayerReplicationInfo == none)
return;
if (PlayerOwner().PlayerReplicationInfo.bOnlySpectator)
{
label_TimeOutCounter.caption = "You are a spectator.";
return;
}
KF = KFGameReplicationInfo(PlayerOwner().GameReplicationInfo);
if (KF == none)
{
label_TimeOutCounter.caption = WaitingForServerStatus;
}
else if (KF.LobbyTimeout <= 0)
{
label_TimeOutCounter.caption = WaitingForOtherPlayers;
}
else
{
label_TimeOutCounter.caption = AutoCommence$":" @ KF.LobbyTimeout;
}
}
final private function DrawPerk(Canvas Canvas)
{
local float X, Y, Width, Height;
local int LevelIndex, CurIndex;
local float TempX, TempY;
local float TempWidth, TempHeight;
local float IconSize, ProgressBarWidth;
local string PerkName, PerkLevelString;
local KFPlayerReplicationInfo KFPRI;
local Material M;
DrawPortrait();
KFPRI = KFPlayerReplicationInfo(PlayerOwner().PlayerReplicationInfo);
if (KFPRI == none || KFPRI.ClientVeteranSkill == None)
{
if (CurrentVeterancyLevel != 255)
{
CurrentVeterancyLevel = 255;
lb_PerkEffects.SetContent("None perk active");
}
return;
}
CurIndex = KFPlayerController(PlayerOwner()).SelectedVeterancy.default.PerkIndex;
LevelIndex = KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements).PerkHighestLevelAvailable(CurIndex);
PerkName = KFPlayerController(PlayerOwner()).SelectedVeterancy.default.VeterancyName;
PerkLevelString = str_LvlAbbr @ LevelIndex;
//Get the position size etc in pixels
X = (i_BGPerk.WinLeft + 0.003) * Canvas.ClipX;
Y = (i_BGPerk.WinTop + 0.040) * Canvas.ClipY;
Width = (i_BGPerk.WinWidth - 0.006) * Canvas.ClipX;
Height = (i_BGPerk.WinHeight - 0.043) * Canvas.ClipY;
// Offset for the Background
TempX = X;
TempY = Y;
// Initialize the Canvas
Canvas.Style = 1;
Canvas.Font = class'ROHUD'.Static.GetSmallMenuFont(Canvas);
Canvas.SetDrawColor(255, 255, 255, 255);
// Draw Item Background
Canvas.SetPos(TempX, TempY);
//Canvas.DrawTileStretched(ItemBackground, Width, Height);
// Offset and Calculate Icon's Size
TempX += ItemBorder * Height;
TempY += ItemBorder * Height;
IconSize = Height - (ItemBorder * 2.0 * Height);
// Draw Icon
Canvas.SetPos(TempX, TempY);
M = class'KFGameType'.default.LoadedSkills[CurIndex].default.OnHUDIcon;
Canvas.DrawTile(M, IconSize, IconSize, 0, 0, M.MaterialUSize(), M.MaterialVSize());
TempX += IconSize + (IconToInfoSpacing * Width);
TempY += TextTopOffset * Height;
ProgressBarWidth = Width - (TempX - X) - (IconToInfoSpacing * Width);
// Select Text Color
Canvas.SetDrawColor(255, 255, 255, 255);
// Draw the Perk's Level name
Canvas.StrLen(PerkName, TempWidth, TempHeight);
Canvas.SetPos(TempX, TempY);
Canvas.DrawText(PerkName);
// Draw the Perk's Level
if (PerkLevelString != "")
{
Canvas.StrLen(PerkLevelString, TempWidth, TempHeight);
Canvas.SetPos(TempX + ProgressBarWidth - TempWidth, TempY);
Canvas.DrawText(PerkLevelString);
}
TempY += TempHeight + (0.01 * Height);
if (CurrentVeterancy != KFPRI.ClientVeteranSkill || CurrentVeterancyLevel != LevelIndex)
{
CurrentVeterancy = KFPRI.ClientVeteranSkill;
CurrentVeterancyLevel = LevelIndex;
lb_PerkEffects.SetContent(KFPRI.ClientVeteranSkill.default.LevelEffects[LevelIndex]);
}
}
final private function DrawPortrait()
{
if (PlayerOwner().PlayerReplicationInfo != none)
sChar = PlayerOwner().PlayerReplicationInfo.CharacterName;
else
sChar = PlayerOwner().GetUrlOption("Character");
if (sCharD != sChar)
{
sCharD = sChar;
SetPlayerRec();
}
}
final private function SetPlayerRec()
{
PlayerRec = Class'xUtil'.Static.FindPlayerRecord(sChar);
i_Portrait.Image = PlayerRec.Portrait;
}
final private function bool ShowPerkMenu(GUIComponent Sender)
{
if (PlayerOwner() != none)
{
PlayerOwner().ClientOpenMenu("KFGUI.KFProfilePage", false);
}
return true;
}
final private function OnSteamStatsAndAchievementsReady()
{
Controller.OpenMenu("KFGUI.KFProfilePage");
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(SelectPerkInformationString, QBTN_Ok, QBTN_Ok);
}
//=============================================================================
// DEFAULTPROPERTIES
//=============================================================================
defaultproperties
{
MaxPlayersOnList=18
str_Beginner="Beginner"
STR_Normal="Normal"
str_Hard="Hard"
str_Sui="Suicidal"
str_HOE="Hell on Earth"
str_LvlAbbr="Lv"
str_CurrentMap="Current Map:"
str_Difficulty="Difficulty Level:"
SelectPerkInformationString="Perks enhance certain abilities of your character.|There are 6 Perks to choose from in the center of the screen.|Each has different Effects shown in the upper right.|Perks improve as you complete the Level Requirements shown on the right."
PerksDisabledString="Perk Progress has been disabled because the Game Length is set to Custom, Sandbox Mode is on, or you have previously used Cheats."
Begin Object Class=HideLobbyChat Name=ChatBox
OnCreateComponent=ChatBox.InternalOnCreateComponent
WinTop=0.807600
WinLeft=0.016090
WinWidth=0.971410
WinHeight=0.100000
RenderWeight=0.010000
TabOrder=1
OnPreDraw=ChatBox.FloatingPreDraw
OnRendered=ChatBox.FloatingRendered
OnHover=ChatBox.FloatingHover
OnMousePressed=ChatBox.FloatingMousePressed
OnMouseRelease=ChatBox.FloatingMouseRelease
End Object
t_ChatBox=HideLobbyChat'HideMut.HideLobbyMenu.ChatBox'
Begin Object Class=KFMapStoryLabel Name=LobbyMapStoryBox
OnCreateComponent=LobbyMapStoryBox.InternalOnCreateComponent
ToolTip=None
End Object
l_StoryBox=KFMapStoryLabel'HideMut.HideLobbyMenu.LobbyMapStoryBox'
Begin Object Class=AltSectionBackground Name=StoryBoxBackground
bNoCaption=True
WinTop=0.109808
WinLeft=0.489062
WinWidth=0.487374
WinHeight=0.309092
OnPreDraw=StoryBoxBackground.InternalPreDraw
End Object
StoryBoxBG=AltSectionBackground'HideMut.HideLobbyMenu.StoryBoxBackground'
Begin Object Class=AltSectionBackground Name=GameInfoB
WinTop=0.037851
WinLeft=0.489062
WinWidth=0.487374
WinHeight=0.075000
OnPreDraw=GameInfoB.InternalPreDraw
End Object
GameInfoBG=AltSectionBackground'HideMut.HideLobbyMenu.GameInfoB'
Begin Object Class=GUILabel Name=CurrentMapL
Caption="LAlalala Map"
TextColor=(B=158,G=176,R=175)
WinTop=0.042179
WinLeft=0.496524
WinWidth=0.360000
WinHeight=0.035714
RenderWeight=0.900000
End Object
CurrentMapLabel=GUILabel'HideMut.HideLobbyMenu.CurrentMapL'
Begin Object Class=GUILabel Name=DifficultyL
Caption="Difficulty"
TextColor=(B=158,G=176,R=175)
WinTop=0.072381
WinLeft=0.496524
WinWidth=0.360000
WinHeight=0.035714
RenderWeight=0.900000
End Object
DifficultyLabel=GUILabel'HideMut.HideLobbyMenu.DifficultyL'
Begin Object Class=GUIImage Name=WaveB
Image=Texture'KillingFloorHUD.HUD.Hud_Bio_Circle'
ImageStyle=ISTY_Justified
ImageRenderStyle=MSTY_Normal
WinTop=0.043810
WinLeft=0.923238
WinWidth=0.051642
WinHeight=0.061783
RenderWeight=0.800000
End Object
WaveBG=GUIImage'HideMut.HideLobbyMenu.WaveB'
Begin Object Class=GUILabel Name=WaveL
Caption="1/4"
TextAlign=TXTA_Center
TextColor=(B=158,G=176,R=175)
VertAlign=TXTA_Center
FontScale=FNS_Small
WinTop=0.043810
WinLeft=0.923238
WinWidth=0.051642
WinHeight=0.061783
RenderWeight=0.900000
End Object
WaveLabel=GUILabel'HideMut.HideLobbyMenu.WaveL'
Begin Object Class=GUILabel Name=TimeOutCounter
Caption="Game will auto-commence in: "
TextAlign=TXTA_Center
TextColor=(B=158,G=176,R=175)
WinTop=0.000010
WinLeft=0.059552
WinWidth=0.346719
WinHeight=0.045704
TabOrder=6
End Object
label_TimeOutCounter=GUILabel'HideMut.HideLobbyMenu.TimeOutCounter'
Begin Object Class=GUILabel Name=PerkClickArea
WinTop=0.432395
WinLeft=0.488851
WinWidth=0.444405
WinHeight=0.437312
bAcceptsInput=True
OnClickSound=CS_Click
OnClick=HideLobbyMenu.ShowPerkMenu
End Object
PerkClickLabel=GUILabel'HideMut.HideLobbyMenu.PerkClickArea'
Begin Object Class=GUISectionBackground Name=BGPerk
bFillClient=True
Caption="Current Perk"
WinTop=0.432291
WinLeft=0.650976
WinWidth=0.325157
WinHeight=0.138086
OnPreDraw=BGPerk.InternalPreDraw
End Object
i_BGPerk=GUISectionBackground'HideMut.HideLobbyMenu.BGPerk'
Begin Object Class=GUISectionBackground Name=BGPerkEffects
bFillClient=True
Caption="Perk Effects"
WinTop=0.568448
WinLeft=0.650976
WinWidth=0.325157
WinHeight=0.307442
OnPreDraw=BGPerkEffects.InternalPreDraw
End Object
i_BGPerkEffects=GUISectionBackground'HideMut.HideLobbyMenu.BGPerkEffects'
Begin Object Class=GUIScrollTextBox Name=PerkEffectsScroll
CharDelay=0.002500
EOLDelay=0.100000
OnCreateComponent=PerkEffectsScroll.InternalOnCreateComponent
WinTop=0.626094
WinLeft=0.659687
WinWidth=0.309454
WinHeight=0.244961
TabOrder=9
ToolTip=None
End Object
lb_PerkEffects=GUIScrollTextBox'HideMut.HideLobbyMenu.PerkEffectsScroll'
Begin Object Class=GUIImage Name=PlayerPortrait
Image=Texture'InterfaceArt_tex.Menu.changeme_texture'
ImageStyle=ISTY_Scaled
ImageRenderStyle=MSTY_Normal
IniOption="@Internal"
WinTop=0.472396
WinLeft=0.492522
WinWidth=0.156368
WinHeight=0.397022
RenderWeight=0.300000
End Object
i_Portrait=GUIImage'HideMut.HideLobbyMenu.PlayerPortrait'
Begin Object Class=GUISectionBackground Name=PlayerPortraitB
WinTop=0.432291
WinLeft=0.489062
WinWidth=0.163305
WinHeight=0.443451
OnPreDraw=PlayerPortraitB.InternalPreDraw
End Object
PlayerPortraitBG=GUISectionBackground'HideMut.HideLobbyMenu.PlayerPortraitB'
IconBorder=0.050000
ItemBorder=0.110000
ProgressBarHeight=0.300000
TextTopOffset=0.050000
IconToInfoSpacing=0.050000
ProgressBarBackground=Texture'KF_InterfaceArt_tex.Menu.Innerborder'
ProgressBarForeground=Texture'InterfaceArt_tex.Menu.progress_bar'
PerkBackground=Texture'KF_InterfaceArt_tex.Menu.Item_box_box'
InfoBackground=Texture'KF_InterfaceArt_tex.Menu.Item_box_bar'
WaitingForServerStatus="Awaiting server status..."
WaitingForOtherPlayers="Waiting for players to be ready..."
AutoCommence="Game will auto-commence in"
Begin Object Class=GUITabControl Name=PageTabs
bDockPanels=True
TabHeight=0.040000
WinLeft=0.010000
WinWidth=0.980000
WinHeight=0.040000
RenderWeight=0.490000
TabOrder=3
bAcceptsInput=True
OnActivate=PageTabs.InternalOnActivate
End Object
c_Tabs=GUITabControl'KFGui.GUILibraryMenu.PageTabs'
Begin Object Class=GUIHeader Name=ServerBrowserHeader
bVisible=False
End Object
t_Header=GUIHeader'HideMut.HideLobbyMenu.ServerBrowserHeader'
Begin Object Class=HideLobbyFooter Name=BuyFooter
RenderWeight=0.300000
TabOrder=8
bBoundToParent=False
bScaleToParent=False
OnPreDraw=BuyFooter.InternalOnPreDraw
End Object
t_Footer=HideLobbyFooter'HideMut.HideLobbyMenu.BuyFooter'
i_Background=None
i_bkChar=None
bRenderWorld=True
bAllowedAsLast=True
OnClose=HideLobbyMenu.InternalOnClosed
OnCanClose=HideLobbyMenu.StopClose
WinHeight=0.500000
OnPreDraw=HideLobbyMenu.InternalOnPreDraw
OnRendered=HideLobbyMenu.DrawPerk
OnKeyEvent=HideLobbyMenu.InternalOnKeyEvent
}

View file

@ -0,0 +1,785 @@
// base class, not vanilla
class HideMainMenu extends UT2K4GUIPage;
#exec OBJ LOAD FILE=InterfaceContent.utx
#exec OBJ LOAD FIlE=2K4Menus.utx
// #exec OBJ LOAD FIlE=2K4MenuSounds.uax
#exec OBJ LOAD FIlE=2K4Menus.utx
#exec OBJ LOAD FIlE=PatchTex.utx
#exec OBJ LOAD FIlE=KF_DLC.utx
#exec OBJ LOAD FIlE=KillingFloorHUD_SUMMER.utx
#exec OBJ LOAD FIlE=KillingFloorHUD_HALLOWEEN.utx
#exec OBJ LOAD FIlE=KillingFloorHUD_XMAS.utx
//=============================================================================
// VARIABLES
//=============================================================================
//var KFDataObject SPAmmo;
var bool bOpenAlready;
var bool bMovingOnTraining, bMovingOnResume, bMovingOnSP;
var automated FloatingImage KFBackground;
var automated FloatingImage KFBackgroundOverlay;
var automated GUIImage KFLogoBit;
var automated GUILabel KFVersionNum; // Keep track of updates from now on ! :D
var automated GUILabel KFWorkshopDownload;
// Variable Name Legend
// l_ GUILabel lb_ GUIListBox
// i_ GUIImage li_ GUIList
// b_ GUIButton tp_ GUITabPanel
// t_ GUITitleBar sp_ GUISplitter
// c_ GUITabControl
// p_ GUIPanel
// ch_ moCheckBox
// co_ moComboBox
// nu_ moNumericEdit
// ed_ moEditBox
// fl_ moFloatEdit
// sl_ moSlider
var automated BackgroundImage i_BkChar,
i_Background;
var automated GUIImage i_UT2Logo,
i_PanHuge,
i_PanBig,
i_PanSmall,
i_UT2Shader,
i_TV;
var automated GUIButton b_SinglePlayer,
b_MultiPlayer, b_Host,
b_InstantAction,
b_ModsAndDemo,
b_Profile,
b_JoinLH,
b_Workshop,
b_Settings,
b_Quit;
var bool bAllowClose;
var array<material> CharShots;
var float CharFade, DesiredCharFade, CharFadeTime;
var GUIButton Selected;
var() bool bNoInitDelay;
var() config string MenuSong;
var bool bNewNews;
var float FadeTime;
var bool FadeOut;
var localized string NewNewsMsg,
FireWallTitle,
FireWallMsg,
SteamMustBeRunningText,
UnknownSteamErrorText,
DownloadingText,
DownloadedText;
//=============================================================================
// LOGIC
//=============================================================================
// DISABLED
function OnClose(optional Bool bCancelled){}
// remove NEWS tab and all logs spam / lags caused by it
event Opened(GUIComponent Sender)
{
super(GUIMultiComponent).Opened(Sender);
class'KFServerBrowser'.default.PanelClass[0] = "none";
}
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
local byte SpecialEventType;
super.InitComponent(MyController, MyOwner);
Background = none;
i_BkChar.Image = CharShots[rand(CharShots.Length)];
SpecialEventType = class'KFGameType'.static.GetSpecialEventType();
if (SpecialEventType == 1)
{
KFBackground.Image = MaterialSequence'KillingFloorHUD_SUMMER.MainMenu.kf_menu_seq';
KFLogoBit.Image = FinalBlend'KillingFloorHUD_SUMMER.KFLogoFB';
}
else if (SpecialEventType == 2)
{
KFBackground.Image = MaterialSequence'KillingFloorHUD_HALLOWEEN.MainMenu.kf_menu_seq_HALLOWEEN';
KFLogoBit.Image = FinalBlend'KillingFloorHUD_HALLOWEEN.KFLogoFB_halloween';
}
else if (SpecialEventType == 3)
{
KFBackground.Image = MaterialSequence'KillingFloorHUD_XMAS.MainMenu.kf_menu_seq_XMAS';
KFLogoBit.Image = FinalBlend'KillingFloorHUD_XMAS.KFLogoFB_XMAS';
}
}
function InternalOnOpen()
{
if (bNoInitDelay)
Timer();
else
SetTimer(4.5, false);
Controller.PerformRestore();
// if ( !PlayerOwner().level.game.IsA('KFCinematicGame') )
// {
// bOpenAlready = True;
// PlayerOwner().ConsoleCommand("OPEN Entry?Game=KFMod.KFCinematicGame");
// PlayerOwner().ClientSetInitialMusic(MenuSong,MTRAN_Segue);
// }
PlayerOwner().ClientSetInitialMusic(MenuSong,MTRAN_Segue);
// Begin Syncing Subscribed Steam Workshop Files(if necessary)
PlayerOwner().SyncSteamWorkshop();
}
function bool MyOnDraw(Canvas Canvas)
{
local GUIButton FButton;
local int i,x2;
local float XL,YL;
local float DeltaTime;
local int percentage;
if (PlayerOwner().SubscribedFileDownloadTitle != "")
{
if (PlayerOwner().SubscribedFileDownloadIndex != -1)
{
percentage = int(PlayerOwner().DownloadFileProgress * 100);
KFWorkshopDownload.Caption = DownloadingText @ "|" @ PlayerOwner().SubscribedFileDownloadTitle @ "|" @percentage $ "%";
}
else
{
KFWorkshopDownload.Caption = PlayerOwner().SubscribedFileDownloadTitle @ "|" @ DownloadedText;
}
}
if ( bAnimating || !Controller.bCurMenuInitialized )
{
return false;
}
DeltaTime = Controller.RenderDelta;
for ( i = 0; i < Controls.Length; i++ )
{
if ( GUIButton(Controls[i]) != none )
{
FButton = GUIButton(Controls[i]);
if ( FButton.Tag > 0 && FButton.MenuState != MSAT_Focused )
{
FButton.Tag -= 784 * DeltaTime;
if ( FButton.Tag < 0 )
{
FButton.Tag = 0;
}
}
else if ( FButton.MenuState == MSAT_Focused )
{
FButton.Tag = 200;
}
if ( FButton.Tag > 0 )
{
fButton.Style.TextSize(Canvas, MSAT_Focused, FButton.Caption, XL, YL, FButton.FontScale);
x2 = FButton.ActualLeft() + XL + 16;
Canvas.Style = 5;
Canvas.SetDrawColor(150, 25, 25, FButton.Tag);
Canvas.SetPos(0, fButton.ActualTop());
Canvas.DrawTilePartialStretched(material'Highlight', x2, FButton.ActualHeight());
}
}
}
return false;
}
event Timer()
{
if (!bMovingOnTraining && !bMovingOnResume && !bMovingOnSP)
{
bNoInitDelay = true;
if (!Controller.bQuietMenu)
{
PlayerOwner().PlaySound(SlideInSound,SLOT_None);
}
i_TV.Animate(-0.000977, 0.332292, 0.35);
i_UT2Logo.Animate(0.007226,0.016926,0.35);
i_UT2Shader.Animate(0.249023,0.180988,0.35);
i_TV.OnEndAnimation = MenuIn_OnArrival;
i_UT2Logo.OnEndAnimation = MenuIn_OnArrival;
i_UT2Shader.OnEndAnimation = MenuIn_OnArrival;
}
else
{
if (bMovingOnResume)
{
bMovingOnResume = false;
Controller.ConsoleCommand("OPEN KFS-RESUMEGAME?Game=KFmod.KFSPGameType");
}
if (bMovingOnTraining)
{
bMovingOnTraining = false;
Controller.ConsoleCommand("OPEN KF-MANOR?Game=KFmod.KFGameType");
}
if (bMovingOnSP)
{
bMovingOnSP = false;
Controller.ConsoleCommand("OPEN KF-G-BIOTICSLAB?Game=KFmod.KFGameType");
}
}
}
function MoveOn()
{
local int i;
local bool bShowPerkInfo;
switch (Selected)
{
case b_SinglePlayer:
return;
case b_MultiPlayer:
if (!Controller.CheckSteam())
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(SteamMustBeRunningText, QBTN_Ok, QBTN_Ok);
return;
}
Profile("ServerBrowser");
Controller.OpenMenu("KFGUI.KFServerBrowser");
Profile("ServerBrowser");
return;
case b_Host:
if (!Controller.CheckSteam())
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(SteamMustBeRunningText, QBTN_Ok, QBTN_Ok);
return;
}
Profile("MPHost");
if (PlayerOwner() != none)
{
PlayerOwner().OpenUPNPPorts();
}
Controller.OpenMenu("KFGUI.KFGamePageMP");
Profile("MPHost");
return;
case b_InstantAction:
Profile("InstantAction");
Controller.OpenMenu("KFGUI.KFGamePageSP");
Profile("InstantAction");
return;
case b_Profile:
if (!Controller.CheckSteam())
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(SteamMustBeRunningText, QBTN_Ok, QBTN_Ok);
return;
}
if (PlayerOwner() != none)
{
if (PlayerOwner().SteamStatsAndAchievements == none)
{
PlayerOwner().SteamStatsAndAchievements = PlayerOwner().Spawn(PlayerOwner().default.SteamStatsAndAchievementsClass, PlayerOwner());
if (!PlayerOwner().SteamStatsAndAchievements.Initialize(PlayerOwner()))
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(UnknownSteamErrorText, QBTN_Ok, QBTN_Ok);
PlayerOwner().SteamStatsAndAchievements.Destroy();
PlayerOwner().SteamStatsAndAchievements = none;
}
else
{
PlayerOwner().SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
}
return;
}
else if (!PlayerOwner().SteamStatsAndAchievements.bInitialized)
{
PlayerOwner().SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
PlayerOwner().SteamStatsAndAchievements.GetStatsAndAchievements();
return;
}
for (i = 0; i < class'KFGameType'.default.LoadedSkills.Length; i++)
{
if (KFSteamStatsAndAchievements(PlayerOwner().SteamStatsAndAchievements).GetPerkProgress(i) < 0.0)
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(class'HideMainMenu'.default.UnknownSteamErrorText, QBTN_Ok, QBTN_Ok);
PlayerOwner().SteamStatsAndAchievements.OnDataInitialized = OnSteamStatsAndAchievementsReady;
PlayerOwner().SteamStatsAndAchievements.GetStatsAndAchievements();
return;
}
}
if (class'KFPlayerController'.default.SelectedVeterancy == none)
{
bShowPerkInfo = true;
}
Profile("Profile");
Controller.OpenMenu("KFGUI.KFProfileAndAchievements");
Profile("Profile");
if (bShowPerkInfo)
{
Controller.OpenMenu(Controller.QuestionMenuClass);
GUIQuestionPage(Controller.TopPage()).SetupQuestion(class'LobbyMenu'.default.SelectPerkInformationString, QBTN_Ok, QBTN_Ok);
}
}
return;
case b_JoinLH:
Controller.ViewportOwner.Console.ConsoleCommand("open 127.0.0.1");
return;
case b_Workshop:
PlayerOwner().SteamStatsAndAchievements.ShowWorkshopContent();
return;
case b_ModsAndDemo:
Profile("ModsandDemos");
Controller.ViewportOwner.Console.ConsoleCommand("OPEN KF-Intro?Game=unrealgame.cinematicgame");
Controller.CloseAll(True);
SetTimer(0.5,false);
Profile("ModsandDemos");
return;
case b_Settings:
Profile("Settings");
Controller.OpenMenu("KFGUI.KFSettingsPage");
Profile("Settings");
return;
case b_Quit:
Profile("Quit");
Controller.OpenMenu(Controller.GetQuitPage());
Profile("Quit");
return;
default:
StopWatch(True);
break;
}
}
function MenuIn_OnArrival(GUIComponent Sender, EAnimationType Type)
{
Sender.OnArrival = none;
if (bAnimating)
return;
i_UT2Shader.OnDraw = MyOnDraw;
DesiredCharFade=255;
CharFadeTime = 0.75;
if (!Controller.bQuietMenu)
PlayerOwner().PlaySound(FadeInSound);
}
function MainReopened()
{
if (!PlayerOwner().Level.IsPendingConnection())
{
i_BkChar.Image = CharShots[rand(CharShots.Length)];
Opened(none);
Timer();
}
}
function bool MyKeyEvent(out byte Key,out byte State,float delta)
{
// Escape pressed
if (Key == 0x1B && state == 1)
bAllowClose = true;
return false;
}
function bool CanClose(optional bool bCancelled)
{
if (bAllowClose)
ButtonClick(b_Quit);
bAllowClose = false;
return PlayerOwner().Level.IsPendingConnection();
}
function PlayPopSound(GUIComponent Sender, EAnimationType Type)
{
if (!Controller.bQuietMenu)
PlayerOwner().PlaySound(PopInSound);
}
function MenuIn_Done(GUIComponent Sender, EAnimationType Type)
{
Sender.OnArrival = none;
PlayPopSound(Sender,Type);
}
function bool ButtonClick(GUIComponent Sender)
{
Selected = GUIButton(Sender);
if (Selected == none)
return false;
DesiredCharFade=0;
CharFadeTime = 0.35;
MoveOn();
return true;
}
function MenuOut_Done(GUIComponent Sender, EAnimationType Type)
{
Sender.OnArrival = none;
if (bAnimating)
return;
MoveOn();
}
event bool NotifyLevelChange()
{
if (bDebugging)
log(Name@"NotifyLevelChange PendingConnection:"$PlayerOwner().Level.IsPendingConnection());
return PlayerOwner().Level.IsPendingConnection();
}
function bool CommunityDraw(canvas c)
{
local float x,y,xl,yl,a;
if (bNewNews)
{
a = 255.0 * (FadeTime/1.0);
if (FadeOut)
a = 255 - a;
FadeTime += Controller.RenderDelta;
if (FadeTime>=1.0)
{
FadeTime = 0;
FadeOut = !FadeOut;
}
a = fclamp(a,1.0,254.0);
x = b_ModsAndDemo.ActualLeft();
y = b_Settings.ActualTop();
C.Font = Controller.GetMenuFont("UT2MenuFont").GetFont(C.ClipX);
C.Strlen("Qz,q",xl,yl);
y -= yl - 5;
C.Style=5;
C.SetPos(x+1,y+1);
C.SetDrawColor(0,0,0,A);
C.DrawText(NewNewsMsg);
C.SetPos(x,y);
C.SetDrawColor(207,185,103,A);
C.DrawText(NewNewsMsg);
}
return false;
}
function OnSteamStatsAndAchievementsReady()
{
Profile("Profile");
Controller.OpenMenu("KFGUI.KFProfileAndAchievements");
Profile("Profile");
}
//=============================================================================
// DEFAULTPROPERTIES
//=============================================================================
defaultproperties
{
Begin Object Class=FloatingImage Name=FloatingBackground
Image=MaterialSequence'KillingFloorHUD.MainMenu.kf_menu_seq'
DropShadow=None
ImageStyle=ISTY_Scaled
WinTop=0.136089
WinLeft=0.273078
WinWidth=0.802660
WinHeight=1.080918
RenderWeight=0.000003
End Object
KFBackground=FloatingImage'HideMut.HideMainMenu.FloatingBackground'
Begin Object Class=FloatingImage Name=FloatingBackgroundOverlay
Image=FinalBlend'InterfaceArt2_tex.filmgrain.FilmgrainOverlayFB'
DropShadow=None
ImageStyle=ISTY_Scaled
WinTop=0.000000
WinLeft=0.000000
WinWidth=1.000000
WinHeight=1.000000
RenderWeight=0.900000
End Object
KFBackgroundOverlay=FloatingImage'HideMut.HideMainMenu.FloatingBackgroundOverlay'
Begin Object Class=GUIImage Name=KFMenuLogo
Image=FinalBlend'KillingFloorHUD.KFLogoFB'
ImageStyle=ISTY_Scaled
WinTop=0.012000
WinLeft=0.008000
WinWidth=0.620000
WinHeight=0.300000
RenderWeight=0.050000
End Object
KFLogoBit=GUIImage'HideMut.HideMainMenu.KFMenuLogo'
Begin Object Class=GUILabel Name=WorkshopDownloadLabel
TextAlign=TXTA_Right
TextColor=(B=200,G=200,R=200)
bMultiLine=True
FontScale=FNS_Small
WinTop=0.050000
WinLeft=0.600000
WinWidth=0.390000
WinHeight=0.150000
RenderWeight=0.950000
End Object
KFWorkshopDownload=GUILabel'HideMut.HideMainMenu.WorkshopDownloadLabel'
Begin Object Class=BackgroundImage Name=ImgBkChar
ImageColor=(A=160)
ImageRenderStyle=MSTY_Alpha
X1=0
Y1=0
X2=1024
Y2=768
RenderWeight=0.040000
Tag=0
End Object
i_bkChar=BackgroundImage'HideMut.HideMainMenu.ImgBkChar'
Begin Object Class=BackgroundImage Name=PageBackground
ImageStyle=ISTY_Scaled
ImageRenderStyle=MSTY_Alpha
X1=0
Y1=0
X2=1024
Y2=768
End Object
i_Background=BackgroundImage'HideMut.HideMainMenu.PageBackground'
Begin Object Class=GUIImage Name=ImgUT2Logo
End Object
i_UT2Logo=GUIImage'HideMut.HideMainMenu.ImgUT2Logo'
Begin Object Class=GUIImage Name=iPanHuge
End Object
i_PanHuge=GUIImage'HideMut.HideMainMenu.iPanHuge'
Begin Object Class=GUIImage Name=iPanBig
End Object
i_PanBig=GUIImage'HideMut.HideMainMenu.iPanBig'
Begin Object Class=GUIImage Name=iPanSmall
End Object
i_PanSmall=GUIImage'HideMut.HideMainMenu.iPanSmall'
Begin Object Class=GUIImage Name=ImgUT2Shader
End Object
i_UT2Shader=GUIImage'HideMut.HideMainMenu.ImgUT2Shader'
Begin Object Class=GUIImage Name=ImgTV
End Object
i_TV=GUIImage'HideMut.HideMainMenu.ImgTV'
Begin Object Class=GUIButton Name=MultiplayerButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Multiplayer"
StyleName="ListSelection"
Hint="All hell breaks loose..."
WinTop=0.290000
WinLeft=0.050000
WinWidth=0.200000
WinHeight=0.035000
TabOrder=1
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=MultiplayerButton.InternalOnKeyEvent
End Object
b_MultiPlayer=GUIButton'HideMut.HideMainMenu.MultiplayerButton'
Begin Object Class=GUIButton Name=HostButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Host Game"
StyleName="ListSelection"
Hint="Start a server and invite others to join your game"
WinTop=0.325000
WinLeft=0.050000
WinWidth=0.200000
WinHeight=0.035000
TabOrder=2
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=HostButton.InternalOnKeyEvent
End Object
b_Host=GUIButton'HideMut.HideMainMenu.HostButton'
Begin Object Class=GUIButton Name=InstantActionButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Solo"
StyleName="ListSelection"
Hint="Play Killing Floor Solo Mode"
WinTop=0.360000
WinLeft=0.050000
WinWidth=0.200000
TabOrder=3
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=InstantActionButton.InternalOnKeyEvent
End Object
b_InstantAction=GUIButton'HideMut.HideMainMenu.InstantActionButton'
Begin Object Class=GUIButton Name=ProfileButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Profile and Achievements"
StyleName="ListSelection"
Hint="Your profile and achievements"
WinTop=0.420000
WinLeft=0.050000
WinWidth=0.220000
TabOrder=4
bFocusOnWatch=True
OnDraw=HideMainMenu.CommunityDraw
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=ModsAndDemosButton.InternalOnKeyEvent
End Object
b_Profile=GUIButton'HideMut.HideMainMenu.ProfileButton'
Begin Object Class=GUIButton Name=JoinLHButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Join Local Host"
StyleName="ListSelection"
Hint="Joins local host server."
WinTop=0.455000
WinLeft=0.050000
WinWidth=0.220000
TabOrder=4
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=ModsAndDemosButton.InternalOnKeyEvent
End Object
b_JoinLH=GUIButton'HideMut.HideMainMenu.JoinLHButton'
Begin Object Class=GUIButton Name=WorkshopButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Steam Workshop Content"
StyleName="ListSelection"
Hint="Custom Content in the Steam Workshop"
WinTop=0.490000
WinLeft=0.050000
WinWidth=0.220000
TabOrder=4
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=ModsAndDemosButton.InternalOnKeyEvent
End Object
b_Workshop=GUIButton'HideMut.HideMainMenu.WorkshopButton'
Begin Object Class=GUIButton Name=SettingsButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Settings"
StyleName="ListSelection"
Hint="Change your controls and settings"
WinTop=0.550000
WinLeft=0.050000
WinWidth=0.200000
WinHeight=0.035000
TabOrder=6
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=SettingsButton.InternalOnKeyEvent
End Object
b_Settings=GUIButton'HideMut.HideMainMenu.SettingsButton'
Begin Object Class=GUIButton Name=QuitButton
CaptionAlign=TXTA_Left
CaptionEffectStyleName="TextButtonEffect"
Caption="Exit"
StyleName="ListSelection"
Hint="Leave this loose game"
WinTop=0.585000
WinLeft=0.050000
WinWidth=0.200000
WinHeight=0.035000
TabOrder=7
bFocusOnWatch=True
OnClick=HideMainMenu.ButtonClick
OnKeyEvent=QuitButton.InternalOnKeyEvent
End Object
b_Quit=GUIButton'HideMut.HideMainMenu.QuitButton'
MenuSong="KFMenu"
SteamMustBeRunningText="Steam must be running and you must have an active internet connection to access this"
UnknownSteamErrorText="Unknown Steam error prevented access to this"
PopInSound=Sound'PatchSounds.slide1-1'
SlideInSound=Sound'PatchSounds.slide1-1'
BeepSound=Sound'KFWeaponSound.bullethitmetal3'
bRenderWorld=True
bPersistent=True
OnOpen=HideMainMenu.InternalOnOpen
OnReOpen=HideMainMenu.MainReopened
OnCanClose=HideMainMenu.CanClose
WinTop=0.000000
WinHeight=1.000000
OnKeyEvent=HideMainMenu.MyKeyEvent
}

View file

@ -0,0 +1,10 @@
class HideMenuPreset extends Object
PerObjectConfig
Config(HideMut);
var config array<string> uselessActors;
var config string presetDescription;
defaultproperties
{
}

View file

@ -0,0 +1,168 @@
class HideMut extends Mutator
config(HideMut);
// =============================================================
struct FunctionRecord
{
var config string About, Replace, With;
};
var config array<FunctionRecord> List;
var HideMut ref_HideMut;
// var newMainMenuClass class'HideMainMenu';
// =============================================================
event PreBeginPlay()
{
super.PreBeginPlay();
ref_HideMut = self;
default.ref_HideMut = self;
// remove some annoying messages
class'WaitingMessage'.default.DoorMessage = "";
class'WaitingMessage'.default.WeldedShutMessage = "";
class'WaitingMessage'.default.ZEDTimeActiveMessage = "";
// CrossbuzzsawBlade sound spam fix
class'CrossbuzzsawBlade'.default.AmbientSoundRef = "";
class'FNFALFire'.default.AmbientFireVolume = 0;
class'CashPickup'.default.TransientSoundVolume = 0.0;
class'CashPickup'.default.AmbientGlow = 0;
class'machete'.default.priority = 3;
// replacing vanilla functions with ours
replace_Functions();
replace_LobbyMenu();
replace_MainMenu();
// EXPERIMENTAL!!!
// ReplaceDefaults();
}
final private function replace_LobbyMenu()
{
class'KFPlayerController'.default.LobbyMenuClassString = string(class'HideLobbyMenu');
class'KFPlayerController_Story'.default.LobbyMenuClassString = string(class'HideLobbyMenu');
}
// replace main menu with fixed one
final private function replace_MainMenu()
{
local bool bChan;
local string newmenuclass;
local GameEngine GE;
// our class
newmenuclass = string(class'HideMainMenu');
if (class'GameEngine'.default.MainMenuClass != newmenuclass || class'GameEngine'.default.SinglePlayerMenuClass != newmenuclass)
{
// change defaults
class'GameEngine'.default.MainMenuClass = newmenuclass;
class'GameEngine'.default.SinglePlayerMenuClass = newmenuclass;
// strange variable, not used anywhere??
// class'GameEngine'.default.InstantActionMenuClass = class'HideMainMenu';
// save the config
// class'GameEngine'.static.StaticSaveConfig();
bChan = true;
}
if (!bChan)
return;
// change instanced ones
foreach AllObjects(class'GameEngine', GE)
{
GE.MainMenuClass = class'GameEngine'.default.MainMenuClass;
GE.SinglePlayerMenuClass = class'GameEngine'.default.SinglePlayerMenuClass;
// save the config
// GE.SaveConfig();
}
// log(">>> HIDEMUT: MENU class changed to " $ newmenuclass);
}
// replace lot's of bugged functions / add our hacks
final function replace_Functions()
{
local uFunction A, B;
local int i;
for (i = 0; i < List.Length; i++)
{
// This removes the need to declare variables for every new class we make.
DynamicLoadObject(class.outer.name $ "." $ Left(List[i].With,InStr(List[i].With,".")), class'class',true);
A = class'UFunction'.static.CastFunction(FindObject(List[i].Replace, class'function'));
B = class'UFunction'.static.CastFunction(FindObject(List[i].With, class'function'));
if (A == none)
{
log("> Failed to process " $ List[i].Replace);
continue;
}
if (B == none)
{
log("> Failed to process " $ List[i].With);
continue;
}
A.Script = B.Script;
log("> Processing " $ List[i].Replace $ " ----> " $ List[i].With);
}
}
// final function ReplaceDefaults()
// {
// local UClass a, b;
// a = class'UClass'.static.CastClass(FindObject("KFMod.CrossbuzzsawBlade", class'class'));
// b = class'UClass'.static.CastClass(FindObject("HideMut.repl_proj_buzzsaw", class'class'));
// if (A == none)
// {
// log("> Failed to process " $ string(a));
// return;
// }
// if (B == none)
// {
// log("> Failed to process " $ string(b));
// return;
// }
// a.Defaults = b.Defaults;
// log("> Processing " $ string(a) $ " ----> " $ string(b));
// }
// get our GUIController and open our Daddy menu, which attaches HideMutInteraction and saves it from GC
simulated function tick(float deltaTime)
{
local PlayerController pc;
pc = level.getLocalPlayerController();
if (pc != none)
{
GUIController(pc.player.guiController).openMenu(string(class'WhosYourDaddy'));
GUIController(pc.player.guiController).closeMenu(false);
// we don't want this running forever, we already did all the work
disable('tick');
destroyed();
}
}
// =============================================================
defaultproperties
{
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,110 @@
class HideObjectPool extends object;
var array<Object> Objects;
// AllocateObject
simulated function Object AllocateObject(class ObjectClass)
{
local Object Result;
local int i;
for (i = 0; i < Objects.Length; i++)
{
if (Objects[i].Class == ObjectClass)
{
Result = Objects[i];
Objects.Remove(i,1);
break;
}
}
if (Result == none)
Result = new(Outer) ObjectClass;
return Result;
}
// create object with given name
simulated function Object AllocateObjectParam(class ObjectClass, string objName)
{
local Object Result;
local int i;
for (i = 0; i < Objects.Length; i++)
{
if (Objects[i].Class == ObjectClass)
{
Result = Objects[i];
Objects.Remove(i, 1);
break;
}
}
if (Result == none)
{
Result = new(outer, objName) ObjectClass;
StoreObj(Result);
}
return Result;
}
simulated function StoreObj(object Obj)
{
local int i;
for (i = 0; i < Objects.Length; i++)
{
// we already have it
if (Obj.Class == Obj)
{
log(string(Obj) $ " was found in Objects array!");
return;
}
}
// else add it to array
Objects[Objects.Length] = Obj;
log(string(Obj) $ " was added to Objects array!");
}
// FreeObject
simulated function FreeObject(Object Obj)
{
Objects.Length = Objects.Length + 1;
Objects[Objects.Length - 1] = Obj;
}
// Shrink
simulated function Shrink()
{
while (Objects.Length > 0)
{
// delete Objects[Objects.Length - 1];
Objects.Remove(Objects.Length - 1, 1);
};
}
final function string PrintObjList()
{
local string s;
local int i;
for (i = 0; i < Objects.Length; i++)
{
s $= string(Objects[i]);
}
return s;
}
defaultproperties
{
}

View file

@ -0,0 +1,23 @@
class HideShopVolume extends ShopVolume;
/*
simulated function postBeginPlay()
{
super.postBeginPlay();
telList[0] = spawn(class'HideTeleporter', , , location);
bHasTeles = true;
}
simulated function destroyed()
{
telList[0].destroyed();
super.destroyed();
}
*/
defaultproperties
{
bStatic=False
bNoDelete=False
}

View file

@ -0,0 +1,7 @@
class HideTeleporter extends Teleporter;
defaultproperties
{
bStatic=False
bNoDelete=False
}

View file

@ -0,0 +1,220 @@
class Hide_IngameChat extends FloatingWindow;
var automated GUISectionBackground sB_Main;
var automated moEditBox eb_Send;
var automated GUIScrollTextBox lb_Chat;
var() int OldCMC;
var() editinline array<byte> CloseKey;
var const color TextColors[3];
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
local int i;
local PlayerController PC;
local ExtendedConsole MyConsole;
super.InitComponent(MyController,MyOwner);
PC = PlayerOwner();
sb_Main.ManageComponent(lb_Chat);
eb_Send.MyEditBox.OnKeyEvent = InternalOnKeyEvent;
lb_Chat.MyScrollText.bNeverFocus=true;
MyConsole = ExtendedConsole(PC.Player.Console);
if (MyConsole == none)
return;
// delegate
MyConsole.OnChat = HandleChat;
for (i = 0; i < MyConsole.ChatMessages.Length; i++)
{
if (!MyConsole.bTeamChatOnly || PC.PlayerReplicationInfo == none ||
PC.PlayerReplicationInfo.Team == none || MyConsole.ChatMessages[i].Team == PC.PlayerReplicationInfo.Team.TeamIndex)
HandleChat(MyConsole.ChatMessages[i].Message, MyConsole.ChatMessages[i].Team);
}
}
event Opened(GUIComponent Sender)
{
local int i;
local string KeyName;
local array<string> KeyNames;
local PlayerController PC;
super.Opened(Sender);
PC = PlayerOwner();
CloseKey.Remove(0, CloseKey.Length);
KeyName = PC.ConsoleCommand("BINDINGTOKEY InGameChat");
Split(KeyName, ",", KeyNames);
for (i = 0; i < KeyNames.Length; i++)
CloseKey[CloseKey.Length] = byte(PC.ConsoleCommand("KEYNUMBER"@KeyNames[i]));
OldCMC = PC.myHud.ConsoleMessageCount;
PC.myHUD.ConsoleMessageCount = 0;
// Advance the cursor position to the end of the text
lb_Chat.MyScrollText.End();
FocusFirst(none);
}
function Closed(GUIComponent Sender, bool bCancelled)
{
super.Closed(Sender, bCancelled);
PlayerOwner().MyHud.ConsoleMessageCount = OldCMC;
}
function HandleChat(string Msg, int TeamIndex)
{
local int i;
local string str;
// normalize the text before any modification
// Msg = class'o_Utility'.static.StripColorStatic(Msg);
// add word filtering
if (class'Settings'.static.bIsWordBanned(Msg))
return;
// convert cyrilic into barbaric
Msg = class'o_CyrillicEncodeUtilities'.static.EnCodeStringHide(Msg);
i = InStr(Msg, ":");
if (TeamIndex < 2 && i != -1)
str = nMakeColorCode(TextColors[TeamIndex]) $ Left(Msg, i) $ nMakeColorCode(TextColors[2]) $ ":" $ Mid(Msg, i+1);
else
str = nMakeColorCode(TextColors[2]) $ Msg;
lb_chat.AddText(str);
}
function string nMakeColorCode(color c)
{
return class'GameInfo'.static.MakeColorCode(c);
}
function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
local string cmd;
local int i;
if (state == 1)
{
for (i = 0; i < CloseKey.Length; i++)
{
if (Key == CloseKey[i])
{
Controller.CloseMenu(false);
return true;
}
}
}
if (state == 3)
{
if (Key == 0x0D)
{
cmd = eb_Send.GetText();
if (cmd == "")
return true;
if (Left(cmd, 1) == "/")
cmd = Mid(cmd,1);
else if (Left(cmd,1) == ".")
cmd = "teamsay" @ Mid(cmd, 1);
else
cmd = "say" @ cmd;
PlayerOwner().ConsoleCommand(cmd);
eb_Send.SetText("");
return true;
}
}
return eb_Send.MyEditBox.InternalOnKeyEvent(key, state, delta);
}
function InternalOnCreateComponent(GUIComponent NewComp, GUIComponent Sender)
{
if (NewComp != eb_Send)
NewComp.bNeverFocus = true;
super.InternalOnCreateComponent(NewComp, Sender);
}
defaultproperties
{
Begin Object Class=AltSectionBackground Name=sbMain
bFillClient=True
LeftPadding=0.000000
RightPadding=0.000000
TopPadding=0.000000
BottomPadding=0.000000
WinHeight=1.000000
bBoundToParent=True
bScaleToParent=True
bNeverFocus=True
OnPreDraw=sbMain.InternalPreDraw
End Object
sb_Main=AltSectionBackground'HideMut.Hide_IngameChat.sbMain'
Begin Object Class=moEditBox Name=ebSend
CaptionWidth=0.100000
Caption="Say: "
OnCreateComponent=ebSend.InternalOnCreateComponent
Hint="Prefix a message with a dot (.) to send a team message or a slash (/) to send a command."
WinTop=0.943855
WinLeft=0.099584
WinWidth=0.818909
WinHeight=0.035416
TabOrder=0
bBoundToParent=True
bScaleToParent=True
End Object
eb_Send=moEditBox'HideMut.Hide_IngameChat.ebSend'
Begin Object Class=GUIScrollTextBox Name=lbChat
bNoTeletype=True
CharDelay=0.002500
EOLDelay=0.000000
OnCreateComponent=lbChat.InternalOnCreateComponent
FontScale=FNS_Small
WinTop=0.441667
WinHeight=0.558333
bBoundToParent=True
bScaleToParent=True
bNeverFocus=True
End Object
lb_Chat=GUIScrollTextBox'HideMut.Hide_IngameChat.lbChat'
TextColors(0)=(B=50,G=50,R=200,A=255)
TextColors(1)=(B=200,G=100,R=50,A=255)
TextColors(2)=(B=255,G=255,R=255)
WindowName="Fancy Chat"
bResizeWidthAllowed=False
bResizeHeightAllowed=False
DefaultLeft=0.110313
DefaultTop=0.057916
DefaultWidth=0.779688
DefaultHeight=0.847083
bPersistent=True
bAllowedAsLast=True
WinTop=0.057916
WinLeft=0.110313
WinWidth=0.779688
WinHeight=0.847083
}

View file

@ -0,0 +1,53 @@
// Fuk u SCHENDZEIK <3
// Alt burn effect for low gore, same as twi BurnEffect, however fully static lighting, no lights on dynamic actors
// Particles set to 4
class KFBurnEffect_FPS extends Emitter;
defaultproperties
{
Begin Object Class=SpriteEmitter Name=SpriteEmitter2
FadeOut=True
FadeIn=True
SpinParticles=True
UseSizeScale=True
UseRegularSizeScale=False
UniformSize=True
UseRandomSubdivision=True
Acceleration=(Z=100.000000)
ColorScale(1)=(RelativeTime=0.300000,Color=(B=255,G=255,R=255))
ColorScale(2)=(RelativeTime=0.667857,Color=(B=89,G=172,R=247,A=255))
ColorScale(3)=(RelativeTime=1.000000,Color=(B=128,G=128,R=128,A=255))
ColorScale(4)=(RelativeTime=1.000000)
ColorScale(5)=(RelativeTime=1.000000)
FadeOutStartTime=0.520000
FadeInEndTime=0.140000
MaxParticles=4
StartLocationShape=PTLS_Sphere
SpinsPerSecondRange=(X=(Max=0.075000))
StartSpinRange=(X=(Min=-0.500000,Max=0.500000))
SizeScale(0)=(RelativeTime=1.000000,RelativeSize=0.500000)
StartSizeRange=(X=(Min=15.000000,Max=28.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000))
ScaleSizeByVelocityMultiplier=(X=0.000000,Y=0.000000,Z=0.000000)
ScaleSizeByVelocityMax=0.000000
Texture=Texture'KillingFloorTextures.LondonCommon.fire3'
TextureUSubdivisions=4
TextureVSubdivisions=4
SecondsBeforeInactive=30.000000
LifetimeRange=(Min=1.000000,Max=1.000000)
StartVelocityRange=(X=(Min=-10.000000,Max=10.000000),Y=(Min=-10.000000,Max=10.000000),Z=(Min=10.000000,Max=50.000000))
End Object
Emitters(0)=SpriteEmitter'HideMut.KFBurnEffect_FPS.SpriteEmitter2'
LightType=LT_Steady
LightHue=30
LightSaturation=100
LightBrightness=300.000000
LightRadius=4.000000
bSpecialLit=True
bNoDelete=False
bOnlyDrawIfAttached=True
AmbientSound=Sound'KF_FlamethrowerSnd.SetFire.FT_SetFire_Self'
bFullVolume=True
SoundVolume=255
bNotOnDedServer=False
}

View file

@ -0,0 +1,46 @@
// a good place to store our 'global' variables
class Settings extends object
config(HideMut);
// =============================================================================
var config bool bRemoveSmoke; // remove smoke effects from most explosions
var config bool bHideZedFlames; // remove burning effects from zeds
var config bool bHideFlamethrowerEffects; // remove flamethrower bullshit
var config bool bHideZedTimeSounds; // remove zed time notification sounds
var config bool bHidePortraits; // remove player portraits from HUD when they chat
var config bool bHideNoPRImessages; // remove messages from HUD when they have no player replication info
var config bool bRandomName; // sets random name from your config collection
var config bool bShowStalkers; // reveals stalkers
var config bool bRemoveBlur; // remove all blur effects
var config bool bRemoveAmbientShake; // remove ambient shake effects
var config bool bRemoveWeaponShakeView; // remove weapon shaking
var config bool bRemoveShakeView; // remove shake view effects
var config bool bDeduceAdvancedInfo; // auto show stat net and fps
var config bool bRemoveOverlays; // remove some bullshit TWI overlays
var config bool bRemoveShitAnimations; // disable zapped / burning animations for zeds
var config array<string> BannedWords; // spam protection
// =============================================================================
// maybe don't normalize (caps) text for comparison?
final static function bool bIsWordBanned(string Msg)
{
local int i;
for (i = 0; i < default.BannedWords.length; i++)
{
if (InStr(caps(Msg), caps(default.BannedWords[i])) != -1)
return true;
}
return false;
}
// =============================================================================
defaultproperties
{
}

View file

@ -0,0 +1,57 @@
class WhosYourDaddy extends UT2K4InGameChat;
// if store interaction in this variable, so garbage collector won't delete it
var HideMutInteraction hmi;
// TO TEST actors
function bool notifyLevelChange()
{
MLGizeTheGame();
// hmi.notifyLevelChange();
return true;
}
event opened(GUIComponent sender)
{
MLGizeTheGame();
super.opened(sender);
}
function MLGizeTheGame()
{
local player p;
local int i;
p = controller.viewportOwner;
// in case interaction is active (i.e. you opened InGameChat during the game)
for (i = 0; i < p.localInteractions.length; i++)
if (p.localInteractions[i].class == dynamicLoadObject(string(class'HideMutInteraction'), class'Class', true))
return;
// interaction is not active, but exists (level changing)
if (hmi != none)
{
//make it active again
p.localInteractions.length = p.localInteractions.length + 1;
p.localInteractions[p.LocalInteractions.Length - 1] = hmi;
hmi.viewportOwner = p;
return;
}
// this is the first time this menu opened
// create interaction and add it to this menu, so it won't be deleted
p.interactionMaster.addInteraction(string(class'HideMutInteraction'), p);
forEach AllObjects(class'HideMutInteraction', hmi)
{
break;
}
}
defaultproperties
{
}

View file

@ -0,0 +1,52 @@
class a_ActorBase extends Actor;
//=============================================================================
// woah, we are making our first linked list
// var a_ActorManager Next;
//=============================================================================
function Termination()
{
destroy();
}
// add a new actor at the end of the list
// final function element_Add(a_ActorManager a)
// {
// if (Next == none)
// Next = a;
// else
// Next.element_Add(a);
// }
// in the SomeImportantActor class
// Function RemoveElement(ListElement Element)
// {
// Local ListElement List;
// If (Element==FirstElement)
// FirstElement=Element.Next;
// Else
// For (List=FirstElement;List!=none;List=List.Next)
// If (List.Next==Element)
// {
// List.Next=Element.Next;
// Break;
// }
// }
// self cleanup
// event Destroyed()
// {
// super.Destroyed();
// }
//=============================================================================
defaultproperties
{
DrawType=DT_None
}

View file

@ -0,0 +1,36 @@
class a_CashTosser extends a_ActorBase;
var KFPlayerController pc;
function startTossCash(KFPlayerController inPc)
{
pc = inPc;
setTimer(0.01, true); //0.01
}
function stopTossCash()
{
setTimer(0.0, false);
}
function timer()
{
if (KFPawn(pc.pawn) != none)
KFPawn(pc.pawn).tossCash(1);
}
// self cleanup
function Termination()
{
pc = none;
super.Termination();
}
defaultproperties
{
}

View file

@ -0,0 +1,41 @@
class a_DebugActor extends a_ActorBase;
// var KFPlayerController pc;
var HideMutInteraction hmi;
var int counter;
// function startSpam(KFPlayerController inPc)
function startSpam()
{
// pc = inPc;
setTimer(0.001, true);
}
function timer()
{
counter++;
hmi.buyAmmo();
hmi.buyKevlar();
hmi.buyHP();
if (counter > 1000)
{
setTimer(0.00, false);
Termination();
}
}
// self cleanup
function Termination()
{
hmi = none;
super.Termination();
}
defaultproperties
{
}

View file

@ -0,0 +1,164 @@
class a_MapOptimizer extends a_ActorBase
config(HideMut);
struct MyZone
{
var int ZoneKey; //zone key
var string ZoneName; //Zone name
var array<Vector> VectorsCoord; //Coordinates of zone borders. Drawing from 0 to 1, 1 to 2 and etc.
var float MinX, MinY, MaxX, MaxY; //Minimal coords for setting zoned actors
var array<int> PortalActorsRefs; //Actors that are visible through "portal" aka hole between neighbouring zones. Neighbouring zones may have same set of this
var array<int> DecorativeActorsRefs; //Decorative stuff between zones
var bool IgnoreXAxis; //Ignore this axis when setting active zone
var bool IgnoreYAxis;
var bool IgnoreZAxis;
var bool HideDecorativeActors;
var bool HidePortalActors;
};
var config array<MyZone> MyZones;
struct MyZonedMap
{
//Struct for map zoning
var string MapName;
var array<int> MyZoneRef; //reference to my zone structure
};
var config array<MyZonedMap> ZonedMaps;
struct ZonedStaticMeshes
{
var int ZoneRef;
var array<StaticMeshActor> SMA;
};
var array<ZonedStaticMeshes> ZonedSMA;
var PlayerController PC;
var int ActiveZonedMap;
var int ActiveZone, PrevActiveZone;
var int i, k;
simulated function StartMapOptimizer()
{
local StaticMeshActor SMA;
PC = Level.GetLocalPlayerController();
if(ZonedMaps.length == 0 || MyZones.length == 0 || PC == none || PC.Pawn == none)
return;
ActiveZonedMap = -1;
for(i=0; i<ZonedMaps.length;i++) //Let's find map profile
{
if(PC.Level.GetURLMap() ~= ZonedMaps[i].MapName);
ActiveZonedMap = i; //and save it
}
if(ActiveZonedMap == -1) //no profiles for this map
return;
for(i=0;i<ZonedMaps[ActiveZonedMap].MyZoneRef.length;i++) //Let's cache static meshes
{
ZonedSMA.length = ZonedSMA.length + 1;
ZonedSMA[ZonedSMA.length-1].ZoneRef = ZonedMaps[ActiveZonedMap].MyZoneRef[i];
ForEach PC.AllActors(class'StaticMeshActor', SMA)
{
if(Sma.bHidden)
continue;
if((SMA.Location.X <= MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MaxX && SMA.Location.Y <= MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MaxY)
&& (SMA.Location.X >= MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinX && SMA.Location.Y >= MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinY))
{
ZonedSMA[ZonedSMA.length-1].SMA.length = ZonedSMA[ZonedSMA.length-1].SMA.length + 1;
ZonedSMA[ZonedSMA.length-1].SMA[ZonedSMA[ZonedSMA.length-1].SMA.length-1] = SMA;
SMA.bHidden = true;
SMA.ResetStaticFilterState();
}
}
}
Enable('Tick');
}
simulated function StopMapOptimizer()
{
Disable('Tick');
for(i=0; i<ZonedSMA.length; i++)
{
for(k=0;k<ZonedSMA[i].SMA.length;k++) //show our hided static meshes
{
ZonedSMA[i].SMA[k].bHidden=false;
ZonedSMA[i].SMA[k].ResetStaticFilterState();
}
}
ZonedSMA.length = 0;
}
function Timer(){}
simulated function Tick(float Delta)
{
if(PC.Pawn == none) //No pawn no optimizer
StopMapOptimizer();
ActiveZone = -1;
for(i=0;i<ZonedMaps[ActiveZonedMap].MyZoneRef.length;i++) //Let's find our active zone == where are we now?
{
if(PC.Pawn.Location.X > MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinX && PC.Pawn.Location.Y > MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinY)
{
if(PC.Pawn.Location.X < MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MaxX && PC.Pawn.Location.Y < MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MaxY)
{
ActiveZone = ZonedMaps[ActiveZonedMap].MyZoneRef[i];
break;
}
}
}
if(ActiveZone == -1 || ZonedSMA.length == 0) //No active zones - seems like we are out of rectangle borders
return;
for(i=0; i<ZonedSMA.length; i++)
{
if(ZonedSMA[i].ZoneRef == ActiveZone) //Let's show our static meshes that situated in our active zone
{
if(ZonedSMA[i].SMA[0]!=none && !ZonedSMA[i].SMA[0].bHidden)
continue;
For(k=0;k<ZonedSMA[i].SMA.length;k++)
{
if(ZonedSMA[i].SMA[k] != none)
{
ZonedSMA[i].SMA[k].bHidden=false;
ZonedSMA[i].SMA[k].ResetStaticFilterState();
}
else
{
ZonedSMA[i].SMA.Remove(k,1);
}
}
}
else //hide statics that was in previous active zone
{
if(!ZonedSMA[i].SMA[0].bHidden)
{
For(k=0;k<ZonedSMA[i].SMA.length;k++)
{
ZonedSMA[i].SMA[k].bHidden=true;
ZonedSMA[i].SMA[k].ResetStaticFilterState();
}
}
}
}
}
// self cleanup
function Termination()
{
pc = none;
ZonedSMA.length = 0;
super.Termination();
}
defaultproperties
{
bUnlit=True
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
class a_SpectateManager extends a_ActorBase;
var KFPlayerController PC;
var bool isSpectator;
function friendlyShoot(KFPlayerController inPC, float timerTime)
{
PC = inPC;
KFHumanPawn(PC.pawn).weapon.serverStartFire(0);
SetTimer(timerTime, true);
}
function Timer()
{
if(!isSpectator)
{
PC.BecomeSpectator();
isSpectator = true;
SetTimer(0.10, false);
}
else
{
PC.BecomeActivePlayer();
SetTimer(0.00, false);
Destroyed();
}
}
// self cleanup
function Termination()
{
pc = none;
super.Termination();
}
defaultproperties
{
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,564 @@
class a_WeaponManager extends a_ActorBase
config(HideMutWeapons);
// when exit save weapon list as "CurrentWeaponList"
// clean me on destroy!!!
var() KFPlayerController kfpc;
var() HideMutInteraction interaction;
var() config bool bUseVanillaManagement;
var() config bool bFastWeaponChanging;
// server preset basic support
struct serverPreset
{
var string gameMode;
var string weaponPreset;
var string serverName;
var bool bUseVanillaManagement;
};
var() config array<serverPreset> serverPresets;
var() array<string> weaponGroup1;
var() array<string> weaponGroup2;
var() array<string> weaponGroup3;
var() array<string> weaponGroup4;
var() array<string> weaponGroup5;
var() array<string> weaponGroup6;
var() array<string> weaponGroup7;
var() array<string> weaponGroup8;
var() array<string> weaponGroup9;
var() array<string> allUsedWeapons;
// self cleanup, coz simple Destroy aint enough
function Termination()
{
// remove all refs
kfpc = none;
interaction = none;
clearAllGroups();
super.Termination();
}
event postBeginPlay()
{
super.postBeginPlay();
forEach allObjects(class'HideMutInteraction', interaction)
break;
loadWeaponList("CurrentWeaponList");
if (serverPresets.length > 0)
checkGameType();
}
final protected function checkGameType()
{
local GameReplicationInfo tempGri;
local int i;
local bool highestPriority;
local bool newBUseVanillaManagement;
local bool bFoundMatchingPreset;
local string newPreset;
foreach allActors(class'GameReplicationInfo', tempGri)
{
for (i = 0; i < serverPresets.length; i++)
{
if (tempGri.gameClass == serverPresets[i].gameMode)
{
// if server name is defined, this preset has higher priority (highestPriority = true)
if (serverPresets[i].serverName != "")
{
if (inStr(caps(tempGri.serverName), caps(serverPresets[i].serverName)) != -1)
{
newBUseVanillaManagement = serverPresets[i].bUseVanillaManagement;
if (serverPresets[i].weaponPreset != "")
newPreset = serverPresets[i].weaponPreset;
highestPriority = true;
bFoundMatchingPreset = true;
}
}
// if we found preset matching gameType and server name, we should skip presets without server name
else if (!highestPriority)
{
newBUseVanillaManagement = serverPresets[i].bUseVanillaManagement;
if (serverPresets[i].weaponPreset != "")
newPreset = serverPresets[i].weaponPreset;
bFoundMatchingPreset = true;
}
}
}
}
if (bFoundMatchingPreset)
{
bUseVanillaManagement = newBUseVanillaManagement;
if (newPreset != "")
loadWeaponList(newPreset);
}
}
simulated function saveWeaponList(string listName)
{
local list_WeaponManager new_WeaponList;
new_WeaponList = new(none, listName) class'list_WeaponManager';
new_WeaponList.clearConfig();
new_WeaponList.weaponGroup1 = weaponGroup1;
new_WeaponList.weaponGroup2 = weaponGroup2;
new_WeaponList.weaponGroup3 = weaponGroup3;
new_WeaponList.weaponGroup4 = weaponGroup4;
new_WeaponList.weaponGroup5 = weaponGroup5;
new_WeaponList.weaponGroup6 = weaponGroup6;
new_WeaponList.weaponGroup7 = weaponGroup7;
new_WeaponList.weaponGroup8 = weaponGroup8;
new_WeaponList.saveConfig();
}
simulated function loadWeaponList(string listName)
{
local list_WeaponManager new_WeaponList;
clearAllGroups();
new_WeaponList = new(none, listName) class'list_WeaponManager';
weaponGroup1 = new_WeaponList.weaponGroup1;
weaponGroup2 = new_WeaponList.weaponGroup2;
weaponGroup3 = new_WeaponList.weaponGroup3;
weaponGroup4 = new_WeaponList.weaponGroup4;
weaponGroup5 = new_WeaponList.weaponGroup5;
weaponGroup6 = new_WeaponList.weaponGroup6;
weaponGroup7 = new_WeaponList.weaponGroup7;
weaponGroup8 = new_WeaponList.weaponGroup8;
updateUnusedWeapons();
}
simulated function deleteWeaponList(string listName)
{
local list_WeaponManager new_WeaponList;
new_WeaponList = new(none, listName) class'list_WeaponManager';
new_WeaponList.clearConfig();
}
final function hide_getWeapon(byte groupNumber)
{
local Inventory inv;
local int i, currentWeapon;
local array<string> loc_weaponGroup;
if (kfpc.pawn == none || kfpc.pawn.inventory == none)
return;
switch (groupNumber)
{
case 1:
loc_weaponGroup = weaponGroup1;
break;
case 2:
loc_weaponGroup = weaponGroup2;
break;
case 3:
loc_weaponGroup = weaponGroup3;
break;
case 4:
loc_weaponGroup = weaponGroup4;
break;
case 5:
loc_weaponGroup = weaponGroup5;
break;
case 6:
loc_weaponGroup = weaponGroup6;
break;
case 7:
loc_weaponGroup = weaponGroup7;
break;
case 8:
loc_weaponGroup = weaponGroup8;
break;
case 9:
loc_weaponGroup = weaponGroup9;
break;
// fallback
default:
loc_weaponGroup = weaponGroup1;
}
if (loc_weaponGroup.length == 0)
return;
currentWeapon = -1;
for (i = 0; i < loc_weaponGroup.length; i++)
{
if (string(kfpc.pawn.weapon.class) ~= loc_weaponGroup[i])
{
currentWeapon = i;
break;
}
}
if (currentWeapon < loc_weaponGroup.length - 1)
{
for (i = currentWeapon + 1; i < loc_weaponGroup.length; i++)
{
for (inv = kfpc.pawn.inventory; inv != none; inv = inv.inventory)
{
if (string(inv.class) ~= loc_weaponGroup[i])
{
kfpc.pawn.pendingWeapon = Weapon(inv);
if (bFastWeaponChanging)
kfpc.pawn.changedWeapon();
else
kfpc.pawn.weapon.putDown();
return;
}
}
}
}
for (i = 0; i < currentWeapon; i++)
{
for (inv = kfpc.pawn.inventory; inv != none; inv = inv.inventory)
{
if (string(inv.class) ~= loc_weaponGroup[i])
{
kfpc.pawn.pendingWeapon = Weapon(inv);
if(bFastWeaponChanging)
kfpc.pawn.changedWeapon();
else
kfpc.pawn.weapon.putDown();
return;
}
}
}
return;
}
// quickest way to self heal
simulated function reallyQuickHeal()
{
local Inventory inv;
local Weapon oldWeapon;
if (kfpc == none || kfpc.pawn == none || kfpc.pawn.inventory == none)
return;
for (inv = kfpc.pawn.inventory; inv != none; inv = inv.inventory)
{
if (ClassIsChildOf(inv.class, class'Syringe'))
{
oldWeapon = kfpc.pawn.weapon;
kfpc.pawn.pendingWeapon = Weapon(inv);
kfpc.pawn.changedWeapon();
// Syringe(kfpc.pawn.weapon).HackClientStartFire();
Syringe(kfpc.pawn.weapon).serverStartFire(1);
kfpc.pawn.pendingWeapon = oldWeapon;
// kfpc.pawn.changedWeapon();
kfpc.pawn.weapon.putDown();
}
}
}
simulated function fullReset()
{
local KFLevelRules kflr;
clearAllGroups();
foreach kfpc.dynamicActors(class'KFLevelRules', kflr)
{
break;
}
if (kflr == none)
{
kfpc.clientMessage("Can't access KFLevelRules. You are probably not in game.");
return;
}
parseItemForSale(kflr.mediItemForSale);
parseItemForSale(kflr.suppItemForSale);
parseItemForSale(kflr.shrpItemForSale);
parseItemForSale(kflr.commItemForSale);
parseItemForSale(kflr.bersItemForSale);
parseItemForSale(kflr.fireItemForSale);
parseItemForSale(kflr.demoItemForSale);
parseItemForSale(kflr.neutItemForSale);
// hardcode big nono
weaponGroup5[weaponGroup5.length] = "KFmod.Syringe";
weaponGroup5[weaponGroup5.length] = "KFmod.Welder";
updateUnusedWeapons();
prioritySortGroup(weaponGroup1);
prioritySortGroup(weaponGroup2);
prioritySortGroup(weaponGroup3);
prioritySortGroup(weaponGroup4);
}
simulated function basicCleaning()
{
local Inventory inv;
local array<class<Pickup> > inventoryWeapons;
clearAllGroups();
if (kfpc.pawn.inventory == none)
{
kfpc.clientMessage("This function requires you inventory.(Needs Pawn)");
return;
}
for (inv = kfpc.pawn.inventory; inv != none; inv = inv.inventory)
{
if (KFWeapon(inv) != none)
{
inventoryWeapons[inventoryWeapons.length] = KFWeapon(inv).pickupClass;
}
}
parseItemForSale(inventoryWeapons);
updateUnusedWeapons();
}
simulated function fullCleaning()
{
clearAllGroups();
updateUnusedWeapons();
}
// part of fullReset()
simulated function parseItemForSale(array<class<Pickup> > itemForSale)
{
local int i;
local class<KFWeapon> tempKFWeapon;
for (i = 0; i < itemForSale.length; i++)
{
tempKFWeapon = class<KFWeapon>(itemForSale[i].default.inventoryType);
// failsafe
if (tempKFWeapon == none)
continue;
if (tempKFWeapon.default.inventoryGroup == 1)
{
weaponGroup1[weaponGroup1.length] = string(tempKFWeapon);
continue;
}
if (tempKFWeapon.default.inventoryGroup == 2)
{
weaponGroup2[weaponGroup2.length] = string(tempKFWeapon);
continue;
}
if (tempKFWeapon.default.inventoryGroup == 3)
{
weaponGroup3[weaponGroup3.length] = string(tempKFWeapon);
continue;
}
if (tempKFWeapon.default.inventoryGroup == 4)
{
weaponGroup4[weaponGroup4.length] = string(tempKFWeapon);
continue;
}
if (tempKFWeapon.default.inventoryGroup == 5)
{
weaponGroup5[weaponGroup5.length] = string(tempKFWeapon);
continue;
}
}
}
// part of fullReset()
simulated function prioritySortGroup(out array<string> weaponGroup)
{
local int i,j;
local string tempString;
local class<KFWeapon> tempKFWeapon1, tempKFWeapon2;
for (i = 0; i < weaponGroup.length; i++)
{
for (j = i; j < weaponGroup.length; j++)
{
tempKFWeapon1 = class<KFWeapon>(dynamicLoadObject(weaponGroup[i], class'Class', true));
tempKFWeapon2 = class<KFWeapon>(dynamicLoadObject(weaponGroup[j], class'Class', true));
if (tempKFWeapon1.default.priority < tempKFWeapon2.default.priority)
{
tempString = weaponGroup[i];
weaponGroup[i] = weaponGroup[j];
weaponGroup[j] = tempString;
}
}
}
}
simulated function clearAllGroups()
{
weaponGroup1.remove(0, weaponGroup1.length);
weaponGroup2.remove(0, weaponGroup2.length);
weaponGroup3.remove(0, weaponGroup3.length);
weaponGroup4.remove(0, weaponGroup4.length);
weaponGroup5.remove(0, weaponGroup5.length);
weaponGroup6.remove(0, weaponGroup6.length);
weaponGroup7.remove(0, weaponGroup7.length);
weaponGroup8.remove(0, weaponGroup8.length);
weaponGroup9.remove(0, weaponGroup9.length);
}
simulated function updateUnusedWeapons()
{
local KFLevelRules kflr;
local array<class<Pickup> > welderSyringe;
updateAllUsedWeapons();
foreach dynamicActors(class'KFLevelRules', kflr)
{
break;
}
if (kflr == none)
{
if (kfpc != none)
kfpc.clientMessage("Can't access KFLevelRules. You are probably not in game.");
return;
}
weaponGroup9.remove(0, weaponGroup9.length);
updateUnusedWeapons_Internal(kflr.mediItemForSale);
updateUnusedWeapons_Internal(kflr.suppItemForSale);
updateUnusedWeapons_Internal(kflr.shrpItemForSale);
updateUnusedWeapons_Internal(kflr.commItemForSale);
updateUnusedWeapons_Internal(kflr.bersItemForSale);
updateUnusedWeapons_Internal(kflr.fireItemForSale);
updateUnusedWeapons_Internal(kflr.demoItemForSale);
updateUnusedWeapons_Internal(kflr.neutItemForSale);
welderSyringe[welderSyringe.length] = class'SyringePickup';
welderSyringe[welderSyringe.length] = class'WelderPickup';
updateUnusedWeapons_Internal(welderSyringe);
prioritySortGroup(weaponGroup9);
}
simulated function updateUnusedWeapons_Internal(array<class<Pickup> > parsedWeapons)
{
local int i, j;
local class<KFWeapon> tempKFWeapon;
for (i = 0; i < parsedWeapons.length; i++)
{
tempKFWeapon = class<KFWeapon>(parsedWeapons[i].default.inventoryType);
if (tempKFWeapon == none)
continue;
if (allUsedWeapons.length == 0)
{
weaponGroup9[weaponGroup9.length] = string(tempKFWeapon);
continue;
}
for (j = 0; j < allUsedWeapons.length; j++)
{
if (string(tempKFWeapon) == allUsedWeapons[j])
break;
if (j == (allUsedWeapons.length - 1))
weaponGroup9[weaponGroup9.length] = string(tempKFWeapon);
}
}
}
simulated function updateAllUsedWeapons()
{
local int i;
allUsedWeapons.remove(0, allUsedWeapons.length);
for (i = 0; i < weaponGroup1.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup1[i];
}
for (i = 0; i < weaponGroup2.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup2[i];
}
for (i = 0; i < weaponGroup3.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup3[i];
}
for (i = 0; i < weaponGroup4.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup4[i];
}
for (i = 0; i < weaponGroup5.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup5[i];
}
for (i = 0; i < weaponGroup6.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup6[i];
}
for (i = 0; i < weaponGroup7.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup7[i];
}
for (i = 0; i < weaponGroup8.length; i++)
{
allUsedWeapons[allUsedWeapons.length] = weaponGroup8[i];
}
}
simulated function array<string> getAllPresetNames()
{
local array<string> names;
local int i;
names = getPerObjectNames("HideMutWeapons", string(class'list_WeaponManager'.name));
for (i = 0; i < names.length; i++)
{
if (names[i] ~= "CurrentWeaponList")
{
names.remove(i, 1);
}
}
return names;
}
// ============================================================
// are we a variant or no
final protected function bool IsVariantClass(class<Inventory> aInventoryType)
{
return Left(aInventoryType, 12) ~= "KFMod.Golden" || Left(aInventoryType, 10) ~= "KFMod.Camo" || Left(aInventoryType, 10) ~= "KFMod.Neon";
}
defaultproperties
{
}

View file

@ -0,0 +1,164 @@
class a_WeaponTosser extends a_ActorBase;
var KFPlayerController PC;
var bool bPrintingMode, bSellingMode, bTossingMode;
var int minWeight;
function startTossWeapons(KFPlayerController inPC)
{
PC = inPC;
bTossingMode = true;
SetTimer(0.01, true);
}
function startPrinting(KFPlayerController inPC)
{
local inventory inv;
PC = inPC;
bPrintingMode = true;
minWeight = KFHumanPawn(inPC.pawn).CurrentWeight;
for(Inv = inPC.Pawn.Inventory; Inv != none; Inv = Inv.Inventory)
{
if (KFWeapon(Inv) != none)
{
if(KFWeapon(Inv).class == class'KFMod.DualMK23Pistol' ||
KFWeapon(Inv).class == class'KFMod.Dual44Magnum' ||
KFWeapon(Inv).class == class'KFMod.GoldenDualDeagle' ||
KFWeapon(Inv).class == class'KFMod.DualDeagle')
{
minWeight = minWeight - 4;
}
if(KFWeapon(Inv).class == class'KFMod.MK23Pistol' ||
KFWeapon(Inv).class == class'KFMod.Magnum44Pistol' ||
KFWeapon(Inv).class == class'KFMod.GoldenDeagle' ||
KFWeapon(Inv).class == class'KFMod.Deagle')
{
minWeight = minWeight - 2;
}
}
}
minWeight = minWeight + 1;
SetTimer(0.01, true);
}
function startSellWeapons(KFPlayerController inPC)
{
PC = inPC;
bSellingMode = true;
SetTimer(0.01, true);
}
function stopAnyActions()
{
SetTimer(0.00, false);
}
function Timer()
{
local KFPawn me;
local Inventory inv;
local int i;
local array<KFWeapon> sellingWeapons;
me = KFPawn(PC.pawn);
if (me == none)
return;
if (bPrintingMode)
{
if (KFHumanPawn(me).CurrentWeight < minWeight)
{
me.ServerBuyWeapon(class'DualMK23Pistol', 0);
me.ServerBuyWeapon(class'Dual44Magnum', 0);
me.ServerBuyWeapon(class'DualDeagle', 0);
}
for (Inv = me.Inventory; Inv != none; Inv = Inv.Inventory)
{
if (KFWeapon(Inv) != none)
{
if(!KFWeapon(Inv).bKFNeverThrow)
{
if(KFWeapon(Inv).class == class'KFMod.DualMK23Pistol' ||
KFWeapon(Inv).class == class'KFMod.MK23Pistol' ||
KFWeapon(Inv).class == class'KFMod.Dual44Magnum' ||
KFWeapon(Inv).class == class'KFMod.Magnum44Pistol' ||
KFWeapon(Inv).class == class'KFMod.GoldenDualDeagle' ||
KFWeapon(Inv).class == class'KFMod.GoldenDeagle' ||
KFWeapon(Inv).class == class'KFMod.DualDeagle' ||
KFWeapon(Inv).class == class'KFMod.Deagle')
{
me.PendingWeapon = Weapon(Inv);
me.ChangedWeapon();
PC.ThrowWeapon();
// return;
}
}
}
}
}
if (bSellingMode)
{
//PC.ToggleDuck();
for (Inv = me.Inventory; Inv != none; Inv = Inv.Inventory)
{
if (KFWeapon(Inv) != none)
{
if (!KFWeapon(Inv).bKFNeverThrow)
{
sellingWeapons[sellingWeapons.length] = KFWeapon(Inv);
}
}
}
for (i = sellingWeapons.length - 1; i > -1 ; i--)
{
me.ServerSellWeapon(sellingWeapons[i].class);
}
return;
}
if (bTossingMode)
{
for (Inv = me.Inventory; Inv != none; Inv = Inv.Inventory)
{
if (KFWeapon(Inv) != none)
{
if (!KFWeapon(Inv).bKFNeverThrow && KFWeapon(Inv).bCanThrow)
{
Inv.Velocity = me.Velocity;
Inv.DropFrom(me.Location + VRand() * 10);
// me.PendingWeapon = Weapon(Inv);
// me.ChangedWeapon();
// PC.ThrowWeapon();
return;
}
}
}
}
}
// self cleanup
function Termination()
{
pc = none;
super.Termination();
}
defaultproperties
{
}

View file

@ -0,0 +1,66 @@
<html>
<head><title>Index of /kf_sources/HideMut/Classes/</title></head>
<body>
<h1>Index of /kf_sources/HideMut/Classes/</h1><hr><pre><a href="../">../</a>
<a href="ActortList.uc">ActortList.uc</a> 06-Jan-2022 08:52 419
<a href="ActortListController.uc">ActortListController.uc</a> 06-Jan-2022 08:52 1902
<a href="BackgroundArea.uc">BackgroundArea.uc</a> 06-Jan-2022 08:52 210
<a href="ChatAnimator.uc">ChatAnimator.uc</a> 06-Jan-2022 08:52 592
<a href="Halo.uc">Halo.uc</a> 06-Jan-2022 08:52 241
<a href="HideHUD.uc">HideHUD.uc</a> 06-Jan-2022 08:52 31295
<a href="HideLobbyChat.uc">HideLobbyChat.uc</a> 06-Jan-2022 08:52 5657
<a href="HideLobbyFooter.uc">HideLobbyFooter.uc</a> 06-Jan-2022 08:52 10795
<a href="HideLobbyMenu.uc">HideLobbyMenu.uc</a> 06-Jan-2022 08:52 27139
<a href="HideMainMenu.uc">HideMainMenu.uc</a> 06-Jan-2022 08:52 23268
<a href="HideMenuPreset.uc">HideMenuPreset.uc</a> 06-Jan-2022 08:52 191
<a href="HideMut.uc">HideMut.uc</a> 06-Jan-2022 08:52 4601
<a href="HideMutInteraction.uc">HideMutInteraction.uc</a> 06-Jan-2022 08:52 38075
<a href="HideObjectPool.uc">HideObjectPool.uc</a> 06-Jan-2022 08:52 1840
<a href="HideShopVolume.uc">HideShopVolume.uc</a> 06-Jan-2022 08:52 361
<a href="HideTeleporter.uc">HideTeleporter.uc</a> 06-Jan-2022 08:52 111
<a href="Hide_IngameChat.uc">Hide_IngameChat.uc</a> 06-Jan-2022 08:52 5669
<a href="KFBurnEffect_FPS.uc">KFBurnEffect_FPS.uc</a> 06-Jan-2022 08:52 2202
<a href="Settings.uc">Settings.uc</a> 06-Jan-2022 08:52 1991
<a href="WhosYourDaddy.uc">WhosYourDaddy.uc</a> 06-Jan-2022 08:52 1344
<a href="a_ActorBase.uc">a_ActorBase.uc</a> 06-Jan-2022 08:52 1105
<a href="a_CashTosser.uc">a_CashTosser.uc</a> 06-Jan-2022 08:52 448
<a href="a_DebugActor.uc">a_DebugActor.uc</a> 06-Jan-2022 08:52 542
<a href="a_MapOptimizer.uc">a_MapOptimizer.uc</a> 06-Jan-2022 08:52 4858
<a href="a_MonsterOptimizer.uc">a_MonsterOptimizer.uc</a> 06-Jan-2022 08:52 49526
<a href="a_SpectateManager.uc">a_SpectateManager.uc</a> 06-Jan-2022 08:52 618
<a href="a_VisibilityHandler.uc">a_VisibilityHandler.uc</a> 06-Jan-2022 08:52 42999
<a href="a_WeaponManager.uc">a_WeaponManager.uc</a> 06-Jan-2022 08:52 14575
<a href="a_WeaponTosser.uc">a_WeaponTosser.uc</a> 06-Jan-2022 08:52 3966
<a href="list_WeaponManager.uc">list_WeaponManager.uc</a> 06-Jan-2022 08:52 438
<a href="menu_Hide.uc">menu_Hide.uc</a> 06-Jan-2022 08:52 41089
<a href="menu_Old.uc">menu_Old.uc</a> 06-Jan-2022 08:52 26094
<a href="menu_WeaponManager.uc">menu_WeaponManager.uc</a> 06-Jan-2022 08:52 24521
<a href="menu_c_HideMut.uc">menu_c_HideMut.uc</a> 06-Jan-2022 08:52 60488
<a href="menu_c_Light.uc">menu_c_Light.uc</a> 06-Jan-2022 08:52 31851
<a href="menu_c_New.uc">menu_c_New.uc</a> 06-Jan-2022 08:52 1464
<a href="menu_c_Optimizer.uc">menu_c_Optimizer.uc</a> 06-Jan-2022 08:52 73281
<a href="menu_c_Zoner.uc">menu_c_Zoner.uc</a> 06-Jan-2022 08:52 7827
<a href="o_AssetLoader.uc">o_AssetLoader.uc</a> 06-Jan-2022 08:52 3804
<a href="o_CyrillicEncodeUtilities.uc">o_CyrillicEncodeUtilities.uc</a> 06-Jan-2022 08:52 11184
<a href="o_Render.uc">o_Render.uc</a> 06-Jan-2022 08:52 2347
<a href="o_Utility.uc">o_Utility.uc</a> 06-Jan-2022 08:52 16883
<a href="proj_GetName.uc">proj_GetName.uc</a> 06-Jan-2022 08:52 2211
<a href="proj_PickActor.uc">proj_PickActor.uc</a> 06-Jan-2022 08:52 736
<a href="repl_Console.uc">repl_Console.uc</a> 06-Jan-2022 08:52 1200
<a href="repl_FlameTendril.uc">repl_FlameTendril.uc</a> 06-Jan-2022 08:52 1778
<a href="repl_GT.uc">repl_GT.uc</a> 06-Jan-2022 08:52 2638
<a href="repl_InternetPage.uc">repl_InternetPage.uc</a> 06-Jan-2022 08:52 1061
<a href="repl_KFSStats.uc">repl_KFSStats.uc</a> 06-Jan-2022 08:52 12162
<a href="repl_LAWProj.uc">repl_LAWProj.uc</a> 06-Jan-2022 08:52 1955
<a href="repl_M79Proj.uc">repl_M79Proj.uc</a> 06-Jan-2022 08:52 1983
<a href="repl_MOTD.uc">repl_MOTD.uc</a> 06-Jan-2022 08:52 292
<a href="repl_Monster.uc">repl_Monster.uc</a> 06-Jan-2022 08:52 4227
<a href="repl_Nade.uc">repl_Nade.uc</a> 06-Jan-2022 08:52 1053
<a href="repl_PC.uc">repl_PC.uc</a> 06-Jan-2022 08:52 8162
<a href="repl_Pawn.uc">repl_Pawn.uc</a> 06-Jan-2022 08:52 3117
<a href="repl_PipeProj.uc">repl_PipeProj.uc</a> 06-Jan-2022 08:52 1223
<a href="repl_ProjFlare.uc">repl_ProjFlare.uc</a> 06-Jan-2022 08:52 1295
<a href="repl_ServerBrowser.uc">repl_ServerBrowser.uc</a> 06-Jan-2022 08:52 974
<a href="repl_proj_buzzsaw.uc">repl_proj_buzzsaw.uc</a> 06-Jan-2022 08:52 251
</pre><hr></body>
</html>

View file

@ -0,0 +1,17 @@
class list_WeaponManager extends object
PerObjectConfig
config(HideMutWeapons);
var config array<string> weaponGroup1;
var config array<string> weaponGroup2;
var config array<string> weaponGroup3;
var config array<string> weaponGroup4;
var config array<string> weaponGroup5;
var config array<string> weaponGroup6;
var config array<string> weaponGroup7;
var config array<string> weaponGroup8;
defaultproperties
{
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,976 @@
class menu_Old extends PopupPageBase
transient;
var(DEBUG) transient array<StaticMeshActor> cachedStaticMeshes;
var(DEBUG) transient array<Light> cachedLights;
var(DEBUG) transient array<Emitter> cachedEmitters;
var(DEBUG) transient array<Decoration> cachedDecorations;
var(DEBUG) transient array<Mover> cachedMovers;
var(DEBUG) transient array<Projector> cachedProjectors; // KFBloodSplatter
var(DEBUG) transient array<KF_RotatingMeshActor> cachedRotatingMeshActors; // terraininfo
var PlayerController PC;
var editinline array<byte> CloseKey;
var ActortListController ALC;
var string mapName;
var automated GUIButton b_HideAllActors, b_ShowAllActors, b_CacheAllActors,
b_UncacheAllActors, b_RefreshScreen, b_DisplayCachedActors,
b_ValidateCachedActors, b_ClearCache, b_ActivateInteraction;
var automated BackgroundArea a_List;
var automated GUIListBox lb_ActortListsList;
var GUIList li_ActortListsList;
var automated GUILabel l_WeaponList;
var string colorG, colorB, colorY, colorW;
simulated function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
super.InitComponent(MyController,MyOwner);
PC = PlayerOwner();
colorG = chr(27) $ chr(1) $ chr(240) $ chr(1);
colorB = chr(27) $ chr(90) $ chr(90) $ chr(240);
colorY = chr(27) $ chr(127) $ chr(127) $ chr(1);
colorW = chr(27) $ chr(255) $ chr(255) $ chr(255);
}
event Opened(GUIComponent Sender)
{
local int i;
local string KeyName;
local array<string> KeyNames;
local array<string> ActortListNames;
super.Opened(Sender);
PC = PlayerOwner();
// write in KeyNames all bind keys that onen this window to use 'closeWindowWithBind()' then
CloseKey.Remove(0, CloseKey.Length);
KeyName = PC.ConsoleCommand("BINDINGTOKEY hideMenu");
Split(KeyName, ",", KeyNames);
for (i = 0; i < KeyNames.Length; i++)
CloseKey[CloseKey.Length] = byte(PC.ConsoleCommand("KEYNUMBER"@KeyNames[i]));
mapName = class'KFGameType'.static.GetCurrentMapName(PC.Level);
// in case of 255.255.225.228:8080/KF-WestLondon
i = InStr(mapName, "/") + 1;
MapName = Mid(MapName, i, Len(MapName) - i);
l_WeaponList.caption = MapName;
// refresh list with ActortLists
GetALL().clear();
ActortListNames = GetALC().GetAllActortLists();
for (i = 0; i < ActortListNames.Length; i++)
{
if (Left(ActortListNames[i], Len(MapName)) ~= MapName)
GetALL().add(ActortListNames[i]);
}
}
simulated function Closed(GUIComponent Sender, bool bCancelled)
{
super.Closed(Sender, bCancelled);
b_CacheAllActors.MenuState=MSAT_Disabled;
b_UncacheAllActors.MenuState=MSAT_Disabled;
}
// safe cleanup
event Free()
{
// all automated components are cleaned in super code
pc = none;
ALC = none;
li_ActortListsList = none;
// clear all arrays
clearCache();
super.Free();
}
// =============================================================================
// getters for safe calls
final private function PCMsg(coerce string s, optional Name Type)
{
if (pc != none)
PC.ClientMessage(s, Type);
}
final private function ActortListController GetALC()
{
if (ALC == none)
ALC = new class'ActortListController';
return ALC;
}
final private function GUIList GetALL()
{
if (li_ActortListsList == none)
{
li_ActortListsList = lb_ActortListsList.List;
li_ActortListsList.TextAlign = TXTA_Left;
li_ActortListsList.OnClick = ActivateAllButtons;
li_ActortListsList.bMultiSelect = true;
li_ActortListsList.bDropSource = true;
li_ActortListsList.bDropTarget = true;
}
return li_ActortListsList;
}
// =============================================================================
simulated function bool ButtonClicked(GUIComponent Sender)
{
// local StaticMeshActor tempActor;
// local Emitter tempEmitter;
// local Light tempLight;
// local mover tempMover;
// local array<string> uselessActors;
// local int i, count;
switch (Sender)
{
case b_CacheAllActors:
cacheStaticMeshes();
cacheLights();
cacheEmitters();
cacheDecorations();
cacheMovers();
cacheRotatingMeshActors();
break;
case b_UncacheAllActors:
// UNCACHE
break;
case b_HideAllActors:
checkAvailability();
PCMsg(colorW$"----------------------------------------");
PCMsg(colorG$"Following actors were hided:");
hideStaticMeshes();
hideLights();
hideEmitters();
hideDecorations();
hideMovers();
hideRotatingMeshActors();
PCMsg(colorW$"----------------------------------------");
break;
case b_ShowAllActors:
checkAvailability();
PCMsg(colorW$"----------------------------------------");
PCMsg(colorG$"Following actors were unhided:");
showStaticMeshes();
showLights();
showEmitters();
showDecorations();
showMovers();
showRotatingMeshActors();
PCMsg(colorW$"----------------------------------------");
break;
case b_RefreshScreen:
hideSMeshesWithoutColliding();
break;
case b_DisplayCachedActors:
checkAvailability();
PCMsg(colorW$"----------------------------------------");
PCMsg(colorG$"Cached actors:");
displayCachedStaticMeshes();
displayCachedLights();
displayCachedEmitters();
displayCachedDecorations();
displayCachedMovers();
displayCachedRotatingMeshActors();
PCMsg(colorW$"----------------------------------------");
break;
case b_ClearCache:
clearCache();
break;
case b_ActivateInteraction:
// runInteraction();
closeInteraction();
break;
default:
return false;
}
return true;
}
simulated function runInteraction()
{
// local int i;
local PlayerController dude;
dude = PlayerOwner();
if (dude != none)
{
// dude.Player.LocalInteractions[dude.Player.LocalInteractions.Length] = none;
// for(i = 0; i < dude.Player.LocalInteractions.Length; i++)
// PCMsg(colorW$string(dude.Player.LocalInteractions[i].name));
dude.Player.LocalInteractions[0] = new class<Interaction>(DynamicLoadObject(string(class'HideMutInteraction'), class'Class', true));
dude.Player.LocalInteractions[0].ViewportOwner = dude.Player;
}
// dude.Player.InteractionMaster.AddInteraction(string(class'HideMutInteraction'), dude.Player);
}
simulated function closeInteraction()
{
PlayerOwner().Player.LocalInteractions[0].ViewportOwner = none;
PlayerOwner().Player.LocalInteractions.Remove(0, 1);
}
// STATIC MESHES
simulated function cacheStaticMeshes()
{
local StaticMeshActor tempSM;
local array<string> uselessStaticMeshes;
local int i, count;
uselessStaticMeshes = GetALC().getUselessStaticMeshes(GetALL().get(false));
PCMsg("Meshes in ini file:"$uselessStaticMeshes.length);
forEach AllObjects (class'StaticMeshActor', tempSM)
{
for (i = 0; i < uselessStaticMeshes.length; i++)
{
if (string(tempSM.name) == uselessStaticMeshes[i])
{
cachedStaticMeshes[cachedStaticMeshes.length] = tempSM;
uselessStaticMeshes.remove(i,1);
count++;
break;
}
}
}
PCMsg("Meshes added:"$count);
PCMsg(colorG$"All static meshes were cached sucessfully.");
}
simulated function hideStaticMeshes()
{
local int i;
PCMsg(colorB$"Static meshes");
for (i = 0; i < cachedStaticMeshes.length; i++)
{
if (cachedStaticMeshes[i].bHidden == false)
{
cachedStaticMeshes[i].bHidden = true;
cachedStaticMeshes[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedStaticMeshes[i].name));
}
}
}
simulated function showStaticMeshes()
{
local int i;
PCMsg(colorB$"Static meshes");
for (i = 0; i < cachedStaticMeshes.length; i++)
{
if (cachedStaticMeshes[i].bHidden == true)
{
cachedStaticMeshes[i].bHidden = false;
cachedStaticMeshes[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedStaticMeshes[i].name));
}
}
}
simulated function displayCachedStaticMeshes()
{
local int i;
PCMsg(colorB$"Static meshes ["$cachedStaticMeshes.length$"]");
for (i = 0; i < cachedStaticMeshes.length; i++)
PCMsg(colorY$" "@string(cachedStaticMeshes[i].name));
}
// LIGHTS
simulated function cacheLights()
{
local Light tempL;
local array<string> uselessLights;
local int i;
uselessLights = GetALC().getUselessLights(GetALL().get(false));
forEach AllObjects (class'Light', tempL)
{
for (i = 0; i < uselessLights.length; i++)
{
if (string(tempL.name) == uselessLights[i])
{
cachedLights[cachedLights.length] = tempL;
uselessLights.remove(i,1);
break;
}
}
}
PCMsg(colorG$"All lights were cached sucessfully.");
}
simulated function hideLights()
{
local int i;
PCMsg(colorB$"Lights[coronas]");
for (i = 0; i < cachedLights.length; i++)
{
if (cachedLights[i].bCorona == true)
{
cachedLights[i].bCorona = false;
if (cachedLights[i].bStatic)
cachedLights[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedLights[i].name));
}
}
}
simulated function showLights()
{
local int i;
PCMsg(colorB$"Lights[coronas]");
for(i = 0; i < cachedLights.length; i++)
if(cachedLights[i].bCorona == false)
{
cachedLights[i].bCorona = true;
if(cachedLights[i].bStatic)
cachedLights[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedLights[i].name));
}
}
simulated function displayCachedLights()
{
local int i;
PCMsg(colorB$"Lights ["$cachedLights.length$"]");
for(i = 0; i < cachedLights.length; i++)
PCMsg(colorY$" "@string(cachedLights[i].name));
}
/*EMITTERS*/
simulated function cacheEmitters()
{
local Emitter tempE;
local array<string> uselessEmitters;
local int i;
uselessEmitters = GetALC().getUselessEmitters(GetALL().get(false));
forEach AllObjects (class'Emitter', tempE)
{
for(i = 0; i < uselessEmitters.length; i++)
{
if(string(tempE.name) == uselessEmitters[i])
{
cachedEmitters[cachedEmitters.length] = tempE;
uselessEmitters.remove(i,1);
break;
}
}
}
PCMsg(colorG$"All emitters were cached sucessfully.");
}
simulated function hideEmitters()
{
local int i;
PCMsg(colorB$"Emitters");
for(i = 0; i < cachedEmitters.length; i++)
if(cachedEmitters[i].bHidden == false)
{
cachedEmitters[i].bHidden = true;
if(cachedEmitters[i].bStatic)
cachedEmitters[i].ResetStaticFilterState();
// PCMsg(colorY$" "@string(cachedEmitters[i].name));
}
}
simulated function showEmitters()
{
local int i;
PCMsg(colorB$"Emitters");
for(i = 0; i < cachedEmitters.length; i++)
if(cachedEmitters[i].bHidden == true)
{
cachedEmitters[i].bHidden = false;
if(cachedEmitters[i].bStatic)
cachedEmitters[i].ResetStaticFilterState();
// PCMsg(colorY$" "@string(cachedEmitters[i].name));
}
}
simulated function displayCachedEmitters()
{
local int i;
PCMsg(colorB$"Emitters ["$cachedEmitters.length$"]");
for(i = 0; i < cachedEmitters.length; i++)
PCMsg(colorY$" "@string(cachedEmitters[i].name));
}
// DECORATIONS
simulated function cacheDecorations()
{
local Decoration tempD;
local array<string> uselessDecorations;
local int i;
uselessDecorations = GetALC().getUselessDecorations(GetALL().get(false));
forEach AllObjects (class'Decoration', tempD)
{
for(i = 0; i < uselessDecorations.length; i++)
{
if(string(tempD.name) == uselessDecorations[i])
{
cachedDecorations[cachedDecorations.length] = tempD;
uselessDecorations.remove(i,1);
break;
}
}
}
PCMsg(colorG$"All decorations were cached sucessfully.");
}
simulated function hideDecorations()
{
local int i;
PCMsg(colorB$"Decorations");
for (i = 0; i < cachedDecorations.length; i++)
if (cachedDecorations[i].bHidden == false)
{
cachedDecorations[i].bHidden = true;
if (cachedDecorations[i].bStatic)
cachedDecorations[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedDecorations[i].name));
}
}
simulated function showDecorations()
{
local int i;
PCMsg(colorB$"Decorations");
for (i = 0; i < cachedDecorations.length; i++)
if (cachedDecorations[i].bHidden == true)
{
cachedDecorations[i].bHidden = false;
if (cachedDecorations[i].bStatic)
cachedDecorations[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedDecorations[i].name));
}
}
simulated function displayCachedDecorations()
{
local int i;
PCMsg(colorB$"Decorations ["$cachedDecorations.length$"]");
for (i = 0; i < cachedDecorations.length; i++)
PCMsg(colorY$" "@string(cachedDecorations[i].name));
}
// MOVERS
simulated function cacheMovers()
{
local Mover tempM;
local array<string> uselessMovers;
local int i;
uselessMovers = GetALC().getUselessMovers(GetALL().get(false));
forEach AllObjects (class'Mover', tempM)
{
for (i = 0; i < uselessMovers.length; i++)
{
if (string(tempM.name) == uselessMovers[i])
{
cachedMovers[cachedMovers.length] = tempM;
uselessMovers.remove(i,1);
break;
}
}
}
PCMsg(colorG$"All movers were cached sucessfully.");
}
simulated function hideMovers()
{
local int i;
PCMsg(colorB$"Movers");
for (i = 0; i < cachedMovers.length; i++)
if (cachedMovers[i].bHidden == false)
{
cachedMovers[i].bHidden = true;
if (cachedMovers[i].bStatic)
cachedMovers[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedMovers[i].name));
}
}
simulated function showMovers()
{
local int i;
PCMsg(colorB$"Movers");
for (i = 0; i < cachedMovers.length; i++)
if (cachedMovers[i].bHidden == true)
{
cachedMovers[i].bHidden = false;
if (cachedMovers[i].bStatic)
cachedMovers[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedMovers[i].name));
}
}
simulated function displayCachedMovers()
{
local int i;
PCMsg(colorB$"Movers ["$cachedMovers.length$"]");
for (i = 0; i < cachedMovers.length; i++)
PCMsg(colorY$" "@string(cachedMovers[i].name));
}
// KF_RotatingMeshActor
// Chaos code
simulated function cacheRotatingMeshActors()
{
local KF_RotatingMeshActor tempRM;
local array<string> uselessRotatingMeshActors;
local int i, count;
uselessRotatingMeshActors = GetALC().getuselessRotatingMeshActors(GetALL().get(false));
PCMsg("Rotating Movers in ini file:"$uselessRotatingMeshActors.length);
forEach AllObjects (class'KF_RotatingMeshActor', tempRM)
{
for (i = 0; i < uselessRotatingMeshActors.length; i++)
{
if (string(tempRM.name) == uselessRotatingMeshActors[i])
{
cachedRotatingMeshActors[cachedRotatingMeshActors.length] = tempRM;
uselessRotatingMeshActors.remove(i,1);
count++;
break;
}
}
}
PCMsg("RotatingMeshActors added:"$count);
PCMsg(colorG$"All RotatingMeshActors were cached sucessfully.");
}
simulated function hideRotatingMeshActors()
{
local int i;
PCMsg(colorB$"RotatingMeshActors");
for (i = 0; i < cachedRotatingMeshActors.length; i++)
if (cachedRotatingMeshActors[i].bHidden == false)
{
cachedRotatingMeshActors[i].bHidden = true;
cachedRotatingMeshActors[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedRotatingMeshActors[i].name));
}
}
simulated function showRotatingMeshActors()
{
local int i;
PCMsg(colorB$"RotatingMeshActors");
for (i = 0; i < cachedRotatingMeshActors.length; i++)
if (cachedRotatingMeshActors[i].bHidden == true)
{
cachedRotatingMeshActors[i].bHidden = false;
cachedRotatingMeshActors[i].ResetStaticFilterState();
PCMsg(colorY$" "@string(cachedRotatingMeshActors[i].name));
}
}
simulated function displayCachedRotatingMeshActors()
{
local int i;
PCMsg(colorB$"RotatingMeshActors ["$cachedRotatingMeshActors.length$"]");
for (i = 0; i < cachedRotatingMeshActors.length; i++)
PCMsg(colorY$" "@string(cachedRotatingMeshActors[i].name));
}
// Chaos code
simulated function clearCache()
{
if (cachedStaticMeshes.length > 0)
cachedStaticMeshes.remove(0,cachedStaticMeshes.length);
if (cachedLights.length > 0)
cachedLights.remove(0,cachedLights.length);
if (cachedEmitters.length > 0)
cachedEmitters.remove(0,cachedEmitters.length);
if (cachedDecorations.length > 0)
cachedDecorations.remove(0,cachedDecorations.length);
if (cachedMovers.length > 0)
cachedMovers.remove(0,cachedMovers.length);
if (cachedProjectors.length > 0)
cachedProjectors.remove(0,cachedProjectors.length);
if (cachedRotatingMeshActors.length > 0)
cachedRotatingMeshActors.remove(0,cachedRotatingMeshActors.length);
PCMsg(colorG$"The cache was cleared.");
}
simulated function bool closeWindowWithBind(out byte Key, out byte State, float delta)
{
local int i;
for (i = 0; i < CloseKey.Length; i++)
if (Key == CloseKey[i])
{
Controller.CloseMenu(false);
return true;
}
}
simulated function bool ActivateAllButtons(GUIComponent Sender)
{
GetALL().InternalOnClick(Sender);
b_CacheAllActors.MenuState=MSAT_Blurry;
// b_UncacheAllActors.MenuState=MSAT_Blurry;
return true;
}
simulated function hideSMeshesWithoutColliding()
{
local StaticMeshActor tempMesh;
local Emitter tempE;
local Light tempL;
local Decoration tempD;
local Mover tempM;
local KF_RotatingMeshActor tempR;
forEach AllObjects (class'StaticMeshActor', tempMesh)
{
if(tempMesh.bBlockActors == false && tempMesh.bBlockZeroExtentTraces == false)
{
tempMesh.bHidden = true;
tempMesh.ResetStaticFilterState();
cachedStaticMeshes[cachedStaticMeshes.length] = tempMesh;
}
}
forEach AllObjects (class'Emitter', tempE)
{
if(tempE.Instigator == none)
{
tempE.bHidden = true;
if(tempE.bStatic)
tempE.ResetStaticFilterState();
cachedEmitters[cachedEmitters.length] = tempE;
}
}
forEach AllObjects (class'Light', tempL)
{
if(tempL.bCorona == true)
{
tempL.bCorona = false;
if(tempL.bStatic)
tempL.ResetStaticFilterState();
cachedLights[cachedLights.length] = tempL;
}
}
forEach AllObjects (class'Decoration', tempD)
{
tempD.bHidden = true;
if(tempD.bStatic)
tempD.ResetStaticFilterState();
cachedDecorations[cachedDecorations.length] = tempD;
}
forEach AllObjects (class'Mover', tempM)
{
if(tempM.bBlockActors == false && tempM.bBlockZeroExtentTraces == false)
{
tempM.bHidden = true;
if(tempM.bStatic)
tempM.ResetStaticFilterState();
cachedMovers[cachedMovers.length] = tempM;
}
}
// TODO:Check it later
forEach AllObjects (class'KF_RotatingMeshActor', tempR)
{
if(tempR.bBlockActors == false)
{
tempR.bHidden = true;
if(tempR.bStatic)
tempR.ResetStaticFilterState();
cachedRotatingMeshActors[cachedRotatingMeshActors.length] = tempR;
}
}
}
simulated function checkAvailability()
{
local int i;
if (cachedStaticMeshes.length > 0)
{
for (i = 0; i < cachedStaticMeshes.length && cachedStaticMeshes[i] == none; i++)
cachedStaticMeshes.remove(i, 1);
}
if (cachedLights.length > 0)
{
for (i = 0; i < cachedLights.length && cachedLights[i] == none; i++)
cachedLights.remove(i, 1);
}
if (cachedEmitters.length > 0)
{
for (i = 0; i < cachedEmitters.length && (cachedEmitters[i] == none || cachedEmitters[i].bDeleteMe); i++)
cachedEmitters.remove(i, 1);
}
if (cachedDecorations.length > 0)
{
for (i = 0; i < cachedDecorations.length && cachedDecorations[i] == none; i++)
cachedDecorations.remove(i, 1);
}
if (cachedMovers.length > 0)
{
for (i = 0; i < cachedMovers.length && cachedMovers[i] == none; i++)
cachedMovers.remove(i, 1);
}
}
defaultproperties
{
Begin Object Class=GUIButton Name=HideAllActorsButton
Caption="Hide cached"
WinTop=0.722000
WinLeft=0.605000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=HideAllActorsButton.InternalOnKeyEvent
End Object
b_HideAllActors=GUIButton'HideMut.menu_Old.HideAllActorsButton'
Begin Object Class=GUIButton Name=ShowAllActorsButton
Caption="Unhide cached"
WinTop=0.722000
WinLeft=0.700000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=ShowAllActorsButton.InternalOnKeyEvent
End Object
b_ShowAllActors=GUIButton'HideMut.menu_Old.ShowAllActorsButton'
Begin Object Class=GUIButton Name=CacheAllActorsButton
Caption="Cache"
MenuState=MSAT_Disabled
WinTop=0.712000
WinLeft=0.405000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=CacheAllActorsButton.InternalOnKeyEvent
End Object
b_CacheAllActors=GUIButton'HideMut.menu_Old.CacheAllActorsButton'
Begin Object Class=GUIButton Name=UncacheAllActorsButton
Caption="Uncache"
MenuState=MSAT_Disabled
WinTop=0.712000
WinLeft=0.505000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=UncacheAllActorsButton.InternalOnKeyEvent
End Object
b_UncacheAllActors=GUIButton'HideMut.menu_Old.UncacheAllActorsButton'
Begin Object Class=GUIButton Name=RefreshScreenButton
Caption="Just button"
WinTop=0.722000
WinLeft=0.795000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=RefreshScreenButton.InternalOnKeyEvent
End Object
b_RefreshScreen=GUIButton'HideMut.menu_Old.RefreshScreenButton'
Begin Object Class=GUIButton Name=DisplayCachedActorsButton
Caption="Display cached"
WinTop=0.722000
WinLeft=0.305000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=DisplayCachedActorsButton.InternalOnKeyEvent
End Object
b_DisplayCachedActors=GUIButton'HideMut.menu_Old.DisplayCachedActorsButton'
Begin Object Class=GUIButton Name=ValidateCachedActorsButton
Caption="Validate cache"
MenuState=MSAT_Disabled
WinTop=0.722000
WinLeft=0.210000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=ValidateCachedActorsButton.InternalOnKeyEvent
End Object
b_ValidateCachedActors=GUIButton'HideMut.menu_Old.ValidateCachedActorsButton'
Begin Object Class=GUIButton Name=ClearCacheButton
Caption="Clear cache"
WinTop=0.722000
WinLeft=0.115000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=ClearCacheButton.InternalOnKeyEvent
End Object
b_ClearCache=GUIButton'HideMut.menu_Old.ClearCacheButton'
Begin Object Class=GUIButton Name=ActivateInteractionButton
Caption="Run interaction"
WinTop=0.712000
WinLeft=0.015000
WinWidth=0.090000
WinHeight=0.080000
OnClick=menu_Old.ButtonClicked
OnKeyEvent=ActivateInteractionButton.InternalOnKeyEvent
End Object
b_ActivateInteraction=GUIButton'HideMut.menu_Old.ActivateInteractionButton'
Begin Object Class=BackgroundArea Name=ListArea
WinTop=0.550000
WinLeft=0.400000
WinWidth=0.200000
WinHeight=0.150000
End Object
a_List=BackgroundArea'HideMut.menu_Old.ListArea'
Begin Object Class=GUIListBox Name=ActortListsListBox
bVisibleWhenEmpty=True
OnCreateComponent=ActortListsListBox.InternalOnCreateComponent
WinTop=0.557000
WinLeft=0.403000
WinWidth=0.194000
WinHeight=0.140000
End Object
lb_ActortListsList=GUIListBox'HideMut.menu_Old.ActortListsListBox'
Begin Object Class=GUILabel Name=WeaponListLabel
Caption="Current map"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
Hint="Current map"
WinTop=0.530000
WinLeft=0.400000
WinWidth=0.200000
WinHeight=0.020000
End Object
l_WeaponList=GUILabel'HideMut.menu_Old.WeaponListLabel'
bPersistent=True
bAllowedAsLast=True
WinTop=0.700000
WinLeft=0.400000
WinWidth=0.200000
WinHeight=0.100000
OnKeyEvent=menu_Old.closeWindowWithBind
}

View file

@ -0,0 +1,778 @@
class menu_WeaponManager extends GUIPage
transient;
//=============================================================================
var PlayerController pc;
var a_WeaponManager a_weaponManager;
var string colorG, colorR;
var automated BackgroundArea ba_Group1, ba_Group2, ba_Group3, ba_Group4,
ba_Group5, ba_Group6, ba_Group7, ba_Group8,
ba_Group9, ba_Presets;
var automated GUIListBox lb_Group1, lb_Group2, lb_Group3, lb_Group4,
lb_Group5, lb_Group6, lb_Group7, lb_Group8,
lb_Group9, lb_Presets;
var GUIList li_Group1, li_Group2, li_Group3, li_Group4,
li_Group5, li_Group6, li_Group7, li_Group8,
li_Group9, li_Presets;
var automated GUIButton b_VanillaReset, b_BasicCleaning, b_FullCleaning,
b_SavePreset, b_DeletePreset;
var automated moEditBox eb_PresetName;
var automated moCheckbox cb_UseVanillaManagement, cb_FastWeaponChanging;
var automated GUILabel l_Group1, l_Group2, l_Group3, l_Group4,
l_Group5, l_Group6, l_Group7, l_Group8,
l_Group9, l_Presets;
//=============================================================================
simulated function initComponent(GUIController MyController, GUIComponent MyOwner)
{
super.initComponent(MyController,MyOwner);
pc = playerOwner();
SetupHmi();
li_Group1 = lb_Group1.List;
li_Group1.TextAlign = TXTA_Left;
li_Group1.bMultiSelect = true;
li_Group1.bDropSource = true;
li_Group1.bDropTarget = true;
li_Group1.OnDblClick = ListDblClick;
// li_Group1.bDrawSelectionBorder = true;
li_Group2 = lb_Group2.List;
li_Group2.TextAlign = TXTA_Left;
li_Group2.bMultiSelect = true;
li_Group2.bDropSource = true;
li_Group2.bDropTarget = true;
li_Group2.OnDblClick = ListDblClick;
li_Group3 = lb_Group3.List;
li_Group3.TextAlign = TXTA_Left;
li_Group3.bMultiSelect = true;
li_Group3.bDropSource = true;
li_Group3.bDropTarget = true;
li_Group3.OnDblClick = ListDblClick;
li_Group4 = lb_Group4.List;
li_Group4.TextAlign = TXTA_Left;
li_Group4.bMultiSelect = true;
li_Group4.bDropSource = true;
li_Group4.bDropTarget = true;
li_Group4.OnDblClick = ListDblClick;
li_Group5 = lb_Group5.List;
li_Group5.TextAlign = TXTA_Left;
li_Group5.bMultiSelect = true;
li_Group5.bDropSource = true;
li_Group5.bDropTarget = true;
li_Group5.OnDblClick = ListDblClick;
li_Group6 = lb_Group6.List;
li_Group6.TextAlign = TXTA_Left;
li_Group6.bMultiSelect = true;
li_Group6.bDropSource = true;
li_Group6.bDropTarget = true;
li_Group6.OnDblClick = ListDblClick;
li_Group7 = lb_Group7.List;
li_Group7.TextAlign = TXTA_Left;
li_Group7.bMultiSelect = true;
li_Group7.bDropSource = true;
li_Group7.bDropTarget = true;
li_Group7.OnDblClick = ListDblClick;
li_Group8 = lb_Group8.List;
li_Group8.TextAlign = TXTA_Left;
li_Group8.bMultiSelect = true;
li_Group8.bDropSource = true;
li_Group8.bDropTarget = true;
li_Group8.OnDblClick = ListDblClick;
li_Group9 = lb_Group9.List;
li_Group9.TextAlign = TXTA_Left;
li_Group9.bMultiSelect = true;
li_Group9.bDropSource = true;
li_Group9.bDropTarget = true;
li_Group9.OnDblClick = ListDblClick;
li_Presets = lb_Presets.List;
li_Presets.TextAlign = TXTA_Left;
li_Presets.bMultiSelect = true;
li_Presets.bDropSource = true;
li_Presets.bDropTarget = true;
li_Presets.OnDblClick = ListDblClick;
colorG = chr(27)$chr(1)$chr(240)$chr(1);
colorR = chr(27)$chr(240)$chr(1)$chr(1);
refreshLists();
refreshPresetNames();
}
event opened(GUIComponent sender)
{
// local int i;
// local string KeyName;
// local array<string> KeyNames;
super.opened(sender);
pc = playerOwner();
SetupHmi();
refreshLists();
refreshPresetNames();
cb_UseVanillaManagement.SetComponentValue(a_weaponManager.bUseVanillaManagement, true);
cb_FastWeaponChanging.SetComponentValue(a_weaponManager.bFastWeaponChanging, true);
// write in KeyNames all bind keys that onen this window to use 'closeWindowWithBind()' then
// CloseKey.Remove(0, CloseKey.Length);
// KeyName = PC.ConsoleCommand("BINDINGTOKEY hideMenu");
// Split(KeyName, ",", KeyNames);
// for (i = 0; i < KeyNames.Length; i++)
// CloseKey[CloseKey.Length] = byte(PC.ConsoleCommand("KEYNUMBER"@KeyNames[i]));
}
final private function SetupHmi()
{
local HideMutInteraction tempHmi;
forEach AllObjects(class'HideMutInteraction', tempHmi)
break;
if (tempHmi.a_weaponManager == none)
tempHmi.a_weaponManager = pc.Spawn(class'a_WeaponManager');
tempHmi.a_weaponManager.kfpc = KFPlayerController(pc);
a_weaponManager = tempHmi.a_weaponManager;
}
simulated function closed(GUIComponent sender, bool bCancelled)
{
eb_PresetName.SetComponentValue("");
super.closed(sender, bCancelled);
saveChanges();
}
simulated function refreshLists()
{
RefreshGUIList(li_Group1, a_weaponManager.weaponGroup1);
RefreshGUIList(li_Group2, a_weaponManager.weaponGroup2);
RefreshGUIList(li_Group3, a_weaponManager.weaponGroup3);
RefreshGUIList(li_Group4, a_weaponManager.weaponGroup4);
RefreshGUIList(li_Group5, a_weaponManager.weaponGroup5);
RefreshGUIList(li_Group6, a_weaponManager.weaponGroup6);
RefreshGUIList(li_Group7, a_weaponManager.weaponGroup7);
RefreshGUIList(li_Group8, a_weaponManager.weaponGroup8);
a_weaponManager.updateUnusedWeapons();
RefreshGUIList(li_Group9, a_weaponManager.weaponGroup9);
}
final private function RefreshGUIList(GUIList gList, array<string> weaponGroup)
{
local int i;
local class<KFWeapon> tempWeaponClass;
// cleanup first
gList.clear();
for (i = 0; i < weaponGroup.length; i++)
{
tempWeaponClass = class<KFWeapon>(DynamicLoadObject(weaponGroup[i], class'Class', true));
if (tempWeaponClass != none)
gList.add(getColor(weaponGroup[i])$tempWeaponClass.default.itemName,,weaponGroup[i]);
else
gList.add(colorR$weaponGroup[i],,weaponGroup[i]);
}
}
simulated function refreshPresetNames()
{
local array<String> names;
local int i;
li_Presets.clear();
names = a_weaponManager.getAllPresetNames();
for ( i = 0; i < names.length; i++ )
li_Presets.add(names[i]);
}
simulated function string getColor(string weaponClass)
{
local Inventory inv;
if (pc.pawn == none)
return "";
for (inv = pc.pawn.inventory; inv != none; inv = inv.inventory)
{
if (string(inv.class) ~= weaponClass)
{
return colorG;
}
}
return "";
}
simulated function saveChanges()
{
local int i;
a_weaponManager.clearAllGroups();
for(i = 0; i < li_Group1.elements.length; i++)
{
a_weaponManager.weaponGroup1[a_weaponManager.weaponGroup1.length] = li_Group1.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group2.elements.length; i++)
{
a_weaponManager.weaponGroup2[a_weaponManager.weaponGroup2.length] = li_Group2.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group3.elements.length; i++)
{
a_weaponManager.weaponGroup3[a_weaponManager.weaponGroup3.length] = li_Group3.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group4.elements.length; i++)
{
a_weaponManager.weaponGroup4[a_weaponManager.weaponGroup4.length] = li_Group4.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group5.elements.length; i++)
{
a_weaponManager.weaponGroup5[a_weaponManager.weaponGroup5.length] = li_Group5.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group6.elements.length; i++)
{
a_weaponManager.weaponGroup6[a_weaponManager.weaponGroup6.length] = li_Group6.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group7.elements.length; i++)
{
a_weaponManager.weaponGroup7[a_weaponManager.weaponGroup7.length] = li_Group7.elements[i].ExtraStrData;
}
for(i = 0; i < li_Group8.elements.length; i++)
{
a_weaponManager.weaponGroup8[a_weaponManager.weaponGroup8.length] = li_Group8.elements[i].ExtraStrData;
}
a_weaponManager.updateUnusedWeapons(); //weaponGroup9
a_weaponManager.saveWeaponList("CurrentWeaponList");
}
function checkboxUsed(GUIComponent sender)
{
switch (sender)
{
case cb_UseVanillaManagement:
a_weaponManager.bUseVanillaManagement = cb_UseVanillaManagement.isChecked();
a_weaponManager.SaveConfig();
break;
case cb_FastWeaponChanging:
a_weaponManager.bFastWeaponChanging = cb_FastWeaponChanging.isChecked();
a_weaponManager.SaveConfig();
break;
}
}
simulated function bool buttonClicked(GUIComponent sender)
{
switch (sender)
{
case b_VanillaReset:
a_weaponManager.fullReset();
refreshLists();
break;
case b_BasicCleaning:
a_weaponManager.basicCleaning();
refreshLists();
break;
case b_FullCleaning:
a_weaponManager.fullCleaning();
refreshLists();
break;
case b_SavePreset:
addNewPreset();
break;
case b_DeletePreset:
a_weaponManager.deleteWeaponList(li_Presets.get());
li_Presets.removeItem(li_Presets.get());
eb_PresetName.SetComponentValue("");
break;
}
// ADDITION
return true;
}
function bool ListDblClick(GUIComponent C)
{
if (C == li_Group1 || C == li_Group2 || C == li_Group3 || C == li_Group4 || C == li_Group5 || C == li_Group6 || C == li_Group7 || C == li_Group8 || C == li_Group9)
return buyWeaponFromList(c);
if (C == li_Presets)
{
a_weaponManager.loadWeaponList(li_Presets.get());
refreshLists();
return true;
}
return false;
}
final private function bool buyWeaponFromList(GUIList gList)
{
local class<KFWeapon> weaponToBuy;
if (KFPawn(pc.pawn) == none)
return false;
weaponToBuy = class<KFWeapon>(DynamicLoadObject(gList.getExtra(), class'Class', true));
if (weaponToBuy == none)
return false;
KFPawn(pc.pawn).serverBuyWeapon(weaponToBuy, 0);
saveChanges();
refreshLists();
return true;
}
function addNewPreset()
{
if (len(eb_PresetName.getComponentValue()) == 0)
{
pc.clientMessage("Please, type at least 1 character of preset's name");
return;
}
if (inStr(eb_PresetName.getComponentValue(), " ") > 0)
{
pc.clientMessage("Don't use spaces at preset's name");
return;
}
saveChanges();
a_weaponManager.saveWeaponList(eb_PresetName.GetComponentValue());
li_Presets.add(eb_PresetName.GetComponentValue());
eb_PresetName.SetComponentValue("");
}
//=============================================================================
defaultproperties
{
Begin Object Class=BackgroundArea Name=BackgroundArea_Group1
WinTop=0.100000
WinLeft=0.180000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group1=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group1'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group2
WinTop=0.100000
WinLeft=0.345000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group2=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group2'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group3
WinTop=0.100000
WinLeft=0.510000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group3=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group3'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group4
WinTop=0.100000
WinLeft=0.675000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group4=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group4'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group5
WinTop=0.100000
WinLeft=0.840000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group5=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group5'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group6
WinTop=0.450000
WinLeft=0.180000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group6=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group6'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group7
WinTop=0.450000
WinLeft=0.345000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group7=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group7'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group8
WinTop=0.450000
WinLeft=0.510000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Group8=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group8'
Begin Object Class=BackgroundArea Name=BackgroundArea_Group9
WinTop=0.100000
WinLeft=0.015000
WinWidth=0.150000
WinHeight=0.800000
End Object
ba_Group9=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Group9'
Begin Object Class=BackgroundArea Name=BackgroundArea_Presets
WinTop=0.450000
WinLeft=0.840000
WinWidth=0.150000
WinHeight=0.304000
End Object
ba_Presets=BackgroundArea'HideMut.menu_WeaponManager.BackgroundArea_Presets'
Begin Object Class=GUIListBox Name=ListBox_Group1
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group1.InternalOnCreateComponent
WinTop=0.102000
WinLeft=0.182000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group1=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group1'
Begin Object Class=GUIListBox Name=ListBox_Group2
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group2.InternalOnCreateComponent
WinTop=0.102000
WinLeft=0.347000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group2=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group2'
Begin Object Class=GUIListBox Name=ListBox_Group3
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group3.InternalOnCreateComponent
WinTop=0.102000
WinLeft=0.512000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group3=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group3'
Begin Object Class=GUIListBox Name=ListBox_Group4
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group4.InternalOnCreateComponent
WinTop=0.102000
WinLeft=0.677000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group4=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group4'
Begin Object Class=GUIListBox Name=ListBox_Group5
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group5.InternalOnCreateComponent
WinTop=0.102000
WinLeft=0.842000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group5=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group5'
Begin Object Class=GUIListBox Name=ListBox_Group6
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group6.InternalOnCreateComponent
WinTop=0.452000
WinLeft=0.182000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group6=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group6'
Begin Object Class=GUIListBox Name=ListBox_Group7
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group7.InternalOnCreateComponent
WinTop=0.452000
WinLeft=0.347000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group7=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group7'
Begin Object Class=GUIListBox Name=ListBox_Group8
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group8.InternalOnCreateComponent
WinTop=0.452000
WinLeft=0.512000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Group8=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group8'
Begin Object Class=GUIListBox Name=ListBox_Group9
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Group9.InternalOnCreateComponent
WinTop=0.102000
WinLeft=0.017000
WinWidth=0.146000
WinHeight=0.796000
End Object
lb_Group9=GUIListBox'HideMut.menu_WeaponManager.ListBox_Group9'
Begin Object Class=GUIListBox Name=ListBox_Presets
bVisibleWhenEmpty=True
OnCreateComponent=ListBox_Presets.InternalOnCreateComponent
WinTop=0.452000
WinLeft=0.842000
WinWidth=0.146000
WinHeight=0.300000
End Object
lb_Presets=GUIListBox'HideMut.menu_WeaponManager.ListBox_Presets'
Begin Object Class=GUIButton Name=VanillaResetButton
Caption="Full reset"
WinTop=0.450000
WinLeft=0.675000
WinWidth=0.150000
WinHeight=0.080000
OnClick=menu_WeaponManager.ButtonClicked
OnKeyEvent=VanillaResetButton.InternalOnKeyEvent
End Object
b_VanillaReset=GUIButton'HideMut.menu_WeaponManager.VanillaResetButton'
Begin Object Class=GUIButton Name=BasicCleaningButton
Caption="Basic cleaning"
WinTop=0.550000
WinLeft=0.675000
WinWidth=0.150000
WinHeight=0.080000
OnClick=menu_WeaponManager.ButtonClicked
OnKeyEvent=BasicCleaningButton.InternalOnKeyEvent
End Object
b_BasicCleaning=GUIButton'HideMut.menu_WeaponManager.BasicCleaningButton'
Begin Object Class=GUIButton Name=FullCleaningButton
Caption="Full cleaning"
WinTop=0.650000
WinLeft=0.675000
WinWidth=0.150000
WinHeight=0.080000
OnClick=menu_WeaponManager.ButtonClicked
OnKeyEvent=FullCleaningButton.InternalOnKeyEvent
End Object
b_FullCleaning=GUIButton'HideMut.menu_WeaponManager.FullCleaningButton'
Begin Object Class=GUIButton Name=SavePresetButton
Caption="Save"
WinTop=0.787000
WinLeft=0.840000
WinWidth=0.074000
WinHeight=0.050000
OnClick=menu_WeaponManager.ButtonClicked
OnKeyEvent=SavePresetButton.InternalOnKeyEvent
End Object
b_SavePreset=GUIButton'HideMut.menu_WeaponManager.SavePresetButton'
Begin Object Class=GUIButton Name=DeletePresetButton
Caption="Delete"
WinTop=0.787000
WinLeft=0.916000
WinWidth=0.073000
WinHeight=0.050000
OnClick=menu_WeaponManager.ButtonClicked
OnKeyEvent=DeletePresetButton.InternalOnKeyEvent
End Object
b_DeletePreset=GUIButton'HideMut.menu_WeaponManager.DeletePresetButton'
Begin Object Class=moEditBox Name=EditBoxPresetName
CaptionWidth=0.000000
OnCreateComponent=EditBoxPresetName.InternalOnCreateComponent
WinTop=0.754000
WinLeft=0.840000
WinWidth=0.150000
End Object
eb_PresetName=moEditBox'HideMut.menu_WeaponManager.EditBoxPresetName'
Begin Object Class=moCheckBox Name=checkBox_UseVanillaManagement
Caption="Native system"
OnCreateComponent=checkBox_UseVanillaManagement.InternalOnCreateComponent
WinTop=0.020000
WinLeft=0.050000
WinWidth=0.100000
WinHeight=0.100000
OnChange=menu_WeaponManager.checkboxUsed
End Object
cb_UseVanillaManagement=moCheckBox'HideMut.menu_WeaponManager.checkBox_UseVanillaManagement'
Begin Object Class=moCheckBox Name=checkBox_FastWeaponChanging
Caption="Instaswitching"
OnCreateComponent=checkBox_FastWeaponChanging.InternalOnCreateComponent
WinTop=0.020000
WinLeft=0.250000
WinWidth=0.100000
WinHeight=0.100000
OnChange=menu_WeaponManager.checkboxUsed
End Object
cb_FastWeaponChanging=moCheckBox'HideMut.menu_WeaponManager.checkBox_FastWeaponChanging'
Begin Object Class=GUILabel Name=Group1Label
Caption="Group 1"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.070000
WinLeft=0.180000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group1=GUILabel'HideMut.menu_WeaponManager.Group1Label'
Begin Object Class=GUILabel Name=Group2Label
Caption="Group 2"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.070000
WinLeft=0.345000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group2=GUILabel'HideMut.menu_WeaponManager.Group2Label'
Begin Object Class=GUILabel Name=Group3Label
Caption="Group 3"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.070000
WinLeft=0.512000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group3=GUILabel'HideMut.menu_WeaponManager.Group3Label'
Begin Object Class=GUILabel Name=Group4Label
Caption="Group 4"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.070000
WinLeft=0.677000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group4=GUILabel'HideMut.menu_WeaponManager.Group4Label'
Begin Object Class=GUILabel Name=Group5Label
Caption="Group 5"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.070000
WinLeft=0.842000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group5=GUILabel'HideMut.menu_WeaponManager.Group5Label'
Begin Object Class=GUILabel Name=Group6Label
Caption="Group 6"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.422000
WinLeft=0.180000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group6=GUILabel'HideMut.menu_WeaponManager.Group6Label'
Begin Object Class=GUILabel Name=Group7Label
Caption="Group 7"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.422000
WinLeft=0.345000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group7=GUILabel'HideMut.menu_WeaponManager.Group7Label'
Begin Object Class=GUILabel Name=Group8Label
Caption="Group 8"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.422000
WinLeft=0.510000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group8=GUILabel'HideMut.menu_WeaponManager.Group8Label'
Begin Object Class=GUILabel Name=Group9Label
Caption="Group 9 [Unused weapons]"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.070000
WinLeft=0.015000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Group9=GUILabel'HideMut.menu_WeaponManager.Group9Label'
Begin Object Class=GUILabel Name=PresetsLabel
Caption="Presets"
TextAlign=TXTA_Center
VertAlign=TXTA_Center
StyleName="TextLabel"
WinTop=0.422000
WinLeft=0.842000
WinWidth=0.150000
WinHeight=0.020000
End Object
l_Presets=GUILabel'HideMut.menu_WeaponManager.PresetsLabel'
bRenderWorld=True
bRequire640x480=False
bPersistent=True
bAllowedAsLast=True
BackgroundRStyle=MSTY_Modulated
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,954 @@
class menu_c_Light extends GUI2K4.MidGamePanel
config(HideMut);
// =================================================================Interface section
var automated GUISectionBackground sb_ControlsAllMap, sb_Stats, sb_Tweaker;
var automated moNumericEdit nu_Radius, nu_newRadius, nu_maxRadius, nu_LightCone,
nu_LightPeriod, nu_LightBrightness,
nu_LightHue, nu_LightSaturation, nu_LightEffect, nu_LightType;
var automated MOCheckBox ch_Optimize, ch_RemoveFlickering, ch_FlickeringToStatic,
ch_ActorShadows, ch_AttenByLife, ch_bCorona,
ch_bDirectionalCorona, ch_bDynamicLight, ch_bLightingVisibility,
ch_bSpecialLit;
var automated GUIScrollTextBox lb_Actions;
var automated GUIButton b_HideLights, b_OptAllLights, b_MakeAllLightVisible, b_DisableCoronas,
b_SaveConfig, b_OptStatic, b_ClearLog;
// ====================================================================End of interface section
var transient array<Light> CachedLights; // Cached lights for checks, stats and etc.
var transient array<TriggerLight> CachedTriggerLights; // Cached trigger lights just in case
var transient array<int> LightColors; // Unique light colors
var bool bCached; // Prevents multiple caching
var int maxRadius_L, maxRadius_TL; // Max radius for light sources(trigger light and lights)
// ==========================================config variables
var config bool bActorShadows, bAttenByLife, bLightingVisibility, bCorona, bDirectionalCorona,
bSpecialLit, // Tweaker
Optimize, RemoveFlickering, FlickeringToStatic;
var config int NewRadius, maxRadius;
var config byte byteRadius, byteLightBrightness, byteLightHue, byteLightSaturation, byteLightType,
byteLightEffect, byteLightCone, byteLightPeriod;
// ==========================================end of config variables
var PlayerController PC;
var bool IsUnlited, bConfigLoaded;
simulated function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
local GUIButton B;
local string s;
local int i;
super.InitComponent(MyController,MyOwner);
PC = PlayerOwner();
sb_Stats.ManageComponent(lb_Actions);
sb_Stats.ManageComponent(b_ClearLog);
sb_Tweaker.ManageComponent(nu_newRadius);
sb_Tweaker.ManageComponent(nu_maxRadius);
sb_Tweaker.ManageComponent(ch_Optimize);
sb_Tweaker.ManageComponent(ch_RemoveFlickering);
sb_Tweaker.ManageComponent(ch_FlickeringToStatic);
sb_Tweaker.ManageComponent(b_HideLights);
sb_Tweaker.ManageComponent(b_DisableCoronas);
sb_Tweaker.ManageComponent(b_OptStatic);
sb_ControlsAllMap.ManageComponent(nu_Radius);
sb_ControlsAllMap.ManageComponent(nu_LightCone);
sb_ControlsAllMap.ManageComponent(nu_LightPeriod);
sb_ControlsAllMap.ManageComponent(nu_LightBrightness);
sb_ControlsAllMap.ManageComponent(nu_LightHue);
sb_ControlsAllMap.ManageComponent(nu_LightSaturation);
sb_ControlsAllMap.ManageComponent(nu_LightEffect);
sb_ControlsAllMap.ManageComponent(nu_LightType);
sb_ControlsAllMap.ManageComponent(ch_ActorShadows);
sb_ControlsAllMap.ManageComponent(ch_AttenByLife);
sb_ControlsAllMap.ManageComponent(ch_bCorona);
sb_ControlsAllMap.ManageComponent(ch_bDirectionalCorona);
sb_ControlsAllMap.ManageComponent(ch_bDynamicLight);
sb_ControlsAllMap.ManageComponent(ch_bLightingVisibility);
sb_ControlsAllMap.ManageComponent(ch_bSpecialLit);
sb_ControlsAllMap.ManageComponent(b_OptAllLights);
sb_ControlsAllMap.ManageComponent(b_SaveConfig);
sb_ControlsAllMap.ManageComponent(b_MakeAllLightVisible);
// For resizing buttons
s = GetSizingCaption();
for (i = 0; i < Controls.length; i++)
{
B = GUIButton(Controls[i]);
if (B != none)
{
B.bAutoSize = true;
B.SizingCaption = s;
B.AutoSizePadding.HorzPerc = 0.04;
B.AutoSizePadding.VertPerc = 0.8;
}
}
ch_ActorShadows.Checked(bActorShadows);
ch_AttenByLife.Checked(bAttenByLife);
nu_Radius.SetValue(byteRadius);
ch_bLightingVisibility.Checked(bLightingVisibility);
ch_bCorona.Checked(bCorona);
ch_bDirectionalCorona.Checked(bDirectionalCorona);
nu_LightBrightness.SetValue(byteLightBrightness);
nu_LightHue.SetValue(byteLightHue);
nu_LightSaturation.SetValue(byteLightSaturation);
ch_bSpecialLit.Checked(bSpecialLit);
nu_LightType.SetValue(byteLightType);
nu_LightEffect.SetValue(byteLightEffect);
nu_LightCone.SetValue(byteLightCone);
nu_LightPeriod.SetValue(byteLightPeriod);
}
function string GetSizingCaption()
{
local int i;
local string S;
for (i = 0; i < Controls.length; i++)
if (GUIButton(Controls[i]) != none)
if (S == "" || Len(GUIButton(Controls[i]).Caption) > Len(S))
S = GUIButton(Controls[i]).Caption;
return S;
}
function ShowPanel(bool bShow)
{
super.ShowPanel(bShow);
if (bShow)
CacheLights();
}
event Opened(GUIComponent Sender)
{
super.Opened(Sender);
// Caching lights
if (!bCached)
{
CacheLights();
}
if (!bConfigLoaded)
{
LoadLightConfig();
bConfigLoaded = true;
}
}
simulated function bool ButtonClicked(GUIComponent Sender)
{
// Caching lights
if (!bCached)
{
CacheLights();
}
switch (Sender)
{
case b_HideLights:
OptLights(nu_newRadius.GetValue(), nu_maxRadius.GetValue(), ch_Optimize.IsChecked(), ch_RemoveFlickering.IsChecked(), ch_FlickeringToStatic.IsChecked());
break;
case b_OptAllLights:
OptAllLights();
break;
case b_MakeAllLightVisible:
AllLightVisible();
break;
case b_DisableCoronas:
RemoveCoronas();
break;
case b_SaveConfig:
SaveLightConfig();
break;
case b_OptStatic:
OptimizeStaticMeshes();
break;
case b_ClearLog:
lb_Actions.SetContent("");
break;
}
// Get lighting statistics
StatLights();
return true;
}
simulated function SaveLightConfig()
{
bActorShadows = ch_ActorShadows.IsChecked();
bAttenByLife = ch_AttenByLife.IsChecked();
byteRadius = nu_Radius.GetValue();
bLightingVisibility = ch_bLightingVisibility.IsChecked();
bCorona = ch_bCorona.IsChecked();
bDirectionalCorona = ch_bDirectionalCorona.IsChecked();
byteLightBrightness = nu_LightBrightness.GetValue();
byteLightHue = nu_LightHue.GetValue();
byteLightSaturation = nu_LightSaturation.GetValue();
bSpecialLit = ch_bSpecialLit.IsChecked();
byteLightType = nu_LightType.GetValue();
byteLightEffect = nu_LightEffect.GetValue();
byteLightCone = nu_LightCone.GetValue();
byteLightPeriod = nu_LightPeriod.GetValue();
NewRadius = nu_newRadius.GetValue();
maxRadius = nu_maxRadius.GetValue();
Optimize = ch_Optimize.IsChecked();
RemoveFlickering = ch_RemoveFlickering.IsChecked();
FlickeringToStatic = ch_FlickeringToStatic.IsChecked();
SaveConfig();
}
simulated function LoadLightConfig()
{
ch_ActorShadows.Checked(bActorShadows);
ch_AttenByLife.Checked(bAttenByLife);
nu_Radius.SetValue(byteRadius);
ch_bLightingVisibility.Checked(bLightingVisibility);
ch_bCorona.Checked(bCorona);
ch_bDirectionalCorona.Checked(bDirectionalCorona);
nu_LightBrightness.SetValue(byteLightBrightness);
nu_LightHue.SetValue(byteLightHue);
nu_LightSaturation.SetValue(byteLightSaturation);
ch_bSpecialLit.Checked(bSpecialLit);
nu_LightType.SetValue(byteLightType);
nu_LightEffect.SetValue(byteLightEffect);
nu_LightCone.SetValue(byteLightCone);
nu_LightPeriod.SetValue(byteLightPeriod );
nu_newRadius.SetValue(NewRadius);
nu_maxRadius.SetValue(maxRadius);
ch_Optimize.Checked(Optimize);
ch_RemoveFlickering.Checked(RemoveFlickering);
ch_FlickeringToStatic.Checked(FlickeringToStatic);
}
simulated function AllLightVisible() // Toggle lights visibility
{
local int i;
for (i=0;i<CachedLights.length;i++)
{
if (CachedLights[i].bHidden)
CachedLights[i].bHidden = false;
else
CachedLights[i].bHidden = true;
if (CachedLights[i].bStatic)
CachedLights[i].ResetStaticFilterState();
}
}
simulated function CacheLights() // Cache lights
{
local Light LE;
local TriggerLight TL;
local int i;
// Cached lights for checks, stats and etc.
forEach AllObjects (class'Light', LE)
{
CachedLights[i] = LE;
i++;
}
i=0;
// Cached TriggerLights
forEach AllObjects (class'TriggerLight', TL)
{
CachedTriggerLights[i] = TL;
i++;
}
// Empty lights check
if (CachedLights.length > 0 || CachedTriggerLights.Length > 0)
bCached = true;
}
// Clear cache
simulated function ClearCache()
{
CachedLights.Remove(0,CachedLights.Length);
CachedTriggerLights.Remove(0,CachedTriggerLights.Length);
bCached = false;
}
// Get max radius of light sources and triggerlight
simulated function MaxRad(out int MRad, out int TlMRad)
{
local int i;
if (CachedLights.length == 0)
return;
MRad = CachedLights[0].LightRadius;
// Find max radius
for (i=0;i<CachedLights.length; i++)
{
if (CachedLights[i].LightRadius > MRad)
{
MRad = CachedLights[i].LightRadius ;
}
}
if (CachedTriggerLights.length == 0)
return;
TlMRad = CachedTriggerLights[0].LightRadius;
// Find max radius
for (i = 0; i < CachedTriggerLights.length; i++)
{
if (CachedLights[i].LightRadius > TlMRad)
{
TlMRad = CachedLights[i].LightRadius;
}
}
}
simulated function GetUniqueColorsLights()
{
local int i, k, count;
local bool bAlreadyIsIn;
if (CachedLights.Length == 0)
return;
if (LightColors.Length == 0)
{
LightColors[0] = CachedLights[0].LightHue;
count++;
}
for (i = 0; i < CachedLights.length; i++)
{
for (k = 0; k < LightColors.length; k++) // Finding unique color
{
if (LightColors[k] == CachedLights[i].LightHue)
{
bAlreadyIsIn = true;
break; // Already having dat color
}
}
if (!bAlreadyIsIn)
{
LightColors[count] = CachedLights[i].LightHue; // Adding unique light
count++;
}
bAlreadyIsIn = false; // Next iteration
}
}
// Statistics
simulated function StatLights() // Get light statistics
{
local int i, maxRadiusCountL, maxRadiusCountTL, SpecialLit_CountL, SpecialLit_CountTL;
if (maxRadius_TL == 0 || maxRadius_L == 0)
{
MaxRad(maxRadius_L, maxRadius_TL);
}
if (CachedTriggerLights.length > 0)
{
for (i = 0; i < cachedTriggerLights.length; i++)
{
if (CachedTriggerLights[i].bSpecialLit)
SpecialLit_CountTL++;
if (CachedTriggerLights[i].LightRadius == maxRadius_TL)
maxRadiusCountTL++;
}
}
if (CachedLights.length == 0) // if no lights on map == fuckoff
return;
for (i = 0; i < CachedLights.length; i++)
{
if (CachedLights[i].bSpecialLit)
SpecialLit_CountL++;
if (CachedLights[i].LightRadius == maxRadius_L)
maxRadiusCountL++;
}
LightColors.Length = 0;
GetUniqueColorsLights();
lb_Actions.Addtext("There are" @ CachedLights.length @ "light sources" @ "and" @ cachedTriggerLights.length @ "Trigger light sources");
lb_Actions.Addtext("Max Radius for light source is " @ maxRadius_L @ ". Light sources that uses max radius:" @ maxRadiusCountL
@ "Max Radius for triggerlight source is " @ maxRadius_TL @ ". TriggerLight sources that uses max radius:" @ maxRadiusCountTL);
lb_Actions.Addtext("Detected" @ LightColors.length @ "unique lights");
lb_Actions.Addtext("Detected" @ SpecialLit_CountL @ " SpecialLit lights"
@ "Detected" @ SpecialLit_CountTL @ " SpecialLit triggerlights");
}
// =======Lights
// Light Optimization
simulated function OptLights(Int Radius, Int maxRadius, bool Optimize, bool RemoveFlickering, bool FlickeringToStatic)
{
local Light LE;
local TriggerLight TL;
local int i, count;
if (Radius == 0 || maxRadius == 0)
return;
forEach AllObjects (class'Light', LE)
{
if (LE.LightRadius > maxRadius)
{
LE.bSpecialLit = Optimize;
LE.LightRadius = Radius;
i++;
}
if (RemoveFlickering)
{
switch (LE.LightType)
{
case LT_Pulse: // 3 Laggy types of lights
LE.LightType = LT_Steady; // Replace this to steady light
count++;
if (FlickeringToStatic)
{
LE.bSpecialLit = true;
LE.bLightingVisibility = false;
}
break;
case LT_Blink:
LE.LightType = LT_Steady; // Replace this to steady light
count++;
if (FlickeringToStatic)
{
LE.bSpecialLit = true;
LE.bLightingVisibility = false;
}
break;
case LT_Flicker:
LE.LightType = LT_Steady; // Replace this to steady light
count++;
if (FlickeringToStatic)
{
LE.bSpecialLit = true;
LE.bLightingVisibility = false;
}
break;
default:
break;
}
}
LE.bLightChanged = true; // Recalculate light now
if (LE.bStatic)
LE.ResetStaticFilterState();
}
forEach AllObjects (class'TriggerLight', TL)
{
if (TL.LightRadius > maxRadius)
{
TL.bSpecialLit = Optimize;
TL.LightRadius = Radius;
i++;
}
if (RemoveFlickering)
{
switch (TL.LightType)
{
case LT_Pulse: // 3 Laggy types of lights
TL.LightType = LT_Steady; // Replace this to steady light
TL.InitialState = '';
count++;
if (FlickeringToStatic)
{
TL.bSpecialLit = true;
TL.bLightingVisibility = false;
}
break;
case LT_Blink:
TL.LightType = LT_Steady; // Replace this to steady light
TL.InitialState = '';
count++;
if (FlickeringToStatic)
{
TL.bSpecialLit = true;
TL.bLightingVisibility = false;
}
break;
case LT_Flicker:
TL.LightType = LT_Steady; // Replace this to steady light
TL.InitialState = '';
count++;
if (FlickeringToStatic)
{
TL.bSpecialLit = true;
TL.bLightingVisibility = false;
}
break;
default:
break;
}
}
TL.bLightChanged = true; // Recalculate light now
if (TL.bStatic)
TL.ResetStaticFilterState();
}
if (Optimize)
lb_Actions.Addtext("Laggy lights are now fully static.");
lb_Actions.Addtext("Radius for " @ i @ " lights set to " @ Radius @ ".Removed" @ count @ " flickering/pulsing/blinking light sources");
foreach AllObjects(class'Light', LE)
if (LE.bLightChanged)
LE.bLightChanged = false;
}
// RemoveCoronas
simulated function RemoveCoronas()
{
local Light tempL;
// Corona will be rendered because map author decide to force dis. No freedom for players...
// Somehow this slow down Mesh lighting quite a bit(x2, x3)...
forEach AllObjects (class'Light', tempL)
{
if (tempL.bCorona == true)
{
tempL.bCorona = false;
if (tempL.bStatic)
tempL.ResetStaticFilterState();
}
}
lb_Actions.Addtext("All coronas disabled!");
}
simulated function OptimizeStaticMeshes()
{
local StaticMeshActor SMA;
local Decoration Deco;
IsUnlited = !IsUnlited;
foreach AllObjects(class'StaticMeshActor', SMA)
{
SMA.bUnlit = IsUnlited;
SMA.ResetStaticFilterstate();
}
foreach AllObjects(class'Decoration', Deco)
{
Deco.bUnlit = IsUnlited;
if (Deco.bStatic)
Deco.ResetStaticFilterstate();
}
}
simulated function OptAllLights()
{
local int i;
local light L;
for (i = 0; i < CachedLights.length; i++)
{
CachedLights[i].bActorShadows = ch_ActorShadows.IsChecked();
CachedLights[i].bAttenByLife = ch_AttenByLife.IsChecked();
CachedLights[i].LightRadius = nu_Radius.GetValue();
CachedLights[i].bLightingVisibility = ch_bLightingVisibility.IsChecked();
CachedLights[i].bCorona = ch_bCorona.IsChecked(); // Must be tweak
CachedLights[i].bDirectionalCorona = ch_bDirectionalCorona.IsChecked();
CachedLights[i].LightBrightness = nu_LightBrightness.GetValue();
CachedLights[i].LightHue = nu_LightHue.GetValue();
CachedLights[i].LightSaturation = nu_LightSaturation.GetValue();
CachedLights[i].bSpecialLit = ch_bSpecialLit.IsChecked();
CachedLights[i].LightType = ELightType(nu_LightType.GetValue());
CachedLights[i].LightEffect = ELightEffect(nu_LightEffect.GetValue());
CachedLights[i].LightCone = nu_LightCone.GetValue();
CachedLights[i].LightPeriod = nu_LightPeriod.GetValue();
CachedLights[i].bDynamicLight=ch_bDynamicLight.IsChecked();
CachedLights[i].bLightChanged=true; // Recalculate light now
CachedLights[i].Style = STY_Additive; // Enabling bDeferRendering
CachedLights[i].bDeferRendering = true;
CachedLights[i].bUnlit = true;
CachedLights[i].bStaticLighting = false;
if (CachedLights[i].bStatic)
CachedLights[i].ResetStaticFilterState();
}
lb_Actions.Addtext("All lights on map set to given parameters");
if (CachedTriggerLights.length == 0)
return;
for (i = 0; i < CachedTriggerLights.length; i++)
{
CachedTriggerLights[i].bActorShadows = ch_ActorShadows.IsChecked();
CachedTriggerLights[i].bAttenByLife = ch_AttenByLife.IsChecked();
CachedTriggerLights[i].LightCone = nu_Radius.GetValue();
CachedTriggerLights[i].bLightingVisibility = ch_bLightingVisibility.IsChecked();
CachedTriggerLights[i].bCorona = ch_bCorona.IsChecked(); // Must be tweak
CachedTriggerLights[i].bDirectionalCorona = ch_bDirectionalCorona.IsChecked();
CachedTriggerLights[i].LightBrightness = nu_LightBrightness.GetValue();
CachedTriggerLights[i].LightHue = nu_LightHue.GetValue();
CachedTriggerLights[i].LightSaturation = nu_LightSaturation.GetValue();
CachedTriggerLights[i].bSpecialLit = ch_bSpecialLit.IsChecked();
CachedTriggerLights[i].LightType = ELightType(nu_LightType.GetValue());
CachedTriggerLights[i].LightEffect = ELightEffect(nu_LightEffect.GetValue());
CachedTriggerLights[i].LightCone = nu_LightCone.GetValue();
CachedTriggerLights[i].LightPeriod = nu_LightPeriod.GetValue();
CachedTriggerLights[i].bDynamicLight=ch_bDynamicLight.IsChecked();
CachedTriggerLights[i].bLightChanged=true; // Recalculate light now
if (CachedTriggerLights[i].bStatic)
CachedTriggerLights[i].ResetStaticFilterState();
}
foreach AllObjects(class'Light', L)
if (L.bLightChanged)
L.bLightChanged = false;
}
// ===================================================================
simulated function InternalOnChange(GUIComponent Sender)
{
// switch (Sender)
// {
// case ch_HideNiggaz:
// break;
// }
}
defaultproperties
{
Begin Object Class=GUISectionBackground Name=BGControlsAllMap
bFillClient=True
Caption="Control of light sources and shadows on all map"
WinTop=0.010000
WinLeft=0.400000
WinWidth=0.500000
WinHeight=0.900000
OnPreDraw=BGControlsAllMap.InternalPreDraw
End Object
sb_ControlsAllMap=GUISectionBackground'HideMut.menu_c_Light.BGControlsAllMap'
Begin Object Class=GUISectionBackground Name=BGStats
bFillClient=True
Caption="Statistics of light sources on current map"
WinTop=0.510000
WinWidth=0.400000
WinHeight=0.460000
OnPreDraw=BGStats.InternalPreDraw
End Object
sb_Stats=GUISectionBackground'HideMut.menu_c_Light.BGStats'
Begin Object Class=GUISectionBackground Name=BGTweaker
bFillClient=True
Caption="Various lighting tweaks"
WinTop=0.010000
WinWidth=0.400000
WinHeight=0.500000
OnPreDraw=BGTweaker.InternalPreDraw
End Object
sb_Tweaker=GUISectionBackground'HideMut.menu_c_Light.BGTweaker'
Begin Object Class=moNumericEdit Name=Radius
MinValue=0
MaxValue=1024
Caption="Light Radius"
OnCreateComponent=Radius.InternalOnCreateComponent
Hint="Light radius for all lights"
OnChange=menu_c_Light.InternalOnChange
End Object
nu_Radius=moNumericEdit'HideMut.menu_c_Light.Radius'
Begin Object Class=moNumericEdit Name=LightnewRadius
MinValue=0
MaxValue=512
Caption="New Light radius"
OnCreateComponent=LightnewRadius.InternalOnCreateComponent
Hint="New Light radius for laggy lights"
OnChange=menu_c_Light.InternalOnChange
End Object
nu_newRadius=moNumericEdit'HideMut.menu_c_Light.LightnewRadius'
Begin Object Class=moNumericEdit Name=LightmaxRadius
MinValue=1
MaxValue=1024
Caption="Max light Radius"
OnCreateComponent=LightmaxRadius.InternalOnCreateComponent
Hint="Max Light radius for laggy lights"
OnChange=menu_c_Light.InternalOnChange
End Object
nu_maxRadius=moNumericEdit'HideMut.menu_c_Light.LightmaxRadius'
Begin Object Class=moNumericEdit Name=LightCone
MinValue=0
MaxValue=255
Caption="LightCone"
OnCreateComponent=LightCone.InternalOnCreateComponent
Hint="Changes the size of the lightbeam in specific lights such as the spotlight."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightCone=moNumericEdit'HideMut.menu_c_Light.LightCone'
Begin Object Class=moNumericEdit Name=LightPeriod
MinValue=0
MaxValue=255
Caption="LightPeriod"
OnCreateComponent=LightPeriod.InternalOnCreateComponent
Hint="Sets speed of selected LightType and/or LightEffect."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightPeriod=moNumericEdit'HideMut.menu_c_Light.LightPeriod'
Begin Object Class=moNumericEdit Name=LightBrightness
MinValue=0
MaxValue=255
Caption="LightBrightness"
OnCreateComponent=LightPeriod.InternalOnCreateComponent
Hint="How bright the light should be from source and outwards."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightBrightness=moNumericEdit'HideMut.menu_c_Light.LightBrightness'
Begin Object Class=moNumericEdit Name=LightHue
MinValue=0
MaxValue=255
Caption="LightHue"
OnCreateComponent=LightPeriod.InternalOnCreateComponent
Hint="Allows you to select a color through the default color spectrum. Affects the color chosen."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightHue=moNumericEdit'HideMut.menu_c_Light.LightHue'
Begin Object Class=moNumericEdit Name=LightSaturation
MinValue=0
MaxValue=255
Caption="LightSaturation"
OnCreateComponent=LightSaturation.InternalOnCreateComponent
Hint="This value sets the amount of white light to mix with the color selected. If the value is set to 0, it will be the pure color. The higher the value, the less rich the color becomes. This is very effective when creating realistic lighting schemes. The default saturation is 127. Affects the chosen color."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightSaturation=moNumericEdit'HideMut.menu_c_Light.LightSaturation'
Begin Object Class=moNumericEdit Name=LightEffect
MinValue=0
MaxValue=15
Caption="LightEffect"
OnCreateComponent=LightEffect.InternalOnCreateComponent
Hint="Adds an animation to the light."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightEffect=moNumericEdit'HideMut.menu_c_Light.LightEffect'
Begin Object Class=moNumericEdit Name=LightType
MinValue=0
MaxValue=8
Caption="LightType"
OnCreateComponent=LightType.InternalOnCreateComponent
Hint="Light types affect the brightness and darkness values of a lights' lighteffect."
OnChange=menu_c_Light.InternalOnChange
End Object
nu_LightType=moNumericEdit'HideMut.menu_c_Light.LightType'
Begin Object Class=moCheckBox Name=moOptimize
Caption="Toggle static lighting on laggy lights"
OnCreateComponent=moOptimize.InternalOnCreateComponent
Hint="Toggle static lighting on laggy lights(if they are >maxRadus)"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_Optimize=moCheckBox'HideMut.menu_c_Light.moOptimize'
Begin Object Class=moCheckBox Name=moRemoveFlickering
Caption="Remove flickering lights"
OnCreateComponent=moRemoveFlickering.InternalOnCreateComponent
Hint="Remove flickering, blinking, pulse lights cuz fuk TWI optimization bullcrap"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_RemoveFlickering=moCheckBox'HideMut.menu_c_Light.moRemoveFlickering'
Begin Object Class=moCheckBox Name=moFlickeringToStatic
Caption="Flickering to Static lighting"
OnCreateComponent=moFlickeringToStatic.InternalOnCreateComponent
Hint="Makes all flickering lights static and steady"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_FlickeringToStatic=moCheckBox'HideMut.menu_c_Light.moFlickeringToStatic'
Begin Object Class=moCheckBox Name=moActorShadows
Caption="Actor Shadows"
OnCreateComponent=moActorShadows.InternalOnCreateComponent
Hint="Light casts actor shadows."
OnChange=menu_c_Light.InternalOnChange
End Object
ch_ActorShadows=moCheckBox'HideMut.menu_c_Light.moActorShadows'
Begin Object Class=moCheckBox Name=moAttenByLife
Caption="Attenuate light"
OnCreateComponent=moAttenByLife.InternalOnCreateComponent
Hint="Attenuate light by diminishing lifespan"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_AttenByLife=moCheckBox'HideMut.menu_c_Light.moAttenByLife'
Begin Object Class=moCheckBox Name=moCorona
Caption="Light Corona"
OnCreateComponent=moCorona.InternalOnCreateComponent
Hint="Toggle Coronas"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_bCorona=moCheckBox'HideMut.menu_c_Light.moCorona'
Begin Object Class=moCheckBox Name=moDirectionalCorona
Caption="Directional Corona"
OnCreateComponent=moDirectionalCorona.InternalOnCreateComponent
Hint="(if bCorona) Make corona bigger if it faces you, and zero and 90 degrees or beyond."
OnChange=menu_c_Light.InternalOnChange
End Object
ch_bDirectionalCorona=moCheckBox'HideMut.menu_c_Light.moDirectionalCorona'
Begin Object Class=moCheckBox Name=moDynamicLight
Caption="DynamicLight"
OnCreateComponent=moDirectionalCorona.InternalOnCreateComponent
Hint="Use dynamic light on lightsources"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_bDynamicLight=moCheckBox'HideMut.menu_c_Light.moDynamicLight'
Begin Object Class=moCheckBox Name=moLightingVisibility
Caption="LightingVisibility"
OnCreateComponent=moDirectionalCorona.InternalOnCreateComponent
Hint="Calculate Lighting Visibility by using line checks"
OnChange=menu_c_Light.InternalOnChange
End Object
ch_bLightingVisibility=moCheckBox'HideMut.menu_c_Light.moLightingVisibility'
Begin Object Class=moCheckBox Name=moSpecialLit
Caption="SpecialLit"
OnCreateComponent=moDirectionalCorona.InternalOnCreateComponent
Hint="Special Lit adds another layer of lighting used to isolate lighting to specific surfaces."
OnChange=menu_c_Light.InternalOnChange
End Object
ch_bSpecialLit=moCheckBox'HideMut.menu_c_Light.moSpecialLit'
Begin Object Class=GUIScrollTextBox Name=lbActions
bNoTeletype=True
CharDelay=0.000000
EOLDelay=0.000000
RepeatDelay=0.000000
OnCreateComponent=lbActions.InternalOnCreateComponent
FontScale=FNS_Small
bNeverFocus=True
End Object
lb_Actions=GUIScrollTextBox'HideMut.menu_c_Light.lbActions'
Begin Object Class=GUIButton Name=HideLights_Button
Caption="Optimize lights!"
Hint="Optimize light radius to your value(if light radius >maxRadius)"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=HideLights_Button.InternalOnKeyEvent
End Object
b_HideLights=GUIButton'HideMut.menu_c_Light.HideLights_Button'
Begin Object Class=GUIButton Name=OptAllLights_Button
Caption="Optimize all lights!"
Hint="Optimize all lights on map by given parameters"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=OptAllLights_Button.InternalOnKeyEvent
End Object
b_OptAllLights=GUIButton'HideMut.menu_c_Light.OptAllLights_Button'
Begin Object Class=GUIButton Name=MakeAllLightVisible_Button
Caption="Make all lights visible to player(debug)"
Hint="Debug light sources"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=MakeAllLightVisible_Button.InternalOnKeyEvent
End Object
b_MakeAllLightVisible=GUIButton'HideMut.menu_c_Light.MakeAllLightVisible_Button'
Begin Object Class=GUIButton Name=DisableCoronas_Button
Caption="Remove coronas"
Hint="Remove coronas from light sources"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=DisableCoronas_Button.InternalOnKeyEvent
End Object
b_DisableCoronas=GUIButton'HideMut.menu_c_Light.DisableCoronas_Button'
Begin Object Class=GUIButton Name=SaveConfig_Button
Caption="Save config variables"
Hint="Remove coronas from light sources"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=SaveConfig_Button.InternalOnKeyEvent
End Object
b_SaveConfig=GUIButton'HideMut.menu_c_Light.SaveConfig_Button'
Begin Object Class=GUIButton Name=OptStatic_Button
Caption="Optimize lighting on static meshes"
Hint="Apply bUnlit to all static meshes. Fixes retarded light calculate render to static meshes"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=OptStatic_Button.InternalOnKeyEvent
End Object
b_OptStatic=GUIButton'HideMut.menu_c_Light.OptStatic_Button'
Begin Object Class=GUIButton Name=clearLog
Caption="Clear log spam"
Hint="Clear log"
OnClick=menu_c_Light.ButtonClicked
OnKeyEvent=clearLog.InternalOnKeyEvent
End Object
b_ClearLog=GUIButton'HideMut.menu_c_Light.clearLog'
PropagateVisibility=False
WinHeight=1.000000
}

View file

@ -0,0 +1,40 @@
class menu_c_New extends UT2K4PlayerLoginMenu;
var bool bNoSteam;
function InitComponent(GUIController MyController, GUIComponent MyComponent)
{
// just to remove that "help" tab
Panels.remove(4, 1);
super.InitComponent(MyController, MyComponent);
// c_Main.ActivateTabByName(Panels[1].Caption, true);
}
// Overridden to stop the unnecessary removal of Panels
function RemoveMultiplayerTabs(GameInfo Game){}
defaultproperties
{
Panels(0)=(ClassName="HideMut.menu_c_HideMut",Caption="HideMenu",Hint="Some tweaks, cheats and etc.")
Panels(1)=(ClassName="HideMut.menu_c_Optimizer",Caption="OptimizerMenu",Hint="Module aimed for game optimization and clientside zed modifications")
Panels(2)=(ClassName="HideMut.menu_c_Light",Caption="LightMenu",Hint="Module aimed for analysis of light sources and their optimization")
Panels(3)=(ClassName="HideMut.menu_c_Zoner",Caption="ZonerMenu")
Begin Object Class=GUITabControl Name=NewLoginMenu
bDockPanels=True
BackgroundStyleName="TabBackground"
WinTop=0.026336
WinLeft=0.012500
WinWidth=0.974999
WinHeight=0.050000
bScaleToParent=True
bAcceptsInput=True
OnActivate=NewLoginMenu.InternalOnActivate
End Object
c_Main=GUITabControl'HideMut.menu_c_New.NewLoginMenu'
WinTop=0.000000
WinLeft=0.000000
WinWidth=1.000000
WinHeight=1.000000
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,256 @@
class menu_c_Zoner extends GUI2K4.MidGamePanel
config(HideMut);
//=================================================================Interface section
/*
var automated MOCheckBox
var automated MoComboBox
var automated moNumericEdit
var automated moFloatEdit
var Automated GUIListBox
var Automated GUISectionBackground
var automated moNumericEdit
*/
var automated GUIButton b_SetStart, b_SetEnd, b_SaveConfig, b_DrawZones, b_ShowZonedStaticMeshes;
var automated GUISectionBackground sb_ZonerDraw;
//=================================================================Interface section
//=================================================================Structs start
struct MyZone
{
var int ZoneKey; //zone key
var string ZoneName; //Zone name
var array<Vector> VectorsCoord; //Coordinates of zone borders. Drawing from 0 to 1, 1 to 2 and etc.
var float MinX, MinY, MaxX, MaxY; //Minimal coords for setting zoned actors
var array<int> PortalActorsRefs; //Actors that are visible through "portal" aka hole between neighbouring zones. Neighbouring zones may have same set of this
var array<int> DecorativeActorsRefs; //Decorative stuff between zones
var bool IgnoreXAxis; //Ignore this axis when setting active zone
var bool IgnoreYAxis;
var bool IgnoreZAxis;
var bool HideDecorativeActors;
var bool HidePortalActors;
};
// Struct for map zoning
struct MyZonedMap
{
var string MapName;
var array<int> MyZoneRef; //reference to my zone structure
var int MinVectorRef; //currently all vectors are 1 big array for all maps
var int MaxVectorRef;
};
var config array<MyZonedMap> ZonedMaps;
var config array<MyZone> MyZones;
var PlayerController PC;
var vector LineStart, LineEnd;
var byte R, G, B; //colors for vectors
var config array<Vector> ZVectors;
var config array<string> ZZones;
var config array<StaticMeshActor> SMAS;
var int LinesCount, NextZone;
//=================================================================Structs end
simulated function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
super.InitComponent(MyController,MyOwner);
sb_ZonerDraw.ManageComponent(b_SetStart);
sb_ZonerDraw.ManageComponent(b_SetEnd);
sb_ZonerDraw.ManageComponent(b_SaveConfig);
sb_ZonerDraw.ManageComponent(b_DrawZones);
sb_ZonerDraw.ManageComponent(b_ShowZonedStaticMeshes);
PC = PlayerOwner();
R = 255; //Line color
G = 0;
B = 0;
}
function ShowPanel(bool bShow)
{
super.ShowPanel(bShow);
}
event Opened(GUIComponent Sender)
{
super.Opened(Sender);
}
function StartDrawing()
{
LineStart = PC.Pawn.Location;
}
function DrawLine()
{
LineEnd = PC.Pawn.Location;
PC.Pawn.DrawStayingDebugLine(LineStart, LineEnd, R, G, B); //Draw line for visual zone representation
ZVectors[LinesCount] = LineStart; //Save our vectors
LinesCount++;
ZVectors[LinesCount] = LineEnd;
LinesCount++;
LineStart = LineEnd; //Next line
}
function SaveConfigStr()
{
local int i,k; //,l;
ZonedMaps.length = ZonedMaps.length + 1;
ZonedMaps[ZonedMaps.length-1].MapName = PC.Level.GetURLMap(); //save variables
for (i=0; i<9;i++)
{
ZonedMaps[ZonedMaps.length-1].MyZoneRef[i] = i;
}
for (i=0; i<ZVectors.length;i++)
{
if (i==0 || i==5 || i==10 || i==15 || i==20 || i==25 || i==30 || i==35 || i==40 || i==45)
{
MyZones.Insert(MyZones.length, 1);
MyZones[MyZones.length-1].ZoneName = "Zone" @ MyZones.length-1; //Create new zone
MyZones[MyZones.length-1].ZoneKey = MyZones.length-1;
k=0;
}
MyZones[MyZones.length-1].VectorsCoord[k] = ZVectors[i];
k++;
}
for (i=0; i<MyZones.length;i++) //Let's add min|max values to structure
{
for (k=0; k<MyZones[i].VectorsCoord.length;k++)
{
if (MyZones[i].VectorsCoord[k].X < MyZones[i].MinX || MyZones[i].MinX==0)
MyZones[i].MinX = MyZones[i].VectorsCoord[k].X;
if (MyZones[i].VectorsCoord[k].Y < MyZones[i].MinY || MyZones[i].MinY==0)
MyZones[i].MinY = MyZones[i].VectorsCoord[k].Y;
if (MyZones[i].VectorsCoord[k].X > MyZones[i].MaxX || MyZones[i].MaxX==0)
MyZones[i].MaxX = MyZones[i].VectorsCoord[k].X;
if (MyZones[i].VectorsCoord[k].Y > MyZones[i].MaxY || MyZones[i].MaxY==0)
MyZones[i].MaxY = MyZones[i].VectorsCoord[k].Y;
}
}
SaveConfig();
}
function DrawZonesFromConfig()
{
local int i;
PC.Pawn.ClearStayingDebugLines();
for (i=0; i<ZVectors.length; i++)
{
if (i==4 || i==9 || i==14 || i==19 || i==24 || i==29 || i==34 || i==39 || i==44)
continue;
PC.Pawn.DrawStayingDebugLine(ZVectors[i], ZVectors[i+1], R, G, B);
}
}
function ShowZonedStaticMeshes()
{
local int i; // k;
local StaticMeshActor SMA;
local float MaxX,MaxY,MinX,MinY;
for (i=0; i<5; i++) //For each 5 vectors get MaxX,MaxY,MinX,MinY
{
if (ZVectors[i].X > MaxX || MaxX==0)
MaxX = ZVectors[i].X;
if (ZVectors[i].Y > MaxY || MaxY==0)
MaxY = ZVectors[i].Y;
if (ZVectors[i].X < MinX || MinX==0)
MinX = ZVectors[i].X;
if (ZVectors[i].Y < MinY || MinY==0)
MinY = ZVectors[i].Y;
}
PC.ClientMessage(MaxX @ MaxY @ MinX @ MinY);
forEach PC.AllActors(class'StaticMeshActor', SMA)
{
if((SMA.Location.X <= MaxX && SMA.Location.Y <= MaxY) && (SMA.Location.X >= MinX && SMA.Location.Y >= MinY))
{
SMA.bHidden = false;
SMA.ResetStaticFilterState();
}
}
}
simulated function bool ButtonClicked(GUIComponent Sender)
{
switch (Sender)
{
case b_SetStart:
StartDrawing();
break;
case b_SetEnd:
DrawLine();
break;
case b_SaveConfig:
SaveConfigStr();
break;
case b_DrawZones:
DrawZonesFromConfig();
break;
case b_ShowZonedStaticMeshes:
ShowZonedStaticMeshes();
break;
default:
return false;
}
return true;
}
simulated function InternalOnChange(GUIComponent Sender){}
defaultproperties
{
Begin Object Class=GUIButton Name=bSetStart
Caption="Set Start vector"
OnClick=menu_c_Zoner.ButtonClicked
OnKeyEvent=bSetStart.InternalOnKeyEvent
End Object
b_SetStart=GUIButton'HideMut.menu_c_Zoner.bSetStart'
Begin Object Class=GUIButton Name=bSetEnd
Caption="Set End vector"
OnClick=menu_c_Zoner.ButtonClicked
OnKeyEvent=bSetEnd.InternalOnKeyEvent
End Object
b_SetEnd=GUIButton'HideMut.menu_c_Zoner.bSetEnd'
Begin Object Class=GUIButton Name=bSaveConfig
Caption="Save config"
OnClick=menu_c_Zoner.ButtonClicked
OnKeyEvent=bSaveConfig.InternalOnKeyEvent
End Object
b_SaveConfig=GUIButton'HideMut.menu_c_Zoner.bSaveConfig'
Begin Object Class=GUIButton Name=bDrawZones
Caption="Draw zones"
OnClick=menu_c_Zoner.ButtonClicked
OnKeyEvent=bDrawZones.InternalOnKeyEvent
End Object
b_DrawZones=GUIButton'HideMut.menu_c_Zoner.bDrawZones'
Begin Object Class=GUIButton Name=bShowZonedStaticMeshes
Caption="Draw zoned static meshes"
OnClick=menu_c_Zoner.ButtonClicked
OnKeyEvent=bShowZonedStaticMeshes.InternalOnKeyEvent
End Object
b_ShowZonedStaticMeshes=GUIButton'HideMut.menu_c_Zoner.bShowZonedStaticMeshes'
Begin Object Class=GUISectionBackground Name=BGZonerDraw
bFillClient=True
Caption="Zoner Draw"
WinWidth=0.900000
WinHeight=0.900000
OnPreDraw=BGZonerDraw.InternalPreDraw
End Object
sb_ZonerDraw=GUISectionBackground'HideMut.menu_c_Zoner.BGZonerDraw'
}

View file

@ -0,0 +1,88 @@
// helps to get rid of first time zed spawn lags
// source: https://github.com/poosh/KF-ScrnBalance/blob/master/Classes/ScrnGameLength.uc#L190
class o_AssetLoader extends object;
// ====================================================
// contains all vanilla zeds for easy access
var array < class<KFMonster> > ZedsArray_std;
var array < class<KFMonster> > ZedsArray_xmas;
var array < class<KFMonster> > ZedsArray_halow;
var array < class<KFMonster> > ZedsArray_circus;
// ====================================================
// tbh when we load vanilla zed assets, it removes most of the hitches
// but let's set all variants if we ever need them
final static function LoadZedAsset(string event, LevelInfo Level)
{
local int i;
local array < class<KFMonster> > tmpZedsArray;
// failsafe
if (level == none)
return;
if (event ~= "c")
tmpZedsArray = default.ZedsArray_circus;
else if (event ~= "h")
tmpZedsArray = default.ZedsArray_halow;
else if (event ~= "x")
tmpZedsArray = default.ZedsArray_xmas;
// by default load standard zed assets
else
tmpZedsArray = default.ZedsArray_std;
for (i = 0; i < tmpZedsArray.length && Level != none; i++)
{
tmpZedsArray[i].static.PreCacheAssets(Level);
// log(string(tmpZedsArray[i]) $ " assets cached!!");
}
}
// ====================================================
defaultproperties
{
ZedsArray_std(0)=Class'KFChar.ZombieClot_STANDARD'
ZedsArray_std(1)=Class'KFChar.ZombieCrawler_STANDARD'
ZedsArray_std(2)=Class'KFChar.ZombieFleshpound_STANDARD'
ZedsArray_std(3)=Class'KFChar.ZombieScrake_STANDARD'
ZedsArray_std(4)=Class'KFChar.ZombieSiren_STANDARD'
ZedsArray_std(5)=Class'KFChar.ZombieStalker_STANDARD'
ZedsArray_std(6)=Class'KFChar.ZombieHusk_STANDARD'
ZedsArray_std(7)=Class'KFChar.ZombieBloat_STANDARD'
ZedsArray_std(8)=Class'KFChar.ZombieBoss_STANDARD'
ZedsArray_std(9)=Class'KFChar.ZombieGorefast_STANDARD'
ZedsArray_xmas(0)=Class'KFChar.ZombieCLot_XMas'
ZedsArray_xmas(1)=Class'KFChar.ZombieCrawler_XMas'
ZedsArray_xmas(2)=Class'KFChar.ZombieFleshPound_XMas'
ZedsArray_xmas(3)=Class'KFChar.ZombieScrake_XMas'
ZedsArray_xmas(4)=Class'KFChar.ZombieSiren_XMas'
ZedsArray_xmas(5)=Class'KFChar.ZombieStalker_XMas'
ZedsArray_xmas(6)=Class'KFChar.ZombieHusk_XMas'
ZedsArray_xmas(7)=Class'KFChar.ZombieBloat_XMas'
ZedsArray_xmas(8)=Class'KFChar.ZombieBoss_XMas'
ZedsArray_xmas(9)=Class'KFChar.ZombieGoreFast_XMas'
ZedsArray_halow(0)=Class'KFChar.ZombieClot_HALLOWEEN'
ZedsArray_halow(1)=Class'KFChar.ZombieCrawler_HALLOWEEN'
ZedsArray_halow(2)=Class'KFChar.ZombieFleshPound_HALLOWEEN'
ZedsArray_halow(3)=Class'KFChar.ZombieScrake_HALLOWEEN'
ZedsArray_halow(4)=Class'KFChar.ZombieSiren_HALLOWEEN'
ZedsArray_halow(5)=Class'KFChar.ZombieStalker_HALLOWEEN'
ZedsArray_halow(6)=Class'KFChar.ZombieHusk_HALLOWEEN'
ZedsArray_halow(7)=Class'KFChar.ZombieBloat_HALLOWEEN'
ZedsArray_halow(8)=Class'KFChar.ZombieBoss_HALLOWEEN'
ZedsArray_halow(9)=Class'KFChar.ZombieGorefast_HALLOWEEN'
ZedsArray_circus(0)=Class'KFChar.ZombieClot_CIRCUS'
ZedsArray_circus(1)=Class'KFChar.ZombieCrawler_CIRCUS'
ZedsArray_circus(2)=Class'KFChar.ZombieFleshPound_CIRCUS'
ZedsArray_circus(3)=Class'KFChar.ZombieScrake_CIRCUS'
ZedsArray_circus(4)=Class'KFChar.ZombieSiren_CIRCUS'
ZedsArray_circus(5)=Class'KFChar.ZombieStalker_CIRCUS'
ZedsArray_circus(6)=Class'KFChar.ZombieHusk_CIRCUS'
ZedsArray_circus(7)=Class'KFChar.ZombieBloat_CIRCUS'
ZedsArray_circus(8)=Class'KFChar.ZombieBoss_CIRCUS'
ZedsArray_circus(9)=Class'KFChar.ZombieGoreFast_CIRCUS'
}

View file

@ -0,0 +1,421 @@
class o_CyrillicEncodeUtilities extends object;
// source: http://killingfloor.ru/xforum/threads/ispravlenie-russkix-imen.4023/#post-121031 @Flame
// Пусть для определённости SpecialOpen="([{", а SpecialClose="}])"
// Функция конвертирует строку. Символы кириллицы заменяются на символы латиницы, а так же спец символы
// Например слово проверка конвертируется в строку ([{proverka}]), теsт->([{te}])s([{t}])
// То есть все блоки символов кириллицы выделяются с помощью набора спец символов. Спец символы можно задавать в настройках
final static function string EnCodeString(string Source, string SpecialOpen, string SpecialClose)
{
local int i;
local int code;
local int sLength;
local bool bOpened;
local string result;
sLength = Len(Source);
for (i = 0; i < sLength; i++)
{
// Получаем код первого символа строки
code = Asc(Source);
// Если кодировка за 1000 - вычитаем 848. Подробнее в теме про кириллицу в линуксе и винде
if (code > 848)
code -= 848;
// Параметр bOpened отвечает за индикацию, того что сейчас идут символы кириллицы.
// Если code <= 160, значит встретился символ латиницы и надо закрывать блок отвечающий за русский язык
// То есть ранее был прописан спец набор символов SpecialOpen и надо закрывать этот набор символов с помощью SpecialClose
if (bOpened && code <= 160)
{
bOpened = false;
result $= SpecialClose;
}
// Если кириллица и не добавлен спец символы открытия блока русского языка SpecialOpen - добавляем
// Если же либо символ латиницы, либо уже были символы открытия - пытаемся конвертировать символ с помощью EnCodeSymbol
// EnCodeSymbol конвертирует только кириллицу, остальные символы он не трогает
if(code > 160 && !bOpened)
{
bOpened = true;
result $= SpecialOpen $ Chr(EnCodeSymbol(code));
}
else
result $= Chr(EnCodeSymbol(code));
// "Отрезаем" первый символ от входной строки - мы его уже обработали. Теперь новый первый символ и цикл повторяется
Source = Mid(Source, 1);
// Если исходная строка заканчивается кириллицей, то надо закрыть строку символами SpecialClose
if (i >= sLength-1 && bOpened)
result $= SpecialClose;
}
return result;
}
// our version without any open / close symbols
final static function string EnCodeStringHide(string Source)
{
local int i;
local int code;
local int sLength;
local string result;
sLength = Len(Source);
for (i = 0; i < sLength; i++)
{
// Получаем код первого символа строки
code = Asc(Source);
// Если кодировка за 1000 - вычитаем 848. Подробнее в теме про кириллицу в линуксе и винде
if (code > 848)
code -= 848;
result $= Chr(EnCodeSymbol(code));
// "Отрезаем" первый символ от входной строки - мы его уже обработали. Теперь новый первый символ и цикл повторяется
Source = Mid(Source, 1);
}
return result;
}
// Получаем исходную строку на кириллице из преобразованной
// ([{proverka}])->проверка, ([{te}])s([{t}])->те
final static function string DeCodeString(string Source, string SpecialOpen, string SpecialClose)
{
local string result;
local int i;
local array<string> Parts, InnerParts;
local string Part;
// Разбиваем строку на подстроки. Строка по которой разбиваем - SpecialClose набор символов
// "([{te}])s([{t}])" разбивается на "([{te" и "s([{t"
Split(Source, SpecialClose, Parts);
for (i = 0; i < Parts.Length; i++)
{
Part = Parts[i];
// Для каждой подстроки проверяем содержит ли она спец символы открытия SpecialOpen
// Если содержут, то разбивам на 2 подстроки по ([{
// Например. ([{te-> "пустая строка" и "te", s([{t-> "s" и "t"
// Левая из двух подстрок - чистая латиница, правая - кириллица и её надо конвертировать
// DeCodePart конвертирует строку на латинице в строку на кириллице, согласно правилам определённых выше
if (InStr(Part, SpecialOpen) >= 0)
{
Split(Part, SpecialOpen, InnerParts);
result $= InnerParts[0] $ DeCodePart(InnerParts[1]);
}
else
result $= Part;
}
return result;
}
// Конвертация символов из латиницы в кириллицу
final static function string DeCodePart(string Source)
{
local int sLength;
local int i;
local int code;
local string result;
sLength = Len(Source);
for (i = 0; i < sLength; i++)
{
code = Asc(Source);
result $= Chr(DeCodeSymbol(code) + 848); // Для Windows надо добавить. Для Linux надо проверять
Source = Mid(Source,1);
}
return result;
}
// Конвертация символа из кириллицы в латиницу. Передаётся и возвращается код символа
final static function int EnCodeSymbol(int code)
{
switch(code)
{
case 224:
return 97;
case 225:
return 98;
case 226:
return 118;
case 227:
return 103;
case 228:
return 100;
case 229:
return 101;
case 184:
return 42;
case 230:
return 106;
case 231:
return 122;
case 232:
return 105;
case 233:
return 94;
case 234:
return 107;
case 235:
return 108;
case 236:
return 109;
case 237:
return 110;
case 238:
return 111;
case 239:
return 112;
case 240:
return 114;
case 241:
return 115;
case 242:
return 116;
case 243:
return 117;
case 244:
return 102;
case 245:
return 104;
case 246:
return 99;
case 247:
return 121;
case 248:
return 119;
case 249:
return 36;
case 250:
return 33;
case 251:
return 37;
case 252:
return 63;
case 253:
return 41;
case 254:
return 124;
case 255:
return 47;
case 192:
return 65;
case 193:
return 66;
case 194:
return 86;
case 195:
return 71;
case 196:
return 68;
case 197:
return 69;
case 168:
return 64;
case 198:
return 74;
case 199:
return 90;
case 200:
return 73;
case 201:
return 38;
case 202:
return 75;
case 203:
return 76;
case 204:
return 77;
case 205:
return 78;
case 206:
return 79;
case 207:
return 80;
case 208:
return 82;
case 209:
return 83;
case 210:
return 84;
case 211:
return 85;
case 212:
return 70;
case 213:
return 72;
case 214:
return 67;
case 215:
return 89;
case 216:
return 87;
case 217:
return 55;
case 218:
return 56;
case 219:
return 57;
case 220:
return 48;
case 221:
return 49;
case 222:
return 50;
case 223:
return 51;
}
return code;
}
// Конвертация символа из латиницы в кириллицу. Передаётся и возвращается код символа
final static function int DeCodeSymbol(int code)
{
switch(code)
{
case 97:
return 224;
case 98:
return 225;
case 118:
return 226;
case 103:
return 227;
case 100:
return 228;
case 101:
return 229;
case 42:
return 184;
case 106:
return 230;
case 122:
return 231;
case 105:
return 232;
case 94:
return 233;
case 107:
return 234;
case 108:
return 235;
case 109:
return 236;
case 110:
return 237;
case 111:
return 238;
case 112:
return 239;
case 114:
return 240;
case 115:
return 241;
case 116:
return 242;
case 117:
return 243;
case 102:
return 244;
case 104:
return 245;
case 99:
return 246;
case 121:
return 247;
case 119:
return 248;
case 36:
return 249;
case 33:
return 250;
case 37:
return 251;
case 63:
return 252;
case 41:
return 253;
case 124:
return 254;
case 47:
return 255;
case 65:
return 192;
case 66:
return 193;
case 86:
return 194;
case 71:
return 195;
case 68:
return 196;
case 69:
return 197;
case 64:
return 168;
case 74:
return 198;
case 90:
return 199;
case 73:
return 200;
case 38:
return 201;
case 75:
return 202;
case 76:
return 203;
case 77:
return 204;
case 78:
return 205;
case 79:
return 206;
case 80:
return 207;
case 82:
return 208;
case 83:
return 209;
case 84:
return 210;
case 85:
return 211;
case 70:
return 212;
case 72:
return 213;
case 67:
return 214;
case 89:
return 215;
case 87:
return 216;
case 55:
return 217;
case 56:
return 218;
case 57:
return 219;
case 48:
return 220;
case 49:
return 221;
case 50:
return 222;
case 51:
return 223;
}
return code;
}
defaultproperties
{
}

View file

@ -0,0 +1,74 @@
class o_Render extends object;
// ===========================================================================
// draw zed health
final function DrawHealthBars(Canvas C, float f)
{
local HUDKillingFloor KFH;
local KFMonster m;
KFH = HUDKillingFloor(C.ViewPort.Actor.myHUD);
// this draws debug sphere for pawns
// HKF.DrawPointSphere();
// draw dem bars, using the fastest iterator at least up to 2000UU
if (KFH == none)
return;
foreach C.ViewPort.Actor.CollidingActors(class'KFMonster', m, f)
{
if (m == none || m.Health <= 0)
continue;
KFH.DrawHealthBar(C, m, m.Health, m.HealthMax , 50.0);
}
}
// draw crosshair
final function DrawXhair(Canvas C, Color cl, float l, float w)
{
C.SetPos((float(C.sizeX) - w) / 2, (float(C.sizeY) - l) / 2);
C.DrawColor = cl;
C.DrawTile(Texture'Engine.WhiteSquareTexture', w, l, 0, 0, 2, 2);
C.SetPos((float(C.sizeX) - l) / 2, (float(C.sizeY) - w) / 2);
C.DrawTile(Texture'Engine.WhiteSquareTexture', l, w, 0, 0, 2, 2);
}
// For debugging headshots
// simulated function DrawHeadShotSphere(out Canvas C) // Dave@Psyonix
// {
// local HUDKillingFloor KFH;
// local KFHumanPawn p;
// local KFMonster KFM;
// local coords CO;
// local vector HeadLoc;
// KFH = HUDKillingFloor(C.ViewPort.Actor.myHUD);
// p = getPawn();
// if ( p == none || KFH == none)
// return;
// //super.DrawHeadShotSphere();
// foreach p.DynamicActors(class'KFMonster', KFM)
// {
// if ( KFM == none ) // && KFM.ServerHeadLocation != KFM.LastServerHeadLocation )
// continue;
// //KFM.DrawDebugSphere(KFM.Location + (KFM.OnlineHeadshotOffset >> KFM.Rotation), KFM.HeadRadius * KFM.HeadScale * KFM.OnlineHeadshotScale, 10, 0, 255, 0);
// KFH.ClearStayingDebugLines();
// // KFM.LastServerHeadLocation = KFM.ServerHeadLocation;
// // DrawStayingDebugSphere(KFM.ServerHeadLocation, KFM.HeadRadius * KFM.HeadScale, 10, 128, 255, 255);
// CO = KFM.GetBoneCoords(KFM.HeadBone);
// HeadLoc = CO.Origin + (KFM.HeadHeight * KFM.HeadScale * CO.XAxis);
// KFH.DrawStayingDebugSphere(HeadLoc, KFM.HeadRadius * KFM.HeadScale, 10, 0, 255, 0);
// }
// }
// ===========================================================================
defaultproperties
{
}

View file

@ -0,0 +1,657 @@
class o_Utility extends object
config(HideMut_Utility);
var const string DIVIDER;
// ===========================================================================
// VARIABLES
// ===========================================================================
// some complicated structure to hold all required perk data
struct sData
{
var byte Index;
var array<int> Value;
};
struct sPerkInfo
{
var class<KFVeterancyTypes> Perk;
var array<sData> PerkData;
};
var array<sPerkInfo> PerkInfo;
// colors and tags, maybe later I will convert this to a config array
struct ColorRecord
{
var string ColorName; // color name, for comfort
var string ColorTag; // color tag
var Color Color; // RGBA values
};
var config array<ColorRecord> ColorList; // color list
var config array<string> MsgHelp; // help messages
var config array<string> SPHelp; // help messages
// admin login-pass, server ip info
struct adminAccount
{
var string Name;
var string ip;
var string login;
var string pass;
};
var config array<adminAccount> adminAccounts;
// shit bind strings
var config string SC_names;
var config string FP_names;
var config string tnames;
// ===========================================================================
// UTILITY
// ===========================================================================
// get gametype string
final function GetGT(player player)
{
local GameReplicationInfo gri;
foreach allObjects(class'GameReplicationInfo', gri)
{
if (gri == none)
continue;
print_Console_s(gri.gameClass, player);
}
}
// ===========================================================================
// TEXT
// ===========================================================================
// help list for zed spawning
final function TellAbout(player player, string whatToTell)
{
local int i;
local array<string> StrTemp;
switch (whatToTell)
{
case "MsgHelp":
StrTemp = MsgHelp;
break;
case "Chars":
StrTemp = class'KFGameType'.default.AvailableChars;
for(i = 0; i < StrTemp.Length; i++)
{
StrTemp[i] = "^w^" $ i $ ". ^y^" $ StrTemp[i];
}
break;
default:
// fallback warning
StrTemp[0] = "^r^HIDE MENU HELPER: We shouldn't get to this so this means you used WRONG modifier!";
}
print_Console_arr(StrTemp, player);
}
// help list for zed spawning
final function string getRandString(byte i)
{
local string s;
local array<string> loc_arr;
// get exact string
if (i == 1)
s = SC_names;
else if (i == 2)
s = FP_names;
else
s = tnames;
// fill the array
split(s, DIVIDER, loc_arr);
return loc_arr[rand(loc_arr.length)];
}
// ===========================================================================
// COLORS
// ===========================================================================
// converts color tags to colors
final function string ParseTags(string input)
{
local int i;
for (i = 0; i < ColorList.Length; i++)
{
ReplaceText(input, ColorList[i].ColorTag, class'GameInfo'.static.MakeColorCode(ColorList[i].Color));
}
return input;
}
// same thing ^ but as a static function
final static function string ParseTagsStatic(string input)
{
local int i;
for (i = 0; i < default.ColorList.Length; i++)
{
ReplaceText(input, default.ColorList[i].ColorTag, class'GameInfo'.static.MakeColorCode(default.ColorList[i].Color));
}
return input;
}
// to make a color: class'Canvas'.Static.MakeColor(R,G,B, optional A)
// Engine.GameInfo
// removes colors from a string
final function string StripColor(string s)
{
local int p;
p = InStr(s, chr(27));
while (p >= 0)
{
s = left(s, p) $ mid(S, p + 4);
p = InStr(s, Chr(27));
}
return s;
}
// same thing ^ but as a static function
final static function string StripColorStatic(string s)
{
local int p;
p = InStr(s, chr(27));
while (p >= 0)
{
s = left(s, p) $ mid(S, p + 4);
p = InStr(s, Chr(27));
}
return s;
}
// ===========================================================================
// ADMIN STUFF
// ===========================================================================
// admin login-logout
final function adlog(KFPlayerController pc)
{
local int i;
local string serverIp;
if (!bIsValid(pc))
return;
if (pc.playerReplicationInfo.bAdmin == true)
{
pc.adminLogout();
return;
}
serverIp = pc.getServerNetworkAddress();
for (i = 0; i < adminAccounts.length; i++)
{
if (serverIp == adminAccounts[i].ip)
{
if (adminAccounts[i].login != "")
pc.adminLogin(adminAccounts[i].login @ adminAccounts[i].pass);
else
pc.adminLogin(adminAccounts[i].pass);
}
}
}
// print aviablable admin - pass pairs, optionally to console
final function adlog_Info(KFPlayerController pc, optional bool toConsole)
{
local int i;
if (!bIsValid(pc))
return;
for (i = 0; i < adminAccounts.length; i++)
{
if (toConsole)
{
pc.Player.Console.Chat(adminAccounts[i].login, 6.0, pc.playerReplicationInfo);
pc.Player.Console.Chat(adminAccounts[i].pass, 6.0, pc.playerReplicationInfo);
}
else
{
pc.myHUD.AddTextMessage(adminAccounts[i].login, class'LocalMessage', pc.playerReplicationInfo);
pc.myHUD.AddTextMessage(adminAccounts[i].pass, class'LocalMessage', pc.playerReplicationInfo);
}
}
}
final function adlog_Control(KFPlayerController pc, bool bAdd, string Param)
{
local int i;
local string serverIp, serverName;
local array<string> Params;
local GameReplicationInfo tempGri;
local adminAccount loc_adminAccount;
if (!bIsValid(pc))
return;
// get server IP
serverIp = pc.getServerNetworkAddress();
if (bAdd)
{
// get login, pass
split(Param, ",", Params);
// get server name
foreach pc.allActors(class'GameReplicationInfo', tempGri)
{
if (tempGri == none)
continue;
serverName = tempGri.ServerName;
log(tempGri.ServerName);
}
loc_adminAccount.Name = serverName;
loc_adminAccount.ip = serverIp;
loc_adminAccount.login = Params[0];
loc_adminAccount.pass = Params[1];
adminAccounts[adminAccounts.Length] = loc_adminAccount;
pc.myHUD.AddTextMessage(Params[0] @ Params[1] @ "added to admin info config!", class'LocalMessage', pc.playerReplicationInfo);
// save the config!
StaticSaveConfig();
}
else
{
for (i = 0; i < adminAccounts.length; i++)
{
if (serverIp == adminAccounts[i].ip)
{
pc.myHUD.AddTextMessage(adminAccounts[i].login @ adminAccounts[i].pass @ "removed from admin info config!", class'LocalMessage', pc.playerReplicationInfo);
adminAccounts.Remove(i, 1);
StaticSaveConfig();
break;
}
}
}
}
// check for nones
final function bool bIsValid(KFPlayerController pc)
{
if (pc == none || pc.playerReplicationInfo == none)
return false;
else
return true;
}
// ===========================================================================
// CRASHING
// ===========================================================================
// dosh spam for CrashServer()
final function doshspam(KFHumanPawn p)
{
local int i;
while (p != none && i < 10000)
{
p.tossCash(1);
i++;
}
}
// nade spam for CrashServer2()
final function nadespam(KFHumanPawn p, int i)
{
local int n;
// StopWatch(false);
while (p != none && n < i)
{
ThrowNade(p);
n++;
}
// StopWatch(true);
}
// spec-join spam for CrashServer3()
final function specspam(KFPlayerController pc)
{
local int i;
if (pc == none)
return;
while (i < 100)
{
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
pc.BecomeActivePlayer();
pc.BecomeSpectator();
i++;
}
}
final function Frag FindNade(KFHumanPawn p)
{
local inventory inv;
if (p == none)
return none;
for (inv = p.Inventory; inv != none; inv = inv.Inventory)
{
if (ClassIsChildOf(inv.class, class'Frag'))
{
return Frag(inv);
}
}
}
final function ThrowNade(KFHumanPawn p)
{
if (p == none || FindNade(p) == none)
return;
FindNade(p).ServerThrow();
}
// ===========================================================================
// helper messages
final function string GetChar(string s)
{
local int i;
// default skins are 56!
i = clamp(int(s), 0, 55);
return class'KFGameType'.default.AvailableChars[i];
}
// ===========================================================================
// return all avialable KFWeapon classes array
final function array< class<KFWeapon> > getALLWeapons(KFPlayerController pc)
{
local KFLevelRules lr;
local array< class<KFWeapon> > array_wep;
// failsafe
if (pc == none)
return array_wep;
foreach pc.dynamicActors(class'KFLevelRules', lr)
{
if (lr == none)
return array_wep;
break;
}
// fill weapon class array
MergeSellArrays(array_wep, lr.mediItemForSale);
MergeSellArrays(array_wep, lr.suppItemForSale);
MergeSellArrays(array_wep, lr.shrpItemForSale);
MergeSellArrays(array_wep, lr.commItemForSale);
MergeSellArrays(array_wep, lr.bersItemForSale);
MergeSellArrays(array_wep, lr.fireItemForSale);
MergeSellArrays(array_wep, lr.demoItemForSale);
MergeSellArrays(array_wep, lr.neutItemForSale);
return array_wep;
}
// convert pickups to weapon class and add to out array
final private function MergeSellArrays(out array< class<KFWeapon> > array_wep, array< class<Pickup> > sellItems)
{
local int i;
for (i = 0; i < sellItems.length; i++)
{
array_wep[array_wep.Length] = class<KFWeapon>(sellItems[i].default.inventoryType);
}
}
// ===========================================================================
// PERKS
// ===========================================================================
final function PerkSwitch(KFPlayerController pc, int i, optional string level)
{
local int j, n;
// failsafe
if (pc == none)
return;
// failsafe for perk index
// tho we make sure we pass right values to here
i = clamp(i, 0, 7);
// what level we want
// if we don't specify it force to 6
if (level ~= "")
j = 6;
else
j = clamp(int(level), 0, 6);
n = PerkInfo[i].PerkData.Length;
// set SelectedVeterancy
pc.SelectedVeterancy = PerkInfo[i].Perk;
pc.SaveConfig();
// set the veterancy
pc.selectVeterancy(PerkInfo[i].Perk, true);
pc.SetSelectedVeterancy(PerkInfo[i].Perk);
// set levels
if (n > 0)
{
pc.serverInitializeSteamStatInt(PerkInfo[i].PerkData[0].Index, PerkInfo[i].PerkData[0].Value[j]);
// if we have 2'nd index - use it!
if (n > 1)
pc.serverInitializeSteamStatInt(PerkInfo[i].PerkData[1].Index, PerkInfo[i].PerkData[1].Value[j]);
}
pc.serverSteamStatsAndAchievementsInitialized();
}
// get perk index byte
// Fail = 99
// KFVeterancyTypes = 255
// Perk Neutral = 7
// Medic = 0 || Sup = 1 || Sharp = 2
// Mando = 3 || Zerk = 4 || Pyro = 5 || Demo = 6
final function byte Get_Perk_Index(KFPlayerController pc)
{
local KFPlayerReplicationInfo PRI;
PRI = KFPlayerReplicationInfo(PC.PlayerReplicationInfo);
// fail indicator
if (pc == none || PRI == none)
return 99;
if (PRI.ClientVeteranSkill != none)
return PRI.ClientVeteranSkill.default.perkIndex;
else
return 7; // Perk Neutral
}
// ===========================================================================
// CONSOLE SHIT
// ===========================================================================
// privately prints from ARRAY to console
final function print_Console_arr(array<string> s, player player)
{
local KFConsole console;
local int i;
// fail safe. Console must be always present
if (player == none)
return;
console = KFConsole(player.console);
for (i = 0; i < s.length; i++)
{
console.Message(ParseTags(s[i]), 0.0f);
}
}
// privately prints from STRING to console, accepts arrays with DIVIDER DIVIDER
final function print_Console_s(string s, player player)
{
local KFConsole console;
local array<string> array_s;
local int i;
// fail safe. Console must be always present
if (player == none)
return;
console = KFConsole(player.console);
// fill the array
split(s, DIVIDER, array_s);
// if we have an array
if (array_s.length > 0)
{
for (i = 0; i < array_s.length; i++)
{
console.Message(ParseTags(array_s[i]), 0.0f);
}
}
else
console.Message(ParseTags(s), 0.0f);
}
// toss a string array, get the Console, and execute everything in a safe, clean way, divider - DIVIDER
final function write_Console(string s, player player)
{
local KFConsole console;
local array<string> array_s;
local int i;
// fail safe. Console must be always present
if (player == none)
return;
console = KFConsole(player.console);
// fill the array
split(s, DIVIDER, array_s);
// we are using delayed to allow huuuuge console spam
for (i = 0; i < array_s.length; i++)
{
console.DelayedConsoleCommand(array_s[i]);
}
}
// ===========================================================================
// DEFS
// ===========================================================================
defaultproperties
{
Divider=";"
PerkInfo(0)=(Perk=Class'KFMod.KFVetFieldMedic',PerkData=((Value=(0,200,750,4000,12000,25000,100000))))
PerkInfo(1)=(Perk=Class'KFMod.KFVetSupportSpec',PerkData=((Index=2,Value=(0,25000,100000,500000,1500000,3500000,5500000)),(Index=1,Value=(0,2000,7000,35000,120000,250000,370000))))
PerkInfo(2)=(Perk=Class'KFMod.KFVetSharpshooter',PerkData=((Index=3,Value=(0,30,100,700,2500,5500,8500))))
PerkInfo(3)=(Perk=Class'KFMod.KFVetCommando',PerkData=((Index=5,Value=(0,25000,100000,500000,1500000,3500000,5500000)),(Index=4,Value=(0,30,100,350,1200,2400,3600))))
PerkInfo(4)=(Perk=Class'KFMod.KFVetBerserker',PerkData=((Index=6,Value=(0,25000,100000,500000,1500000,3500000,5500000))))
PerkInfo(5)=(Perk=Class'KFMod.KFVetFirebug',PerkData=((Index=7,Value=(0,25000,100000,500000,1500000,3500000,5500000))))
PerkInfo(6)=(Perk=Class'KFMod.KFVetDemolitions',PerkData=((Index=21,Value=(0,25000,100000,500000,1500000,3500000,5500000))))
PerkInfo(7)=(Perk=Class'KFMod.KFVeterancyTypes')
}

View file

@ -0,0 +1,64 @@
class proj_GetName extends KFMod.ShotgunBullet;
final protected function pcClientMessage(string s)
{
if (KFPlayerController(owner) != none)
KFPlayerController(owner).clientMessage(s);
}
simulated function processTouch(Actor other, vector hitLocation)
{
if (other == none || other == KFPlayerController(owner).pawn || other.base == instigator || KFBulletWhipAttachment(other) != none)
return;
pcClientMessage(other.name);
// pcClientMessage(""@GetPropertyText(StaticMeshActor(other).StaticMesh.Materials[0].Material));
// pcClientMessage(""@GetPropertyText(StaticMeshActor(other).StaticMesh.Materials);
pcClientMessage(""@StaticMeshActor(other).StaticMesh.GetPropertyText("Materials"));
destroy();
}
simulated singular function hitWall(vector hitNormal, actor wall)
{
pcClientMessage(wall.name@"Do I need this function at all?!");
if (StaticMeshActor(wall) != none)
{
pcClientMessage(StaticMeshActor(wall).StaticMesh.GetPropertyText("Materials"));
pcClientMessage(ReplaceText2(StaticMeshActor(wall).StaticMesh.GetPropertyText("Materials"), "true", "false"));
pcClientMessage(SetPropertyText("Materials",ReplaceText2(StaticMeshActor(wall).StaticMesh.GetPropertyText("Materials"), "true", "false")));
}
spawn(impactEffect, , , location, rotator(-hitNormal));
destroy();
}
static final function string ReplaceText2(coerce string Text, coerce string Replace, coerce string With)
{
local int i;
local string Output;
i = InStr(Text, Replace);
while (i != -1)
{
Output = Output $ Left(Text, i) $ With;
Text = Mid(Text, i + Len(Replace));
i = InStr(Text, Replace);
}
Output = Output $ Text;
return Output;
}
// Referencers of Struct Engine.StaticMesh.StaticMeshMaterial:
// ObjectProperty Engine.StaticMesh.StaticMeshMaterial.Material
// BoolProperty Engine.StaticMesh.StaticMeshMaterial.EnableCollision
// StructProperty Engine.StaticMesh.Materials.StructProperty0
// Can't save HideMut.u: Graph is linked to external private object Struct Engine.StaticMesh.StaticMeshMaterial
// History: UObject::SavePackage <- UMakeCommandlet::Main
defaultproperties
{
}

View file

@ -0,0 +1,27 @@
class proj_PickActor extends KFMod.ShotgunBullet;
var a_VisibilityHandler a_visibilityHandler;
simulated singular function hitWall(vector hitNormal, actor wall)
{
if (wall.mesh != none || wall.staticMesh != none)
{
if ((wall.bNoDelete || wall.bStatic) && !wall.bDeleteMe)
a_visibilityHandler.pickActorWithProjectile(wall);
else
a_visibilityHandler.logMessage(a_visibilityHandler.getActorName(wall)@"can't be hided because this actor can be destroyed any time.");
spawn(impactEffect, , , location, rotator(-hitNormal));
destroy();
}
if (LevelInfo(wall) != none)
{
spawn(impactEffect, , , location, rotator(-hitNormal));
destroy();
}
}
defaultproperties
{
}

View file

@ -0,0 +1,44 @@
class repl_Console extends KFConsole;
// =============================================================================
// ANTI-SPAM !!!
// =============================================================================
// remove text spam
// XInterface.ExtendedConsole
function Chat(coerce string Msg, float MsgLife, PlayerReplicationInfo PRI)
{
local int index;
// add word filtering
if (class'Settings'.static.bIsWordBanned(Msg))
return;
// convert cyrilic into barbaric
Msg = class'o_CyrillicEncodeUtilities'.static.EnCodeStringHide(Msg);
Message(Msg, MsgLife); // For compatibility
Index = ChatMessages.Length;
ChatMessages.Length = Index+1;
ChatMessages[Index].Message = Msg;
if (PRI != none && PRI.Team!=none)
ChatMessages[Index].Team = PRI.Team.TeamIndex;
else
ChatMessages[Index].Team = 2;
if (!bTeamChatOnly || PRI == none || PRI.Team == none || PRI.Team == ViewportOwner.Actor.PlayerReplicationInfo.Team)
{
OnChat(Msg, ChatMessages[Index].team);
OnChatMessage(Msg);
}
if (ChatMessages.Length > 100)
ChatMessages.Remove(0, 1);
}
defaultproperties
{
}

View file

@ -0,0 +1,70 @@
class repl_FlameTendril extends FlameTendril;
// remove flamer flaming effects
// KFMod.FlameTendril
simulated function PostBeginPlay()
{
SetTimer(0.2, true);
// ADDITION!!!
// turn off pulsating lights, perf +++
bDynamicLight = false;
LightType = LT_None;
Velocity = Speed * Vector(Rotation);
// ADDITION!!! switch to shut it off
if (Level.NetMode != NM_DedicatedServer && !class'Settings'.default.bHideFlamethrowerEffects)
{
if (!PhysicsVolume.bWaterVolume)
{
FlameTrail = spawn(class'FlameThrowerFlameB', self);
Trail = spawn(class'FlameThrowerFlame', self);
}
}
Velocity.z += TossZ;
}
// remove flamer flaming effects
// KFMod.FlameTendril
simulated function PostNetBeginPlay()
{
super(ShotgunBullet).PostNetBeginPlay();
if (Level.NetMode == NM_DedicatedServer)
return;
// ADDITION!!! removed old code
// have to do this light hack since ProcessTouch() is not simulated
// and we can't prevent spawning of zed burning flame effect
// at least no pulsing shit with -10-50fps
bDynamicLight = false;
LightType = LT_None;
}
// remove flamer flaming effects
// KFMod.FlameTendril
simulated function Explode(vector HitLocation,vector HitNormal)
{
if (Role == ROLE_Authority)
HurtRadius(Damage, DamageRadius, MyDamageType, MomentumTransfer, HitLocation);
// ADDITION!!! emitter-effect toggle
if (KFHumanPawn(Instigator) != none && !class'Settings'.default.bHideFlamethrowerEffects)
{
if (EffectIsRelevant(Location,false))
{
Spawn(ExplosionDecal,self,,Location, rotator(-HitNormal));
Spawn(class'FuelFlame',self,,Location);
}
}
SetCollisionSize(0.0, 0.0);
Destroy();
}
defaultproperties
{
}

View file

@ -0,0 +1,89 @@
class repl_GT extends KFStoryGameInfo;
// we have some SteamStatsAndAchievements none errors on game startup
// Engine.GameInfo
event PostLogin(PlayerController NewPlayer)
{
local class<HUD> HudClass;
local class<Scoreboard> ScoreboardClass;
if (!bIsSaveGame)
{
// Log player's login.
if (GameStats != none)
{
GameStats.ConnectEvent(NewPlayer.PlayerReplicationInfo);
GameStats.GameEvent("NameChange",NewPlayer.PlayerReplicationInfo.playername,NewPlayer.PlayerReplicationInfo);
}
if (!bDelayedStart)
{
// start match, or let player enter, immediately
bRestartLevel = false; // let player spawn once in levels that must be restarted after every death
if (bWaitingToStartMatch)
StartMatch();
else
RestartPlayer(newPlayer);
bRestartLevel = default.bRestartLevel;
}
}
// tell client what hud and scoreboard to use
if (HUDType == "")
log("No HUDType specified in GameInfo", 'Log');
else
{
HudClass = class<HUD>(DynamicLoadObject(HUDType, class'Class'));
if (HudClass == none)
log("Can't find HUD class "$HUDType, 'Error');
}
if (ScoreBoardType != "")
{
ScoreboardClass = class<Scoreboard>(DynamicLoadObject(ScoreBoardType, class'Class'));
if (ScoreboardClass == none)
log("Can't find ScoreBoard class "$ScoreBoardType, 'Error');
}
NewPlayer.ClientSetHUD(HudClass, ScoreboardClass);
SetWeaponViewShake(NewPlayer);
if (bIsSaveGame)
return;
if (NewPlayer.Pawn != none)
NewPlayer.Pawn.ClientSetRotation(NewPlayer.Pawn.Rotation);
if (VotingHandler != none)
VotingHandler.PlayerJoin(NewPlayer);
if (AccessControl != none)
NewPlayer.LoginDelay = AccessControl.LoginDelaySeconds;
// hmmm, maybe we can set netspeed here?
NewPlayer.ClientCapBandwidth(NewPlayer.Player.CurrentNetSpeed);
NotifyLogin(NewPlayer.PlayerReplicationInfo.PlayerID);
if (Level.NetMode != NM_Client)
{
NewPlayer.SteamStatsAndAchievements = spawn(NewPlayer.default.SteamStatsAndAchievementsClass, NewPlayer);
// ADDITION!!! none check
if (NewPlayer.SteamStatsAndAchievements != none && !NewPlayer.SteamStatsAndAchievements.Initialize(NewPlayer))
{
NewPlayer.SteamStatsAndAchievements.destroy();
NewPlayer.SteamStatsAndAchievements = none;
}
}
log("New Player" @ NewPlayer.PlayerReplicationInfo.PlayerName @ "id=" $ NewPlayer.GetPlayerIDHash());
}
defaultproperties
{
GameName="Dummy Floor"
Description="Dummy Floor for tests"
Acronym="KF"
}

View file

@ -0,0 +1,42 @@
class repl_InternetPage extends KFServerListPageInternet;
// game startup: (Function KFGui.KFServerListPageInternet.GameTypeChanged:0081) Accessed none 'li_Server'
// KFGui.KFServerListPageInternet
function GameTypeChanged(UT2K4Browser_ServersList NewList)
{
local int i;
if (NewList != none)
{
if (li_Server != none)
{
li_Server.OnChange = none;
li_Server.StopPings();
li_Server.SetAnchor(none);
}
lb_Server.InitBaseList(NewList);
}
CurrentGameType = Browser.co_GameType.GetText();
// ADDITION!!! none check
if (li_Server != none)
li_Server.Clear();
// Display any found servers of the current game type
for (i = 0; i < AllServers.Length; i++)
{
if (AllServers[i].GameType == CurrentGameType || InterchangeableGameTypes(AllServers[i].GameType,CurrentGameType) || Browser.co_GameType.GetComponentValue() == KFServerBrowser(Browser).AllTypesClassName)
{
DisplayServers(AllServers[i]);
}
}
InitServerList();
}
defaultproperties
{
}

View file

@ -0,0 +1,235 @@
class repl_KFSStats extends KFSteamStatsAndAchievements;
// unlock DLC weapons
// ROEngine.KFSteamStatsAndAchievements
simulated event OnStatsAndAchievementsReady()
{
local int i;
GetStatInt(DamageHealedStat, SteamNameStat[KFSTAT_DamageHealed]);
SavedDamageHealedStat = DamageHealedStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_DamageHealed, DamageHealedStat.Value);
GetStatInt(WeldingPointsStat, SteamNameStat[KFSTAT_WeldingPoints]);
SavedWeldingPointsStat = WeldingPointsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_WeldingPoints, WeldingPointsStat.Value);
GetStatInt(ShotgunDamageStat, SteamNameStat[KFSTAT_ShotgunDamage]);
SavedShotgunDamageStat = ShotgunDamageStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_ShotgunDamage, ShotgunDamageStat.Value);
GetStatInt(HeadshotKillsStat, SteamNameStat[KFSTAT_HeadshotKills]);
SavedHeadshotKillsStat = HeadshotKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_HeadshotKills, HeadshotKillsStat.Value);
GetStatInt(StalkerKillsStat, SteamNameStat[KFSTAT_StalkerKills]);
SavedStalkerKillsStat = StalkerKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_StalkerKills, StalkerKillsStat.Value);
GetStatInt(BullpupDamageStat, SteamNameStat[KFSTAT_BullpupDamage]);
SavedBullpupDamageStat = BullpupDamageStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_BullpupDamage, BullpupDamageStat.Value);
GetStatInt(MeleeDamageStat, SteamNameStat[KFSTAT_MeleeDamage]);
SavedMeleeDamageStat = MeleeDamageStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_MeleeDamage, MeleeDamageStat.Value);
GetStatInt(FlameThrowerDamageStat, SteamNameStat[KFSTAT_FlameThrowerDamage]);
SavedFlameThrowerDamageStat = FlameThrowerDamageStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_FlameThrowerDamage, FlameThrowerDamageStat.Value);
GetStatInt(ExplosivesDamageStat, SteamNameStat[KFSTAT_ExplosivesDamage]);
SavedExplosivesDamageStat = ExplosivesDamageStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_ExplosivesDamage, ExplosivesDamageStat.Value);
GetStatInt(SelfHealsStat, SteamNameStat[KFSTAT_SelfHeals]);
SavedSelfHealsStat = SelfHealsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_SelfHeals, SelfHealsStat.Value);
GetStatInt(SoleSurvivorWavesStat, SteamNameStat[KFSTAT_SoleSurvivorWaves]);
SavedSoleSurvivorWavesStat = SoleSurvivorWavesStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_SoleSurvivorWaves, SoleSurvivorWavesStat.Value);
GetStatInt(CashDonatedStat, SteamNameStat[KFSTAT_CashDonated]);
SavedCashDonatedStat = CashDonatedStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_CashDonated, CashDonatedStat.Value);
GetStatInt(FeedingKillsStat, SteamNameStat[KFSTAT_FeedingKills]);
SavedFeedingKillsStat = FeedingKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_FeedingKills, FeedingKillsStat.Value);
GetStatInt(BurningCrossbowKillsStat, SteamNameStat[KFSTAT_BurningCrossbowKills]);
SavedBurningCrossbowKillsStat = BurningCrossbowKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_BurningCrossbowKills, BurningCrossbowKillsStat.Value);
GetStatInt(GibbedFleshpoundsStat, SteamNameStat[KFSTAT_GibbedFleshpounds]);
SavedGibbedFleshpoundsStat = GibbedFleshpoundsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_GibbedFleshpounds, GibbedFleshpoundsStat.Value);
GetStatInt(StalkersKilledWithExplosivesStat, SteamNameStat[KFSTAT_StalkersKilledWithExplosives]);
SavedStalkersKilledWithExplosivesStat = StalkersKilledWithExplosivesStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_StalkersKilledWithExplosives, StalkersKilledWithExplosivesStat.Value);
GetStatInt(GibbedEnemiesStat, SteamNameStat[KFSTAT_GibbedEnemies]);
SavedGibbedEnemiesStat = GibbedEnemiesStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_GibbedEnemies, GibbedEnemiesStat.Value);
GetStatInt(SirensKilledWithExplosivesStat, SteamNameStat[KFSTAT_SirensKilledWithExplosives]);
SavedSirensKilledWithExplosivesStat = SirensKilledWithExplosivesStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_SirensKilledWithExplosives, SirensKilledWithExplosivesStat.Value);
GetStatInt(BloatKillsStat, SteamNameStat[KFSTAT_BloatKills]);
SavedBloatKillsStat = BloatKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_BloatKills, BloatKillsStat.Value);
GetStatFloat(TotalZedTimeStat, SteamNameStat[KFSTAT_TotalZedTime]);
SavedTotalZedTimeStat = TotalZedTimeStat.Value;
PCOwner.ServerInitializeSteamStatFloat(KFSTAT_TotalZedTime, TotalZedTimeStat.Value);
GetStatInt(SirenKillsStat, SteamNameStat[KFSTAT_SirenKills]);
SavedSirenKillsStat = SirenKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_SirenKills, SirenKillsStat.Value);
GetStatInt(KillsStat, SteamNameStat[KFSTAT_Kills]);
SavedKillsStat = KillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_Kills, KillsStat.Value);
GetStatInt(DemolitionsPipebombKillsStat, SteamNameStat[KFSTAT_DemolitionsPipebombKills]);
SavedDemolitionsPipebombKillsStat = DemolitionsPipebombKillsStat.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_DemolitionsPipebombKills, DemolitionsPipebombKillsStat.Value);
GetStatInt(EnemiesGibbedWithM79, SteamNameStat[KFSTAT_EnemiesGibbedWithM79]);
SavedEnemiesGibbedWithM79 = EnemiesGibbedWithM79.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesGibbedWithM79, EnemiesGibbedWithM79.Value);
GetStatInt(EnemiesKilledWithSCAR, SteamNameStat[KFSTAT_EnemiesKilledWithSCAR]);
SavedEnemiesKilledWithSCAR = EnemiesKilledWithSCAR.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithSCAR, EnemiesKilledWithSCAR.Value);
GetStatInt(TeammatesHealedWithMP7, SteamNameStat[KFSTAT_TeammatesHealedWithMP7]);
SavedTeammatesHealedWithMP7 = TeammatesHealedWithMP7.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_TeammatesHealedWithMP7, TeammatesHealedWithMP7.Value);
GetStatInt(FleshpoundsKilledWithAA12, SteamNameStat[KFSTAT_FleshpoundsKilledWithAA12]);
SavedFleshpoundsKilledWithAA12 = FleshpoundsKilledWithAA12.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_FleshpoundsKilledWithAA12, FleshpoundsKilledWithAA12.Value);
GetStatInt(CrawlersKilledInMidair, SteamNameStat[KFSTAT_CrawlersKilledInMidair]);
SavedCrawlersKilledInMidair = CrawlersKilledInMidair.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_CrawlersKilledInMidair, CrawlersKilledInMidair.Value);
GetStatInt(Mac10BurnDamage, SteamNameStat[KFSTAT_Mac10BurnDamage]);
SavedMac10BurnDamage = Mac10BurnDamage.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_Mac10BurnDamage, Mac10BurnDamage.Value);
GetStatInt(DroppedTier3Weapons, SteamNameStat[KFSTAT_DroppedTier3Weapons]);
SavedDroppedTier3Weapons = DroppedTier3Weapons.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_DroppedTier3Weapons, DroppedTier3Weapons.Value);
GetStatInt(HalloweenKills, SteamNameStat[KFSTAT_HalloweenKills]);
SavedHalloweenKills = HalloweenKills.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_HalloweenKills, HalloweenKills.Value);
GetStatInt(HalloweenScrakeKills, SteamNameStat[KFSTAT_HalloweenScrakeKills]);
SavedHalloweenScrakeKills = HalloweenScrakeKills.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_HalloweenScrakeKills, HalloweenScrakeKills.Value);
GetStatInt(XMasHusksKilledWithHuskCannon, SteamNameStat[KFSTAT_XMasHusksKilledWithHuskCannon]);
SavedXMasHusksKilledWithHuskCannon = XMasHusksKilledWithHuskCannon.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_XMasHusksKilledWithHuskCannon, XMasHusksKilledWithHuskCannon.Value);
GetStatInt(XMasPointsHealedWithMP5, SteamNameStat[KFSTAT_XMasPointsHealedWithMP5]);
SavedXMasPointsHealedWithMP5 = XMasPointsHealedWithMP5.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_XMasPointsHealedWithMP5, XMasPointsHealedWithMP5.Value);
GetStatInt(EnemiesKilledWithFNFal, SteamNameStat[KFSTAT_EnemiesKilledWithFNFal]);
SavedEnemiesKilledWithFNFal = EnemiesKilledWithFNFal.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithFNFal, EnemiesKilledWithFNFal.Value);
GetStatInt(EnemiesKilledWithBullpup, SteamNameStat[KFSTAT_EnemiesKilledWithBullpup]);
SavedEnemiesKilledWithBullpup = EnemiesKilledWithBullpup.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithBullpup, EnemiesKilledWithBullpup.Value);
GetStatInt(ZedSetFireWithTrenchOnHillbilly, SteamNameStat[KFSTAT_EnemiesKilledWithTrenchOnHillbilly]);
SavedZedSetFireWithTrenchOnHillbilly = ZedSetFireWithTrenchOnHillbilly.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledWithTrenchOnHillbilly, ZedSetFireWithTrenchOnHillbilly.Value);
GetStatInt(ZedKilledDuringHillbilly, SteamNameStat[KFSTAT_EnemiesKilledDuringHillbilly]);
SavedZedKilledDuringHillbilly = ZedKilledDuringHillbilly.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_EnemiesKilledDuringHillbilly, ZedKilledDuringHillbilly.Value);
GetStatInt(HillbillyAchievementsCompleted, SteamNameStat[KFSTAT_HillbillyAchievementsCompleted]);
SavedHillbillyAchievementsCompleted = HillbillyAchievementsCompleted.Value;
PCOwner.ServerInitializeSteamStatInt(KFSTAT_HillbillyAchievementsCompleted, HillbillyAchievementsCompleted.Value);
GetStatInt(Stat46, SteamNameStat[KFSTAT_Stat46]);
PCOwner.ServerInitializeSteamStatInt(KFSTAT_Stat46, Stat46.Value);
GetEventCommand();
GetStatInt(FleshPoundsKilledWithAxe, SteamNameStat[KFSTAT_FleshPoundsKilledWithAxe]);
PCOwner.ServerInitializeSteamStatInt(KFSTAT_FleshPoundsKilledWithAxe, FleshPoundsKilledWithAxe.Value);
GetStatInt(ZedsKilledWhileAirborne, SteamNameStat[KFSTAT_ZedsKilledWhileAirborne]);
PCOwner.ServerInitializeSteamStatInt(KFSTAT_ZedsKilledWhileAirborne, ZedsKilledWhileAirborne.Value);
GetStatInt(ZEDSKilledWhileZapped, SteamNameStat[KFSTAT_ZEDSKilledWhileZapped]);
PCOwner.ServerInitializeSteamStatInt(KFSTAT_ZEDSKilledWhileZapped, ZEDSKilledWhileZapped.Value);
EnemiesKilledWithMKB42NoReload = 0;
StalkersKilledWithNail = 0;
HillbillyCrawlerKills = 0;
HillbillysKilledIn10Secs = 0;
HillbillySKilledIn10SecsTime = 0;
HillbillyGorefastsOnFire = 0;
HuskAndZedOneShotTotalKills = 0;
HuskAndZedOneShotZedKills = 0;
ZedsKilledInZedTime = 0;
HeadShottedMonsters.Remove( 0, HeadShottedMonsters.Length );
SpeciesKilledWithBile.Remove( 0, SpeciesKilledWithBile.Length );
// EDITED!!! DLC UNLOCK
InitStatInt(OwnedWeaponDLC, 4095);
PCOwner.ServerInitializeSteamStatInt(200, 4095);
// InitStatInt(OwnedWeaponDLC, GetOwnedWeaponDLC());
// PCOwner.ServerInitializeSteamStatInt(KFSTAT_OwnedWeaponDLC, OwnedWeaponDLC.Value);
// Check which Perks are available on Client
InitializePerks();
CheckMedicPerks(false);
CheckSupportPerks(false);
CheckSharpshooterPerks(false);
CheckCommandoPerks(false);
CheckBerserkerPerks(false);
CheckFirebugPerks(false);
CheckDemolitionsPerks(false);
// Achievements[i].bCompleted = byte(GetAchievementCompleted(Achievements[i].SteamName));
// use these functions to call out to the server to make sure the servers know if the achievements
// have been gotten or not
GetAchievementCompleted(Achievements[131].SteamName);
GetAchievementCompleted(Achievements[155].SteamName);
GetAchievementCompleted(Achievements[162].SteamName);
GetAchievementCompleted(Achievements[193].SteamName);
GetAchievementCompleted(Achievements[202].SteamName);
GetAchievementCompleted(Achievements[208].SteamName);
for (i = 0; i < Achievements.Length; i++)
{
Achievements[i].bCompleted = byte(GetAchievementCompleted(Achievements[i].SteamName));
GetAchievementDescription(Achievements[i].SteamName, Achievements[i].DisplayName, Achievements[i].Description);
}
CheckHillbillyAchievementsCompleted();
UpdateAchievementProgress();
super(SteamStatsAndAchievementsBase).OnStatsAndAchievementsReady();
}
defaultproperties
{
}

View file

@ -0,0 +1,76 @@
class repl_LAWProj extends LAWProj;
simulated function Explode(vector HitLocation, vector HitNormal)
{
local Controller C;
local PlayerController LocalPlayer;
bHasExploded = true;
// Don't explode if this is a dud
if (bDud)
{
Velocity = vect(0,0,0);
LifeSpan=1.0;
SetPhysics(PHYS_Falling);
}
PlaySound(ExplosionSound,,2.0);
if (!class'Settings'.default.bRemoveSmoke && EffectIsRelevant(Location,false) )
{
Spawn(class'KFMod.LawExplosion',,,HitLocation + HitNormal*20,rotator(HitNormal));
Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
}
BlowUp(HitLocation);
Destroy();
// Shake nearby players screens
LocalPlayer = Level.GetLocalPlayerController();
if ((LocalPlayer != none) && (VSize(Location - LocalPlayer.ViewTarget.Location) < DamageRadius))
LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
for (C=Level.ControllerList; C!=none; C=C.NextController)
if ((PlayerController(C) != none) && (C != LocalPlayer)
&& (VSize(Location - PlayerController(C).ViewTarget.Location) < DamageRadius))
C.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
}
simulated function PostBeginPlay()
{
local rotator SmokeRotation;
BCInverse = 1 / BallisticCoefficient;
if (!class'Settings'.default.bRemoveSmoke && Level.NetMode != NM_DedicatedServer)
{
SmokeTrail = Spawn(class'PanzerfaustTrail',self);
SmokeTrail.SetBase(self);
SmokeRotation.Pitch = 32768;
SmokeTrail.SetRelativeRotation(SmokeRotation);
//Corona = Spawn(class'KFMod.KFLAWCorona',self);
}
OrigLoc = Location;
if (!bDud)
{
Dir = vector(Rotation);
Velocity = speed * Dir;
}
if (PhysicsVolume.bWaterVolume)
{
bHitWater = true;
Velocity=0.6*Velocity;
}
super(Projectile).PostBeginPlay();
}
defaultproperties
{
}

View file

@ -0,0 +1,75 @@
class repl_M79Proj extends M79GrenadeProjectile;
simulated function Explode(vector HitLocation, vector HitNormal)
{
local Controller C;
local PlayerController LocalPlayer;
bHasExploded = true;
// Don't explode if this is a dud
if (bDud)
{
Velocity = vect(0,0,0);
LifeSpan=1.0;
SetPhysics(PHYS_Falling);
}
PlaySound(ExplosionSound,,2.0);
if (!class'Settings'.default.bRemoveSmoke && EffectIsRelevant(Location,false))
{
Spawn(class'KFMod.KFNadeLExplosion',,,HitLocation + HitNormal*20,rotator(HitNormal));
Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
}
BlowUp(HitLocation);
Destroy();
// Shake nearby players screens
LocalPlayer = Level.GetLocalPlayerController();
if ((LocalPlayer != none) && (VSize(Location - LocalPlayer.ViewTarget.Location) < DamageRadius))
LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
for (C=Level.ControllerList; C!=none; C=C.NextController)
if ((PlayerController(C) != none) && (C != LocalPlayer)
&& (VSize(Location - PlayerController(C).ViewTarget.Location) < DamageRadius) )
C.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
}
simulated function PostBeginPlay()
{
local rotator SmokeRotation;
BCInverse = 1 / BallisticCoefficient;
if (!class'Settings'.default.bRemoveSmoke && Level.NetMode != NM_DedicatedServer)
{
SmokeTrail = Spawn(class'PanzerfaustTrail',self);
SmokeTrail.SetBase(self);
SmokeRotation.Pitch = 32768;
SmokeTrail.SetRelativeRotation(SmokeRotation);
// Corona = Spawn(class'KFMod.KFLAWCorona',self);
}
OrigLoc = Location;
if (!bDud)
{
Dir = vector(Rotation);
Velocity = speed * Dir;
}
if (PhysicsVolume.bWaterVolume)
{
bHitWater = true;
Velocity=0.6*Velocity;
}
super(Projectile).PostBeginPlay();
}
defaultproperties
{
}

View file

@ -0,0 +1,15 @@
class repl_MOTD extends KFGui.KFMOTD;
// do not let ourselves to start
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
super(UT2K4Browser_MOTD).InitComponent(MyController, MyOwner);
// the "Destroy" function
free();
}
defaultproperties
{
}

View file

@ -0,0 +1,135 @@
class repl_Monster extends KFMonster;
// =============================================================================
// STOP THE FLAMES !!!
// =============================================================================
// block the whole code, becuase i dont give a fuck about flame effects
// KFMod.KFMonster
simulated function StartBurnFX()
{
local class<emitter> Effect;
// ADDITION!!!
if (bDeleteMe || class'Settings'.default.bHideZedFlames)
return;
// No real flames when low gore, make them smoke, smoking kills
if (class'GameInfo'.static.UseLowGore())
Effect = AltBurnEffect;
else
Effect = BurnEffect;
if (FlamingFXs == none)
FlamingFXs = spawn(Effect);
FlamingFXs.SetBase(self);
FlamingFXs.Emitters[0].SkeletalMeshActor = self;
FlamingFXs.Emitters[0].UseSkeletalLocationAs = PTSU_SpawnOffset;
AttachEmitterEffect(Effect, HeadBone, Location, Rotation);
bBurnApplied = true;
}
// =============================================================================
// BURNING ANIMATION FIX !!!
// =============================================================================
// maybe we can set normal animations for us and get normal headshots? maybe!
// KFMod.KFMonster
simulated function SetBurningBehavior()
{
// cant use this part but let's keep it
if (Role == Role_Authority)
{
Intelligence = BRAINS_Retarded;
SetGroundSpeed(OriginalGroundSpeed * 0.8);
AirSpeed *= 0.8;
WaterSpeed *= 0.8;
// Make them less accurate while they are burning
if (Controller != none)
{
MonsterController(Controller).Accuracy = -5;
}
}
// ADDITION!!!
if (class'Settings'.default.bRemoveShitAnimations)
{
// restore regular anims, just to be sure
// not using for loop, coz it's crashing me somehow...
MovementAnims[0] = default.MovementAnims[0];
WalkAnims[0] = default.WalkAnims[0];
MovementAnims[1] = default.MovementAnims[1];
WalkAnims[1] = default.WalkAnims[1];
MovementAnims[2] = default.MovementAnims[2];
WalkAnims[2] = default.WalkAnims[2];
MovementAnims[3] = default.MovementAnims[3];
WalkAnims[3] = default.WalkAnims[3];
}
// vanilla bullshit
else
{
MovementAnims[0] = BurningWalkFAnims[Rand(3)];
WalkAnims[0] = BurningWalkFAnims[Rand(3)];
MovementAnims[1] = BurningWalkAnims[0];
WalkAnims[1] = BurningWalkAnims[0];
MovementAnims[2] = BurningWalkAnims[1];
WalkAnims[2] = BurningWalkAnims[1];
MovementAnims[3] = BurningWalkAnims[2];
WalkAnims[3] = BurningWalkAnims[2];
}
}
// Set the zed to the zapped behavior
// KFMod.KFMonster
simulated function SetZappedBehavior()
{
if (Role == Role_Authority)
{
Intelligence = BRAINS_Retarded; // burning dumbasses!
SetGroundSpeed(OriginalGroundSpeed * ZappedSpeedMod);
AirSpeed *= ZappedSpeedMod;
WaterSpeed *= ZappedSpeedMod;
// Make them less accurate while they are burning
if (Controller != none)
{
MonsterController(Controller).Accuracy = -5; // More chance of missing. (he's burning now, after all) :-D
}
}
// ADDITION!!!
if (class'Settings'.default.bRemoveShitAnimations)
{
// ADDITION!!!
// restore regular anims, just to be sure
// not using for loop, coz it's crashing me somehow...
MovementAnims[0] = default.MovementAnims[0];
WalkAnims[0] = default.WalkAnims[0];
MovementAnims[1] = default.MovementAnims[1];
WalkAnims[1] = default.WalkAnims[1];
MovementAnims[2] = default.MovementAnims[2];
WalkAnims[2] = default.WalkAnims[2];
MovementAnims[3] = default.MovementAnims[3];
WalkAnims[3] = default.WalkAnims[3];
}
// vanilla bullshit
else
{
MovementAnims[0] = BurningWalkFAnims[Rand(3)];
MovementAnims[1] = BurningWalkAnims[0];
WalkAnims[1] = BurningWalkAnims[0];
MovementAnims[2] = BurningWalkAnims[1];
WalkAnims[2] = BurningWalkAnims[1];
MovementAnims[3] = BurningWalkAnims[2];
WalkAnims[3] = BurningWalkAnims[2];
}
}
defaultproperties
{
}

View file

@ -0,0 +1,39 @@
class repl_Nade extends Nade;
// remove smoke effects
simulated function Explode(vector HitLocation, vector HitNormal)
{
local PlayerController LocalPlayer;
local Projectile P;
local byte i;
bHasExploded = true;
BlowUp(HitLocation);
PlaySound(ExplodeSounds[rand(ExplodeSounds.length)],,2.0);
// Shrapnel
for (i = Rand(6); i < 10; i++)
{
P = Spawn(ShrapnelClass,,,,RotRand(true));
if (P != none)
P.RemoteRole = ROLE_None;
}
if (!class'Settings'.default.bRemoveSmoke && EffectIsRelevant(Location,false))
{
Spawn(Class'KFmod.KFNadeExplosion',,, HitLocation, rotator(vect(0,0,1)));
Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
}
// Shake nearby players screens
LocalPlayer = Level.GetLocalPlayerController();
if ((LocalPlayer != none) && (VSize(Location - LocalPlayer.ViewTarget.Location) < (DamageRadius * 1.5)))
LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
Destroy();
}
defaultproperties
{
}

View file

@ -0,0 +1,302 @@
// stub KFPlayerController for hooks
class repl_PC extends KFPlayerController_Story;
// =========================================================
// empty function stub
simulated function noop(){}
// always true bool
simulated function bool bTrue()
{
return true;
}
// =========================================================
// auto netspeed 10001
simulated event PostNetReceive()
{
local xUtil.PlayerRecord rec;
super(UnrealPlayer).PostNetReceive();
if (PlayerReplicationInfo != none && bWaitingForPRI)
{
bWaitingForPRI = false;
rec = class'xUtil'.static.FindPlayerRecord(PlayerReplicationInfo.CharacterName);
if (rec.Species != none)
{
if (PlayerReplicationInfo.Team == none)
rec.Species.static.LoadResources(rec, Level, PlayerReplicationInfo, 255);
else
rec.Species.static.LoadResources(rec, Level, PlayerReplicationInfo, PlayerReplicationInfo.Team.TeamIndex);
}
// ADDITION!!! fps unlock
Player.Console.DelayedConsoleCommand("netspeed " $ 10001);
// auto `stat fps` / `stat net`
if (class'Settings'.default.bDeduceAdvancedInfo)
{
Player.Console.DelayedConsoleCommand("stat fps");
Player.Console.DelayedConsoleCommand("stat net");
}
// Handle auto Demo Recording
if (bAutoDemoRec && level.NetMode == NM_Client && !bDemoOwner)
Player.Console.DelayedConsoleCommand("demorec");
}
if (VoiceReplicationInfo != none && bWaitingForVRI)
{
if (PlayerReplicationInfo != none && !PlayerReplicationInfo.NeedNetNotify())
{
bWaitingForVRI = VoiceReplicationInfo.GetPublicChannelCount(true) == 0;
if (!bWaitingForVRI)
{
VoiceReplicationInfo.SetOwner(self);
if (bVoiceChatEnabled)
InitializeVoiceChat();
else
DisableVoiceChat();
}
}
}
bNetNotify = NeedNetNotify();
}
// change the HUD
// Engine.PlayerController
simulated function ClientSetHUD(class<HUD> newHUDClass, class<Scoreboard> newScoringClass)
{
if (myHUD != none)
myHUD.Destroy();
if (newHUDClass == none)
myHUD = none;
else
{
// inject our HUD class
class'repl_PC'.static.ReplaceHUDClass(newHUDClass);
myHUD = spawn(newHUDClass, self);
if (myHUD == none)
log ("PlayerController::ClientSetHUD(): Could not spawn a HUD of class "$newHUDClass, 'Error');
else
myHUD.SetScoreBoardClass( newScoringClass );
}
if (Level.Song != "" && Level.Song != "none")
ClientSetInitialMusic(Level.Song, MTRAN_Fade);
}
// currently only vanilla hud and steamy test map supported
final static function ReplaceHUDClass(out class<HUD> hud)
{
if (string(hud) ~= "KFMod.HUDKillingFloor" || string(hud) ~= "PerkTestMutV3.PTHUD")
{
hud = class'HideHUD';
// hud = class'SkeletonHUD';
log("HideHUD injected and active!!!");
}
}
// =========================================================
// zed time sound effect switch
simulated function CheckZEDMessage()
{
if (!bHadZED && !class'Settings'.default.bHideZedTimeSounds)
{
ReceiveLocalizedMessage(class'KFMod.WaitingMessage', 5);
bHadZED = true;
SaveConfig();
}
}
simulated function ClientEnterZedTime()
{
if (class'Settings'.default.bHideZedTimeSounds)
return;
CheckZEDMessage();
if ( Pawn != none && Pawn.Weapon != none )
Pawn.Weapon.PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Enter', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
else
PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Enter', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
}
simulated function ClientExitZedTime()
{
if (class'Settings'.default.bHideZedTimeSounds)
return;
if ( Pawn != none && Pawn.Weapon != none )
Pawn.Weapon.PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Exit', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
else
PlaySound(Sound'KF_PlayerGlobalSnd.Zedtime_Exit', SLOT_Talk, 2.0,false,500.0,1.1/Level.TimeDilation,false);
}
// =========================================================
// show lobby menu if we press Esc during pending game state
// Playercontroller
exec function ShowMenu()
{
local bool bCloseHUDScreen;
if (Level.GRI.bMatchHasBegun || PlayerReplicationInfo.bOnlySpectator)
{
if (MyHUD != None)
{
bCloseHUDScreen = MyHUD.bShowScoreboard || MyHUD.bShowLocalStats;
if (MyHUD.bShowScoreboard)
MyHUD.bShowScoreboard = false;
if (MyHUD.bShowLocalStats)
MyHUD.bShowLocalStats = false;
if (bCloseHUDScreen)
return;
}
ShowMidGameMenu(true);
}
// ADDITION!!! Open lobby menu at same time!
else
{
StopForceFeedback();
// this shit is an issue, find a way to set this
bPendingLobbyDisplay = false;
// ClientOpenMenu(LobbyMenuClassString);
if (Player != none)
ClientOpenMenu(LobbyMenuClassString);
}
}
// motherfucking idiots in TWI
// yet another <pawn is none> log spam fix
simulated function ShowLoginMenu()
{
// FIXED!!!
if (Pawn != none && ((Pawn.Health > 0) || (Pawn.PlayerReplicationInfo != none && Pawn.PlayerReplicationInfo.bReadyToPlay)))
return;
if (GameReplicationInfo != none)
{
// Open menu
ClientReplaceMenu(LobbyMenuClassString);
}
}
// The player wants to switch to weapon group number F.
exec function SwitchWeapon(byte F)
{
if (Pawn == none)
return;
if (class'a_WeaponManager'.default.bUseVanillaManagement)
Pawn.SwitchWeapon(F);
else
ConsoleCommand("hide_getWeapon " $ F);
}
// remove ambient shake
event SetAmbientShake(float FalloffStartTime, float FalloffTime, vector OffsetMag, float OffsetFreq, rotator RotMag, float RotFreq)
{
local float FalloffScaling;
local float CurrentOffsetMag;
// on-off switch
if (class'Settings'.default.bRemoveAmbientShake)
return;
// Calculate current shake's magnitude
if (AmbientShakeFalloffStartTime > 0)
{
FalloffScaling = 1.0 - ((Level.TimeSeconds - AmbientShakeFalloffStartTime) / AmbientShakeFalloffTime);
FalloffScaling = FClamp(FalloffScaling, 0.0, 1.0);
}
else
{
FalloffScaling = 1.0;
}
CurrentOffsetMag = VSize(AmbientShakeOffsetMag * FalloffScaling);
// If new shake is less than old shake just ignore it
if (VSize(OffsetMag) < CurrentOffsetMag)
{
return;
}
bEnableAmbientShake = true;
AmbientShakeFalloffStartTime = FalloffStartTime;
AmbientShakeFalloffTime = FalloffTime;
AmbientShakeOffsetMag = OffsetMag;
AmbientShakeOffsetFreq = OffsetFreq;
AmbientShakeRotMag = RotMag;
AmbientShakeRotFreq = RotFreq;
}
// remove whole shaking effect
function ShakeView(vector shRotMag, vector shRotRate, float shRotTime, vector shOffsetMag, vector shOffsetRate, float shOffsetTime)
{
// on-off switch
if (class'Settings'.default.bRemoveShakeView)
return;
if (VSize(shRotMag) > VSize(ShakeRotMax))
{
ShakeRotMax = shRotMag;
ShakeRotRate = shRotRate;
ShakeRotTime = shRotTime * vect(1,1,1);
}
if (VSize(shOffsetMag) > VSize(ShakeOffsetMax))
{
ShakeOffsetMax = shOffsetMag;
ShakeOffsetRate = shOffsetRate;
ShakeOffsetTime = shOffsetTime * vect(1,1,1);
}
}
function WeaponShakeView(vector shRotMag, vector shRotRate, float shRotTime, vector shOffsetMag, vector shOffsetRate, float shOffsetTime)
{
if (!class'Settings'.default.bRemoveWeaponShakeView && bWeaponViewShake)
ShakeView(shRotMag * (1.0 - ZoomLevel), shRotRate, shRotTime, shOffsetMag * (1.0 - ZoomLevel), shOffsetRate, shOffsetTime);
}
exec function ToggleBehindView()
{
local bool bWasBehindView;
bWasBehindView = bBehindView;
CameraDist = default.CameraDist;
if (bBehindView != bWasBehindView)
ViewTarget.POVChanged(self, true);
if (Vehicle(Pawn) != none)
{
Vehicle(Pawn).bDesiredBehindView = bWasBehindView;
Pawn.SaveConfig();
}
bBehindView = !bBehindView;
}
defaultproperties
{
}

View file

@ -0,0 +1,113 @@
// stub KFHumanPawn for hooks
class repl_Pawn extends KFHumanPawn_Story;
// =============================================================
// remove bile effects
simulated function DoHitCamEffects(vector HitDirection, float JarrScale, float BlurDuration, float JarDurationScale ){}
// remove burning effects
simulated function StartBurnFX(){}
// remove blur effect
simulated function AddBlur(Float BlurDuration, float Intensity)
{
if (class'Settings'.default.bRemoveBlur || KFPC == none)
return;
if (!bUsingHitBlur)
{
// If we can't handle the post processing shaders, just do an old style motion blur effect
if (bUseBlurEffect)
{
StartingBlurFadeOutTime = BlurDuration;
BlurFadeOutTime = StartingBlurFadeOutTime;
if (CurrentBlurIntensity < Intensity)
{
CurrentBlurIntensity = Intensity;
}
if (!KFPC.PostFX_IsReady())
{
if (CameraEffectFound == none)
{
FindCameraEffect(class 'KFmod.UnderWaterBlur');
}
UnderWaterBlur(CameraEffectFound).BlurAlpha = UnderWaterBlur(CameraEffectFound).default.BlurAlpha;
}
else
{
KFPC.SetBlur(CurrentBlurIntensity);
}
}
}
}
// PlayerReplicationInfo is none fix, sp (c)
simulated function tick(float DeltaTime)
{
super(KFPawn).tick(DeltaTime);
if (IsLocallyControlled() && !bUsingHitBlur && BlurFadeOutTime > 0)
{
BlurFadeOutTime -= DeltaTime;
DeltaTime = BlurFadeOutTime/StartingBlurFadeOutTime * CurrentBlurIntensity;
if (BlurFadeOutTime <= 0)
{
BlurFadeOutTime = 0;
StopHitCamEffects();
}
else if (bUseBlurEffect && KFPC!=none && !KFPC.PostFX_IsReady())
{
if (CameraEffectFound != none)
UnderWaterBlur(CameraEffectFound).BlurAlpha = Lerp(DeltaTime, 255, UnderWaterBlur(CameraEffectFound).default.BlurAlpha);
else
KFPC.SetBlur(DeltaTime);
}
}
}
// =============================================================
// commando skill for everyone
function bool ShowStalkers()
{
// yea, show em bitches
if (class'Settings'.default.bShowStalkers)
return true;
if (KFPlayerReplicationInfo(PlayerReplicationInfo) != none && KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill != none)
{
return KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill.Static.ShowStalkers(KFPlayerReplicationInfo(PlayerReplicationInfo));
}
return false;
}
function float GetStalkerViewDistanceMulti()
{
// yea, show em bitches
if (class'Settings'.default.bShowStalkers)
return 1.0;
if (KFPlayerReplicationInfo(PlayerReplicationInfo) != none && KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill != none)
{
return KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill.Static.GetStalkerViewDistanceMulti(KFPlayerReplicationInfo(PlayerReplicationInfo));
}
return 0.0;
}
// =============================================================
defaultproperties
{
}

View file

@ -0,0 +1,47 @@
class repl_PipeProj extends KFMod.PipeBombProjectile;
simulated function Explode(vector HitLocation, vector HitNormal)
{
local PlayerController LocalPlayer;
local Projectile P;
local byte i;
bHasExploded = true;
BlowUp(HitLocation);
bTriggered = true;
if (Role == ROLE_Authority)
{
SetTimer(0.1, false);
NetUpdateTime = Level.TimeSeconds - 1;
}
PlaySound(ExplodeSounds[rand(ExplodeSounds.length)],,2.0);
// Shrapnel
for (i = Rand(6); i < 10; i++)
{
P = Spawn(ShrapnelClass,,,,RotRand(true));
if (P != none)
P.RemoteRole = ROLE_None;
}
if (!class'Settings'.default.bRemoveSmoke && EffectIsRelevant(Location,false))
{
Spawn(Class'KFMod.KFNadeLExplosion',,, HitLocation, rotator(vect(0,0,1)));
Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
}
// Shake nearby players screens
LocalPlayer = Level.GetLocalPlayerController();
if ((LocalPlayer != none) && (VSize(Location - LocalPlayer.ViewTarget.Location) < (DamageRadius * 1.5)))
LocalPlayer.ShakeView(RotMag, RotRate, RotTime, OffsetMag, OffsetRate, OffsetTime);
if (Role < ROLE_Authority)
Destroy();
}
defaultproperties
{
}

View file

@ -0,0 +1,59 @@
class repl_ProjFlare extends FlareRevolverProjectile;
simulated function PostBeginPlay()
{
// if (Level.NetMode != NM_DedicatedServer && !PhysicsVolume.bWaterVolume)
// FlameTrail = Spawn(FlameTrailEmitterClass,self);
// turn off pulsating lights, perf +++
bDynamicLight = false;
LightType = LT_None;
OrigLoc = Location;
if (!bDud)
{
Dir = vector(Rotation);
Velocity = speed * Dir;
}
super(ROBallisticProjectile).PostBeginPlay();
}
simulated function Explode(vector HitLocation, vector HitNormal)
{
bHasExploded = true;
// Don't explode if this is a dud
if (bDud)
{
Velocity = vect(0,0,0);
LifeSpan = 1.0;
SetPhysics(PHYS_Falling);
}
PlaySound(ExplosionSound,,ExplosionSoundVolume);
// if (EffectIsRelevant(Location,false))
// {
// Spawn(ExplosionEmitter,,,HitLocation + HitNormal*20,rotator(HitNormal));
// Spawn(ExplosionDecal,self,,HitLocation, rotator(-HitNormal));
// }
BlowUp(HitLocation);
Destroy();
// let's remove our client code, server will try to do shaking anyways
}
// so we prevent shaking from this function
simulated function float GetShakeScale(vector ViewLocation, vector EventLocation)
{
return 0.0f;
}
defaultproperties
{
}

View file

@ -0,0 +1,37 @@
class repl_ServerBrowser extends KFServerBrowser;
// (Function GUI2K4.UT2k4ServerBrowser.InitComponent:0040) Accessed none 'ch_Standard'
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
super(UT2K4MainPage).InitComponent(MyController, MyOwner);
f_Browser = UT2K4Browser_Footer(t_Footer);
f_Browser.p_Anchor = self;
// ADDITION!!! none check
if (f_Browser.ch_Standard != none)
{
f_Browser.ch_Standard.OnChange = StandardOptionChanged;
f_Browser.ch_Standard.SetComponentValue(bStandardServersOnly, true);
}
if (FilterMaster == none)
{
FilterMaster = new(self) class'GUI2K4.BrowserFilters';
FilterMaster.InitCustomFilters();
}
if (FilterInfo == none)
FilterInfo = new(none) class'Engine.PlayInfo';
Background = MyController.DefaultPens[0];
InitializeGameTypeCombo();
co_GameType.MyComboBox.Edit.bCaptureMouse = true;
CreateTabs();
}
defaultproperties
{
}

View file

@ -0,0 +1,11 @@
class repl_proj_buzzsaw extends CrossbuzzsawBlade;
defaultproperties
{
MaxBounces=50
StraightFlightTime=10.000000
AmbientVolumeScale=0.000000
SoundVolume=0
SoundRadius=0.000000
TransientSoundVolume=0.000000
}