#include "stdafx.h" #include "SUITargetWnd_Creature.h" #include "SLog.h" #include "Util.h" #include "CommonUtil.h" #include "SGameManager.h" #include "SInventoryMgr.h" #include "SSummonSlotMgr.h" #include "SPlayerInfoMgr.h" #include "KUIDefine.h" #include "SPetDB.h" #include "SStringDB.h" #include "SMonsterDB.h" #include "SCreatureDB.h" #include "SMonsterCreatureDB.h" #include "SMonsterSpeciesDB.h" #include "SMonsterAffiliationDB.h" #include "SMonsterAffiliationDetailDB.h" #include "SUIUtil.h" #include namespace nsTargetUI_Creature { static const string LEVEL_CONTROL_NAME( "creature_monster_target_lv_number" ); // 크리쳐 / 펫 / 몬스터 레벨 컨트롤 이름 static const string NAME_CONTROL_NAME( "creature_monster_target_name_text_long" ); // 크리쳐 / 펫 / 몬스터 이름 컨트롤 이름 static const string EVOLUTIONNAME_CONTROL_NAME( "creature_monster_target_text_job_02" ); // 크리쳐 / 펫 / 몬스터 진화 이름 컨트롤 이름 static const string SPECIES_NAME_CONTROL_NAME( "creature_monster_target_text_job_01" ); // 크리쳐 / 펫 / 몬스터 종 이름 컨트롤 이름 static const string ENHANCE_CONTROL_NAME( "creature_monster_target_text_enhance_01" ); // 크리쳐 / 펫 / 몬스터 강화 컨트롤 이름 static const string ENHANCE_MARK_CONTROL_NAME( "creature_monster_mark_enhance_01" ); // 크리쳐 강화 마크 컨트롤 이름 static const string AFFILIATION_NAME_CONTROL_NAME( "creature_monster_target_text_type_01" ); // 크리쳐 / 펫 / 몬스터 계열 이름 컨트롤 이름 static const string AFFILIATION_ICON_CONTROL_NAME( "creature_monster_target_mark_type" ); // 크리쳐 / 펫 / 몬스터 계열 아이콘 컨트롤 이름 static const string AFFILIATION_BACKGROUND_POSSIBLE_TAME_CONTROL_NAME( "creature_monster_target_type_able_01" ); // 크리쳐 / 펫 / 몬스터 계열 배경 ( 테이밍 가능 )컨트롤 이름 static const string AFFILIATION_BACKGROUND_IMPOSSIBLE_TAME_CONTROL_NAME( "creature_monster_target_type_unable_01" );// 크리쳐 / 펫 / 몬스터 계열 배경 ( 테이밍 불 가능 )컨트롤 이름 static const string AFFILIATION_BACKGROUND_TAMED_CONTROL_NAME( "creature_monster_target_type_use_01" ); // 크리쳐 / 펫 / 몬스터 계열 배경 ( 테이밍 됨 )컨트롤 이름 static const string AFFILIATION_POSSIBLE_TAME_DEFAULT_ICON_NAME( "common_mark_monster_type_able_%02d.png" ); // 크리쳐 / 펫 / 몬스터 계열 아이콘 ( 테이밍 가능 ) 기본 이름 static const string AFFILIATION_IMPOSSIBLE_TAME_DEFAULT_ICON_NAME( "common_mark_monster_type_unable_%02d.png" ); // 크리쳐 / 펫 / 몬스터 계열 아이콘 ( 테이밍 불 가능 ) 기본 이름 static const string AFFILIATION_TAMED_DEFAULT_ICON_NAME( "common_mark_monster_type_use_%02d.png" ); // 크리쳐 / 펫 / 몬스터 계열 아이콘 ( 테이밍 됨 ) 기본 이름 static const string PLAYER_LEVEL_COLOR_CONTROL_NAME_ABSOLUTE_STRONG( "creature_monster_target_lv_number_01" ); // 레벨 색상 컨트롤 이름 ( 절대적 강함 ) static const string PLAYER_LEVEL_COLOR_CONTROL_NAME_VERY_STRONG( "creature_monster_target_lv_number_03" ); // 레벨 색상 컨트롤 이름 ( 매우 강함 ) static const string PLAYER_LEVEL_COLOR_CONTROL_NAME_STRONG( "creature_monster_target_lv_number_02" ); // 레벨 색상 컨트롤 이름 ( 강함 ) static const string PLAYER_LEVEL_COLOR_CONTROL_NAME_WEAK( "creature_monster_target_lv_number_04" ); // 레벨 색상 컨트롤 이름 ( 약함 ) static const string PLAYER_LEVEL_COLOR_CONTROL_NAME_VERY_WEAK( "creature_monster_target_lv_number_05" ); // 레벨 색상 컨트롤 이름 ( 매우 약함 ) static const string PLAYER_LEVEL_COLOR_CONTROL_NAME_ABSOLUTE_WEAK( "creature_monster_target_lv_number_06" ); // 레벨 색상 컨트롤 이름 ( 절대적 약함 ) static const string HP_GAUGE_CONTROL_NAME( "creature_monster_target_hpbar" ); // HP 게이지 컨트롤 이름 static const string HP_GAUGE_VALUE_CONTROL_NAME( "creature_monster_static_hp_value" ); // HP 게이지 수치 컨트롤 이름 static const string MP_GAUGE_CONTROL_NAME( "creature_monster_target_mpbar" ); // MP 게이지 컨트롤 이름 static const string MP_GAUGE_VALUE_CONTROL_NAME( "creature_monster_static_mp_value" ); // MP 게이지 수치 컨트롤 이름 static const string HP_GAUGE_RED_SPRITE_NAME( "common_gauge_titanium_monster_middle" ); // HP 게이지 이미지 (레드) 이름 static const WORD GAUGE_ANIMATION_FILLTIME( 1000 ); // 게이지 차는 애니메이션 시간 static const string RANK_ICON_CONTROL_NAME( "creature_monster_target_rank" ); // 크리쳐 / 펫 / 몬스터 등급 아이콘 컨트롤 이름 static const string EVOLUTION_RANK_ICON_CONTROL_NAME( "creature_monster_mark_evolution_01" ); // 크리쳐 / 펫 / 몬스터 진화 등급 아이콘 컨트롤 이름 static const string RANK_NAME_CONTROL_NAME( "creature_monster_target_text_job_01" ); // 크리쳐 / 펫 / 몬스터 등급 이름 컨트롤 이름 static const string PET_RANK_ICON_ANINAME( "common_mark_rank_pet" ); // 펫 등급 아이콘 이름 static const string CREATURE_RANK_ICONNAME_TAG_BASIC( "#@C1R@#" ); // 크리쳐 랭크 1 아이콘 이름 Tag ( 이 이름을 넣으면 이미지 파일 이름으로 변경 됨 ) static const string CREATURE_RANK_ICONNAME_TAG_NBASIC( "#@C2R@#" ); // 크리쳐 랭크 2 아이콘 이름 Tag ( 이 이름을 넣으면 이미지 파일 이름으로 변경 됨 ) static const string CREATURE_RANK_ICONNAME_TAG_SBASIC( "#@C3R@#" ); // 크리쳐 랭크 3 아이콘 이름 Tag ( 이 이름을 넣으면 이미지 파일 이름으로 변경 됨 ) static const string CREATURE_RANK_ICONNAME_TAG_NRARE( "#@C4R@#" ); // 크리쳐 랭크 4 아이콘 이름 Tag ( 이 이름을 넣으면 이미지 파일 이름으로 변경 됨 ) static const string CREATURE_RANK_ICONNAME_TAG_SRARE( "#@C5R@#" ); // 크리쳐 랭크 5 아이콘 이름 Tag ( 이 이름을 넣으면 이미지 파일 이름으로 변경 됨 ) static const string CREATURE_RANK_ICONNAME_TAG_UNIQUE( "#@C6R@#" ); static const string CREATURE_RANK_ICONNAME_TAG_VERACRUZ("#@C7R@#"); static const string CREATURE_RANK_ICONNAME_TAG_PHANTOM("#@C8R@#"); static const string CREATURE_RANK_ICONNAME_TAG_AURA("#@C9R@#"); static const string CREATURE_RANK_ICONNAME_TAG_SHINNY("#@C10R@#"); static const string CREATURE_RANK_ICONNAME_TAG_GALAXY("#@C11R@#"); static const string MONSTER_RANK_DEFAULT_ICON_NAME( "common_mark_rank_monster_%02d" ); // 몬스터 랭크 아이콘 기본 이름 }; using namespace nsTargetUI_Creature; //----------------------------------------------------------------------------------------------------------------- // 생성자 //----------------------------------------------------------------------------------------------------------------- SUITargetWnd_Creature::SUITargetWnd_Creature( SGameManager * pGameManager, SUIDisplayInfo* pDisplayInfo ) : SUIWnd( pGameManager ) , m_pDisplayInfo( pDisplayInfo ) , m_pLevel( NULL ) , m_pName( NULL ) , m_pEvolutionName( NULL ) , m_pSpecies( NULL ) , m_pAffiliationName( NULL ) , m_pAffiliationBackground_Possible_Tame( NULL ) , m_pAffiliationBackground_Impossible_Tame( NULL ) , m_pAffiliationBackground_Tamed( NULL ) , m_pEnhance( NULL )\ , m_pEnhanceMark( NULL ) , m_pRankIcon( NULL ) , m_pEvolutionRankIcon( NULL ) , m_pAffiliationIcon( NULL ) , m_pHpGauge( NULL ) , m_pHpGaugeValue( NULL ) , m_pMpGauge( NULL ) , m_pMpGaugeValue( NULL ) , m_strLevelPropertyTag( "" ) , m_strNamePropertyTag( "" ) , m_strEvolutionNamePropertyTag( "" ) , m_strSpeciesPropertyTag( "" ) , m_strAffiliationNamePropertyTag( "" ) , m_strEnhancePropertyTag( "" ) , m_strHpGaugeValuePropertyTag( "" ) , m_strMpGaugeValuePropertyTag( "" ) , m_strLevelTextColorValue_AbsoluteStrong( "FFFFFF" ) , m_strLevelTextColorValue_VeryStrong( "FFFFFF" ) , m_strLevelTextColorValue_Strong( "FFFFFF" ) , m_strLevelTextColorValue_Similar( "FFFFFF" ) , m_strLevelTextColorValue_Weak( "FFFFFF" ) , m_strLevelTextColorValue_VeryWeak( "FFFFFF" ) , m_strLevelTextColorValue_AbsoluteWeak( "FFFFFF" ) { } //----------------------------------------------------------------------------------------------------------------- // 파괴자 //----------------------------------------------------------------------------------------------------------------- SUITargetWnd_Creature::~SUITargetWnd_Creature() { } //----------------------------------------------------------------------------------------------------------------- // 윈도우 생성 //----------------------------------------------------------------------------------------------------------------- SUIWnd* SUITargetWnd_Creature::CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID ) { SUIWnd::CreateWnd( szFile, pWndManager, kPos, nWindowID ); return this; } //----------------------------------------------------------------------------------------------------------------- // 컨트롤 초기화 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::InitControls( KPoint kPos ) { return SUIWnd::InitControls( kPos ); } //----------------------------------------------------------------------------------------------------------------- // 데이터 초기화 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::InitData( bool bReload /*= false*/ ) { m_pLevel = dynamicCast( GetChild( LEVEL_CONTROL_NAME.c_str() ) ); if( NULL == m_pLevel ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", LEVEL_CONTROL_NAME.c_str() ); assert( m_pLevel ); } else { string strCaption( m_pLevel->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strLevelPropertyTag ); GetTextColorValue( strCaption, m_strLevelTextColorValue_Similar ); } m_pName = dynamicCast( GetChild( NAME_CONTROL_NAME.c_str() ) ); if( NULL == m_pName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", NAME_CONTROL_NAME.c_str() ); assert( m_pName ); } else { string strCaption( m_pName->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strNamePropertyTag ); } m_pEvolutionName = dynamicCast( GetChild( EVOLUTIONNAME_CONTROL_NAME.c_str() ) ); if( NULL == m_pEvolutionName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", EVOLUTIONNAME_CONTROL_NAME.c_str() ); assert( m_pEvolutionName ); } else { string strCaption( m_pEvolutionName->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strEvolutionNamePropertyTag ); } m_pSpecies = dynamicCast( GetChild( SPECIES_NAME_CONTROL_NAME.c_str() ) ); if( NULL == m_pSpecies ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", SPECIES_NAME_CONTROL_NAME.c_str() ); assert( m_pSpecies ); } else { string strCaption( m_pSpecies->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strSpeciesPropertyTag ); } m_pAffiliationName = dynamicCast( GetChild( AFFILIATION_NAME_CONTROL_NAME.c_str() ) ); if( NULL == m_pAffiliationName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", AFFILIATION_NAME_CONTROL_NAME.c_str() ); assert( m_pAffiliationName ); } else { string strCaption( m_pAffiliationName->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strAffiliationNamePropertyTag ); } m_pAffiliationBackground_Possible_Tame = dynamicCast( GetChild( AFFILIATION_BACKGROUND_POSSIBLE_TAME_CONTROL_NAME.c_str() ) ); if( NULL == m_pAffiliationBackground_Possible_Tame ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", AFFILIATION_BACKGROUND_POSSIBLE_TAME_CONTROL_NAME.c_str() ); assert( m_pAffiliationBackground_Possible_Tame ); } else { m_pAffiliationBackground_Possible_Tame->SetShow( false ); } m_pAffiliationBackground_Impossible_Tame = dynamicCast( GetChild( AFFILIATION_BACKGROUND_IMPOSSIBLE_TAME_CONTROL_NAME.c_str() ) ); if( NULL == m_pAffiliationBackground_Impossible_Tame ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", AFFILIATION_BACKGROUND_IMPOSSIBLE_TAME_CONTROL_NAME.c_str() ); assert( m_pAffiliationBackground_Impossible_Tame ); } else { m_pAffiliationBackground_Impossible_Tame->SetShow( false ); } m_pAffiliationBackground_Tamed = dynamicCast( GetChild( AFFILIATION_BACKGROUND_TAMED_CONTROL_NAME.c_str() ) ); if( NULL == m_pAffiliationBackground_Tamed ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", AFFILIATION_BACKGROUND_TAMED_CONTROL_NAME.c_str() ); assert( m_pAffiliationBackground_Tamed ); } else { m_pAffiliationBackground_Tamed->SetShow( false ); } m_pEnhance = dynamicCast( GetChild( ENHANCE_CONTROL_NAME.c_str() ) ); if( NULL == m_pEnhance ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", ENHANCE_CONTROL_NAME.c_str() ); assert( m_pEnhance ); } else { string strCaption( m_pEnhance->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strEnhancePropertyTag ); } m_pEnhanceMark = dynamicCast( GetChild( ENHANCE_MARK_CONTROL_NAME.c_str() ) ); if( NULL == m_pEnhanceMark ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", ENHANCE_MARK_CONTROL_NAME.c_str() ); assert( m_pEnhanceMark ); } m_pRankIcon = dynamicCast( GetChild( RANK_ICON_CONTROL_NAME.c_str() ) ); if( NULL == m_pRankIcon ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", RANK_ICON_CONTROL_NAME.c_str() ); assert( m_pRankIcon ); } m_pEvolutionRankIcon = dynamicCast( GetChild( EVOLUTION_RANK_ICON_CONTROL_NAME.c_str() ) ); if( NULL == m_pEvolutionRankIcon ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", EVOLUTION_RANK_ICON_CONTROL_NAME.c_str() ); assert( m_pEvolutionRankIcon ); } m_pAffiliationIcon = dynamicCast( GetChild( AFFILIATION_ICON_CONTROL_NAME.c_str() ) ); if( NULL == m_pAffiliationIcon ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", AFFILIATION_ICON_CONTROL_NAME.c_str() ); assert( m_pAffiliationIcon ); } m_pHpGauge = dynamicCast( GetChild( HP_GAUGE_CONTROL_NAME.c_str() ) ); if( NULL == m_pHpGauge ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", HP_GAUGE_CONTROL_NAME.c_str() ); assert( m_pHpGauge ); } m_pHpGaugeValue = dynamicCast( GetChild( HP_GAUGE_VALUE_CONTROL_NAME.c_str() ) ); if( NULL == m_pHpGaugeValue ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", HP_GAUGE_VALUE_CONTROL_NAME.c_str() ); assert( m_pHpGaugeValue ); } else { string strCaption( m_pHpGaugeValue->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strHpGaugeValuePropertyTag ); m_pHpGaugeValue->SetShow( true ); } m_pMpGauge = dynamicCast( GetChild( MP_GAUGE_CONTROL_NAME.c_str() ) ); if( NULL == m_pMpGauge ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", MP_GAUGE_CONTROL_NAME.c_str() ); assert( m_pMpGauge ); } m_pMpGaugeValue = dynamicCast( GetChild( MP_GAUGE_VALUE_CONTROL_NAME.c_str() ) ); if( NULL == m_pMpGaugeValue ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 컨트롤 정보 얻기 실패 - Name[%s]", MP_GAUGE_VALUE_CONTROL_NAME.c_str() ); assert( m_pMpGaugeValue ); } else { string strCaption( m_pMpGaugeValue->GetCaption() ); GetTextDecoration( strCaption.c_str(), m_strMpGaugeValuePropertyTag ); m_pMpGaugeValue->SetShow( true ); } KUIControlStatic* pLevelTextColor_AbsoluteStorng = dynamicCast( GetChild( PLAYER_LEVEL_COLOR_CONTROL_NAME_ABSOLUTE_STRONG.c_str() ) ); if( NULL == pLevelTextColor_AbsoluteStorng ) { SDEBUGLOG( "[타겟윈도우(NPC)] 컨트롤 정보 얻기 실패 - Name[%s]", PLAYER_LEVEL_COLOR_CONTROL_NAME_ABSOLUTE_STRONG.c_str() ); assert( pLevelTextColor_AbsoluteStorng ); } else { string strCaption( pLevelTextColor_AbsoluteStorng->GetCaption() ); GetTextColorValue( strCaption, m_strLevelTextColorValue_AbsoluteStrong ); } KUIControlStatic* pLevelTextColor_VeryStorng = dynamicCast( GetChild( PLAYER_LEVEL_COLOR_CONTROL_NAME_VERY_STRONG.c_str() ) ); if( NULL == pLevelTextColor_VeryStorng ) { SDEBUGLOG( "[타겟윈도우(NPC)] 컨트롤 정보 얻기 실패 - Name[%s]", PLAYER_LEVEL_COLOR_CONTROL_NAME_VERY_STRONG.c_str() ); assert( pLevelTextColor_VeryStorng ); } else { string strCaption( pLevelTextColor_VeryStorng->GetCaption() ); GetTextColorValue( strCaption, m_strLevelTextColorValue_VeryStrong ); } KUIControlStatic* pLevelTextColor_Storng = dynamicCast( GetChild( PLAYER_LEVEL_COLOR_CONTROL_NAME_STRONG.c_str() ) ); if( NULL == pLevelTextColor_Storng ) { SDEBUGLOG( "[타겟윈도우(NPC)] 컨트롤 정보 얻기 실패 - Name[%s]", PLAYER_LEVEL_COLOR_CONTROL_NAME_STRONG.c_str() ); assert( pLevelTextColor_Storng ); } else { string strCaption( pLevelTextColor_Storng->GetCaption() ); GetTextColorValue( strCaption, m_strLevelTextColorValue_Strong ); } KUIControlStatic* pLevelTextColor_Weak = dynamicCast( GetChild( PLAYER_LEVEL_COLOR_CONTROL_NAME_WEAK.c_str() ) ); if( NULL == pLevelTextColor_Weak ) { SDEBUGLOG( "[타겟윈도우(NPC)] 컨트롤 정보 얻기 실패 - Name[%s]", PLAYER_LEVEL_COLOR_CONTROL_NAME_WEAK.c_str() ); assert( pLevelTextColor_Weak ); } else { string strCaption( pLevelTextColor_Weak->GetCaption() ); GetTextColorValue( strCaption, m_strLevelTextColorValue_Weak ); } KUIControlStatic* pLevelTextColor_VeryWeak = dynamicCast( GetChild( PLAYER_LEVEL_COLOR_CONTROL_NAME_VERY_WEAK.c_str() ) ); if( NULL == pLevelTextColor_VeryWeak ) { SDEBUGLOG( "[타겟윈도우(NPC)] 컨트롤 정보 얻기 실패 - Name[%s]", PLAYER_LEVEL_COLOR_CONTROL_NAME_VERY_WEAK.c_str() ); assert( pLevelTextColor_VeryWeak ); } else { string strCaption( pLevelTextColor_VeryWeak->GetCaption() ); GetTextColorValue( strCaption, m_strLevelTextColorValue_VeryWeak ); } KUIControlStatic* pLevelTextColor_AbsoluteWeak = dynamicCast( GetChild( PLAYER_LEVEL_COLOR_CONTROL_NAME_ABSOLUTE_WEAK.c_str() ) ); if( NULL == pLevelTextColor_AbsoluteWeak ) { SDEBUGLOG( "[타겟윈도우(NPC)] 컨트롤 정보 얻기 실패 - Name[%s]", PLAYER_LEVEL_COLOR_CONTROL_NAME_ABSOLUTE_WEAK.c_str() ); assert( pLevelTextColor_AbsoluteWeak ); } else { string strCaption( pLevelTextColor_AbsoluteWeak->GetCaption() ); GetTextColorValue( strCaption, m_strLevelTextColorValue_AbsoluteWeak ); } return SUIWnd::InitData(bReload); } //----------------------------------------------------------------------------------------------------------------- // 윈도우 열리고, 닫힐 때 //----------------------------------------------------------------------------------------------------------------- void SUITargetWnd_Creature::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd ) { SUIWnd::OnNotifyUIWindowOpen( bOpen ); } //----------------------------------------------------------------------------------------------------------------- // 메시지 처리 //----------------------------------------------------------------------------------------------------------------- void SUITargetWnd_Creature::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam ) { if( NULL == lpszControlID ) return; if( NULL == m_pGameManager ) return; string strControlID( lpszControlID ); switch( nMessage ) { case KBUTTON_CLICK: case KBUTTON_PRESSING: { if( NULL == strControlID.compare( "creature_monster_target_off_01" ) ) // 닫기 버튼 클릭 { m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_TARGET_CREATURE, false ) ); m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_TARGET_STATE, false ) ); // 타겟 해제, 게임 내에 NULL 타겟을 보낸다 SIMSG_UI_ACT_TARGET msg; msg.m_nTargetHandle = NULL; m_pGameManager->ProcMsgAtStatic(&msg); } } break; default: break; } SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam ); } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 //----------------------------------------------------------------------------------------------------------------- void SUITargetWnd_Creature::ProcMsgAtStatic( SGameMessage* pMsg ) { if( NULL == pMsg ) return; switch( pMsg->nType ) { case MSG_CHANGE_NAME: { SMSG_CHANGE_NAME* pChangeNameMsg( static_cast( pMsg ) ); ProcessMessage_ChangeName( pChangeNameMsg ); } break; case MSG_PROPERTY: { SMSG_PROPERTY* pProperty( static_cast( pMsg ) ); if( pProperty ) { if( SMSG_PROPERTY::PROPERTY_LEVEL == pProperty->nPropertyType ) ProcessMessage_Property_Level( pProperty ); } } break; case IMSG_UI_TARGET_INFO: { SIMSG_UI_TARGET_INFO* pTargetMsg( static_cast( pMsg ) ); ProcessMessage_UITargetInfo( pTargetMsg ); } break; case IMSG_UI_TARGET_STAT: { SIMSG_UI_TARGET_STAT* pStatMsg = static_cast( pMsg ); ProcessMessage_UITargetStat( pStatMsg ); } break; } pMsg->bUse = true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 레벨 변경 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_Property_Level( SMSG_PROPERTY* const pPropertyLevelMsg ) { if( false == IsShow() ) return false; if( NULL == pPropertyLevelMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pPropertyLevelMsg ); return false; } if( NULL == pPropertyLevelMsg->handle ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 핸들 정보가 유효하지 않습니다." ); assert( pPropertyLevelMsg->handle ); return false; } if( pPropertyLevelMsg->handle != m_PlayerInfoMgr.GetTarget() ) return false; if( m_pLevel ) { int nTargetLevel( NULL ); string strLevel( m_strLevelPropertyTag ); if( NULL != pPropertyLevelMsg->strValue.length() ) nTargetLevel = _ttoi( pPropertyLevelMsg->strValue.c_str() ); ReplaceTextColorValue( strLevel, GetLevelTextColorValue( nTargetLevel ) ); if( NULL != pPropertyLevelMsg->strValue.length() ) strLevel.append( pPropertyLevelMsg->strValue ); else strLevel.append( "0" ); m_pLevel->SetCaption( strLevel.c_str() ); } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 이름 변경 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_ChangeName( SMSG_CHANGE_NAME* const pChangeNameMsg ) { if( false == IsShow() ) return false; if( NULL == pChangeNameMsg ) { SDEBUGLOG( "[타겟윈도우(PLAYER)] Msg 포인터가 유효하지 않습니다." ); assert( pChangeNameMsg ); return false; } if( NULL == pChangeNameMsg->handle ) { SDEBUGLOG( "[타겟윈도우(PLAYER)] Msg 핸들 정보가 유효하지 않습니다." ); assert( pChangeNameMsg->handle ); return false; } if( pChangeNameMsg->handle != m_PlayerInfoMgr.GetTarget() ) return false; if( m_pName ) { string strPlayerName( m_strNamePropertyTag ); string strTempName( m_PlayerInfoMgr.GetTargetName() ); if( NULL == strTempName.length() ) strPlayerName.append( "Unknown Name" ); else strPlayerName.append( strTempName ); m_pName->SetCaption( strPlayerName.c_str() ); } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - UI 타겟 스텟 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetStat( SIMSG_UI_TARGET_STAT* const pStatMsg ) { if( false == IsShow() ) return false; if( NULL == pStatMsg ) { SDEBUGLOG( "[타겟윈도우(PLAYER)] Msg 포인터가 유효하지 않습니다." ); assert( pStatMsg ); return false; } if( NULL == pStatMsg->handle ) { SDEBUGLOG( "[타겟윈도우(PLAYER)] Msg 핸들 정보가 유효하지 않습니다." ); assert( pStatMsg->handle ); return false; } if( pStatMsg->handle != m_PlayerInfoMgr.GetTarget() ) return false; ProcessMessage_UITargetStat_Gauge( pStatMsg ); return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - UI 타겟 스텟 ( HP, MP 게이지 ) //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetStat_Gauge( SIMSG_UI_TARGET_STAT* const pStatMsg ) { if( NULL == m_pDisplayInfo ) { SDEBUGLOG( "[타겟윈도우(PLAYER)] 디스플레이 정보 포인터가 유효하지 않습니다." ); assert( m_pDisplayInfo ); return false; } BYTE byType( NULL ); bool bFriend( m_pDisplayInfo->IsFriend( pStatMsg->handle, byType ) ? true : false ); int nMaxHP( max( pStatMsg->m_nVar1, pStatMsg->m_nVar3 ) ); int nCurrentHP( max( pStatMsg->m_nVar1, 0LL ) ); int nMaxMP( max( pStatMsg->m_nVar2, pStatMsg->m_nVar4 ) ); int nCurrentMP( max( pStatMsg->m_nVar2, 0LL ) ); if( m_pHpGaugeValue ) { string strHpGaugeValue( m_strHpGaugeValuePropertyTag ); int nExp = 100, nRest = 0; m_pDisplayInfo->GetPercentValue( nCurrentHP, nMaxHP, &nExp, &nRest ); strHpGaugeValue.append( StringFormat( "%d.%d", nExp, nRest ) ); strHpGaugeValue += "%"; #ifdef _DEV // HP TEXT 출력 부분 ( 개발 버젼에서만 보임 ) strHpGaugeValue.append( StringFormat( "[DEV]%u/%u", nCurrentHP, nMaxHP ) ); #endif m_pHpGaugeValue->SetCaption( strHpGaugeValue.c_str() ); } if( m_pHpGauge ) RefreshGauge( m_pHpGauge, nCurrentHP, nMaxHP, true, bFriend ); if( m_pMpGaugeValue ) { string strMpGaugeValue( m_strMpGaugeValuePropertyTag ); int nExp = 100, nRest = 0; m_pDisplayInfo->GetPercentValue( nCurrentMP, nMaxMP, &nExp, &nRest ); strMpGaugeValue.append( StringFormat( "%d.%d", nExp, nRest ) ); strMpGaugeValue += "%"; #ifdef _DEV // HP TEXT 출력 부분 ( 개발 버젼에서만 보임 ) strMpGaugeValue.append( StringFormat( "[DEV]%u/%u", nCurrentMP, nMaxMP ) ); #endif m_pMpGaugeValue->SetCaption( strMpGaugeValue.c_str() ); } if( m_pMpGauge ) RefreshGauge( m_pMpGauge, nCurrentMP, nMaxMP, true, bFriend ); return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - UI 타겟 정보 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == pTargetMsg->handle ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 핸들 정보가 유효하지 않습니다." ); assert( pTargetMsg->handle ); return false; } ProcessMessage_UITargetInfo_Name( pTargetMsg ); ProcessMessage_UITargetInfo_Level( pTargetMsg ); ProcessMessage_UITargetInfo_Enhance( pTargetMsg ); ProcessMessage_UITargetInfo_RankIcon( pTargetMsg ); ProcessMessage_UITargetInfo_EvolutionRankIcon( pTargetMsg ); ProcessMessage_UITargetInfo_Species( pTargetMsg ); ProcessMessage_UITargetInfo_Affiliation( pTargetMsg ); ProcessMessage_UITargetInfo_AffiliationBackground( pTargetMsg ); ProcessMessage_UITargetInfo_Gauge( pTargetMsg ); return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 이름 갱신 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_Name( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 이름 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pName ); return false; } if( NULL == m_pEvolutionName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 진화 이름 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pEvolutionName ); return false; } string strName( m_strNamePropertyTag ); string strTempName( pTargetMsg->strName ); if( NULL == strTempName.length() ) strName.append( "Unknown Name" ); else strName.append( strTempName ); m_pName->SetCaption( strName.c_str() ); string strEvolutionName( m_strEvolutionNamePropertyTag ); switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { strEvolutionName.append( "*" ); strEvolutionName.append( pTargetMsg->strEvolutionName.c_str() ); m_pEvolutionName->SetCaption( strEvolutionName.c_str() ); m_pEvolutionName->SetShow ( true ); } break; case TS_ENTER::GAME_SUMMON: { strEvolutionName.append( pTargetMsg->strEvolutionName.c_str() ); m_pEvolutionName->SetCaption( strEvolutionName.c_str() ); m_pEvolutionName->SetShow ( true ); } break; case TS_ENTER::GAME_MOB: { m_pEvolutionName->SetShow ( false ); } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 레벨 갱신 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_Level( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pLevel ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 레벨 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pLevel ); return false; } int nTargetLevel( pTargetMsg->nLevel ); string strLevel( m_strLevelPropertyTag ); string strTempLevel( StringFormat( "%u", nTargetLevel ) ); switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { strLevel.append( strTempLevel ); m_pLevel->SetCaption( strLevel.c_str() ); } break; case TS_ENTER::GAME_SUMMON: case TS_ENTER::GAME_MOB: { ReplaceTextColorValue( strLevel, GetLevelTextColorValue( nTargetLevel ) ); strLevel.append( strTempLevel ); m_pLevel->SetCaption( strLevel.c_str() ); } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 강화 갱신 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_Enhance( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pEnhance ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 강화 아이콘 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pEnhance ); return false; } if( NULL == m_pEnhanceMark ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 강화 마크 아이콘 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pEnhanceMark ); return false; } switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { m_pEnhance->SetShow( false ); m_pEnhanceMark->SetShow( false ); } break; case TS_ENTER::GAME_SUMMON: { m_pEnhance->SetShow( false ); m_pEnhanceMark->SetShow( false ); //Show Pet Stage Rate ///Alucard 27/9/2010 int nEnhance( NULL ); const SCreatureInfo* pInfo( m_CreatureSlotMgr.GetCreatureInfo( pTargetMsg->handle ) ); if( pInfo ) { SInventorySlot* pInventorySlot( m_InventoryMgr.GetItemInfo(pInfo->GetCardHandle() ) ); if( pInventorySlot ) nEnhance = pInventorySlot->GetEnhance(); string strEnhance( m_strEnhancePropertyTag ); string strTempEnhance( StringFormat( "%u", nEnhance ) ); strEnhance.append( strTempEnhance ); m_pEnhance->SetCaption( strEnhance.c_str() ); } else { m_pEnhance->SetShow( false ); m_pEnhanceMark->SetShow( false ); } } break; case TS_ENTER::GAME_MOB: { m_pEnhance->SetShow( false ); m_pEnhanceMark->SetShow( false ); } break; default: { SDEBUGLOG( "[TargetWindow (CREATURE)] Unknown object type. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 종 설정 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_Species( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pSpecies ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 종 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pSpecies ); return false; } string strSpecies( m_strSpeciesPropertyTag ); switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { UINT nSpeciesID( GetPetDB().GetSpeciesID( pTargetMsg->nMobID ) ); MONSTER_SPECIES_INFO* const pSpeciesInfo( GetMonsterSpeciesDB().GetMonsterSpeciesInfo( nSpeciesID ) ); if( pSpeciesInfo ) { strSpecies.append( S( pSpeciesInfo->m_nStringID ) ); m_pSpecies->SetCaption( strSpecies.c_str() ); if( false == m_pSpecies->IsShow() ) m_pSpecies->SetShow( true ); } else m_pSpecies->SetShow( false ); } break; case TS_ENTER::GAME_SUMMON: { int nID( NULL ); const SCreatureInfo* pInfo( m_CreatureSlotMgr.GetCreatureInfo( pTargetMsg->handle ) ); if( pInfo ) nID = pInfo->GetID(); else nID = pTargetMsg->nMobID; if( nID <= NULL ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 크리쳐 정보를 얻어 올 수 없습니다." ); assert( pInfo ); m_pSpecies->SetShow( false ); break; } UINT nSpeciesID( GetCreatureDB().GetSpeciesID( nID ) ); MONSTER_SPECIES_INFO* const pSpeciesInfo( GetMonsterSpeciesDB().GetMonsterSpeciesInfo( nSpeciesID ) ); if( pSpeciesInfo ) { strSpecies.append( S( pSpeciesInfo->m_nStringID ) ); m_pSpecies->SetCaption( strSpecies.c_str() ); if( false == m_pSpecies->IsShow() ) m_pSpecies->SetShow( true ); } else m_pSpecies->SetShow( false ); } break; case TS_ENTER::GAME_MOB: { UINT nSpeciesID( GetMonsterDB().GetSpeciesID( pTargetMsg->nMobID ) ); MONSTER_SPECIES_INFO* const pSpeciesInfo( GetMonsterSpeciesDB().GetMonsterSpeciesInfo( nSpeciesID ) ); if( pSpeciesInfo ) { strSpecies.append( S( pSpeciesInfo->m_nStringID ) ); m_pSpecies->SetCaption( strSpecies.c_str() ); if( false == m_pSpecies->IsShow() ) m_pSpecies->SetShow( true ); } else m_pSpecies->SetShow( false ); } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 계열 설정 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_Affiliation( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pAffiliationName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 계열 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pAffiliationName ); return false; } string strAffiliationResult( m_strAffiliationNamePropertyTag ); string strAffiliation( "" ); string strAffiliationDetail( "" ); switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { UINT nAffiliationID( GetPetDB().GetAffiliationID( pTargetMsg->nMobID ) ); UINT nAffiliationDetailID( GetPetDB().GetAffiliationDetailID( pTargetMsg->nMobID ) ); MONSTER_AFFILIATION_INFO* const pAffiliationInfo( GetMonsterAffiliationDB().GetMonsterAffiliationInfo( nAffiliationID ) ); if( pAffiliationInfo ) { strAffiliation = S( pAffiliationInfo->m_nStringID ); strAffiliationResult.append( strAffiliation ); } MONSTER_AFFILIATION_DETAIL_INFO* const pAffiliationDetail( GetMonsterAffiliationDetailDB().GetMonsterAffiliationDetailInfo( nAffiliationDetailID ) ); if( pAffiliationDetail ) { strAffiliationDetail = S( pAffiliationDetail->m_nStringID ); if( NULL != strAffiliationDetail.compare( strAffiliation ) ) { strAffiliationResult.append( " : " ); strAffiliationResult.append( strAffiliationDetail ); } if( m_pAffiliationIcon ) m_pAffiliationIcon->SetIcon( c_szDEF_SPR_NAME, pAffiliationDetail->m_strTamingImpossibleIconFileName.c_str() ); } m_pAffiliationName->SetCaption( strAffiliationResult.c_str() ); } break; case TS_ENTER::GAME_SUMMON: { int nID( NULL ); const SCreatureInfo* pInfo( m_CreatureSlotMgr.GetCreatureInfo( pTargetMsg->handle ) ); if( pInfo ) nID = pInfo->GetID(); else nID = pTargetMsg->nMobID; if( nID <= NULL ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 크리쳐 정보를 얻어 올 수 없습니다." ); assert( pInfo ); m_pAffiliationName->SetCaption( strAffiliationResult.c_str() ); m_pAffiliationIcon->SetIcon(); break; } UINT nAffiliationID( GetCreatureDB().GetAffiliationID( nID ) ); UINT nAffiliationDetailID( GetCreatureDB().GetAffiliationDetailID( nID ) ); MONSTER_AFFILIATION_INFO* const pAffiliationInfo( GetMonsterAffiliationDB().GetMonsterAffiliationInfo( nAffiliationID ) ); if( pAffiliationInfo ) { strAffiliation = S( pAffiliationInfo->m_nStringID ); strAffiliationResult.append( strAffiliation ); } MONSTER_AFFILIATION_DETAIL_INFO* const pAffiliationDetail( GetMonsterAffiliationDetailDB().GetMonsterAffiliationDetailInfo( nAffiliationDetailID ) ); if( pAffiliationDetail ) { strAffiliationDetail = S( pAffiliationDetail->m_nStringID ); if( NULL != strAffiliationDetail.compare( strAffiliation ) ) { strAffiliationResult.append( " : " ); strAffiliationResult.append( strAffiliationDetail ); } if( m_pAffiliationIcon ) m_pAffiliationIcon->SetIcon( c_szDEF_SPR_NAME, pAffiliationDetail->m_strTamingTamedIconFileName.c_str() ); } m_pAffiliationName->SetCaption( strAffiliationResult.c_str() ); } break; case TS_ENTER::GAME_MOB: { UINT nAffiliationID( GetMonsterDB().GetAffiliationID( pTargetMsg->nMobID ) ); UINT nAffiliationDetailID( GetMonsterDB().GetAffiliationDetailID( pTargetMsg->nMobID ) ); MONSTER_AFFILIATION_INFO* const pAffiliationInfo( GetMonsterAffiliationDB().GetMonsterAffiliationInfo( nAffiliationID ) ); if( pAffiliationInfo ) { strAffiliation = S( pAffiliationInfo->m_nStringID ); strAffiliationResult.append( strAffiliation ); } MONSTER_AFFILIATION_DETAIL_INFO* const pAffiliationDetail( GetMonsterAffiliationDetailDB().GetMonsterAffiliationDetailInfo( nAffiliationDetailID ) ); if( pAffiliationDetail ) { strAffiliationDetail = S( pAffiliationDetail->m_nStringID ); if( NULL != strAffiliationDetail.compare( strAffiliation ) ) { strAffiliationResult.append( " : " ); strAffiliationResult.append( strAffiliationDetail ); } if( m_pAffiliationIcon ) { bool bIsPossibleTaming( GetMonsterDB().IsPossibleTaming( pTargetMsg->nMobID ) ); if( bIsPossibleTaming ) m_pAffiliationIcon->SetIcon( c_szDEF_SPR_NAME, pAffiliationDetail->m_strTamingPossibleIconFileName.c_str() ); else m_pAffiliationIcon->SetIcon( c_szDEF_SPR_NAME, pAffiliationDetail->m_strTamingImpossibleIconFileName.c_str() ); } } m_pAffiliationName->SetCaption( strAffiliationResult.c_str() ); } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 계열 배경 설정 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_AffiliationBackground( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pAffiliationBackground_Possible_Tame || NULL == m_pAffiliationBackground_Impossible_Tame || NULL == m_pAffiliationBackground_Tamed || NULL == m_pAffiliationIcon ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 계열 배경 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pSpecies ); return false; } switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { m_pAffiliationBackground_Possible_Tame->SetShow( false ); m_pAffiliationBackground_Impossible_Tame->SetShow( true ); m_pAffiliationBackground_Tamed->SetShow( false ); m_pAffiliationIcon->SetTooltip( S( 690000061 ) /*테이밍 할 수 없는 몬스터*/ ); } break; case TS_ENTER::GAME_SUMMON: { m_pAffiliationBackground_Possible_Tame->SetShow( false ); m_pAffiliationBackground_Impossible_Tame->SetShow( false ); m_pAffiliationBackground_Tamed->SetShow( true ); m_pAffiliationIcon->SetTooltip( S( 690000062 ) /*테이밍 된 몬스터 */ ); } break; case TS_ENTER::GAME_MOB: { bool bIsPossibleTaming( GetMonsterDB().IsPossibleTaming( pTargetMsg->nMobID ) ); if( bIsPossibleTaming ) { m_pAffiliationBackground_Possible_Tame->SetShow( true ); m_pAffiliationBackground_Impossible_Tame->SetShow( false ); _MONSTER_INFO_FILE* pMobData = GetMonsterDB().GetMonsterData( pTargetMsg->nMobID ); // 기존 크리쳐 카드 int nTamingCode = pMobData->taming_code; if( pMobData->creature_taming_code ) { // 소울 크리처 카드 nTamingCode = GetMonsterCreatureDB().GetTameCode( pMobData->creature_taming_code ); } int nCardItemCode = 0; _SUMMON_INFO_FILE* pSpec = GetCreatureDB().GetCreatureData( nTamingCode ); if( pSpec != NULL ) { nCardItemCode = pSpec->card_id; } if( nCardItemCode != 0 ) { m_pAffiliationIcon->SetTooltip( SR( 188, "#@item_name@#", S( GetItemDB().GetTextID( nCardItemCode ) ) ).c_str() ); } else { m_pAffiliationIcon->SetTooltip( S( 690000060 ) /*테이밍 할 수 있는 몬스터*/ ); } } else { m_pAffiliationBackground_Possible_Tame->SetShow( false ); m_pAffiliationBackground_Impossible_Tame->SetShow( true ); m_pAffiliationIcon->SetTooltip( S( 690000061 ) /*테이밍 할 수 없는 몬스터*/ ); } m_pAffiliationBackground_Tamed->SetShow( false ); } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 등급 아이콘 갱신 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_RankIcon( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pRankIcon ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 랭크 아이콘 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pRankIcon ); return false; } switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_PET: { m_pRankIcon->SetCaption( "" ); m_pRankIcon->SetIcon( c_szDEF_SPR_NAME, PET_RANK_ICON_ANINAME.c_str() ); m_pRankIcon->SetTooltip( S( 6674 ) /*펫*/ ); if( false == m_pRankIcon->IsShow() ) m_pRankIcon->SetShow( true ); } break; case TS_ENTER::GAME_SUMMON: { m_pRankIcon->SetIcon(); string strCreatureRank( "" ); string strCreatureRankToolTip( "" ); BYTE byRank( SummonBase::RATE_BASIC ); int nID( NULL ); const SCreatureInfo* pInfo( m_CreatureSlotMgr.GetCreatureInfo( pTargetMsg->handle ) ); if( pInfo ) nID = pInfo->GetID(); else nID = pTargetMsg->nMobID; if( nID <= NULL ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 크리쳐 정보를 얻어 올 수 없습니다." ); assert( pInfo ); m_pRankIcon->SetShow( false ); break; } byRank = GetCreatureDB().GetRate( nID ); switch( byRank ) { case SummonBase::RATE_BASIC: strCreatureRank.append( CREATURE_RANK_ICONNAME_TAG_BASIC ); break; case SummonBase::RATE_NORMAL_BASIC: strCreatureRank.append( CREATURE_RANK_ICONNAME_TAG_NBASIC ); break; case SummonBase::RATE_SPECIAL_BASIC: strCreatureRank.append( CREATURE_RANK_ICONNAME_TAG_SBASIC ); break; case SummonBase::RATE_NORMAL_RARE: strCreatureRank.append( CREATURE_RANK_ICONNAME_TAG_NRARE ); break; case SummonBase::RATE_SPECIAL_RARE: strCreatureRank.append( CREATURE_RANK_ICONNAME_TAG_SRARE ); break; case SummonBase::RATE_UNIQUE: strCreatureRank.append( CREATURE_RANK_ICONNAME_TAG_UNIQUE ); break; // AziaMafia Pet Rarity case SummonBase::RATE_VERACRUZ: strCreatureRank.append(CREATURE_RANK_ICONNAME_TAG_VERACRUZ); break; case SummonBase::RATE_PHANTOM: strCreatureRank.append(CREATURE_RANK_ICONNAME_TAG_PHANTOM); break; case SummonBase::RATE_AURA: strCreatureRank.append(CREATURE_RANK_ICONNAME_TAG_AURA); break; case SummonBase::RATE_SHINNY: strCreatureRank.append(CREATURE_RANK_ICONNAME_TAG_SHINNY); break; case SummonBase::RATE_GALAXY: strCreatureRank.append(CREATURE_RANK_ICONNAME_TAG_GALAXY); break; default: { SDEBUGLOG( "[Target Window (CREATURE)] Unknown creature grade. - [%u]", byRank ); assert( NULL ); } break; } m_pRankIcon->SetCaption( strCreatureRank.c_str() ); m_pRankIcon->SetTooltip( GetCreatureDB().GetRateString( byRank ).c_str() ); if( false == m_pRankIcon->IsShow() ) m_pRankIcon->SetShow( true ); } break; case TS_ENTER::GAME_MOB: { if( NULL == pTargetMsg->nMobID ) { m_pRankIcon->SetShow( false ); break; } m_pRankIcon->SetCaption( "" ); int nRank( GetMonsterDB().GetGradeIconID( pTargetMsg->nMobID ) ); string strRankIconAniName( CStringUtil::StringFormat( MONSTER_RANK_DEFAULT_ICON_NAME.c_str(), nRank ) ); string strRankIconToolTip( GetMonsterDB().GetGradeString( nRank ) ); m_pRankIcon->SetIcon( c_szDEF_SPR_NAME, strRankIconAniName.c_str() ); m_pRankIcon->SetTooltip( strRankIconToolTip.c_str() ); if( false == m_pRankIcon->IsShow() ) m_pRankIcon->SetShow( true ); } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 진화 등급 아이콘 갱신 //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_EvolutionRankIcon( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == pTargetMsg ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] Msg 포인터가 유효하지 않습니다." ); assert( pTargetMsg ); return false; } if( NULL == m_pEvolutionRankIcon ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 진화 등급 아이콘 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pEvolutionRankIcon ); return false; } if( NULL == m_pEvolutionName ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 진화 이름 컨트롤 포인터가 유효하지 않습니다." ); assert( m_pEvolutionName ); return false; } switch( pTargetMsg->nObjType ) { case TS_ENTER::GAME_MOB: case TS_ENTER::GAME_PET: m_pEvolutionRankIcon->SetShow( false ); break; case TS_ENTER::GAME_SUMMON: { const SCreatureInfo* pInfo( m_CreatureSlotMgr.GetCreatureInfo( pTargetMsg->handle ) ); int nID( NULL ); if( pInfo ) nID = pInfo->GetID(); else nID = pTargetMsg->nMobID; if( nID <= NULL ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 크리쳐 정보를 얻어 올 수 없습니다." ); assert( pInfo ); m_pEvolutionRankIcon->SetShow( false ); break; } string strGetEvolutionFormIconFileName( GetCreatureDB().GetEvolutionFormIconFileName( nID ) ); if( strGetEvolutionFormIconFileName.empty() ) { m_pEvolutionRankIcon->SetShow( false ); } else { KRect rtEvolutionName( m_pEvolutionName->GetRect() ); DWORD dwCaptionWidth( KTextPhrase::GetOneLineStringSize( m_pEvolutionName->GetCaption(), NULL, NULL ) ); int nCalcWidth( ( rtEvolutionName.GetWidth() - dwCaptionWidth ) * 0.5f ); int nCalcHeight( ( rtEvolutionName.GetHeight() - m_pEvolutionRankIcon->GetRect().GetHeight() ) * 0.5f ); int nIconWidth( m_pEvolutionRankIcon->GetRect().GetWidth() ); const int nOffsetWidth( 2 ); m_pEvolutionRankIcon->MovePos( rtEvolutionName.left + nCalcWidth - nIconWidth - nOffsetWidth, rtEvolutionName.top + nCalcHeight ); m_pEvolutionRankIcon->SetIcon( c_szDEF_SPR_NAME, strGetEvolutionFormIconFileName.c_str() ); m_pEvolutionRankIcon->SetTooltip( GetCreatureDB().GetEvolutionFormString( nID ).c_str() ); m_pEvolutionRankIcon->SetShow( true ); } } break; default: { SDEBUGLOG( "[타겟윈도우(CREATURE)] 알수 없는 오브젝트 타입 입니다. - [%u]", pTargetMsg->nObjType ); assert( NULL ); } break; } return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - UI 타겟 정보 ( HP, MP 게이지 ) //----------------------------------------------------------------------------------------------------------------- bool SUITargetWnd_Creature::ProcessMessage_UITargetInfo_Gauge( SIMSG_UI_TARGET_INFO* const pTargetMsg ) { if( NULL == m_pDisplayInfo ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 디스플레이 정보 포인터가 유효하지 않습니다." ); assert( m_pDisplayInfo ); return false; } BYTE byType( NULL ); bool bFriend( m_pDisplayInfo->IsFriend( pTargetMsg->handle, byType ) ? true : false ); int nMaxHP( max( pTargetMsg->nHP, pTargetMsg->nMaxHP ) ); int nCurrentHP( max( pTargetMsg->nHP, 0 ) ); int nMaxMP( max( pTargetMsg->nMP, pTargetMsg->nMaxMP ) ); int nCurrentMP( max( pTargetMsg->nMP, 0 ) ); if( m_pHpGaugeValue ) { string strHpGaugeValue( m_strHpGaugeValuePropertyTag ); int nExp = 100, nRest = 0; m_pDisplayInfo->GetPercentValue( nCurrentHP, nMaxHP, &nExp, &nRest ); strHpGaugeValue.append( StringFormat( "%d.%d", nExp, nRest ) ); strHpGaugeValue += "%"; #ifdef _DEV // HP TEXT 출력 부분 ( 개발 버젼에서만 보임 ) strHpGaugeValue.append( StringFormat( "[DEV]%u/%u", nCurrentHP, nMaxHP ) ); #endif m_pHpGaugeValue->SetCaption( strHpGaugeValue.c_str() ); } if( m_pHpGauge ) RefreshGauge( m_pHpGauge, nCurrentHP, nMaxHP, false, bFriend ); if( m_pMpGaugeValue ) { string strMpGaugeValue( m_strMpGaugeValuePropertyTag ); int nExp = 100, nRest = 0; m_pDisplayInfo->GetPercentValue( nCurrentMP, nMaxMP, &nExp, &nRest ); strMpGaugeValue.append( StringFormat( "%d.%d", nExp, nRest ) ); strMpGaugeValue += "%"; #ifdef _DEV // HP TEXT 출력 부분 ( 개발 버젼에서만 보임 ) strMpGaugeValue.append( StringFormat( "[DEV]%u/%u", nCurrentMP, nMaxMP ) ); #endif m_pMpGaugeValue->SetCaption( strMpGaugeValue.c_str() ); } if( m_pMpGauge ) RefreshGauge( m_pMpGauge, nCurrentMP, nMaxMP, false, bFriend ); return true; } //----------------------------------------------------------------------------------------------------------------- // 정적 메시지 처리 - 게이지 갱신 //----------------------------------------------------------------------------------------------------------------- void SUITargetWnd_Creature::RefreshGauge( KUIControlGauge* pGaugeControl, const int nCurrent, const int nMax, const bool bAnimation, const bool bFriend ) { if( NULL == pGaugeControl ) { SDEBUGLOG( "[타겟윈도우(CREATURE)] 게이지 컨트롤 포인터가 유효하지 않습니다." ); assert( pGaugeControl ); return; } WORD wGaugeFillTime( NULL ); if( bAnimation ) wGaugeFillTime = GAUGE_ANIMATION_FILLTIME; BYTE byPercent( NULL ); if( nMax > 0 ) byPercent = ( static_cast( nCurrent ) / static_cast( nMax ) ) * 100; pGaugeControl->SetMax( static_cast(nMax) ); if( HP_GAUGE_CONTROL_NAME.compare( pGaugeControl->GetID() ) == NULL ) { if( bFriend ) setHPGaugeTexture( byPercent, pGaugeControl, 11 ); else pGaugeControl->SetBack( c_szDEF_SPR_NAME, HP_GAUGE_RED_SPRITE_NAME.c_str() ); } pGaugeControl->SetGauge( static_cast(nCurrent), wGaugeFillTime ); } //----------------------------------------------------------------------------------------------------------------- // 마우스 메시지 처리 //----------------------------------------------------------------------------------------------------------------- DWORD SUITargetWnd_Creature::OnMouseMessage(DWORD dwMessage, int x, int y) { return SUIWnd::OnMouseMessage(dwMessage, x, y); } //----------------------------------------------------------------------------------------------------------------- // 윈도우 갱신 //----------------------------------------------------------------------------------------------------------------- void* SUITargetWnd_Creature::Perform( KID id, KArg& msg ) { return SUIWnd::Perform( id, msg ); } //----------------------------------------------------------------------------------------------------------------- // 레벨 문자열 색상 값 얻기 //----------------------------------------------------------------------------------------------------------------- string SUITargetWnd_Creature::GetLevelTextColorValue( const int nTargetLevel ) { int nDiffLevel( m_PlayerInfoMgr.GetPlayerInfo().GetLevel() - nTargetLevel ); if( nDiffLevel <= -9 ) return m_strLevelTextColorValue_AbsoluteStrong; if( nDiffLevel <= -6 && nDiffLevel >= -8 ) return m_strLevelTextColorValue_VeryStrong; if( nDiffLevel <= -3 && nDiffLevel >= -5 ) return m_strLevelTextColorValue_Strong; if( nDiffLevel <= 2 && nDiffLevel >= -2 ) return m_strLevelTextColorValue_Similar; if( nDiffLevel <= 5 && nDiffLevel >= 3 ) return m_strLevelTextColorValue_Weak; if( nDiffLevel <= 8 && nDiffLevel >= 6 ) return m_strLevelTextColorValue_VeryWeak; if( nDiffLevel >= 9 ) return m_strLevelTextColorValue_AbsoluteWeak; // 에러 상황이다. 이 경우 기본 값으로 색상을 리턴 return m_strLevelTextColorValue_Similar; }