#include "SunClientPrecompiledHeader.h" #ifdef _NA_005026_20120527_CHAOS_ZONE_BATTLE_GROUND #include "uiChaosZoneBattle.h" #include "ChaosZoneSystem/PacketStruct_ChaosZoneSystem.h" #include "ChaosSystem/ChaosSystemData.h" #include "ChaosSystem/ChaosSystemFunction.h" #include "ItemManager.h" #include "GlobalFunc.h" #include "uiToolTipMan/uiToolTipMan.h" #include "Mouse.h" #include "ItemInfoParser.h" #include "BattleGroundInfoParser.h" #include "ItemUnitRenderer.h" #include "MissionRewardParser.h" #include "RewardInfoList.h" #include "ItemTypeList.h" #include "Hero.h" #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND #include "uiBattlezone2Man/uiBattlezone2Man.h" #include "Application.h" #include "ChaosSystem/ChaosSystemPacketFunction.h" #endif //_NA_008679_20160202_REWORK_BATTLEGROUND #include "ChaosZoneInfoParser.h" const DWORD uiChaosZoneBattle::kDialog_ID = StrToWzID("0642"); #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND const int reservation_count_refresh_time = 5; #endif //_NA_008679_20160202_REWORK_BATTLEGROUND uiChaosZoneBattle::uiChaosZoneBattle(InterfaceManager* ui_manager) : ui_chaossystem_manager_(NULL), once_make_list_(false), scroll_control_(NULL), list_control_(NULL), item_unit_renderer_(NULL) #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND ,number_texture_(INVALID_HANDLE_VALUE) ,notice_re_enter_message_(false) #endif //_NA_008679_20160202_REWORK_BATTLEGROUND { RegisterControlPosition(StrToWzID("B999"), kControl_Button_B999); RegisterControlPosition(StrToWzID("T999"), kControl_Text_T999); RegisterControlPosition(StrToWzID("B005"), kControl_Button_B005); RegisterControlPosition(StrToWzID("V001"), kControl_VScroll_V001); RegisterControlPosition(StrToWzID("S000"), kControl_Text_S000); RegisterControlPosition(StrToWzID("P001"), kControl_Picture_P001); RegisterControlPosition(StrToWzID("P005"), kControl_Picture_P005); RegisterControlPosition(StrToWzID("P009"), kControl_Picture_P009); RegisterControlPosition(StrToWzID("L000"), kControl_List_L000); RegisterControlPosition(StrToWzID("L001"), kControl_List_L001); RegisterControlPosition(StrToWzID("S006"), kControl_Text_S006); RegisterControlPosition(StrToWzID("S009"), kControl_Text_S009); RegisterControlPosition(StrToWzID("S010"), kControl_Text_S010); RegisterControlPosition(StrToWzID("B000"), kControl_Button_B000); RegisterControlPosition(StrToWzID("B001"), kControl_Button_B001); RegisterControlPosition(StrToWzID("B002"), kControl_Button_B002); RegisterControlPosition(StrToWzID("B003"), kControl_Button_B003); RegisterControlPosition(StrToWzID("B004"), kControl_Button_B004); RegisterControlPosition(StrToWzID("B007"), kControl_Button_B007); RegisterControlPosition(StrToWzID("P024"), kControl_Picture_P024); RegisterControlPosition(StrToWzID("P025"), kControl_Picture_P025); RegisterControlPosition(StrToWzID("P026"), kControl_Picture_P026); RegisterControlPosition(StrToWzID("P027"), kControl_Picture_P027); RegisterControlPosition(StrToWzID("P028"), kControl_Picture_P028); RegisterControlPosition(StrToWzID("P029"), kControl_Picture_P029); RegisterControlPosition(StrToWzID("P030"), kControl_Picture_P030); RegisterControlPosition(StrToWzID("P031"), kControl_Picture_P031); RegisterControlPosition(StrToWzID("P032"), kControl_Picture_P032); RegisterControlPosition(StrToWzID("P033"), kControl_Picture_P033); #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND RegisterControlPosition(StrToWzID("C000"), kControl_Check_C000); RegisterControlPosition(StrToWzID("C001"), kControl_Check_C001); RegisterControlPosition(StrToWzID("P039"), kControl_Picture_P039); RegisterControlPosition(StrToWzID("P040"), kControl_Picture_P040); RegisterControlPosition(StrToWzID("P041"), kControl_Picture_P041); RegisterControlPosition(StrToWzID("P042"), kControl_Picture_P042); RegisterControlPosition(StrToWzID("P043"), kControl_Picture_P043); RegisterControlPosition(StrToWzID("P044"), kControl_Picture_P044); RegisterControlPosition(StrToWzID("S003"), kControl_Text_S003); RegisterControlPosition(StrToWzID("S005"), kControl_Text_S005); refresh_timer_.On(reservation_count_refresh_time); #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } //------------------------------------------------------------------------------ uiChaosZoneBattle::~uiChaosZoneBattle() { } //------------------------------------------------------------------------------ void uiChaosZoneBattle::Init(CDrawBase* draw_base) { //½½·ÔÃʱâÈ­ SCItemSlotContainer::Init(kSlotTotalCount, SI_CHAOSZONE_BATTLEGROUND); // ·£´õ·¯ ÃʱâÈ­ assert(!item_unit_renderer_); item_unit_renderer_ = new ItemUnitRenderer; item_unit_renderer_->Init(uiBase::GetDrawBase(), kSlotTotalCount); CCtrlStaticWZ* static_control = NULL; static_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S000))); if (static_control) { // 2571 À̽º¶óÇÊÀÇ ´ëÁö static_control->SetTextID(2571); } static_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S006))); if (static_control) { // 2714 ÆÐ¹è ÆÀ static_control->SetTextID(2714); } static_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S009))); if (static_control) { // 2577 º¸»ó static_control->SetTextID(2577); } static_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S010))); if (static_control) { // 2713 ½Â¸® ÆÀ static_control->SetTextID(2713); } //À̹ÌÁö ºñȰ¼ºÈ­ CCtrlPictureWZ* picture_control; picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P009))); if (picture_control) { picture_control->ShowWindowWZ(WZ_HIDE); } picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P005))); if (picture_control) { picture_control->ShowWindowWZ(WZ_HIDE); } //¹öư ºñȰ¼ºÈ­ CCtrlButtonCheckWZ* check_control = NULL; #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND // ÀüÀåÀº ¸®´º¾ó µÇ´Âµ¥ °ñµå·¯½¬´Â ¸®´º¾óÀÌ ¾ÈµÇ¼­ ui ´Ý¾Æ³õÀ½ check_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B001))); if (check_control) { check_control->EnableWindowWZ(false); } #else #ifndef _NA_007114_20140313_CHAOSZONE_GOLDRUSH check_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B001))); if (check_control) { check_control->EnableWindowWZ(false); } #endif // _NA_007114_20140313_CHAOSZONE_GOLDRUSH #endif //_NA_008679_20160202_REWORK_BATTLEGROUND check_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B002))); if (check_control) { check_control->EnableWindowWZ(false); } #ifdef _NA_006088_20120910_CHAOS_ZONE_FREE_PVP #else check_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B004))); if (check_control) { check_control->EnableWindowWZ(false); } #endif //_NA_006088_20120910_CHAOS_ZONE_FREE_PVP // ÀÔÀå ¿¹¾à SetReservationButton(false); // ÀüÀå Á¤º¸ list_control_ = static_cast(GetControlWZ(GetControlID_byPosition(kControl_List_L001))); if (list_control_) { RECT list_rect = list_control_->GetSizeRect(); ftext_render_.Init(draw_base, list_rect); ftext_render_.SetMargin(0,0,0,-5); ftext_render_.SetGap(0,0); ftext_render_.convertLineInfo(); } // ½ºÅ©·Ñ scroll_control_ = GetVScrollControlWZ(GetControlID_byPosition(kControl_VScroll_V001)); if (scroll_control_) { scroll_control_->SetScrollPosWZ(0); scroll_control_->SetScrollRangeWZ(0,1); } // Æ®¸® ¸Þ´º select_index_.menu_depth[3] = 1; select_index_.menu_depth[2] = 0; select_index_.menu_depth[1] = 0; select_index_.menu_depth[0] = 0; last_select_index_ = 0; tree_menu().Init(BASE_TreeMenuInfo::kGroupType_Chaoszone_BattleTree, GetListControlWZ(GetControlID_byPosition(kControl_List_L000)), NULL, true, NULL); tree_menu().set_menu_height_gab(20); TCHAR string_buffer[BASE_TreeMenuInfo::kNameLength] = {0,}; TCHAR temp_string[INTERFACE_STRING_LENGTH] = {0,}; BYTE* menu_depth_count = ChaosZoneTreeParser::Instance()->max_menu_depth(); const ChaosZoneTreeInfo* find_info; TreeMenuGroup::TreeObject* tree_object = NULL; //Æ®¸® ¸®½ºÆ® »ý¼ºÇϱâ /* 3´ÜÀ¸·Î ÇÏ·Á¸é ÁÖ¼®À» Áö¿ö ÁÖ¼¼¿ä (ÇöÀç1´Ü) */ if (once_make_list_ == false) { once_make_list_ = true; TreeMenuInfoParser::Instance()->Remove(BASE_TreeMenuInfo::kGroupType_Chaoszone_BattleTree); //for (BYTE LGroupCount = 1; LGroupCount <= menu_depth_count[0]; ++LGroupCount) { for (BYTE SGroupCount = 1; SGroupCount <= menu_depth_count[1]; ++SGroupCount) { //for (BYTE OrderCount = 1; OrderCount <= menu_depth_count[2]; ++OrderCount) { find_info = ChaosZoneTreeParser::Instance()->GetTreeMenu( 1 /*LGroupCount*/, SGroupCount, 0 /*OrderCount*/); if (find_info != NULL) { //if (SGroupCount == 1 && OrderCount == 1) // 1´ÜÀ̶ó ŸÀÌÆ² »ý·« //{ // MakeChaoszoneTree( 1 /*LGroupCount*/, 0, 0, 0, 0, find_info->title_string_code, NULL, find_info->font_color); //} //if (OrderCount == 1) //{ // MakeChaoszoneTree( 1 /*LGroupCount*/, SGroupCount, 0, 0, 1, find_info->subtitle_string_code, NULL, find_info->font_color); //} g_InterfaceManager.GetInterfaceString(find_info->subtitle_string_code /*find_info->mission_string_code*/, temp_string); Snprintf(string_buffer, sizeof(string_buffer), temp_string); // ÀüÀå Æ®¸®´Â Ưº°ÇÏ°Ô 2´Ü°è·Î µÇ¾î ÀÖ´Â°É 1´Ü°è·Î Ç¥½ÃÇϱâ À§ÇØ index°¡ º¯ÇüµÇ¾î ÀÖ½À´Ï´Ù. MakeChaoszoneTree(SGroupCount /*LGroupCount*/, 0 /*SGroupCount*/, 0 /*OrderCount*/, 0, 0 /*2*/, 0, string_buffer, find_info->font_color, find_info->map_code); } else { break; } } } } tree_menu().ApplyTreeGroup(BASE_TreeMenuInfo::kGroupType_Chaoszone_BattleTree); tree_menu().Fill(); tree_object = tree_menu().Find(1,0,0,0); if (tree_object != NULL) { tree_menu().Select(tree_object); ChaosSystem::GetBattleGroundData().set_select_mapcode(tree_object->info->user_data); } // Æ®¸®°¡ ¸¸µé¾îÁø ÈÄ È°¼ºÈ­ ¿©ºÎ üũ #ifdef _NA_007029_20140114_CHAOS_ZONE_ENTER_BLIND //for (BYTE LGroupCount = 1; LGroupCount <= menu_depth_count[0]; ++LGroupCount) { for (BYTE SGroupCount = 1; SGroupCount <= menu_depth_count[1]; ++SGroupCount) { //for (BYTE OrderCount = 1; OrderCount <= menu_depth_count[2]; ++OrderCount) { find_info = ChaosZoneTreeParser::Instance()->GetTreeMenu( 1 /*LGroupCount*/, SGroupCount, 0 /*OrderCount*/); if (find_info != NULL) { tree_object = tree_menu().Find(SGroupCount /*LGroupCount*/, 0 /*SGroupCount*/, 0 /*OrderCount*/, 0); if (tree_object == NULL) { continue; } if (find_info->enter_active == 0) { tree_object->is_enable = false; continue; } } } } } #endif //_NA_007029_20140114_CHAOS_ZONE_ENTER_BLIND } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND // ¼ýÀÚ À̹ÌÁö ·Îµå draw_base_ = draw_base; if (number_texture_ == INVALID_HANDLE_VALUE) { number_texture_ = g_pSunRenderer->x_pManagerTexture->LoadTexture( "Data\\Interface\\64_chaos_Zone.tga", TLS_ORIGINAL_SIZE | TLS_NO_MIPMAP | TLS_NO_MULTITHREAD); } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } //------------------------------------------------------------------------------ void uiChaosZoneBattle::Release() { tree_menu().Release(); last_select_index_ = 0; if(item_unit_renderer_) { item_unit_renderer_->Release(); delete item_unit_renderer_; item_unit_renderer_ = NULL; } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND if( number_texture_ != INVALID_HANDLE_VALUE ) { if(draw_base_ && draw_base_->x_pManagerTexture) { draw_base_->x_pManagerTexture->DestroyTexture(number_texture_); } number_texture_ = INVALID_HANDLE_VALUE; } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } //------------------------------------------------------------------------------ void uiChaosZoneBattle::OnReset() { // ij¸¯ÅÍ ¼±Åà â ÁøÀÔ ½Ã È£ÃâµÊ. ChaosSystem::Function::SetBattleGroundReservation(false); } //------------------------------------------------------------------------------ void uiChaosZoneBattle::NetworkProc(struct MSG_BASE *message) { } //------------------------------------------------------------------------------ void uiChaosZoneBattle::OnUpdateSolarDialog() { UpdateMouseWheel(); CControlWZ* control = NULL; control = GetControlWZ(GetControlID_byPosition(kControl_Button_B005)); if (control != NULL) { if (last_select_index_ != select_index_.menu_index)//À妽º°¡ ¹Ù²ï°æ¿ì¸¸ üũ 1ȸ ¾÷µ¥ÀÌÆ® ¸¶´Ù ¾ÈÇÔ { last_select_index_ = select_index_.menu_index; control->EnableWindowWZ(true); // ¿ä±¸ ¾ÆÀÌÅÛ Ã¼Å© const ChaosZoneTreeInfo* find_info = ChaosZoneTreeParser::Instance()->GetTreeMenu(1 /*select_index_.menu_depth[3]*/, select_index_.menu_depth[3], 0 /*select_index_.menu_depth[1]*/); const ChaosZoneInfo* chaoszone_info = ChaosZoneInfoParser::Instance()->FindData(static_cast(find_info->map_code)); bool is_have = false; TreeMenuGroup::TreeObject* tree_object = tree_menu().Find(select_index_.menu_index); if (chaoszone_info->require_item[0] != 0 && tree_object && tree_object->is_enable) { for (int i = 0; i < MAX_REQUIRE_ITEM; ++i) { if (chaoszone_info && chaoszone_info->require_item[i]) // (ÇÊ¿ä ¾ÆÀÌÅÛ ÀÖ´Â »óÅ¿¡¼­ È®Àιöư ÄÑ°í ¾ÆÀÌÅÛÀÌ ¾ø¾îÁ³´Ù¸é, ¼­¹ö ¿À·ù¸Þ½ÃÁö ÀÌ¿ëÇÔ) { POSTYPE inventory_position = INVALID_POSTYPE_VALUE; BOOL result = ItemManager::Instance()->FindFirstItem(chaoszone_info->require_item[i], inventory_position); if (result && inventory_position != INVALID_POSTYPE_VALUE) //ÀÖÀ½ { is_have = true; break; } } } } if (chaoszone_info->require_item[0] == 0 && tree_object && tree_object->is_enable)//ù¹øÂ° °ÍÀÌ 0À̶ó¸é true { is_have = true; } if (is_have == false) { control->EnableWindowWZ(false); } // ÀüÀå ¼³¸í InitBattleInfo(find_info); #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND // ¿¹¾àÇöȲ°»½Å if (ChaosSystem::GetBattleGroundData().battle_ground_open_type() == kJoinStateAdmission) { refresh_timer_.Off(); refresh_timer_.On(reservation_count_refresh_time); DWORD mapcode = ChaosSystem::GetBattleGroundData().select_mapcode(); ChaosSystem::PacketFunction::SEND_CG_BATTLE_GROUND_RESERVATION_COUNT_SYN(mapcode); } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } } #if defined(_NA_006538_BATTLE_GROUND_TIME_CONTROL_SYSTEM) || defined(_NA_008679_20160202_REWORK_BATTLEGROUND) ChaosSystem::GetBattleGroundData().UpdateBattleGroundOpenTime(); #endif //_NA_006538_BATTLE_GROUND_TIME_CONTROL_SYSTEM #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND // ÀçÀÔÀå ¾È³» ¸Þ¼¼Áöâ ShowReEnterMessage(); // 5Ãʸ¶´Ù ¿¹¾àÇöȲ °»½Å¿äû RefreshReservationCount(); CCtrlStaticWZ* static_control = NULL; static_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S005))); if (static_control) { if (ChaosSystem::GetBattleGroundData().battle_ground_open_type() == kJoinStateAdmission) { TCHAR result_string[256] = {0,}; TCHAR member_count[10] = {0,}; TCHAR remain_time_minute[10] = {0,}; TCHAR remain_time_second[10] = {0,}; WORD reservation_member_count = ChaosSystem::GetBattleGroundData().reservation_member_count(); _itot(reservation_member_count, member_count, 10); DWORD remain_time = (reservation_count_refresh_time*1000) - refresh_timer_.SpentTime(); _itot(remain_time/1000, remain_time_minute, 10); //_itot((remain_time%1000)/10, remain_time_second, 10); Sprintf(remain_time_second, "%02d", (remain_time%1000)/10); // 3548 ÀüÀå ¿¹¾à ÇöȲ : %s¸í %sºÐ%sÃÊ g_InterfaceManager.GetInterfaceStringFormat(result_string, 255, 3548, member_count, remain_time_minute, remain_time_second); static_control->SetTextWZ(result_string); static_control->ShowWindowWZ(WZ_SHOW); } else { static_control->ShowWindowWZ(WZ_HIDE); } } static_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S003))); if (static_control) { if (ChaosSystem::GetBattleGroundData().battle_ground_open_type() == kJoinStateAdmission) { // 2587 ³²Àº ÀÔÀå Á¾·á ½Ã°£ static_control->SetTextID(2587); static_control->SetTextColor(RGBA(217,117,0,255)); } else { // 2586 ³²Àº ÀÔÀå ½ÃÀÛ ½Ã°£ static_control->SetTextID(2586); static_control->SetTextColor(WzColor_RGBA(255,255,255,255)); } } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } //------------------------------------------------------------------------------ void uiChaosZoneBattle::OnRenderSolarDialog() { if (item_unit_renderer_) { item_unit_renderer_->Render(); } ftext_render_.Render(); RenderTooltip(); if (this->m_MouseOverObject.eMouseOverType != eMOUSE_OVER_MAX) { if (eMOUSE_OVER_SLOT == m_MouseOverObject.eMouseOverType) { uiToolTipMan* tooltip_manager = (uiToolTipMan*)g_InterfaceManager.GetUserInterfaceManager(UIMAN_TOOLTIP); if (tooltip_manager) { tooltip_manager->RegisterSlotInfoTooltip(m_MouseOverObject.pSlot); tooltip_manager->SetTooltipDialogID(GetDialogKey()); } } } RenderTimer(); //// ³²Àº ÀÔÀå ½ÃÀÛ/Á¾·á ½Ã°£ //CCtrlStaticWZ* control_pointer = NULL; //control_pointer = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S004))); //if (control_pointer) //{ // TCHAR temp_string[INTERFACE_STRING_LENGTH]; // if (ssq_current_state == SSQTIMEINFO::eTM::eTM_EnterableTimeout) // { // // 2586 ³²Àº ÀÔÀå ½ÃÀÛ ½Ã°£ // g_InterfaceManager.GetInterfaceString(2586, temp_string); // control_pointer->SetTextColor(WzColor_RGBA(255,255,255,255)); // } // else if (ssq_current_state == SSQTIMEINFO::eTM::eTM_CloseTimeout) // { // // 2587 ³²Àº ÀÔÀå Á¾·á ½Ã°£ // g_InterfaceManager.GetInterfaceString(2587, temp_string); // control_pointer->SetTextColor(RGBA(217,117,0,255)); // } // else // { // ZeroMemory(temp_string, sizeof(temp_string)); // } // control_pointer->SetTextWZ(temp_string); //} } //------------------------------------------------------------------------------ void uiChaosZoneBattle::MessageProc(SI_MESSAGE* message) { if (IsLock()) return; if (GetMan() == NULL) return; #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND MovementButtonMessageProc(message); #endif //_NA_008679_20160202_REWORK_BATTLEGROUND switch (message->eResultMsg) { case RT_MSG_LBUTTONCLICK: OnLButtonClick(message); break; case RT_MSG_SB_PAGETOP: //. À­ÂÊ ¸öÅëÀ» ´­·¶´Ù. case RT_MSG_SB_LINETOP: //.À­ÂÊ È­»ìÇ¥¸¦ ´­·¶´Ù. { if(scroll_control_) { int pos = scroll_control_->GetScrollPosWZ(); // ÇöÀç ½ºÅ©·Ñ °ªÀ» ¹Þ¾Æ ¿Â´Ù. int mmin = 0 , mmax = 0; scroll_control_->GetScrollRangeWZ( &mmin, &mmax ); // ½ºÅ©·Ñ °ªÀÇ ÃÖ´ë ÃÖ¼Ò¸¦ ¾ò¾î ¿Â´Ù. if(pos>mmin) // ÇöÀç ÀÔ·ÂµÈ ¶óÀμö º¸´Ù ÀÛÀ¸¸é { --pos; // ÇÑÁÙ °¨¼Ò ½Ã۰í scroll_control_->SetScrollPosWZ(pos); ftext_render_.SetBeginLineIndex(pos); } } } break; case RT_MSG_SB_PAGEBOTTOM: //. ¾Æ·¡ÂÊ ¸öÅëÀ» ´­·¶´Ù. case RT_MSG_SB_LINEBOTTOM: //.¾Æ·§ÂÊ È­»ìÇ¥¸¦ ´­·¶´Ù { if(scroll_control_) { int pos = scroll_control_->GetScrollPosWZ(); // ÇöÀç ½ºÅ©·Ñ °ªÀ» ¹Þ¾Æ ¿Â´Ù. int mmin = 0 , mmax = 0; scroll_control_->GetScrollRangeWZ( &mmin, &mmax ); // ½ºÅ©·Ñ °ªÀÇ ÃÖ´ë ÃÖ¼Ò¸¦ ¾ò¾î ¿Â´Ù. if(posSetScrollPosWZ(pos); ftext_render_.SetBeginLineIndex(pos); } } } break; case RT_MSG_SB_THUMBTRACK: //. ½æÀ» µå·¡±× Çϰí ÀÖ´Ù. case RT_MSG_SB_THUMBPOSITION: //. ½æÀ» µå·¡±×ÇÑÈÄ ¸¶¿ì½º¸¦ ³õ¾Ò´Ù. case RT_MSG_SB_ENDSCROLL: //. ½ºÅ©·ÑÀÌ Á¾·á µÇ¾ú´Ù. { if(scroll_control_) { int pos = scroll_control_->GetScrollPosWZ(); // ÇöÀç ½ºÅ©·Ñ °ªÀ» ¹Þ¾Æ ¿Â´Ù. ftext_render_.SetBeginLineIndex(pos); } } break; case RT_MSG_MOUSEOVER: { POSTYPE position = static_cast(GetControlPosition_byID(message->dwCtrlID)); if (position >= 0 && position < this->GetMaxSlotNum()) { if (!IsEmpty(position)) { SCSlot& rSlot = GetSlot(position); m_MouseOverObject.eMouseOverType = eMOUSE_OVER_SLOT; m_MouseOverObject.pSlot = &rSlot; } else { m_MouseOverObject.eMouseOverType = eMOUSE_OVER_MAX; } } else { m_MouseOverObject.eMouseOverType = eMOUSE_OVER_MAX; } } break; default: SolarDialog::MessageProc(message); break; } } //---------------------------------------------------------------------------- void uiChaosZoneBattle::OnShowWindow(BOOL val) { if (val) { //üũ¹öư CCtrlButtonCheckWZ* check_control = NULL; for (int i = kControl_Button_B000;i <= kControl_Button_B007; ++i) { check_control = static_cast(GetControlWZ(GetControlID_byPosition(i))); if (check_control) { check_control->SetCheckState(false); } } check_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B000))); if (check_control) { check_control->SetCheckState(true); } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND mouse_cursor_point.x = Mouse::Instance()->GetMouseX(); mouse_cursor_point.y = Mouse::Instance()->GetMouseY(); check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C000)); if (check_control) { check_control->SetCheckState(false); } check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C001)); if (check_control) { check_control->SetCheckState(true); } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } } //------------------------------------------------------------------------------ void uiChaosZoneBattle::UpdateMouseWheel() { if(list_control_ == NULL || scroll_control_ == NULL) { return; } int scroll_max_line = 0; size_t list_max_line = ftext_render_.GetDrawLineInRect(); if (ftext_render_.GetMaxLine() > list_max_line) { scroll_max_line = ftext_render_.GetMaxLine() - list_max_line; } scroll_control_->SetScrollRangeWZ(0, scroll_max_line); RECT list_rect = list_control_->GetSizeRect(); ftext_render_.SetRect(list_rect); switch (GetMouseWheelStatus(&list_rect)) { case MOUSE_WHEEL_UP: { int index = scroll_control_->GetScrollPosWZ(); int scroll_min = 0; int scroll_max = 0; scroll_control_->GetScrollRangeWZ(&scroll_min, &scroll_max); if (index > scroll_min) { --index; ftext_render_.SetBeginLineIndex(index); scroll_control_->SetScrollPosWZ(index); } } break; case MOUSE_WHEEL_DOWN: { int index = scroll_control_->GetScrollPosWZ(); int scroll_min = 0; int scroll_max = 0; scroll_control_->GetScrollRangeWZ(&scroll_min, &scroll_max); if (index < scroll_max) { ++index; ftext_render_.SetBeginLineIndex(index); scroll_control_->SetScrollPosWZ(index); } } break; default: break; } } //------------------------------------------------------------------------------ uiChaosSystemMan* uiChaosZoneBattle::GetManager() { if (ui_chaossystem_manager_ == NULL) { ui_chaossystem_manager_ = static_cast(this->GetUIMan()->GetUserInterfaceManager(UIMAN_CHAOS)); assert (ui_chaossystem_manager_); } return ui_chaossystem_manager_; } //------------------------------------------------------------------------------ bool uiChaosZoneBattle::OnLButtonClick(SI_MESSAGE* message) { bool result = true; int tab_index = -1; uiChaosSystemMan* chaos_manager = static_cast(GetMan()); if (chaos_manager == NULL) { return false; } TreeMenuGroup::TreeObject* tree_object = NULL; if ((tree_menu().MessageProc(message, OUT tree_object) == true) && (tree_object != NULL)) { // Æ®¸® º¯°æ½Ã SelectIndex(tree_object); } switch (GetControlPosition_byID(message->dwCtrlID)) { case kControl_Button_B999: { chaos_manager->ShowChaosZone(uiChaosZoneBattle::kDialog_ID, false); } break; case kControl_Button_B005: { ChaosSystem::Function::SendReservationPacket(); } break; case kControl_Button_B000: { tab_index = 0; } break; case kControl_Button_B001: { tab_index = 1; } break; case kControl_Button_B002: { tab_index = 2; } break; case kControl_Button_B003: { tab_index = 3; } break; case kControl_Button_B004: { tab_index = 4; } break; case kControl_Button_B007: { tab_index = 5; } break; default: { } break; } if (tab_index != -1) { chaos_manager->OpenChaosZone(tab_index, true); } return result; } //------------------------------------------------------------------------------ void uiChaosZoneBattle::RenderTooltip() { uiToolTipMan* tooltip_manager = GET_DIALOG_MANAGER(uiToolTipMan, UIMAN_TOOLTIP); if (tooltip_manager == NULL) { return; } int mouse_x = Mouse::Instance()->GetMouseX(); int mouse_y = Mouse::Instance()->GetMouseY(); #ifdef _NA_006088_20120910_CHAOS_ZONE_FREE_PVP #ifdef _NA_007114_20140313_CHAOSZONE_GOLDRUSH int tap_controls[] = { kControl_Button_B000, kControl_Button_B001, 0 /*kControl_Button_B002*/, kControl_Button_B003, kControl_Button_B004, kControl_Button_B007 }; #else int tap_controls[] = { kControl_Button_B000, 0 /*kControl_Button_B001*/, 0 /*kControl_Button_B002*/, kControl_Button_B003, kControl_Button_B004, kControl_Button_B007 }; #endif // _NA_007114_20140313_CHAOSZONE_GOLDRUSH #else int tap_controls[] = { kControl_Button_B000, 0 /*kControl_Button_B001*/, 0 /*kControl_Button_B002*/, kControl_Button_B003, 0 /*kControl_Button_B004*/, kControl_Button_B007 }; #endif //_NA_006088_20120910_CHAOS_ZONE_FREE_PVP CControlWZ* control; for (int index = 0; index < sizeof(tap_controls)/sizeof(tap_controls[0]); ++index) { if (tap_controls[index] == 0) { continue; } control = GetControlWZ_byPosition(tap_controls[index]); if (control) { RECT position = control->GetSizeRect(); if (position.left < mouse_x && position.right > mouse_x && position.top < mouse_y && position.bottom > mouse_y) { // 2571 ~ 2576 / À̽º¶óÇÊÀÇ ´ëÁö~ Ä«¿À½º È÷½ºÅ丮 tooltip_manager->RegisterTooltipWithStringCode(2571 + index); tooltip_manager->SetTooltipDialogID(GetDialogKey()); } } } } //------------------------------------------------------------------------------ void uiChaosZoneBattle::SetReservationButton(bool is_reservation) { CControlWZ* control = GetControlWZ(GetControlID_byPosition(kControl_Button_B005)); if (control) { // 2584 ÀÔÀ忹¾à if (is_reservation == false) { // 2584 ÀÔÀ忹¾à control->SetTextID(2584); } else { // 2585 ¿¹¾àÃë¼Ò control->SetTextID(2585); } } } //------------------------------------------------------------------------------ void uiChaosZoneBattle::MakeChaoszoneTree(BYTE depth_3, BYTE depth_2, BYTE depth_1, BYTE depth_0, int depth, DWORD string_code, TCHAR* string, const DWORD* font_colors, DWORD map_code) { BASE_TreeMenuInfo tree_menu_info; ZeroMemory(&tree_menu_info, sizeof(tree_menu_info)); tree_menu_info.font_id[BASE_TreeMenuInfo::kFontType_Enable] = StrToWzID("st10"); tree_menu_info.font_id[BASE_TreeMenuInfo::kFontType_Disable] = StrToWzID("st10"); tree_menu_info.font_id[BASE_TreeMenuInfo::kFontType_Over] = StrToWzID("st10"); tree_menu_info.font_id[BASE_TreeMenuInfo::kFontType_Select] = StrToWzID("st10"); tree_menu_info.font_color[BASE_TreeMenuInfo::kFontType_Enable] = font_colors[ChaosZoneTreeInfo::kFontType_Enable]; tree_menu_info.font_color[BASE_TreeMenuInfo::kFontType_Disable] = font_colors[ChaosZoneTreeInfo::kFontType_Disable]; tree_menu_info.font_color[BASE_TreeMenuInfo::kFontType_Over] = font_colors[ChaosZoneTreeInfo::kFontType_Over]; tree_menu_info.font_color[BASE_TreeMenuInfo::kFontType_Select] = font_colors[ChaosZoneTreeInfo::kFontType_Select]; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_Enable] = 0; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_Disable] = 10007; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_Collpase] = 10002; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_Unfold] = 10003; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_CheckOn] = 0; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_CheckOff] = 0; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_Cursor] = 10008; tree_menu_info.tree_group = BASE_TreeMenuInfo::kGroupType_Chaoszone_BattleTree; tree_menu_info.menu_depth[3] = depth_3; tree_menu_info.menu_depth[2] = depth_2; tree_menu_info.menu_depth[1] = depth_1; tree_menu_info.menu_depth[0] = depth_0; tree_menu_info.string_code = string_code; if (string_code == 0) { strncpy(tree_menu_info.string_name, string, sizeof(tree_menu_info.string_name)); } switch (depth) { //case 0: //tree_menu_info.menu_type = BASE_TreeMenuInfo::kMenuType_Group; //break; //case 1: //tree_menu_info.menu_type = BASE_TreeMenuInfo::kMenuType_Group; //tree_menu_info.menu_depth_width = 20; //break; case 0: tree_menu_info.menu_type = BASE_TreeMenuInfo::kMenuType_CheckButton; tree_menu_info.menu_depth_width = 0; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_CheckOn] = 10006; tree_menu_info.image_code[BASE_TreeMenuInfo::kIconType_CheckOff] = 10005; break; default: tree_menu_info.menu_type = BASE_TreeMenuInfo::kMenuType_None; break; } //user_data ¿¡ ¸ÊÄÚµå ÀúÀå tree_menu_info.user_data = map_code; TreeMenuInfoParser::Instance()->Insert(tree_menu_info); } //------------------------------------------------------------------------------ bool uiChaosZoneBattle::SelectIndex(TreeMenuGroup::TreeObject* tree_object) { //if (tree_object->info->menu_depth[1] <= 0) //{ // return false;//Ç׸ñÀÌ ¾Æ´Ï´Ù. Æú´õÀÌ´Ù. //} #ifdef _NA_007029_20140114_CHAOS_ZONE_ENTER_BLIND CControlWZ* control = GetControlWZ(GetControlID_byPosition(kControl_Button_B005)); if (control) { if (tree_object->is_enable == false) { control->EnableWindowWZ(false); } else { control->EnableWindowWZ(true); } } #endif //_NA_007029_20140114_CHAOS_ZONE_ENTER_BLIND TreeMenuGroup::TreeObject* find_tree_object = tree_menu().Find(select_index_.menu_index); //ÀÌÀü¿¡ ¼±ÅÃÇß´ø °ÍÀº üũ ²ô±â if (find_tree_object) { find_tree_object->is_check = false; } //¼±ÅÃÇѰÍÀº Ç×»ó üũ select_index_.menu_index = tree_object->info->menu_index; if (tree_object) { tree_object->is_check = true; ChaosSystem::GetBattleGroundData().set_select_mapcode(tree_object->info->user_data); } return true; } //------------------------------------------------------------------------------ void uiChaosZoneBattle::InitBattleInfo(const ChaosZoneTreeInfo* choaszone_info) { // ÀüÀå ¼³¸í ftext_render_.ClearSentence(); FTextParser parser; FTextSentence sentence; FTextSentence temp_sentence; TCHAR temp_string[INTERFACE_STRING_LENGTH]= " "; TCHAR str_format[INTERFACE_STRING_LENGTH]={0,}; BOOL result = false; // ºóÁÙ parser.Parser(temp_string, temp_sentence); //À̸§ g_InterfaceManager.GetInterfaceString(choaszone_info->subtitle_string_code, temp_string, INTERFACE_STRING_LENGTH); result = parser.Parser(temp_string, sentence); if (result == TRUE) { ftext_render_.Append(sentence); } //¼³¸í if (choaszone_info->tooltip_string_code != 0) { // ½ºÆ®¸µ¿¡ ÁٹٲÞÀº # ´ë½Å À¸·Î ³Ö¾îÁÖ¼¼¿ä g_InterfaceManager.GetInterfaceString(choaszone_info->tooltip_string_code, temp_string, INTERFACE_STRING_LENGTH); result = parser.Parser(temp_string, sentence); if (result == TRUE) { ftext_render_.Append(temp_sentence); //ºóÁÙ ftext_render_.Append(sentence); } } //ÀÔÀå°¡´É ·¹º§ const sMAPINFO* mapInfo = MapInfoParser::Instance()->FindMapInfo((MAPCODE)choaszone_info->map_code); if (mapInfo) { // 1780 ÀÔÀå·¹º§ g_InterfaceManager.GetInterfaceString(1780, temp_string, INTERFACE_STRING_LENGTH ); sprintf(str_format, "%s: %d-%d", temp_string, mapInfo->minLV, mapInfo->maxLV); result = parser.Parser(str_format, sentence); if (result == TRUE) { ftext_render_.Append(temp_sentence); //ºóÁÙ ftext_render_.Append(sentence); } } const ChaosZoneInfo* chaoszone_info = ChaosZoneInfoParser::Instance()->FindData(static_cast(choaszone_info->map_code)); //±ÇÀå ·¹º§ // 646 ±ÇÀå·¹º§ g_InterfaceManager.GetInterfaceString(646, temp_string, INTERFACE_STRING_LENGTH ); sprintf(str_format, "%s: %d-%d", temp_string, chaoszone_info->min_level, chaoszone_info->max_level); result = parser.Parser(str_format, sentence); if (result == TRUE) { ftext_render_.Append(sentence); } // »ý¼º¿¡ ÇÊ¿äÇÑ ¾ÆÀÌÅÛ bool is_have_require_item = false; int find_item_number = 0; const BASE_ITEMINFO* item_info = NULL; WzColor find_color = WzColor_RGBA(0,0,0,0); for (int i = 0; i < MAX_REQUIRE_ITEM; ++i) { if (chaoszone_info->require_item[i] != 0) { item_info = ItemInfoParser::Instance()->GetItemInfo(chaoszone_info->require_item[i]); if (item_info) { //¾ÆÀÌÅÛ Ã£±â SCItemSlot* item_slot = ItemManager::Instance()->FindFirstItemSlot(SI_INVENTORY, static_cast(chaoszone_info->require_item[i])); if (item_slot && item_slot->GetNum() > 0) { //nop is_have_require_item = true; find_item_number = i; break; } } } } if (item_info) { if (is_have_require_item == false) { find_color = WzColor_RGBA(255,0,0,255); } //2488 »ý¼º¿¡ ÇÊ¿äÇÑ ¾ÆÀÌÅÛ g_InterfaceManager.GetInterfaceString(2488, temp_string, INTERFACE_STRING_LENGTH); TCHAR item_name[INTERFACE_STRING_LENGTH]={0,}; g_InterfaceManager.GetItemName(chaoszone_info->require_item[find_item_number], item_name, INTERFACE_STRING_LENGTH); sprintf(str_format, "%s %s", temp_string, item_name); result = parser.Parser(temp_string, sentence); if (result == TRUE) { ftext_render_.Append(temp_sentence); //ºóÁÙ ftext_render_.Append(sentence); } // À̹ÌÁö Ãâ·ÂÀº ÇöÀç ¹Ì±¸Çö (FText¿¡ À̹ÌÁö »ðÀÔ ¹Ì±¸ÇöÀ̹ǷΠÀÏ´Ü »ý·«) //RegisterTooltip(str_format, -1, iNameLineHeight, FontID_ItemName, green, TOOLTIP_BG_WZCOLOR, 0); /*RegisterTooltipImage(item_info->m_wVICode, kTexture_Rectangle_SocketItem, textures_rectangles_[kTexture_Rectangle_SocketEmpty].right, textures_rectangles_[kTexture_Rectangle_SocketEmpty].bottom, (c_dwTOOLTIP_EXTRA_INFO_DONOT_CHANGE_LINE | c_dwTOOLTIP_EXTRA_INFO_HANDLE_IMAGE), 0.0f, textures_rectangles_[kTexture_Rectangle_SocketEmpty].top - 3.0f, find_color);*/ //RegisterTooltip(szMessage, -1, iNameLineHeight, FontID_ItemName, green, TOOLTIP_BG_WZCOLOR, c_dwTOOLTIP_EXTRA_INFO_DONOT_CHANGE_LINE); #ifdef _DEV_VER //#ifdef _SCJ_SHOW_ITEM_ID for (int i = 0; i < MAX_REQUIRE_ITEM; ++i) { if (chaoszone_info->require_item[i] != 0) { item_info = ItemInfoParser::Instance()->GetItemInfo(chaoszone_info->require_item[i]); if (item_info) { if (CGeneralGameParam::Instance()->IsShowItemId()) { Snprintf(temp_string, INTERFACE_STRING_LENGTH-1, _T(""), item_info->m_Code); result = parser.Parser(temp_string, sentence); if (result == TRUE) { ftext_render_.Append(temp_sentence); //ºóÁÙ ftext_render_.Append(sentence); } } } } } //#endif //_SCJ_SHOW_ITEM_ID #endif //#ifdef _DEV_VER } ftext_render_.convertLineInfo(); int scroll_range = ftext_render_.GetMaxLine() - ftext_render_.GetDrawLineInRect(); scroll_control_->SetScrollRangeWZ(0,scroll_range); scroll_control_->SetScrollPosWZ(0); // º¸»ó ½½·Ô °»½Å DeleteAllSlot(); const BattleGroundInfo* battle_ground_info = BattleGroundInfoParser::Instance()->FindData(static_cast(choaszone_info->map_code)); if (battle_ground_info) { // ½ÂÀÚ º¸»ó MissionRewardInfo * mission_reward_info = MissionRewardParser::Instance()->GetMissionReward((BYTE)battle_ground_info->win_reward_code); if (mission_reward_info) { int hero_class = static_cast(g_pHero->GetClass()); int reward_code = mission_reward_info->CLASSs[hero_class].REWARDs[0].m_wRewardCode; RewardInfo* reward_info = RewardInfoList::Instance()->FindRewardInfo(reward_code); for (int i = 0; i < RewardInfo::MAX_DROP_INDEX_NUM; ++i) { if (0 == reward_info->GetTypeCode(i)) { continue; } InsertSlot(kControl_Picture_P024 + i, reward_info->GetTypeCode(i), reward_info->GetTypeIndex(i)); } } // ±âº» º¸»ó mission_reward_info = MissionRewardParser::Instance()->GetMissionReward((BYTE)battle_ground_info->base_reward_code); if (mission_reward_info) { int hero_class = static_cast(g_pHero->GetClass()); int reward_code = mission_reward_info->CLASSs[hero_class].REWARDs[0].m_wRewardCode; RewardInfo* reward_info = RewardInfoList::Instance()->FindRewardInfo(reward_code); for (int i = 0; i < RewardInfo::MAX_DROP_INDEX_NUM; ++i) { if (0 == reward_info->GetTypeCode(i)) { continue; } InsertSlot(kControl_Picture_P029 + i, reward_info->GetTypeCode(i), reward_info->GetTypeIndex(i)); } } } } RC::eSLOT_INSERT_RESULT uiChaosZoneBattle::InsertSlot(POSTYPE at_pos, DWORD type_code, DWORD type_index) { DeleteSlot(at_pos,NULL); BASE_ITEMINFO* item_info = ItemInfoParser::Instance()->GetItemInfo(type_code); if (item_info == NULL) { return RC_INSERT_SLOT_FAILED; } static DWORD SERIAL = 10000000; SCItemSlot item_slot; item_slot.SetSlotType(ST_ITEM); item_slot.SetCode(static_cast(type_code)); item_slot.SetSerial(++SERIAL); if (type_index >= RewardInfo::MIN_ITEM_TYPECODE) { // Àåºñ/ÆêÀÇ ¾ÆÀÌÅÛŸÀÔ/Ä¿½ºÅ͸¶ÀÌ¡ ¾ÆÀÌÅÛ Ã³¸® const ItemType* item_type_info = ItemTypeList::Instance()->FindItemType(type_index); { KindOfItemType::value_type kind_of_item = item_type_info->GetItemType(); nsSlot::ItemTypeChanger::ChangeItemByType(&item_slot, kind_of_item); } item_slot.SetEnchant( item_type_info->GetEnchant() ); item_slot.SetNum(1); } else { item_slot.SetNum(static_cast(type_index)); } // ½½·Ô¿¡ ³ÖÀ½ eSLOT_INSERT_RESULT slot_insert_result = SCSlotContainer::InsertSlot(at_pos, item_slot); CControlWZ* control_ptr = GetControlWZ(GetControlID_byPosition(at_pos)); if(control_ptr) { RECT rect = control_ptr->GetSizeRect(); SCSlot& real_slot = GetSlot(at_pos); if (item_unit_renderer_) { item_unit_renderer_->AddItemUnit(item_slot.GetSerial(), item_slot.GetCode(), &rect, &real_slot, control_ptr); } else { assert(item_unit_renderer_); } ReFreshRenderSlot(); } return slot_insert_result; } //------------------------------------------------------------------------------ BOOL uiChaosZoneBattle::DeleteSlot(POSTYPE at_pos, SCSlot* slot_out) { if (item_unit_renderer_) { item_unit_renderer_->RemoveItemUnit(GetSlot(at_pos).GetSerial()); } SCSlotContainer::DeleteSlot(at_pos, slot_out); ReFreshRenderSlot(); return TRUE; } //------------------------------------------------------------------------------ void uiChaosZoneBattle::DeleteAllSlot() { if (item_unit_renderer_ == NULL) { assert(item_unit_renderer_); return; } for (int slot_pos = kControl_Picture_P024; slot_pos <= kControl_Picture_P033; ++slot_pos) { this->DeleteSlot(slot_pos, NULL); } } void uiChaosZoneBattle::ReFreshRenderSlot() { ItemUnitRenderer::RenderUnit* item_unit_render = NULL; RECT slot_rect; CControlWZ* control_ptr = NULL; for (int i = kControl_Picture_P024; i <= kControl_Picture_P033; ++i) { SCSlot& rSlot = GetSlot(i); if (IsEmpty(i)) { continue; } // º¸¿©Áà¾ßÇÒ ¸ñ·Ï if(item_unit_renderer_ == NULL) { continue; } item_unit_render = item_unit_renderer_->GetItemUnit(rSlot.GetSerial()); control_ptr = GetControlWZ(GetControlID_byPosition(i)); if (control_ptr == NULL) { continue; } slot_rect = control_ptr->GetSizeRect(); if (item_unit_render == NULL) { item_unit_render = item_unit_renderer_->AddItemUnit(rSlot.GetSerial(), rSlot.GetCode(), &slot_rect, &rSlot ,control_ptr); } else { item_unit_renderer_->ChangePositionItemUnit(rSlot.GetSerial(), &slot_rect, control_ptr); } } } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND //------------------------------------------------------------------------------ void uiChaosZoneBattle::MovementButtonMessageProc(SI_MESSAGE* message) { static bool mouse_drag = false; // Ŭ¸¯ÀÎÁö. µå·¡±×ÀÎÁö ±¸º° static POINT mouse_cursor_start_point; //Ŭ¸¯ ½ÃÀÛÁ¡ if ((GetControlPosition_byID(message->dwCtrlID) == kControl_Check_C000 || GetControlPosition_byID(message->dwCtrlID) == kControl_Check_C001) == FALSE) { return; } switch (message->eResultMsg) { case RT_MSG_LBUTTONDOWN: { mouse_cursor_point.x = Mouse::Instance()->GetMouseX(); mouse_cursor_point.y = Mouse::Instance()->GetMouseY(); mouse_cursor_start_point.x = mouse_cursor_point.x; mouse_cursor_start_point.y = mouse_cursor_point.y; mouse_drag = false; } break; //case RT_MSG_LBUTTONUP: case RT_MSG_LBUTTONCLICK: { if (mouse_drag == false) //µå·¡±× ¾Æ´Ï°í Ŭ¸¯À̸é { if (GetControlPosition_byID(message->dwCtrlID) == kControl_Check_C000) { uiBattlezone2Man* ui_battlezone2_manager = GET_DIALOG_MANAGER(uiBattlezone2Man, UIMAN_BATTLE_ZONE_MANAGER); if (ui_battlezone2_manager != NULL) { uiBattlezone2Man::ToggleBattlezoneDialog(); } } } CCtrlButtonCheckWZ* check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C000)); if (check_control) { check_control->SetCheckState(false); } check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C001)); if (check_control) { check_control->SetCheckState(true); } } break; case RT_MSG_MOUSEOVER: { if (g_Input.GetState( MOUSE_LBUTTON, IKS_MOUSE_KEY)) { LONG distance_x = Mouse::Instance()->GetMouseX() - mouse_cursor_point.x; LONG distance_y = Mouse::Instance()->GetMouseY() - mouse_cursor_point.y; mouse_cursor_point.x = Mouse::Instance()->GetMouseX(); mouse_cursor_point.y = Mouse::Instance()->GetMouseY(); FRECT dialog_rect; dialog_rect.left = GetDialogWZ()->GetDlgX() + distance_x; dialog_rect.top = GetDialogWZ()->GetDlgY() + distance_y; dialog_rect.right = dialog_rect.left + GetDialogWZ()->GetClientWZ()->GetSizeWidth(); dialog_rect.bottom = dialog_rect.top + GetDialogWZ()->GetClientWZ()->GetSizeHeight(); POINT app_size = g_pApplication->Get2DModeMapping(); // ui°¡ È­¸éÅ©±â¸¦ ¾È¹þ¾î³­´Ù¸é uiÀ̵¿ if (dialog_rect.left > 0 && dialog_rect.top > 0 && dialog_rect.right < app_size.x && dialog_rect.bottom < app_size.y) { MoveWindowWZ( dialog_rect.left, dialog_rect.top, GetDialogWZ()->GetClientWZ()->GetSizeWidth(), GetDialogWZ()->GetClientWZ()->GetSizeHeight() ); if (mouse_drag == false) { static float test_distance = 1.0f; //¸¹ÀÌ À̵¿ÇßÀ¸¸é if (abs(mouse_cursor_start_point.x - mouse_cursor_point.x) + abs(mouse_cursor_start_point.y - mouse_cursor_point.y) > test_distance) { mouse_drag = true; } } } } } break; } } void uiChaosZoneBattle::RenderTimer() { if (number_texture_ == INVALID_HANDLE_VALUE) { return; } // ÀüÀå ¿ÀÇ ŸÀÓ DWORD time_tick = ChaosSystem::GetBattleGroundData().GetBattleGroundOpenTime(); JoinBattleGroundState join_state = ChaosSystem::GetBattleGroundData().battle_ground_open_type(); DWORD hour = time_tick / 3600; time_tick %= 3600; WORD min = static_cast(time_tick) / 60; time_tick %= 60; WORD sec = static_cast(time_tick) % 60; const int PICTURE_SIZE_X = 22; const int PICTURE_SIZE_Y = 33; float picture_source_height = 446.0f; if (join_state == kJoinStateAdmission) { picture_source_height += PICTURE_SIZE_Y; } // ÇöÀç ½Ã°£ Ãâ·Â RECT render_position; CCtrlPictureWZ* picture_control; //if (ssq_time_hour_ > 10) { picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P039))); if (picture_control) { render_position = picture_control->GetSize(); g_pSunRenderer->RenderTexture(number_texture_, static_cast(render_position.left), //DEST(ÂïÀ»À§Ä¡) static_cast(render_position.top), static_cast(render_position.right), static_cast(render_position.bottom), static_cast(hour/10 * PICTURE_SIZE_X), //SRC picture_source_height, static_cast(render_position.right), static_cast(render_position.bottom)); } } //if (ssq_time_hour_ > 0) { picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P040))); if (picture_control) { render_position = picture_control->GetSize(); g_pSunRenderer->RenderTexture(number_texture_, static_cast(render_position.left), //DEST(ÂïÀ»À§Ä¡) static_cast(render_position.top), static_cast(render_position.right), static_cast(render_position.bottom), static_cast(hour%10 * PICTURE_SIZE_X), //SRC picture_source_height, static_cast(render_position.right), static_cast(render_position.bottom)); } } //if (ssq_time_minute_ > 10) { picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P041))); if (picture_control) { render_position = picture_control->GetSize(); g_pSunRenderer->RenderTexture(number_texture_, static_cast(render_position.left), //DEST(ÂïÀ»À§Ä¡) static_cast(render_position.top), static_cast(render_position.right), static_cast(render_position.bottom), static_cast(min/10 * PICTURE_SIZE_X), //SRC picture_source_height, static_cast(render_position.right), static_cast(render_position.bottom)); } } //if (ssq_time_minute_ > 0) { picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P042))); if (picture_control) { render_position = picture_control->GetSize(); g_pSunRenderer->RenderTexture(number_texture_, static_cast(render_position.left), //DEST(ÂïÀ»À§Ä¡) static_cast(render_position.top), static_cast(render_position.right), static_cast(render_position.bottom), static_cast(min%10 * PICTURE_SIZE_X), //SRC picture_source_height, static_cast(render_position.right), static_cast(render_position.bottom)); } } //if (ssq_time_second_ > 10) { picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P043))); if (picture_control) { render_position = picture_control->GetSize(); g_pSunRenderer->RenderTexture(number_texture_, static_cast(render_position.left), //DEST(ÂïÀ»À§Ä¡) static_cast(render_position.top), static_cast(render_position.right), static_cast(render_position.bottom), static_cast(sec/10 * PICTURE_SIZE_X), //SRC picture_source_height, static_cast(render_position.right), static_cast(render_position.bottom)); } } //if (ssq_time_second_ > 0) { picture_control = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Picture_P044))); if (picture_control) { render_position = picture_control->GetSize(); g_pSunRenderer->RenderTexture(number_texture_, static_cast(render_position.left), //DEST(ÂïÀ»À§Ä¡) static_cast(render_position.top), static_cast(render_position.right), static_cast(render_position.bottom), static_cast(sec%10 * PICTURE_SIZE_X), //SRC picture_source_height, static_cast(render_position.right), static_cast(render_position.bottom)); } } ////////////////////////////////////////////////////////////////////////// } void uiChaosZoneBattle::ShowReEnterMessage() { // ÀçÀÔÀå ¾È³» ¸Þ¼¼Áö if (notice_re_enter_message_ == true) { DWORD time_tick = ChaosSystem::GetBattleGroundData().GetBattleGroundOpenTime(); if (time_tick != 0) // time_tick °¡ 0ÀÌ ¾Æ´Ï¸é °»½Å ¹ÞÀº À¯È¿°ª { notice_re_enter_message_ = false; JoinBattleGroundState join_state = ChaosSystem::GetBattleGroundData().battle_ground_open_type(); if (join_state == kJoinStateAdmission) { // ÀÔÀåÀÌ °¡´ÉÇÑ »óÅÂ¸é ¸Þ¼¼Áöâ ¶ç¿öÁÜ uiSystemMan *system_manager = GET_DIALOG_MANAGER(uiSystemMan, UIMAN_SYSTEM); if (system_manager) { TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; // 3577 Áö±Ý ´ÙÀ½ ÀüÀå ¿¹¾àÀ» ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀüÀå Âü¿©¸¦ ¿øÇϽøé [ÀüÀ忹¾à] ¹öưÀ» ´­·¯ ÁÖ¼¼¿ä. g_InterfaceManager.GetInterfaceString(3577, string, INTERFACE_STRING_LENGTH ); system_manager->Sys_Verify(string, NULL); } } } } } void uiChaosZoneBattle::RefreshReservationCount() { // 5Ãʸ¶´Ù ¿¹¾àÇöȲ °»½Å¿äû if (ChaosSystem::GetBattleGroundData().battle_ground_open_type() == kJoinStateAdmission) { if (refresh_timer_.Check() != TIMER_STAT_NONE) { if (refresh_timer_.Check() == TIMER_STAT_FINISH) { refresh_timer_.Off(); refresh_timer_.On(reservation_count_refresh_time); DWORD mapcode = ChaosSystem::GetBattleGroundData().select_mapcode(); ChaosSystem::PacketFunction::SEND_CG_BATTLE_GROUND_RESERVATION_COUNT_SYN(mapcode); } } } } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND #endif //_NA_005026_20120527_CHAOS_ZONE_BATTLE_GROUND