nuclide/Source/vgui/ui_pic.cpp
Marco Hladik 97ea5e6208 Initial commit of the new VGUI replacement code. This dates back to the days
of TW 1.2 (the version that never got released) and besides some primitive
windowing is usable enough in its current state.

Misc fixes to FreeCS as well.
2019-08-03 10:40:34 -07:00

64 lines
1 KiB
C++

/***
*
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
*
* See the file LICENSE attached with the sources for usage details.
*
****/
enumflags
{
IMAGE_VISIBLE
};
class CUIPic : CUIWidget
{
vector m_vecSize;
string m_strImage;
void() CUIPic;
virtual void( vector ) SetSize;
virtual vector() GetSize;
virtual void( string ) SetImage;
virtual string() GetImage;
virtual void() Draw;
virtual void( float, float, float, float ) Input;
};
void CUIPic :: CUIPic ( void )
{
m_vecSize = '16 16';
m_iFlags = IMAGE_VISIBLE;
}
void CUIPic :: Draw ( void )
{
if ( m_strImage ) {
drawpic( m_parent.m_vecOrigin + m_vecOrigin, m_strImage, m_vecSize, '1 1 1', 1.0f );
}
}
void CUIPic :: Input ( float flEVType, float flKey, float flChar, float flDevID )
{
}
void CUIPic :: SetSize ( vector vecSize )
{
m_vecSize = vecSize;
}
vector CUIPic :: GetSize ( void )
{
return m_vecSize;
}
void CUIPic :: SetImage ( string strName )
{
m_strImage = strName;
}
string CUIPic :: GetImage ( void )
{
return m_strImage;
}