Merge branch 'master' into windows

This commit is contained in:
HappyDOGE
2022-07-27 12:58:56 +03:00
3089 changed files with 38639 additions and 844820 deletions
+2 -2
View File
@@ -330,7 +330,7 @@ bool AnimationController::ParseScriptFile(char *pMem, int length)
// get the open brace or a conditional
pMem = ParseFile(pMem, token, NULL);
if ( Q_stristr( token, "[$" ) )
if ( Q_stristr( token, "[$" ) || Q_stristr( token, "[!$" ) )
{
bAccepted = EvaluateConditional( token );
@@ -655,7 +655,7 @@ bool AnimationController::ParseScriptFile(char *pMem, int length)
// Look ahead one token for a conditional
char *peek = ParseFile(pMem, token, NULL);
if ( Q_stristr( token, "[$" ) )
if ( Q_stristr( token, "[$" ) || Q_stristr( token, "[!$" ) )
{
if ( !EvaluateConditional( token ) )
{
+2 -1
View File
@@ -41,6 +41,7 @@
#include "filesystem.h"
#include "tier0/icommandline.h"
#include "const.h"
#include "vprof.h"
#if defined( _X360 )
#include "xbox/xbox_win32stubs.h"
@@ -1541,4 +1542,4 @@ void BuildGroup::ClearResFileCache()
nIndex = m_dictCachedResFiles.Next( nIndex );
}
m_dictCachedResFiles.Purge();
}
}
+5 -5
View File
@@ -862,7 +862,7 @@ int ListPanel::FindColumn(const char *columnName)
// data->GetName() is used to uniquely identify an item
// data sub items are matched against column header name to be used in the table
//-----------------------------------------------------------------------------
int ListPanel::AddItem( const KeyValues *item, unsigned int userData, bool bScrollToItem, bool bSortOnAdd)
int ListPanel::AddItem( const KeyValues *item, uintp userData, bool bScrollToItem, bool bSortOnAdd)
{
FastSortListPanelItem *newitem = new FastSortListPanelItem;
newitem->kv = item->MakeCopy();
@@ -898,7 +898,7 @@ int ListPanel::AddItem( const KeyValues *item, unsigned int userData, bool bScro
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void ListPanel::SetUserData( int itemID, unsigned int userData )
void ListPanel::SetUserData( int itemID, uintp userData )
{
if ( !m_DataItems.IsValidIndex(itemID) )
return;
@@ -909,7 +909,7 @@ void ListPanel::SetUserData( int itemID, unsigned int userData )
//-----------------------------------------------------------------------------
// Purpose: Finds the first itemID with a matching userData
//-----------------------------------------------------------------------------
int ListPanel::GetItemIDFromUserData( unsigned int userData )
int ListPanel::GetItemIDFromUserData( uintp userData )
{
FOR_EACH_LL( m_DataItems, itemID )
{
@@ -1064,7 +1064,7 @@ ListPanelItem *ListPanel::GetItemData( int itemID )
//-----------------------------------------------------------------------------
// Purpose: returns user data for itemID
//-----------------------------------------------------------------------------
unsigned int ListPanel::GetItemUserData(int itemID)
uintp ListPanel::GetItemUserData(int itemID)
{
if ( !m_DataItems.IsValidIndex(itemID) )
return 0;
@@ -2828,7 +2828,7 @@ void ListPanel::SortList( void )
//-----------------------------------------------------------------------------
void ListPanel::SetFont(HFont font)
{
Assert( font );
Assert( font );
if ( !font )
return;
+2 -4
View File
@@ -2365,9 +2365,8 @@ int Menu::GetCurrentlyHighlightedItem()
//-----------------------------------------------------------------------------
// Purpose: Respond to cursor entering a menuItem.
//-----------------------------------------------------------------------------
void Menu::OnCursorEnteredMenuItem(int VPanel)
void Menu::OnCursorEnteredMenuItem(VPANEL menuItem)
{
VPANEL menuItem = (VPANEL)VPanel;
// if we are in mouse mode
if (m_iInputMode == MOUSE)
{
@@ -2389,9 +2388,8 @@ void Menu::OnCursorEnteredMenuItem(int VPanel)
//-----------------------------------------------------------------------------
// Purpose: Respond to cursor exiting a menuItem
//-----------------------------------------------------------------------------
void Menu::OnCursorExitedMenuItem(int VPanel)
void Menu::OnCursorExitedMenuItem(VPANEL menuItem)
{
VPANEL menuItem = (VPANEL)VPanel;
// only care if we are in mouse mode
if (m_iInputMode == MOUSE)
{
+2 -2
View File
@@ -222,7 +222,7 @@ void MenuItem::OnCursorEntered()
// forward the message on to the parent of this menu.
KeyValues *msg = new KeyValues ("CursorEnteredMenuItem");
// tell the parent this menuitem is the one that was entered so it can highlight it
msg->SetInt("VPanel", GetVPanel());
msg->SetInt("menuItem", ToHandle() );
ivgui()->PostMessage(GetVParent(), msg, NULL);
}
@@ -236,7 +236,7 @@ void MenuItem::OnCursorExited()
// forward the message on to the parent of this menu.
KeyValues *msg = new KeyValues ("CursorExitedMenuItem");
// tell the parent this menuitem is the one that was entered so it can unhighlight it
msg->SetInt("VPanel", GetVPanel());
msg->SetInt("menuItem", ToHandle() );
ivgui()->PostMessage(GetVParent(), msg, NULL);
}
+24 -18
View File
@@ -226,7 +226,6 @@ KeyBindingMap_t::~KeyBindingMap_t()
class CKeyBindingsMgr
{
public:
CKeyBindingsMgr() :
m_Bindings( 0, 0, KeyBindingContextHandleLessFunc ),
m_nKeyBindingContexts( 0 )
@@ -881,7 +880,7 @@ const char *Panel::GetClassName()
{
// loop up the panel map name
PanelMessageMap *panelMap = GetMessageMap();
if ( panelMap )
if ( panelMap && panelMap->pfnClassName )
{
return panelMap->pfnClassName();
}
@@ -1450,8 +1449,10 @@ void Panel::SetParent(Panel *newParent)
//-----------------------------------------------------------------------------
void Panel::SetParent(VPANEL newParent)
{
if (newParent)
{
ipanel()->SetParent(GetVPanel(), newParent);
}
else
@@ -1459,19 +1460,19 @@ void Panel::SetParent(VPANEL newParent)
ipanel()->SetParent(GetVPanel(), NULL);
}
if (GetVParent() && !IsPopup())
if (GetVParent() )
{
SetProportional(ipanel()->IsProportional(GetVParent()));
if( ipanel()->IsProportional(GetVParent()) )
SetProportional(true);
// most of the time KBInput == parents kbinput
if (ipanel()->IsKeyBoardInputEnabled(GetVParent()) != IsKeyBoardInputEnabled())
if( IsPopup() )
{
SetKeyBoardInputEnabled(ipanel()->IsKeyBoardInputEnabled(GetVParent()));
}
// most of the time KBInput == parents kbinput
if (ipanel()->IsKeyBoardInputEnabled(GetVParent()) != IsKeyBoardInputEnabled())
SetKeyBoardInputEnabled(ipanel()->IsKeyBoardInputEnabled(GetVParent()));
if (ipanel()->IsMouseInputEnabled(GetVParent()) != IsMouseInputEnabled())
{
SetMouseInputEnabled(ipanel()->IsMouseInputEnabled(GetVParent()));
if (ipanel()->IsMouseInputEnabled(GetVParent()) != IsMouseInputEnabled())
SetMouseInputEnabled(ipanel()->IsMouseInputEnabled(GetVParent()));
}
}
@@ -3574,7 +3575,7 @@ void Panel::RequestFocus(int direction)
//-----------------------------------------------------------------------------
void Panel::OnRequestFocus(VPANEL subFocus, VPANEL defaultPanel)
{
CallParentFunction(new KeyValues("OnRequestFocus", "subFocus", subFocus, "defaultPanel", defaultPanel));
CallParentFunction(new KeyValues("OnRequestFocus", "subFocus", ivgui()->PanelToHandle( subFocus ), "defaultPanel", ivgui()->PanelToHandle( defaultPanel )));
}
//-----------------------------------------------------------------------------
@@ -3801,11 +3802,9 @@ void Panel::SetBuildGroup(BuildGroup* buildGroup)
{
//TODO: remove from old group
Assert(buildGroup != NULL);
_buildGroup = buildGroup;
_buildGroup->PanelAdded(this);
Assert(buildGroup != NULL);
_buildGroup = buildGroup;
_buildGroup->PanelAdded(this);
}
bool Panel::IsBuildGroupEnabled()
@@ -5133,6 +5132,13 @@ void Panel::OnMessage(const KeyValues *params, VPANEL ifromPanel)
VPANEL vp = ivgui()->HandleToPanel( param1->GetInt() );
(this->*((MessageFunc_HandleConstCharPtr_t)pMap->func))( vp, param2->GetWString() );
}
else if ( (DATATYPE_HANDLE == pMap->firstParamType) && (DATATYPE_HANDLE == pMap->secondParamType) )
{
typedef void (Panel::*MessageFunc_HandleConstCharPtr_t)(VPANEL, VPANEL);
VPANEL vp1 = ivgui()->HandleToPanel( param1->GetInt() );
VPANEL vp2 = ivgui()->HandleToPanel( param2->GetInt() );
(this->*((MessageFunc_HandleConstCharPtr_t)pMap->func))( vp1, vp2 );
}
else
{
// the message isn't handled
@@ -5514,7 +5520,7 @@ void Panel::OnDelete()
// Purpose: Panel handle implementation
// Returns a pointer to a valid panel, NULL if the panel has been deleted
//-----------------------------------------------------------------------------
Panel *PHandle::Get()
Panel *PHandle::Get() const
{
if (m_iPanelID != INVALID_PANEL)
{
+2 -2
View File
@@ -2547,12 +2547,12 @@ int RichText::ParseTextStringForUrls( const char *text, int startPos, char *pchU
// get the url
i += Q_strlen( "<a href=" );
const char *pchURLEnd = Q_strstr( text + i, ">" );
Q_strncpy( pchURL, text + i, min( pchURLEnd - text - i + 1, cchURL ) );
Q_strncpy( pchURL, text + i, min( (int)(pchURLEnd - text) - i + 1, cchURL ) );
i += ( pchURLEnd - text - i + 1 );
// get the url text
pchURLEnd = Q_strstr( text, "</a>" );
Q_strncpy( pchURLText, text + i, min( pchURLEnd - text - i + 1, cchURLText ) );
Q_strncpy( pchURLText, text + i, min( (int)(pchURLEnd - text) - i + 1, cchURLText ) );
i += ( pchURLEnd - text - i );
i += Q_strlen( "</a>" );
+4 -2
View File
@@ -149,6 +149,8 @@ ScrollBar::ScrollBar(Panel *parent, const char *panelName, bool vertical) : Pane
m_pOverriddenButtons[0] = NULL;
m_pOverriddenButtons[1] = NULL;
int width = IsProportional() ? scheme()->GetProportionalScaledValue(SCROLLBAR_DEFAULT_WIDTH) : SCROLLBAR_DEFAULT_WIDTH;
if (vertical)
{
// FIXME: proportional changes needed???
@@ -158,7 +160,7 @@ ScrollBar::ScrollBar(Panel *parent, const char *panelName, bool vertical) : Pane
_button[0]->SetTextInset(0, 1);
_button[1]->SetTextInset(0, -1);
SetSize(SCROLLBAR_DEFAULT_WIDTH, 64);
SetSize(width, 64);
}
else
{
@@ -168,7 +170,7 @@ ScrollBar::ScrollBar(Panel *parent, const char *panelName, bool vertical) : Pane
_button[0]->SetTextInset(0, 0);
_button[1]->SetTextInset(0, 0);
SetSize(64, SCROLLBAR_DEFAULT_WIDTH);
SetSize(64, width);
}
Panel::SetPaintBorderEnabled(true);
+4 -5
View File
@@ -230,7 +230,6 @@ void Slider::SetInverted( bool bInverted )
m_bInverted = bInverted;
}
//-----------------------------------------------------------------------------
// Purpose: Send a message to interested parties when the slider moves
//-----------------------------------------------------------------------------
@@ -386,9 +385,9 @@ void Slider::GetTrackRect( int& x, int& y, int& w, int& h )
GetPaintSize( wide, tall );
x = 0;
y = 8;
y = IsProportional() ? scheme()->GetProportionalScaledValue( 8.f ) : 8;;
w = wide - (int)_nobSize;
h = 4;
h = IsProportional() ? scheme()->GetProportionalScaledValue( 4.f ) : 4;
}
//-----------------------------------------------------------------------------
@@ -524,7 +523,7 @@ void Slider::DrawNob()
#endif
surface()->DrawSetColor(col);
int nobheight = 16;
int nobheight = IsProportional() ? scheme()->GetProportionalScaledValue( 16.f ) : 16.f;
surface()->DrawFilledRect(
_nobPos[0],
@@ -941,7 +940,7 @@ void Slider::SetButtonOffset(int buttonOffset)
void Slider::SetThumbWidth( int width )
{
_nobSize = (float)width;
_nobSize = IsProportional() ? scheme()->GetProportionalScaledValue( (float)width) : (float)width;
}
+4
View File
@@ -9,7 +9,11 @@
#include <stdio.h>
#include <ctype.h>
#include <assert.h>
#ifdef OSX
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#include <vgui/IPanel.h>
#include <vgui/ISurface.h>