mirror of
https://github.com/celisej567/source-engine.git
synced 2026-09-19 20:09:06 +03:00
upload "kind" alien swarm
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <vgui/ISurface.h>
|
||||
#include <KeyValues.h>
|
||||
#include <vgui_controls/ImageList.h>
|
||||
#include <filesystem.h>
|
||||
#include <FileSystem.h>
|
||||
|
||||
#include <vgui_controls/RichText.h>
|
||||
#include <vgui_controls/Label.h>
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <stdlib.h> // MAX_PATH define
|
||||
#include <stdio.h>
|
||||
#include "byteswap.h"
|
||||
#include "vgui_int.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -67,7 +68,7 @@ const char *GetStringTeamColor( int i )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CTeamMenu::CTeamMenu(IViewPort *pViewPort) : Frame(NULL, PANEL_TEAM )
|
||||
CTeamMenu::CTeamMenu(IViewPort *pViewPort) : BaseClass(NULL, PANEL_TEAM)
|
||||
{
|
||||
m_pViewPort = pViewPort;
|
||||
m_iJumpKey = BUTTON_CODE_INVALID; // this is looked up in Activate()
|
||||
@@ -90,6 +91,8 @@ CTeamMenu::CTeamMenu(IViewPort *pViewPort) : Frame(NULL, PANEL_TEAM )
|
||||
|
||||
#if defined( ENABLE_HTML_WINDOW )
|
||||
m_pMapInfoHTML = new HTML( this, "MapInfoHTML");
|
||||
#else
|
||||
m_pMapInfoHTML = NULL;
|
||||
#endif
|
||||
|
||||
LoadControlSettings("Resource/UI/TeamMenu.res");
|
||||
@@ -190,7 +193,6 @@ void CTeamMenu::LoadMapPage( const char *mapName )
|
||||
char mapRES[ MAX_PATH ];
|
||||
|
||||
char uilanguage[ 64 ];
|
||||
uilanguage[0] = 0;
|
||||
engine->GetUILanguage( uilanguage, sizeof( uilanguage ) );
|
||||
|
||||
Q_snprintf( mapRES, sizeof( mapRES ), "resource/maphtml/%s_%s.html", mapName, uilanguage );
|
||||
@@ -224,7 +226,7 @@ void CTeamMenu::LoadMapPage( const char *mapName )
|
||||
|
||||
#if defined( ENABLE_HTML_WINDOW )
|
||||
m_pMapInfoHTML->SetVisible( true );
|
||||
m_pMapInfoHTML->OpenURL( localURL, NULL );
|
||||
m_pMapInfoHTML->OpenURL( localURL );
|
||||
#endif
|
||||
InvalidateLayout();
|
||||
Repaint();
|
||||
@@ -275,20 +277,9 @@ void CTeamMenu::LoadMapPage( const char *mapName )
|
||||
data[ bytesRead+1 ] = 0;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
if ( ((ucs2 *)memBlock)[0] == 0xFEFF )
|
||||
{
|
||||
// convert the win32 ucs2 data to wchar_t
|
||||
dataSize*=2;// need to *2 to account for ucs2 to wchar_t (4byte) growth
|
||||
wchar_t *memBlockConverted = (wchar_t *)malloc(dataSize);
|
||||
V_UCS2ToUnicode( (ucs2 *)memBlock, memBlockConverted, dataSize );
|
||||
free(memBlock);
|
||||
memBlock = memBlockConverted;
|
||||
}
|
||||
#else
|
||||
// null-terminate the stream (redundant, since we memset & then trimmed the transformed buffer already)
|
||||
memBlock[dataSize / sizeof(wchar_t) - 1] = 0x0000;
|
||||
#endif
|
||||
|
||||
// ensure little-endian unicode reads correctly on all platforms
|
||||
CByteswap byteSwap;
|
||||
byteSwap.SetTargetBigEndian( false );
|
||||
@@ -367,7 +358,7 @@ void CTeamMenu::OnTeamButton( int team )
|
||||
else // next is spectate
|
||||
{
|
||||
// DuckMessage( "#Spec_Duck" );
|
||||
gViewPortInterface->ShowBackGround( false );
|
||||
GetViewPortInterface()->ShowBackGround( false );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -395,53 +386,18 @@ void CTeamMenu::SetLabelText(const char *textEntryName, const char *text)
|
||||
|
||||
void CTeamMenu::OnKeyCodePressed(KeyCode code)
|
||||
{
|
||||
int nDir = 0;
|
||||
|
||||
switch ( code )
|
||||
if( m_iJumpKey != BUTTON_CODE_INVALID && m_iJumpKey == code )
|
||||
{
|
||||
case KEY_XBUTTON_UP:
|
||||
case KEY_XSTICK1_UP:
|
||||
case KEY_XSTICK2_UP:
|
||||
case KEY_UP:
|
||||
case KEY_XBUTTON_LEFT:
|
||||
case KEY_XSTICK1_LEFT:
|
||||
case KEY_XSTICK2_LEFT:
|
||||
case KEY_LEFT:
|
||||
case STEAMCONTROLLER_DPAD_LEFT:
|
||||
nDir = -1;
|
||||
break;
|
||||
|
||||
case KEY_XBUTTON_DOWN:
|
||||
case KEY_XSTICK1_DOWN:
|
||||
case KEY_XSTICK2_DOWN:
|
||||
case KEY_DOWN:
|
||||
case KEY_XBUTTON_RIGHT:
|
||||
case KEY_XSTICK1_RIGHT:
|
||||
case KEY_XSTICK2_RIGHT:
|
||||
case KEY_RIGHT:
|
||||
case STEAMCONTROLLER_DPAD_RIGHT:
|
||||
nDir = 1;
|
||||
break;
|
||||
AutoAssign();
|
||||
}
|
||||
|
||||
if ( m_iScoreBoardKey != BUTTON_CODE_INVALID && m_iScoreBoardKey == code )
|
||||
else if ( m_iScoreBoardKey != BUTTON_CODE_INVALID && m_iScoreBoardKey == code )
|
||||
{
|
||||
gViewPortInterface->ShowPanel( PANEL_SCOREBOARD, true );
|
||||
gViewPortInterface->PostMessageToPanel( PANEL_SCOREBOARD, new KeyValues( "PollHideCode", "code", code ) );
|
||||
}
|
||||
else if ( nDir != 0 )
|
||||
{
|
||||
CUtlSortVector< SortedPanel_t, CSortedPanelYLess > vecSortedButtons;
|
||||
VguiPanelGetSortedChildButtonList( this, (void*)&vecSortedButtons, "&", 0 );
|
||||
|
||||
if ( VguiPanelNavigateSortedChildButtonList( (void*)&vecSortedButtons, nDir ) != -1 )
|
||||
{
|
||||
// Handled!
|
||||
return;
|
||||
}
|
||||
GetViewPortInterface()->ShowPanel( PANEL_SCOREBOARD, true );
|
||||
GetViewPortInterface()->PostMessageToPanel( PANEL_SCOREBOARD, new KeyValues( "PollHideCode", "code", code ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass::OnKeyCodePressed( code );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user