Skip to content

Commit

Permalink
Merge pull request #761 from ReactiveDrop/ui-and-oe-improvements
Browse files Browse the repository at this point in the history
UI and OE improvements
  • Loading branch information
BenLubar authored May 11, 2024
2 parents 9760978 + 6f11fc2 commit 7555439
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 2 deletions.
222 changes: 222 additions & 0 deletions reactivedrop/resource/ui/nb_mission_summary.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
"Resource/UI/NB_Mission_Summary.res"
{
"Background"
{
"fieldName" "Background"
"xpos" "0"
"ypos" "0"
"wide" "194"
"ControlName" "Panel"
"bgcolor_override" "12 23 37 64"
"PaintBackgroundType" "2"
}
"BackgroundInner"
{
"fieldName" "BackgroundInner"
"xpos" "2"
"ypos" "2"
"wide" "190"
"ControlName" "Panel"
"PaintBackgroundType" "2"
"bgcolor_override" "16 39 63 200"
//"bgcolor_override" "33 63 93 64"
}
"TitleBG"
{
"fieldName" "TitleBG"
"xpos" "3"
"ypos" "3"
"wide" "188"
"tall" "24"
"ControlName" "Panel"
"PaintBackgroundType" "2"
"bgcolor_override" "27 51 73 255"
}
"TitleBGBottom"
{
"fieldName" "TitleBGBottom"
"xpos" "3"
"ypos" "15"
"wide" "188"
"tall" "12"
"ControlName" "Panel"
"PaintBackgroundType" "0"
"bgcolor_override" "27 51 73 255"
}
"Title"
{
"fieldName" "Title"
"xpos" "3"
"ypos" "3"
"wide" "188"
"tall" "24"
"font" "DefaultLarge"
"labelText" "#nb_mission_brief"
"textAlignment" "center"
"ControlName" "Label"
"fgcolor_override" "169 213 255 255"
}
"DifficultyTitle"
{
"fieldName" "DifficultyTitle"
"xpos" "18"
"ypos" "32"
"wide" "50"
"tall" "13"
"font" "Default"
"labelText" "#nb_difficulty_title"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "169 213 255 255"
}
"DifficultyLabel"
{
"fieldName" "DifficultyLabel"
"xpos" "5"
"ypos" "0"
"wide" "120"
"tall" "13"
"font" "Default"
"labelText" "DifficultyLabel"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "83 148 192 255"
"pin_to_sibling" "DifficultyTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "1"
}
// reactivedrop
"ChallengeTitle"
{
"fieldName" "ChallengeTitle"
"xpos" "0"
"ypos" "4"
"wide" "50"
"tall" "13"
"font" "Default"
"labelText" "#rd_ui_select_challenge"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "169 213 255 255"
"pin_to_sibling" "DifficultyTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "2"
}
"ChallengeLabel"
{
"fieldName" "ChallengeLabel"
"xpos" "5"
"ypos" "0"
"wide" "120"
"tall" "13"
"font" "Default"
"labelText" "ChallengeLabel"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "83 148 192 255"
"pin_to_sibling" "ChallengeTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "1"
}
//
"MissionTitle"
{
"fieldName" "MissionTitle"
"xpos" "0"
"ypos" "4"
"wide" "50"
"tall" "13"
"font" "Default"
"labelText" "#nb_mission_title"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "169 213 255 255"
"pin_to_sibling" "ChallengeTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "2"
}
"MissionLabel"
{
"fieldName" "MissionLabel"
"xpos" "5"
"ypos" "0"
"wide" "120"
"tall" "13"
"font" "Default"
"labelText" "MissionLabel"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "83 148 192 255"
"pin_to_sibling" "MissionTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "1"
}
"SpeedrunTimeTitle"
{
"fieldName" "SpeedrunTimeTitle"
"xpos" "0"
"ypos" "4"
"wide" "50"
"tall" "13"
"font" "Default"
"labelText" "#nb_speedruntime_title"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "169 213 255 255"
"pin_to_sibling" "MissionTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "2"
}
"SpeedrunTimeLabel"
{
"fieldName" "SpeedrunTimeLabel"
"xpos" "5"
"ypos" "0"
"wide" "120"
"tall" "13"
"font" "Default"
"labelText" "SpeedrunTimeLabel"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "83 148 192 255"
"pin_to_sibling" "SpeedrunTimeTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "1"
}
"ObjectivesTitle"
{
"fieldName" "ObjectivesTitle"
"xpos" "0"
"ypos" "4"
"wide" "100"
"tall" "13"
"font" "Default"
"labelText" "#nb_objectives"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "169 213 255 255"
"pin_to_sibling" "SpeedrunTimeTitle"
"pin_corner_to_sibling" "0"
"pin_to_sibling_corner" "2"
}
"ObjectivesLabel"
{
"fieldName" "ObjectivesLabel"
"xpos" "18"
"ypos" "112"
"font" "Default"
"textAlignment" "north-west"
"ControlName" "Label"
"fgcolor_override" "83 148 192 255"
"wrap" "1"
}
"DetailsButton"
{
"fieldName" "DetailsButton"
"xpos" "146"
"wide" "22"
"tall" "22"
"zpos" "2"
"ControlName" "CBitmapButton"
}
}
11 changes: 11 additions & 0 deletions src/game/client/swarm/vgui/nb_mission_summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ CNB_Mission_Summary::CNB_Mission_Summary( vgui::Panel *parent, const char *name
m_pChallengeLabel = new vgui::Label(this, "ChallengeLabel", "");
m_pMissionTitle = new vgui::Label( this, "MissionTitle", "" );
m_pMissionLabel = new vgui::Label( this, "MissionLabel", "" );
m_pSpeedrunTimeLabel = new vgui::Label( this, "SpeedrunTimeLabel", "" );
m_pObjectivesTitle = new vgui::Label( this, "ObjectivesTitle", "" );
m_pObjectivesLabel = new vgui::Label( this, "ObjectivesLabel", "" );
// == MANAGED_MEMBER_CREATION_END ==
Expand Down Expand Up @@ -139,6 +140,16 @@ void CNB_Mission_Summary::OnThink()
m_pMissionLabel->SetText(pMap->m_szMissionTitle);
}

int nSpeedrunTime = ASWGameRules()->GetSpeedrunTime();
wchar_t wszSRTime[ 128 ];

if ( nSpeedrunTime <= 0 )
V_snwprintf( wszSRTime, ARRAYSIZE( wszSRTime ), L"-" );
else
V_snwprintf( wszSRTime, ARRAYSIZE( wszSRTime ), g_pVGuiLocalize->FindSafe( "#nb_speedruntime_format" ), nSpeedrunTime / 60, nSpeedrunTime % 60 );

m_pSpeedrunTimeLabel->SetText( wszSRTime );

// compose objectives list
wchar_t wszObjectivesBuffer[ 1024 ];
wchar_t wszBuffer[ 1024 ];
Expand Down
1 change: 1 addition & 0 deletions src/game/client/swarm/vgui/nb_mission_summary.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CNB_Mission_Summary : public vgui::EditablePanel
vgui::Label *m_pChallengeLabel;
vgui::Label *m_pMissionTitle;
vgui::Label *m_pMissionLabel;
vgui::Label *m_pSpeedrunTimeLabel;
vgui::Label *m_pObjectivesTitle;
vgui::Label *m_pObjectivesLabel;
// == MANAGED_MEMBER_POINTERS_END ==
Expand Down
35 changes: 35 additions & 0 deletions src/game/shared/swarm/asw_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ BEGIN_NETWORK_TABLE_NOBASE( CAlienSwarm, DT_ASWGameRules )
RecvPropInt(RECVINFO(m_nFailAdvice)),
RecvPropInt(RECVINFO(m_iMissionDifficulty) ),
RecvPropInt(RECVINFO(m_iSkillLevel) ),
RecvPropInt(RECVINFO(m_iOutstandingExecutionStatus)),
RecvPropBool(RECVINFO(m_bVoteStartedIngame) ),
RecvPropInt(RECVINFO(m_iCurrentVoteYes) ),
RecvPropInt(RECVINFO(m_iCurrentVoteNo) ),
Expand Down Expand Up @@ -909,6 +910,7 @@ BEGIN_NETWORK_TABLE_NOBASE( CAlienSwarm, DT_ASWGameRules )
SendPropInt(SENDINFO(m_nFailAdvice)),
SendPropInt(SENDINFO(m_iMissionDifficulty) ),
SendPropInt(SENDINFO(m_iSkillLevel) ),
SendPropInt(SENDINFO(m_iOutstandingExecutionStatus) ),
SendPropInt(SENDINFO(m_bVoteStartedIngame) ),
SendPropInt(SENDINFO(m_iCurrentVoteYes) ),
SendPropInt(SENDINFO(m_iCurrentVoteNo) ),
Expand Down Expand Up @@ -1014,6 +1016,7 @@ CAlienSwarmProxy::~CAlienSwarmProxy()

BEGIN_RECV_TABLE( CAlienSwarmProxy, DT_AlienSwarmProxy )
RecvPropDataTable( "asw_gamerules_data", 0, 0, &REFERENCE_RECV_TABLE( DT_ASWGameRules ), RecvProxy_ASWGameRules ),
RecvPropInt( RECVINFO( m_iSpeedrunTime ) ),
RecvPropBool( RECVINFO( m_bDisallowCameraRotation ) ),
END_RECV_TABLE()
#else
Expand All @@ -1027,6 +1030,7 @@ CAlienSwarmProxy::~CAlienSwarmProxy()

BEGIN_SEND_TABLE( CAlienSwarmProxy, DT_AlienSwarmProxy )
SendPropDataTable( "asw_gamerules_data", 0, &REFERENCE_SEND_TABLE( DT_ASWGameRules ), SendProxy_ASWGameRules ),
SendPropInt( SENDINFO( m_iSpeedrunTime ) ),
SendPropBool( SENDINFO( m_bDisallowCameraRotation ) ),
END_SEND_TABLE()

Expand Down Expand Up @@ -1663,6 +1667,7 @@ void CAlienSwarm::FullReset()
m_bMissionSuccess = false;
m_bMissionFailed = false;
m_fReserveMarinesEndTime = 0;
m_iOutstandingExecutionStatus = -1;

m_nFailAdvice = ASW_FAIL_ADVICE_DEFAULT;

Expand Down Expand Up @@ -8562,13 +8567,35 @@ void CAlienSwarm::OnSVCheatsChanged()
}
//ConCommand asw_notify_ch( "asw_notify_ch", StartedCheating_f, "Internal use", 0 );

#endif // GAME_DLL

int CAlienSwarm::GetSpeedrunTime( void )
{
Assert( g_pSwarmProxy );

return g_pSwarmProxy->m_iSpeedrunTime;
}

int CAlienSwarm::GetOutstandingExecutionStatus(void)
{
#ifdef CLIENT_DLL
return ASWGameRules()->m_iOutstandingExecutionStatus;
#else

CASW_Campaign_Save *pCampaignSave = GetCampaignSave();
if ( !pCampaignSave )
return -1;

int iSkill = GetLowestSkillLevelPlayed();
if ( iSkill >= 2 && pCampaignSave && pCampaignSave->m_iNumDeaths <= 0 && pCampaignSave->m_iInitialNumMissionsComplete == 0 && !m_bChallengeActiveThisCampaign )
return 1;

return 0;
#endif
}

#ifdef GAME_DLL

int CAlienSwarm::GetJumpJetType(void)
{
Assert( g_pSwarmProxy );
Expand Down Expand Up @@ -9414,6 +9441,14 @@ void CAlienSwarm::LevelInitPostEntity()
}
// todo: if we fail to load the campaign save file above, then gracefully fall into single mission mode?

// restarting on the first mission of the campaign will not fail outstanding execution
CASW_Campaign_Save *pCampaignSave = GetCampaignSave();
const RD_Campaign_t *pCampaignInfo = GetCampaignInfo();
if ( pCampaignSave && pCampaignInfo && pCampaignInfo->Missions.Count() > 1 && !V_strcmp( pCampaignInfo->Missions[1].MapName, STRING( gpGlobals->mapname ) ) )
pCampaignSave->m_iNumDeaths = 0;

m_iOutstandingExecutionStatus = GetOutstandingExecutionStatus();

// make sure we're on easy mode for the tutorial
if ( IsTutorialMap() )
{
Expand Down
8 changes: 6 additions & 2 deletions src/game/shared/swarm/asw_gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class CAlienSwarmProxy : public CGameRulesProxy
DECLARE_NETWORKCLASS();
DECLARE_DATADESC();

int m_iSpeedrunTime;
int m_iJumpJetType;
CNetworkVar( int, m_iSpeedrunTime );
CNetworkVar( bool, m_bDisallowCameraRotation );
string_t m_szStatsMusicSuccess;
string_t m_szStatsMusicFailure;
Expand Down Expand Up @@ -292,7 +292,6 @@ class CAlienSwarm : public CSingleplayRules
CASW_Medals m_Medals;
int m_iNumGrubs;
CHandle<CASW_Debrief_Stats> m_hDebriefStats;
int GetSpeedrunTime( void );
int GetJumpJetType( void );

// voting
Expand Down Expand Up @@ -486,11 +485,15 @@ class CAlienSwarm : public CSingleplayRules

virtual void OnDataChanged( DataUpdateType_t updateType );
unsigned char m_iPreviousGameState;

#endif
void FinishDeathmatchRound( CASW_Marine_Resource *winner );
CNetworkString( m_szStatsMusicOverride, 128 );

// misc
int GetSpeedrunTime( void );
CNetworkVar( int, m_iOutstandingExecutionStatus );
int GetOutstandingExecutionStatus( void );
virtual void CreateStandardEntities( void );
virtual bool IsMultiplayer();
bool IsOfflineGame();
Expand All @@ -503,6 +506,7 @@ class CAlienSwarm : public CSingleplayRules
#ifdef GAME_DLL
void RunScriptFunctionInListenerScopes( const char *szFunctionName, ScriptVariant_t *pReturn, int nArgs, ScriptVariant_t *pArgs );
CUtlMap<string_t, float> m_ActorSpeakingUntil;

#endif

// mission
Expand Down

0 comments on commit 7555439

Please sign in to comment.