198 lines
5.3 KiB
C++
198 lines
5.3 KiB
C++
#pragma once
|
|
|
|
//#include "SUIUtil.h"
|
|
|
|
namespace sui {
|
|
|
|
class kui_window_caption_property : public kui_window_property
|
|
{
|
|
public:
|
|
kui_window_caption_property( const char* name, const char* caption_decorator = 0 ) : kui_window_property( name ), m_caption_decorator( caption_decorator ) {}
|
|
kui_window_caption_property( const kui_window_caption_property& rhs ) : kui_window_property( rhs ), m_caption_decorator( rhs.m_caption_decorator ) {}
|
|
virtual ~kui_window_caption_property() {}
|
|
virtual void get_caption_string( property& data, std::string& caption );
|
|
virtual void on_update( property& data );
|
|
protected:
|
|
const char* m_caption_decorator;
|
|
};
|
|
|
|
class kui_window_numeric_caption_property : public kui_window_caption_property
|
|
{
|
|
public:
|
|
kui_window_numeric_caption_property( const char* name, const char* caption_decorator = 0 ) : kui_window_caption_property( name, caption_decorator ) {}
|
|
kui_window_numeric_caption_property( const kui_window_numeric_caption_property& rhs ) : kui_window_caption_property( rhs ) {}
|
|
virtual ~kui_window_numeric_caption_property() {}
|
|
virtual void get_caption_string( property& data, std::string& caption );
|
|
};
|
|
|
|
class kui_window_itemslot_icon_property : public kui_window_property
|
|
{
|
|
public:
|
|
struct itemslot_icon
|
|
{
|
|
itemslot_icon( int _item_code, const char* _tooltip ) : item_code( _item_code ), tooltip( _tooltip ) {}
|
|
int item_code; ///< item code
|
|
std::string tooltip; ///< tooltip string
|
|
};
|
|
kui_window_itemslot_icon_property( const char* name, SUIDisplayInfo* display, SUIWnd* pParent, SInventoryMgr& inven )
|
|
: kui_window_property( name ), m_display( display ), m_pParent( pParent ), m_InventoryMgr( inven ) {}
|
|
kui_window_itemslot_icon_property( const kui_window_itemslot_icon_property& rhs )
|
|
: kui_window_property( rhs ), m_display( rhs.m_display ), m_pParent( rhs.m_pParent ), m_InventoryMgr( rhs.m_InventoryMgr ) {}
|
|
virtual ~kui_window_itemslot_icon_property() {}
|
|
|
|
virtual void on_update( property& data );
|
|
virtual kui_window_property& set_value( KUIWnd* value );
|
|
protected:
|
|
SUIDisplayInfo* m_display;
|
|
SUIWnd* m_pParent;
|
|
class SInventoryMgr& m_InventoryMgr;
|
|
};
|
|
|
|
//
|
|
// SWindowPropertyUpdator< Updator >
|
|
//
|
|
template< typename Updator >
|
|
class SWindowPropertyUpdator : public kui_window_property
|
|
{
|
|
public:
|
|
SWindowPropertyUpdator( const char* name, KUIWnd* window = 0 )
|
|
: kui_window_property( name )
|
|
{
|
|
set_value( window );
|
|
}
|
|
SWindowPropertyUpdator( const char* name, const Updator& updator, KUIWnd* window = 0 )
|
|
: kui_window_property( name )
|
|
, mUpdator( updator )
|
|
{
|
|
set_value( window );
|
|
}
|
|
SWindowPropertyUpdator( const SWindowPropertyUpdator& rhs )
|
|
: kui_window_property( rhs )
|
|
, mUpdator( rhs.mUpdator )
|
|
{
|
|
}
|
|
virtual ~SWindowPropertyUpdator()
|
|
{
|
|
}
|
|
virtual void on_update( property& data )
|
|
{
|
|
KUIWnd* window = get_window();
|
|
if( window )
|
|
{
|
|
mUpdator.Update( *window, data );
|
|
}
|
|
}
|
|
Updator mUpdator;
|
|
};
|
|
|
|
template< typename Updator >
|
|
SWindowPropertyUpdator< Updator >* MakeUpdator( const char* name, const Updator& updator, KUIWnd* window = 0 )
|
|
{
|
|
return new SWindowPropertyUpdator< Updator >( name, updator, window );
|
|
}
|
|
|
|
template< typename Updator >
|
|
kui_updatable_window* MakeUpdatableWindow( const char* name, const Updator& updator, KUIWnd* window = 0 )
|
|
{
|
|
return new kui_updatable_window( MakeUpdator( name, updator, window ) );
|
|
}
|
|
|
|
//
|
|
// SCaptionUpdator
|
|
//
|
|
struct SCaptionUpdator
|
|
{
|
|
SCaptionUpdator() : mDecorator( 0 ) {}
|
|
SCaptionUpdator( const char* decorator ) : mDecorator( decorator ) {}
|
|
void Update( KUIWnd& window, property& data );
|
|
const char* mDecorator;
|
|
protected:
|
|
virtual void GetCaptionString( property& data, std::string& caption );
|
|
};
|
|
|
|
struct SEnableColorUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
//
|
|
// SOnOffUpdator
|
|
//
|
|
struct SOnOffUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
//
|
|
// SItemSlotIconUpdator
|
|
//
|
|
struct SItemSlotIconUpdator
|
|
{
|
|
SItemSlotIconUpdator( SUIDisplayInfo* displayInfo, SUIWnd* pParent, SInventoryMgr& inven )
|
|
: mDisplayInfo( displayInfo ), m_pParent( pParent ), m_InventoryMgr( inven ) {}
|
|
void Update( KUIWnd& window, property& data );
|
|
SUIDisplayInfo* mDisplayInfo;
|
|
SUIWnd* m_pParent;
|
|
class SInventoryMgr& m_InventoryMgr;
|
|
};
|
|
|
|
//
|
|
// SPetGradeIconUpdator( data: char )
|
|
//
|
|
struct SPetGradeIconUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
//
|
|
// SSkillSlotIconUpdator( data: SSkillSlot* )
|
|
//
|
|
struct SSkillSlotIconUpdator
|
|
{
|
|
SSkillSlotIconUpdator( SUIDisplayInfo* displayInfo ) : mDisplayInfo( displayInfo ) {}
|
|
void Update( KUIWnd& window, property& data );
|
|
SUIDisplayInfo* mDisplayInfo;
|
|
};
|
|
|
|
/// 퀵슬롯 효과(파이어, 토글) 갱신
|
|
struct SSkillSlotFxUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SAniUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SAniFrameIndexUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SVisibilityUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SPositionXUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SPositionYUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SWidthUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
struct SHeightUpdator
|
|
{
|
|
void Update( KUIWnd& window, property& data );
|
|
};
|
|
|
|
} |