Skip to content

Commit

Permalink
New option in Audio Options: Disable Initial Dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
eezstreet committed Sep 13, 2016
1 parent 00c4dfa commit 5c1d779
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 57 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You can make a shortcut to these .bat files for more convenience.
# VERSION HISTORY #
### v2 ###
- New Feature: Speech Recognition. Enable it in Audio Options
- New Feature: Disable initial dispatch. Enable it in Audio Options
- You can now pick up guns through restrained suspects, and all hostages (except live, unrestrained ones)
- AI-controlled officers will now automatically report suspects/hostages that they restrain
- Fixed a bug that caused the Heavy Armor to have texture issues due to StaticLoadout.ini missing
Expand All @@ -32,16 +33,18 @@ You can make a shortcut to these .bat files for more convenience.
- MIRROR UNDER DOOR and CHECK FOR TRAPS now obeys the stack-up positioning and stacks up the squad on the door.
- Fixed: Children of Taronne has traps bolted onto incorrect bones
- Fixed: Children of Taronne has a trap on the wrong side
- Fixed: Missing drug rosters on Stetchkov Drug Lab
- 'Show Subtitles' moved to Audio Options
Files modified:
SP-Tenement.s4m
SpeechCommandGrammar.xml
CommandInterfaceMenus_SP.ini
PlayerInterface_Command_SP.ini
PlayerInterface_Use.ini
SoundEffects.ini
StaticLoadout.ini
SwatGui.ini
Content/Maps/SP-DrugLab.s4m
Content/Maps/SP-Tenement.s4m
System/SpeechCommandGrammar.xml
System/CommandInterfaceMenus_SP.ini
System/PlayerInterface_Command_SP.ini
System/PlayerInterface_Use.ini
System/SoundEffects.ini
System/StaticLoadout.ini
System/SwatGui.ini
Generated code

### v1 ###
Expand Down Expand Up @@ -180,6 +183,7 @@ Some of the changes are as follows.
- Fixed a bug where the music would get glitched
- 'Display Subtitles' moved to Audio Options
- 'Use Speech Recognition' option added to Audio Options
- 'Disable Initial Dispatch' option added to Audio Options


## EQUIPMENT ##
Expand Down
51 changes: 26 additions & 25 deletions Source/Game/SwatGame/Classes/HUD/HUDPageBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function OnConstruct(GUIController MyController)
local int i;

Super.OnConstruct(MyController);

Feedback = GUIFeedback(AddComponent("SwatGame.GUIFeedback", "HUDPage_feedback"));
AmmoStatus = GUIAmmoStatusBase(AddComponent("SwatGUI.GUIAmmoStatus", "HUDPage_ammostatus"));
FireMode = GUIFireMode(AddComponent("SwatGame.GUIFireMode", "HUDPage_FireMode"));
Expand Down Expand Up @@ -102,7 +102,7 @@ function InitComponent(GUIComponent MyOwner)
local int i;

Super.InitComponent(MyOwner);

for( i = 0; i < SequenceComponents.Length; i++ )
{
SequenceComponents[i].bRepeatCycling = false;
Expand Down Expand Up @@ -142,7 +142,7 @@ event Hide()

function PreLevelChangeCleanup()
{
GraphicCommandInterface.SetLogic( None );
GraphicCommandInterface.SetLogic( None );
}

function OnGameInit()
Expand All @@ -159,7 +159,7 @@ function OnGameStarted()
// Set this to true early, to make sure we block out input during the
// first 3 ticks.
bInCinematic=true;

NumTicks = 0;
}

Expand All @@ -172,7 +172,8 @@ function OnTick( float Delta )
if (NumTicks > 25/* && Controller.TopPage() == self*/)
{
if( SwatGUIControllerBase(Controller).GuiConfig.CurrentMission == None ||
SwatGUIControllerBase(Controller).GuiConfig.CurrentMission.CustomScenario != None )
SwatGUIControllerBase(Controller).GuiConfig.CurrentMission.CustomScenario != None ||
SwatGUIControllerBase(Controller).GetDispatchDisabled() )
FinishStartRoundSequence();
else
{
Expand Down Expand Up @@ -224,7 +225,7 @@ function StartEndRoundSequence()
RepositionComponents( MissionEndSequenceAName );
}

function FinishEndRoundSequence()
function FinishEndRoundSequence()
{
bInCinematic=false;
RepositionComponents( MissionEndSequenceBName );
Expand Down Expand Up @@ -264,7 +265,7 @@ protected function OpenComponents()
assert(false); //unexpected SwatGameRole
break;
}

OpenGenericComponents();
}

Expand All @@ -288,7 +289,7 @@ protected function CloseComponents()
assert(false); //unexpected SwatGameRole
break;
}

CloseGenericComponents();
}

Expand All @@ -298,7 +299,7 @@ protected function CloseComponents()
///////////////////////////////////////////////////////////////////////////////////////////////////////////

function OpenCinematicComponents()
{
{
local int i;

for( i = 0; i < SequenceComponents.Length; i++ )
Expand All @@ -308,9 +309,9 @@ function OpenCinematicComponents()
}

function CloseCinematicComponents()
{
{
local int i;

for( i = 0; i < SequenceComponents.Length; i++ )
{
SequenceComponents[i].Hide();
Expand Down Expand Up @@ -381,23 +382,23 @@ function OpenGenericComponents()
assert( Feedback != None );
Feedback.Show();
Feedback.RePosition('down', true); //ensure feedback always starts from down position

assert( AmmoStatus != None );
//updated in UpdateFireMode, below

assert( FireMode != None );
UpdateFireMode();

assert( DamageIndicator != None );
DamageIndicator.Reset();
DamageIndicator.Show();

assert( Overlay != None );
Overlay.Show();

assert( Progress != None );
Progress.Show();

assert( Reticle != None );
Reticle.Show();

Expand Down Expand Up @@ -431,13 +432,13 @@ function UpdateCIVisibility()

CurrentCommandInterface = SwatGamePlayerController(PlayerOwner()).GetCommandInterface();
CurrentInterfaceIsEnabled = CurrentCommandInterface != None && CurrentCommandInterface.Enabled;

CCIShown = SwatGUIControllerBase(Controller).GuiConfig.CurrentCommandInterfaceStyle == CommandInterface_Classic;
//log( self$"::UpdateCIVisibility() ... CCIShown = "$CCIShown$", CurrentCommandInterface = "$CurrentCommandInterface$", CurrentInterfaceIsEnabled = "$CurrentInterfaceIsEnabled );

assertWithDescription(CurrentCommandInterface == None || CurrentCommandInterface.IsA('ClassicCommandInterface') == CCIShown,
"[tcohen] HUDPageBase::UpdateCIVisibility() the GUIConfig and the GamePlayerController disagree about which CommandInterface is current.");

assert(ClassicCommandInterface != None);
ClassicCommandInterface.SetVisibility( CCIShown && CurrentInterfaceIsEnabled );

Expand All @@ -450,8 +451,8 @@ function UpdateCIVisibility()

assert(CommandInterfaceMenuPage != None);
CommandInterfaceMenuPage.SetVisibility(
CurrentInterfaceIsEnabled
&& !CCIShown
CurrentInterfaceIsEnabled
&& !CCIShown
&& (
SwatGUIControllerBase(Controller).GuiConfig.SwatGameRole == GAMEROLE_MP_Host
|| SwatGUIControllerBase(Controller).GuiConfig.SwatGameRole == GAMEROLE_MP_Client
Expand Down Expand Up @@ -527,7 +528,7 @@ simulated function UpdateFireMode()
// var private config array<FireMode> AvailableFireMode; //named in singular for simplicity of config file
//
//log("[FIRE MODE] The following FireModes are available for "$FiredWeapon.class.name$":");

CurrentFireMode = FiredWeapon.CurrentFireMode;

//FireMode.HideFireModes();
Expand All @@ -537,7 +538,7 @@ simulated function UpdateFireMode()
//}

FireMode.SelectFireMode( CurrentFireMode );

//log("[FIRE MODE] FireMode for "$FiredWeapon.class.name$" is now "$GetEnum(FiredWeapon.FireMode, CurrentFireMode));
}
}
Expand All @@ -563,7 +564,7 @@ function ResetDamageIndicator()
protected function RepositionComponents( name ToPos, optional bool Immediate )
{
local int i;

for( i = 0; i < Controls.Length; i++ )
{
Controls[i].RePosition( ToPos, Immediate );
Expand Down
38 changes: 20 additions & 18 deletions Source/Game/SwatGame/Classes/SwatGUIControllerBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,32 @@ import enum EMPMode from Engine.Repo;
// how long since we last polled
var private Float CumulativeDelta;

function bool GetDispatchDisabled();
function SetDispatchDisabled(bool newValue);

/////////////////////////////////////////////////////////////////////////////
// Initialization
/////////////////////////////////////////////////////////////////////////////
function InitializeController()
{
log("[dkaplan] >>> InitializeController of (SwatGUIControllerBase) "$self);

Campaigns = new( None ) class'SwatGame.Campaigns';
AssertWithDescription( Campaigns != None, "Campaigns could not be loaded!");
UseCampaign( Campaigns.CurCampaignName );

log("[dkaplan] ... ViewportOwner="$ViewportOwner$", ViewportOwner.Actor="$ViewportOwner.Actor$", ViewportOwner.Actor.GetEntryLevel()="$ViewportOwner.Actor.GetEntryLevel()$", ViewportOwner.Actor.GetEntryLevel().GetRepo()="$ViewportOwner.Actor.GetEntryLevel().GetRepo() );
log("[dkaplan] ... ViewportOwner="$ViewportOwner$", ViewportOwner.Actor="$ViewportOwner.Actor$", ViewportOwner.Actor.GetEntryLevel()="$ViewportOwner.Actor.GetEntryLevel()$", ViewportOwner.Actor.GetEntryLevel().GetRepo()="$ViewportOwner.Actor.GetEntryLevel().GetRepo() );
//set the repo
//set the repo
Repo = SwatRepo(ViewportOwner.Actor.GetEntryLevel().GetRepo());
AssertWithDescription( Repo != None, "[dkaplan]: The repo could not be retrieved by "$self$" in InitializeController()");
//cache easy reference to the GuiConfig
GuiConfig = Repo.GuiConfig;
AssertWithDescription( GuiConfig != None, "[dkaplan]: The GuiConfig could not be retrieved by "$self$" in InitializeController()");
Super.InitializeController();
//if we are initing as a net client, display the loading menu
if( Repo.bInitAsNetPlayer )
{
Expand Down Expand Up @@ -82,9 +84,9 @@ event OnTick( float Delta )
PollCoopQMMGUI();
return;
}
CumulativeDelta += Delta;
if( CumulativeDelta > GuiConfig.MPPollingDelay )
{
CumulativeDelta = 0;
Expand Down Expand Up @@ -252,14 +254,14 @@ final function OnDisconnected()
function Quit()
{
//may need to add saving info routines here
ConsoleCommand( "quit" );
ConsoleCommand( "quit" );
}

function GameStart()
{
//start of game hook
GuiConfig.SaveLastMissionPlayed();
LoadLevel( GuiConfig.CurrentMission.MapName );
LoadLevel( GuiConfig.CurrentMission.MapName );
}

function GameAbort()
Expand Down Expand Up @@ -339,7 +341,7 @@ function SetMPLoadOutPocketItem( Pocket Pocket, class<actor> Item )
//function NetGameCompleted()
//{
//send a message to the hud informing of the net game imminent completion
//send a message to the hud informing of the net game imminent completion
//log("[dkaplan] Net Game Has Been Completed!");
//}
Expand All @@ -353,7 +355,7 @@ function HudPageBase GetHUDPage()
if (HudPage == None)
{
HudPage = HUDPageBase(CreateComponent("SwatGui.HUDPage"));
if (!HudPage.bInited)
HudPage.InitComponent(None);
}
Expand All @@ -365,9 +367,9 @@ function HudPageBase GetHUDPage()
event SetProgress(string Message1, string Message2)
{
local int i;
log(self$"::SetProgress("$Message1$", "$Message2$")");
if( Message1 == "LoadSplash" ||
Message1 == "WaitForConnection" ||
Message1 == "LoadMap" ||
Expand All @@ -376,8 +378,8 @@ event SetProgress(string Message1, string Message2)
for (i = 0; i < MenuStack.Length; i++)
MenuStack[i].OnProgress(Message2, Message1);
}
else if( Message1 == "ConnectionFailed" ||
Message1 == "Networking Failed" ||
else if( Message1 == "ConnectionFailed" ||
Message1 == "Networking Failed" ||
Message1 == "DemoLoadFailed" ||
Message1 == "UrlFailed" ||
Message1 == "Rejected By Server" ||
Expand All @@ -386,7 +388,7 @@ event SetProgress(string Message1, string Message2)
Message1 == "PackageMD5ChecksumFailed" ||
Message1 == "GenericFailure" ||
( Message1 == "ConnectingText" && Message2 == ConnectingURL ) ||
( Message1 == "" && Message2 == "" )
( Message1 == "" && Message2 == "" )
)
{
ConnectingURL = "";
Expand All @@ -400,7 +402,7 @@ event SetProgress(string Message1, string Message2)
ConnectingURL = Message2;
return;
}

ConnectingURL = "";
}

Expand Down
Loading

0 comments on commit 5c1d779

Please sign in to comment.