#include "SunClientPrecompiledHeader.h" #ifdef _DH_BATTLEZONE2_ #include "uiBattlezone2Man/uiBattlezone2Man.h" #include "uiBattlezone2List/uiBattlezone2List.h" #include "uiBattlezone2Tree/uiBattlezone2Tree.h" #include "uiBattlezone2Lobby/uiBattlezone2Lobby.h" #include "uiBattlezone2Reservation/uiBattlezone2Reservation.h" #include "uiBattlezone2Password/uiBattlezone2Password.h" #include "Hero.h" #include "GlobalFunc.h" #include "Mouse.h" #include "BattleScene.h" #include "uiPartyMan/uiPartyMan.h" #include "ObjectManager.h" #include "uiSystemMan/uiSystemMan.h" #include "uiBattleZoneList/uiBattleZoneList_def.h" #include "BattlezoneMissionTreeParser.h" #include "ChatDialog.h" #include "uiChatMan/uiChatMan_def.h" #include "ItemManager.h" #include "SsqScene.h" #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND #include "ChaosSystem/ChaosSystemMan.h" #include "Application.h" #endif //_NA_008679_20160202_REWORK_BATTLEGROUND const int c_zoneListCount = 20; const int c_AnimationFullTime = 1; const int kListWidth[] = { 42, //BATTLEZONE2_LIST_NUM,= 0, 58,//BATTLEZONE2_LIST_TYPE, 58,//BATTLEZONE2_LIST_STATE, 228, //BATTLEZONE2_LIST_TITLE, 58, //BATTLEZONE2_LIST_MEMBER 162, //BATTLEZONE2_LIST_MAPNAME, }; //const int c_iCYCLE_REFRESH_ROOM_LIST = 30; const DWORD c_ListSelBarColor = RGBA(74,53,15,255); //------------------------------------------------------------------------------ void uiBattlezone2List::RegisterControl() { RegisterControlPosition(StrToWzID("B004"), kControl_Button_B004); // ´Ý±â RegisterControlPosition(StrToWzID("B000"), kControl_Button_B000); RegisterControlPosition(StrToWzID("B005"), kControl_Button_B005); RegisterControlPosition(StrToWzID("B006"), kControl_Button_B006); RegisterControlPosition(StrToWzID("B007"), kControl_Button_B007);//Àüü ¹æº¸±â RegisterControlPosition(StrToWzID("B008"), kControl_Button_B008); RegisterControlPosition(StrToWzID("B009"), kControl_Button_B009);//ÀÔÀå °¡´É ¹æ º¸±â RegisterControlPosition(StrToWzID("B010"), kControl_Button_B010);//¹æ¸¸µé±â //RegisterControlPosition(StrToWzID("ST20"), kControl_Text_ST20); RegisterControlPosition(StrToWzID("B016"), kControl_Button_B016); RegisterControlPosition(StrToWzID("S001"), kControl_Text_S001); RegisterControlPosition(StrToWzID("S002"), kControl_Text_S002); RegisterControlPosition(StrToWzID("S000"), kControl_Text_S000); RegisterControlPosition(StrToWzID("S003"), kControl_Text_S003); RegisterControlPosition(StrToWzID("S005"), kControl_Text_S005); RegisterControlPosition(StrToWzID("S006"), kControl_Text_S006); RegisterControlPosition(StrToWzID("S007"), kControl_Text_S007); RegisterControlPosition(StrToWzID("E000"), kControl_Edit_E000); RegisterControlPosition(StrToWzID("L000"), kControl_List_L000); RegisterControlPosition(StrToWzID("L001"), kControl_List_L001); RegisterControlPosition(StrToWzID("P003"), kControl_Picture_P003); RegisterControlPosition(StrToWzID("P002"), kControl_Picture_P002); RegisterControlPosition(StrToWzID("P000"), kControl_Picture_P000); RegisterControlPosition(StrToWzID("P001"), kControl_Picture_P001); RegisterControlPosition(StrToWzID("P004"), kControl_Picture_P004); RegisterControlPosition(StrToWzID("P005"), kControl_Picture_P005); RegisterControlPosition(StrToWzID("P006"), kControl_Picture_P006); RegisterControlPosition(StrToWzID("P007"), kControl_Picture_P007); RegisterControlPosition(StrToWzID("P009"), kControl_Picture_P009); RegisterControlPosition(StrToWzID("P010"), kControl_Picture_P010); RegisterControlPosition(StrToWzID("V001"), kControl_VScroll_V001); RegisterControlPosition(StrToWzID("V000"), kControl_VScroll_V000); RegisterControlPosition(StrToWzID("S008"), kControl_Text_S008);//ÆäÀÌÁöÇ¥½Ã RegisterControlPosition(StrToWzID("B001"), kControl_Button_B001);//¾Õ RegisterControlPosition(StrToWzID("B002"), kControl_Button_B002);//µÚ RegisterControlPosition(StrToWzID("L002"), kControl_List_L002); RegisterControlPosition(StrToWzID("B012"), kControl_Button_B012); RegisterControlPosition(StrToWzID("B003"), kControl_Button_B003); RegisterControlPosition(StrToWzID("B011"), kControl_Button_B011); RegisterControlPosition(StrToWzID("B013"), kControl_Button_B013); RegisterControlPosition(StrToWzID("B014"), kControl_Button_B014); RegisterControlPosition(StrToWzID("B015"), kControl_Button_B015); #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND RegisterControlPosition(StrToWzID("C000"), kControl_Check_C000); RegisterControlPosition(StrToWzID("C001"), kControl_Check_C001); #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } uiBattlezone2List::uiBattlezone2List(InterfaceManager* ui_manager): uiBase(ui_manager), list_control_(NULL), find_list_ptr_(NULL) { ui_battlezone2_manager_ = NULL; static_edit_control_ = NULL; edit_control_ = NULL; static_page_control_ = NULL; order_by_ = true; GetManager(); last_sort_by_function_ = kControl_Button_B012; is_first_ = true;//óÀ½ ¿©´Â °ÍÀÎÁö last_party_info_ = NULL; follow_party_key_ = 0; } uiBattlezone2List::~uiBattlezone2List(void) { } void uiBattlezone2List::Init(CDrawBase* draw_base) { RegisterControl(); list_control_ = static_cast(GetControlWZ(GetControlID_byPosition(kControl_List_L000))); assert(list_control_); edit_control_ = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Edit_E000))); assert(edit_control_); static_edit_control_ = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S002))); assert(static_edit_control_); static_page_control_ = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Text_S008))); assert(static_page_control_); if (static_page_control_) { static_page_control_->SetTextWZ("1/1");//óÀ½ ÆäÀÌÁö } battlezone_list_.clear(); search_count_ = 0; //TODO:°Ë»ö ±â´É ÃßÈÄ¿¡ CControlWZ* control = GetControlWZ(GetControlID_byPosition(kControl_List_L001)); if (control) { control->ShowWindowWZ(WZ_HIDE); } find_list_ptr_ = static_cast(GetControlWZ(GetControlID_byPosition(kControl_List_L002))); if (find_list_ptr_) { find_list_ptr_->ShowWindowWZ(WZ_HIDE); } is_searched_ = false; is_ssq_open_ = false; bool is_result = true; last_scroll_position_ = 0; current_page_ = 1; //ÇöÀçÆäÀÌÁö max_page_ = 1; //ÃÖ´ëÆäÀÌÁö order_by_ = true; if (is_result) { //is_result = dropdown_class_filter().Init(GetStaticControlWZ(GetControlID_byPosition(kControl_Text_ST20)), is_result = dropdown_class_filter().Init(GetButtonControlWZ(GetControlID_byPosition(kControl_Button_B016)), GetButtonControlWZ(GetControlID_byPosition(kControl_Button_B005)), GetListControlWZ(GetControlID_byPosition(kControl_List_L001)), NULL, GetPictureControlWZ(GetControlID_byPosition(kControl_Picture_P010))); if (dropdown_class_filter().list_control()) { dropdown_class_filter().list_control()->SetUnuseSelBar(true); dropdown_class_filter().list_control()->DeleteItemAll(); dropdown_class_filter().list_control()->SetStartLineGapTop(10); dropdown_class_filter().list_control()->SetSellHeight(16); } // 0868 ¸ÊÀ̸§ // 0636 ¾ÆÀ̵ð·Î ã±â // 0575 ¹øÈ£·Î ã±â dropdown_class_filter().InsertItem(868, (void*)BATTLEZONE2_FIND_BY_MAP_NAME, StrToWzID("st10"), DT_VCENTER | DT_CENTER); dropdown_class_filter().InsertItem(636, (void*)BATTLEZONE2_FIND_BY_ID, StrToWzID("st10"), DT_VCENTER | DT_CENTER); dropdown_class_filter().InsertItem(575, (void*)BATTLEZONE2_FIND_BY_NUMBER, StrToWzID("st10"), DT_VCENTER | DT_CENTER); //dropdown_class_filter().ResetVScroll(); dropdown_class_filter().Select(0); } ToggleViewRoom(true); ShowEditControl(false); ShowFindWords(false); MoveDefaultWindowPos(); InitTextures(); animation_refresh_timer_.On(c_AnimationFullTime); ShowAnimation(false); if (find_vscroll_control()) { find_vscroll_control()->ShowWindowWZ(WZ_HIDE); } control = GetControlWZ(GetControlID_byPosition(kControl_Picture_P006)); if (control) { control->ShowWindowWZ(WZ_HIDE); } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND window_opend_ = FALSE; #endif //_NA_008679_20160202_REWORK_BATTLEGROUND } void uiBattlezone2List::Clear() { if (static_edit_control_) { static_edit_control_->SetTextWZ(_T("")); } if (edit_control_) { edit_control_->SetTextWZ(_T("")); } if (static_page_control_) { static_page_control_->SetTextWZA(_T("1/1")); } last_party_info_ = NULL; ShowEditControl(false); is_searched_ = false; last_scroll_position_ = 0; search_count_ = 0; follow_party_key_ = 0; if (vscroll_control()) { vscroll_control()->SetScrollPosWZ(0); } is_ssq_open_ = false; current_page_ = 1; //ÇöÀçÆäÀÌÁö max_page_ = 1; //ÃÖ´ëÆäÀÌÁö order_by_ = true; ShowAnimation(false); ShowWaitingButton(true); is_first_ = true;//óÀ½ ¿©´Â °ÍÀÎÁö if (find_vscroll_control()) { find_vscroll_control()->ShowWindowWZ(WZ_HIDE); find_vscroll_control()->SetScrollPosWZ(0); } CControlWZ* control = GetControlWZ(GetControlID_byPosition(kControl_Picture_P006)); if (control) { control->ShowWindowWZ(WZ_HIDE); } } //------------------------------------------------------------------------------ void uiBattlezone2List::InitTextures() { // ¾Ö´Ï¸ÞÀÌ¼Ç ÅØ½ºÃÄ 2Àå ·Îµå effect_texture_ = g_pSunRenderer->x_pManagerTexture->LoadTexture( "Data\\Interface\\Loading.tga", TLS_ORIGINAL_SIZE | TLS_NO_MIPMAP | TLS_NO_MULTITHREAD); // ¾Ö´Ï¸ÞÀÌ¼Ç ÅØ½ºÃÄ À§Ä¡ (12ÇÁ·¹ÀÓ) ÇÁ·¹ÀÓ´ç (40 * 40) 4 x 3 °³ int index = 0; float width = 0.0f; float height = 0.0f; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 4; ++j) { width = j * ANIMATION_FRAME_WIDTH; height = i * ANIMATION_FRAME_HEIGHT; texture_rectangles_[index].left = width; texture_rectangles_[index].top = height; texture_rectangles_[index].right = ANIMATION_FRAME_WIDTH; texture_rectangles_[index].bottom = ANIMATION_FRAME_HEIGHT; ++index; if (index >= ANIMATION_FRAME) { break; } } } } void uiBattlezone2List::ShowAnimation(bool is_value) { animatino_show_ = is_value; } void uiBattlezone2List::PlayAnimation() { static FRECT img_rect = {0,}; img_rect.left = (float)GetControlWZ(GetControlID_byPosition(kControl_List_L000))->GetSizeRect().left; img_rect.top = (float)GetControlWZ(GetControlID_byPosition(kControl_List_L000))->GetSizeRect().top; img_rect.right = (float)GetControlWZ(GetControlID_byPosition(kControl_List_L000))->GetSizeRect().right; img_rect.bottom = (float)GetControlWZ(GetControlID_byPosition(kControl_List_L000))->GetSizeRect().bottom; img_rect.left = img_rect.left + ((img_rect.right - img_rect.left - ANIMATION_FRAME_WIDTH) / 2) + 0.5f; img_rect.top = img_rect.top + ((img_rect.bottom - img_rect.top - ANIMATION_FRAME_HEIGHT) / 2); int frame = 30;//ÃÊ´ç ¾Ö´Ï¸ÞÀÌ¼Ç ÇÁ·¡ÀÓ int count = ((animation_refresh_timer_.SpentTime() / frame) % ANIMATION_FRAME); if (animatino_show_) { g_pSunRenderer->RenderTexture(effect_texture_, img_rect.left, img_rect.top, ANIMATION_FRAME_WIDTH, ANIMATION_FRAME_HEIGHT, texture_rectangles_[count].left, texture_rectangles_[count].top, texture_rectangles_[count].right, texture_rectangles_[count].bottom); ++count; } else { //nop } } void uiBattlezone2List::SetBattlezoneList() { if (list_control_ == NULL) { return; } int row = 0; if (list_control_ != NULL) { GlobalFunc::SetReportButtonInfo(list_control_, BATTLEZONE2_LIST_NUM, kListWidth[BATTLEZONE2_LIST_NUM], NULL); GlobalFunc::SetReportButtonInfo(list_control_, BATTLEZONE2_LIST_TYPE, kListWidth[BATTLEZONE2_LIST_TYPE], NULL); GlobalFunc::SetReportButtonInfo(list_control_, BATTLEZONE2_LIST_STATE, kListWidth[BATTLEZONE2_LIST_STATE], NULL); GlobalFunc::SetReportButtonInfo(list_control_, BATTLEZONE2_LIST_TITLE, kListWidth[BATTLEZONE2_LIST_TITLE], NULL); GlobalFunc::SetReportButtonInfo(list_control_, BATTLEZONE2_LIST_MEMBER, kListWidth[BATTLEZONE2_LIST_MEMBER], NULL); GlobalFunc::SetReportButtonInfo(list_control_, BATTLEZONE2_LIST_MAPNAME, kListWidth[BATTLEZONE2_LIST_MAPNAME], NULL); list_control_->DeleteItemAll(); list_control_->SetCurSel(-1); list_control_->SetColorSelBar(c_ListSelBarColor); list_control_->SetUseReport(true); list_control_->SetReportUseCnt(7); list_control_->SetHideReportRender(true); list_control_->SetSellHeight(20); int list_size = battlezone_list_.size(); TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR temp_string[INTERFACE_STRING_LENGTH] = {0,}; //===================================================================================== // 1.¸®½ºÆ®ÄÁÆ®·Ñ µ¥ÀÌÅÍ»ðÀÔ //===================================================================================== std::vector::iterator begin = battlezone_list_.begin(); std::vector::iterator end = battlezone_list_.end(); DWORD font_color = RGBA(255,255,255,0); int index = 0; search_count_ = 0; list_control_->SetBeginDrawIndex(0); for (; begin != end; ++begin) { PartyRoomInfo data = (*begin); index = list_control_->InsertItemBack(); list_control_->SetItemData(index, (void*)&(*begin)); #ifdef _NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION #else if (data.room_key_ == BASE_ROOM_KEY)//Ÿ¶ôÇÑ »ç¿ø { font_color = RGBA(232,0,0,255); } else #endif //_NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION { if (data.is_mission_start_) { font_color = RGBA(154,154,154,255); } else { font_color = RGBA(255,255,0,255); } } ++search_count_; sprintf(string, "%d", (data.room_key_ - BASE_ROOM_KEY)); GlobalFunc::SetItem(list_control_, index, BATTLEZONE2_LIST_NUM, string, StrToWzID("m212"), DT_CENTER, RGBA(255,255,255,0), font_color, font_color); int room_type_string_code; const PartyZoneType zone_type = BattlezoneMissionTreeParser::Instance()->GetType(data.base_party_room_info.map_code_); switch (zone_type) { case PartyOfMission: #ifdef _NA_007734_20141027_ADD_ROOMKIND_SPECIALMISSION case PartyOfSpecialMission: #endif //_NA_007734_20141027_ADD_ROOMKIND_SPECIALMISSION { room_type_string_code = eST_MISSION; } break; case PartyOfPvPByPersonal: case PartyOfPvPByTeam: { room_type_string_code = eST_BATTLE_PVP; } break; case PartyOfTopOfTrialByCash: case PartyOfTopOfTrialByNormal: #ifdef _NA_007156_20140703_TOP_OF_TRIAL_LIGHT case PartyOfTopOfTrialLight_cash: case PartyOfTopOfTrialLight_normal: #endif //_NA_007156_20140703_TOP_OF_TRIAL_LIGHT { room_type_string_code = 2498; } break;//ÀúÁÖ¹ÞÀºÅ¾ 2498 case PartyOfEvent: { room_type_string_code = 2499; } break;//À̺¥Æ® 2499 //case PartyOfNone: //±âº» default: {room_type_string_code = 0;} break; } if (room_type_string_code) { g_InterfaceManager.GetInterfaceString(room_type_string_code, string,INTERFACE_STRING_LENGTH); } else { sprintf(string, "-"); } GlobalFunc::SetItem(list_control_, index, BATTLEZONE2_LIST_TYPE, string, StrToWzID("m212"), DT_CENTER, RGBA(255,255,255,0), font_color, font_color); if (data.is_mission_start_) { g_InterfaceManager.GetInterfaceString(eST_GOING, string, INTERFACE_STRING_LENGTH); } else { g_InterfaceManager.GetInterfaceString(eST_WAITING, string, INTERFACE_STRING_LENGTH); } GlobalFunc::SetItem(list_control_, index, BATTLEZONE2_LIST_STATE, string, StrToWzID("m212"), DT_CENTER, RGBA(255,255,255,0), font_color, font_color); sprintf(string, data.base_party_room_info.party_room_title_); GlobalFunc::SetItem(list_control_, index, BATTLEZONE2_LIST_TITLE, string, StrToWzID("m212"), DT_CENTER, RGBA(255,255,255,0), font_color, font_color); #ifdef _NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION #else if (data.room_key_ == BASE_ROOM_KEY) { sprintf(string, "70"); } else #endif //_NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION { sprintf(string, "%d/%d", data.current_user_num_, data.max_user_num_); } GlobalFunc::SetItem(list_control_, index, BATTLEZONE2_LIST_MEMBER, string, StrToWzID("m212"), DT_CENTER, RGBA(255,255,255,0), font_color, font_color); const sMAPINFO* mapInfo = MapInfoParser::Instance()->FindMapInfo(data.base_party_room_info.map_code_); if (mapInfo) { if (data.base_party_room_info.party_room_type_ == PartyOfTopOfTrialByCash #ifdef _NA_007156_20140703_TOP_OF_TRIAL_LIGHT || (data.base_party_room_info.party_room_type_ == PartyOfTopOfTrialLight_cash) #endif //_NA_007156_20140703_TOP_OF_TRIAL_LIGHT ) { TCHAR temp[INTERFACE_STRING_LENGTH] = {0,}; TCHAR buffer_string[INTERFACE_STRING_LENGTH] = {0,}; g_InterfaceManager.GetInterfaceString(mapInfo->dwNCode, temp); // 2443 (¹Ù·ÎÀÔÀå) g_InterfaceManager.GetInterfaceString(2443, buffer_string); sprintf(string, "%s%s", temp, buffer_string); } else { g_InterfaceManager.GetInterfaceString(mapInfo->dwNCode, string, INTERFACE_STRING_LENGTH); } } else { //788 ¹Ì¼Ç ¾øÀ½ g_InterfaceManager.GetInterfaceString(788, string, INTERFACE_STRING_LENGTH); } GlobalFunc::SetItem(list_control_, index, BATTLEZONE2_LIST_MAPNAME, string, StrToWzID("m212"), DT_CENTER, RGBA(255,255,255,0), font_color, font_color); } } #if WZENGINEVER >= 400 int max_line_count = list_control_->GetListRowCnt(); int draw_line_count = list_control_->GetDrawRowCount(); int scroll_max_num = max(0, max_line_count - draw_line_count); VScrollDialog::ResizeingVScrollControl(scroll_max_num, 0); #endif //#if WZENGINEVER >= 400 } bool uiBattlezone2List::ShowEditControl(bool is_show) { if (edit_control_ == NULL) { return false; } TCHAR string_buffer[INTERFACE_STRING_LENGTH] = {0,}; if (is_show) { static_edit_control_->GetTextWZ(string_buffer, INTERFACE_STRING_LENGTH-1); static_edit_control_->ShowWindowWZ(WZ_HIDE); edit_control_->ShowWindowWZ(WZ_SHOW); edit_control_->SetFocusWZ(); } else { edit_control_->GetTextWZ(string_buffer, INTERFACE_STRING_LENGTH-1); edit_control_->ShowWindowWZ(WZ_HIDE); static_edit_control_->SetTextWZ(string_buffer); static_edit_control_->ShowWindowWZ(WZ_SHOW); } return true; } void uiBattlezone2List::Release() { battlezone_list_.clear(); if (list_control_) { list_control_->DeleteItemAll(); list_control_->SetCurSel(-1); } dropdown_class_filter().Release(); if(effect_texture_ != INVALID_HANDLE_VALUE) { g_pSunRenderer->x_pManagerTexture->DestroyTexture(effect_texture_); effect_texture_ = INVALID_HANDLE_VALUE; } } void uiBattlezone2List::ShowFindWords(bool is_value) { CControlWZ* control = GetControlWZ(GetControlID_byPosition(kControl_Picture_P006)); if (find_list_ptr_ && find_vscroll_control() && control) { if (find_list_ptr_->GetState() == WZ_SHOW && is_value == false) { find_list_ptr_->ShowWindowWZ(WZ_HIDE); find_vscroll_control()->ShowWindowWZ(WZ_HIDE); control->ShowWindowWZ(WZ_HIDE); } else if (find_list_ptr_->GetState() == WZ_HIDE && is_value == true) { find_list_ptr_->ShowWindowWZ(WZ_SHOW); find_vscroll_control()->ShowWindowWZ(WZ_SHOW); control->ShowWindowWZ(WZ_SHOW); } } } void uiBattlezone2List::OnUpdateSolarDialog() { dropdown_class_filter().Update(); if (animation_refresh_timer_.Check() != TIMER_STAT_NONE) { if (animation_refresh_timer_.Check() == TIMER_STAT_FINISH) { animation_refresh_timer_.Off(); animation_refresh_timer_.On(c_AnimationFullTime); } } if (is_searched_ != true) { if (list_refresh_timer_.Check() != TIMER_STAT_NONE) { if (list_refresh_timer_.Check() == TIMER_STAT_FINISH) { RequestBattlezoneList(); //list_refresh_timer_.Off(); //list_refresh_timer_.On(c_iCYCLE_REFRESH_ROOM_LIST); } else if (list_refresh_timer_.SpentTime() > 1200 && animatino_show_) { RequestBattlezoneList(); } } } RECT control_rect; uiBattlezone2Tree* battlezone2_tree = GET_CAST_DIALOG(uiBattlezone2Tree, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_TREE); uiBattlezone2Reservation* battlezone2_reservation = GET_CAST_DIALOG(uiBattlezone2Reservation, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_RESERVATION); GetDialogWZ()->GetClientRect(&control_rect); DWORD focus_dialog_id = 0; if (battlezone2_tree && battlezone2_tree->IsVisible()) { battlezone2_tree->MoveWindowWZ(control_rect.right, control_rect.top); focus_dialog_id = IM_BATTLEZONE2_MANAGER::BATTLEZONE2_TREE; } else if (battlezone2_reservation && battlezone2_reservation->IsVisible()) { battlezone2_reservation->MoveWindowWZ(control_rect.right, control_rect.top); focus_dialog_id = IM_BATTLEZONE2_MANAGER::BATTLEZONE2_RESERVATION; } else { focus_dialog_id = 0; } if (GetDialogWZ()->HaveFocus() == true && focus_dialog_id) { GlobalFunc::MoveToTopDialog(focus_dialog_id); } /*static TCHAR last_string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string_buffer[INTERFACE_STRING_LENGTH] = {0,}; if (edit_control_) { edit_control_->GetTextWZ(string_buffer, INTERFACE_STRING_LENGTH-1); if (dropdown_class_filter().CurrentUserData() == BATTLEZONE2_FIND_BY_MAP_NAME && edit_control_->GetState() == WZ_SHOW && strlen(string_buffer) > 0) { ShowFindWords(true); if (strcmp(last_string, string_buffer) != 0) { sprintf(last_string, string_buffer); FillFindListData(string_buffer); } } else { ShowFindWords(false); } }*/ VScrollDialog::Update(); } void uiBattlezone2List::OnRenderSolarDialog() { RenderIcon(); PlayAnimation(); dropdown_class_filter().OnDraw(); CControlWZ* control = GetControlWZ(GetControlID_byPosition(kControl_List_L001)); if (control) { control->OnDraw(true); } } void uiBattlezone2List::MouseOver_MsgProc(SI_MESSAGE* message) { } void uiBattlezone2List::OnShowWindow(BOOL is_show) { RECT control_rect; uiBattlezone2Lobby* battlezone2_lobby = GET_CAST_DIALOG(uiBattlezone2Lobby, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LOBBY); if (is_show) { if (g_SsqScene.is_ssq_state() == true) { SetIsSSQOpen(true); } LoadMapNameCode();//Çѹø¸¸ ½ÇÇàµÊ SetBattlezoneList(); #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND uiChaosSystemMan* chaos_manager = GET_DIALOG_MANAGER(uiChaosSystemMan, UIMAN_CHAOS); if (chaos_manager) { chaos_manager->ToggleChaoszoneDialog(true); RECT ui_position = chaos_manager->GetUIPosition(); if (ui_position.right != -1) { this->MoveWindowWZ(ui_position.left, ui_position.top); } } mouse_cursor_point.x = Mouse::Instance()->GetMouseX(); mouse_cursor_point.y = Mouse::Instance()->GetMouseY(); CCtrlButtonCheckWZ* check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C000)); if (check_control) { check_control->SetCheckState(true); } check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C001)); if (check_control) { check_control->SetCheckState(false); } if (window_opend_ == FALSE) { window_opend_ = TRUE; } #else if (this->IsVisible() && battlezone2_lobby && battlezone2_lobby->GetDialogWZ()) { battlezone2_lobby->GetDialogWZ()->GetClientRect(&control_rect); this->MoveWindowWZ(control_rect.left, control_rect.top); } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND dropdown_class_filter().Select(0); ShowEditControl(false); if (is_first_) { RequestBattlezoneList(true); is_first_ = false; } else { RequestBattlezoneList(); } list_refresh_timer_.On(c_iCYCLE_REFRESH_ROOM_LIST); is_searched_ = false; keyMsg msg; ZeroMemory(&msg,sizeof(msg)); msg.dwType=eDoType_Battlezone2List_Dialog; msg.wParam=IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST; msg.DoSomething=GlobalFunc::DoShowWindowEx; g_KeyQueueManager.PushBack(msg); } else { #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND uiChaosSystemMan* chaos_manager = GET_DIALOG_MANAGER(uiChaosSystemMan, UIMAN_CHAOS); if (chaos_manager && window_opend_) { this->GetDialogWZ()->GetClientRect(&control_rect); control_rect.right = 0; //ÃʱâÈ­ È®Àοë chaos_manager->SetUIPosition(control_rect); } #else if (!this->IsVisible() && battlezone2_lobby && battlezone2_lobby->GetDialogWZ()) { this->GetDialogWZ()->GetClientRect(&control_rect); battlezone2_lobby->MoveWindowWZ(control_rect.left, control_rect.top); } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND if (edit_control_) { edit_control_->SetTextWZ(""); } ShowWaitingButton(true); if (battlezone2_lobby) { battlezone2_lobby->set_is_ready(false);//·¹µð Ç®¾îÁÖ±â) } if (GetManager()) { GetManager()->ShowBattlezoneDialog(uiBattlezone2Man::BATTLEZONE2_DIALOG_TREE, false); GetManager()->ShowBattlezoneDialog(uiBattlezone2Man::BATTLEZONE2_DIALOG_RESERVATION, false); } g_KeyQueueManager.DeleteMsg(eDoType_Battlezone2List_Dialog); } } uiBattlezone2Man* uiBattlezone2List::GetManager() { if (ui_battlezone2_manager_ == NULL) { ui_battlezone2_manager_ = static_cast(this->GetUIMan()->GetUserInterfaceManager(UIMAN_BATTLE_ZONE_MANAGER)); assert (ui_battlezone2_manager_); } return ui_battlezone2_manager_; } void uiBattlezone2List::Process(DWORD tick_count) { } void uiBattlezone2List::OnSearch() { TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR message[INTERFACE_STRING_LENGTH] = {0,}; if (edit_control_) { edit_control_->GetTextWZ(string, INTERFACE_STRING_LENGTH-1); } //°Ë»ö switch (dropdown_class_filter().CurrentUserData()) { case BATTLEZONE2_FIND_BY_MAP_NAME: { // ij¸¯Å͸íÀÇ ÃÖ´ë »çÀÌÁî(16 byte)¸¦ ³Ñ¾ú½À´Ï´Ù. /*if(!GlobalFunc::CompareLimitText(edit_control_, string, MAX_CHARNAME_LENGTH, 5790)) { return; }*/ if (lstrcmp (string, _T(""))) { is_searched_ = true; SearchMap(string); } } break; case BATTLEZONE2_FIND_BY_ID: { if (lstrcmp (string, _T(""))) { is_searched_ = true; SearchID(string); } } break; case BATTLEZONE2_FIND_BY_NUMBER: { if (lstrcmp (string, _T(""))) { bool is_alpha = true; for (int i = 0; i < lstrlen(string); ++i) { if (!(string[i]>=_T('0') && string[i]<=_T('9'))) { is_alpha = false; } } int value = _ttoi(string); if (is_alpha) { is_searched_ = true; #if 0 //Ŭ¶ó¿¡¼­ °Ë»ö½Ã RequestBattlezoneList(true);//°Ë»öÀü¿¡ Çѹø ¿äû #endif// SearchNo(value); } else { g_InterfaceManager.GetInterfaceString(5211, message, INTERFACE_STRING_LENGTH); uiSystemMan* system_manager = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_SYSTEM)); if (system_manager) { system_manager->Sys_VerifyLock(message); } } } } break; } //ShowEditControl(false); } //------------------------------------------------------------------------------ void uiBattlezone2List::MessageProc(SI_MESSAGE* message) { if (IsLock()) return; DWORD user_data = 0; eCHAR_TYPE menu_type = static_cast(user_data); bool is_change = false; if (dropdown_class_filter().MessageProc(message, OUT is_change)) { if (is_change) { eCHAR_TYPE char_type = static_cast(dropdown_class_filter().CurrentUserData()); } if (GetControlPosition_byID(message->dwCtrlID) == kControl_List_L001) { if (edit_control_ && static_edit_control_)//µå¶ø¹Ú½º°¡ º¯°æµÇ¸é °Ë»ö¾î ÃʱâÈ­ { edit_control_->SetTextWZ(""); static_edit_control_->SetTextWZ(""); } } return; } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND MovementButtonMessageProc(message); #endif //_NA_008679_20160202_REWORK_BATTLEGROUND /*if (GetManager() == NULL) return;*/ switch (message->eResultMsg) { case RT_MSG_LBUTTONDCLICK: OnDoubleButtonClick(message); break; case RT_MSG_LBUTTONCLICK: OnLButtonClick(message); break; case RT_MSG_EDIT_ENTERKEYDOWN: { OnSearch(); } break; case RT_MSG_SB_LINETOP: { if (GetControlPosition_byID(message->dwCtrlID) == kControl_VScroll_V001) { OnVScrollUp(message); } if (GetControlPosition_byID(message->dwCtrlID) == kControl_VScroll_V000) { OnFindVScrollUp(message); } } break; case RT_MSG_SB_LINEBOTTOM: { if (GetControlPosition_byID(message->dwCtrlID) == kControl_VScroll_V001) { OnVScrollDown(message); } if (GetControlPosition_byID(message->dwCtrlID) == kControl_VScroll_V000) { OnFindVScrollDown(message); } } break; case RT_MSG_SB_THUMBTRACK: //!< ½æÀ» µå·¡±× Çϰí ÀÖ´Ù. case RT_MSG_SB_THUMBPOSITION: //!< ½æÀ» µå·¡±×ÇÑÈÄ ¸¶¿ì½º¸¦ ³õ¾Ò´Ù. case RT_MSG_SB_ENDSCROLL: //!< ½ºÅ©·ÑÀÌ Á¾·á µÇ¾ú´Ù. { if (GetControlPosition_byID(message->dwCtrlID) == kControl_VScroll_V001) { OnVScrollThumb(message); } if (GetControlPosition_byID(message->dwCtrlID) == kControl_VScroll_V000) { OnFindVScrollThumb(message); } } break; default: SolarDialog::MessageProc(message); VScrollDialog::MessageProc(message); break; } } //------------------------------------------------------------------------------ CCtrlVScrollWZ* uiBattlezone2List::vscroll_control() { return GetVScrollControlWZ(GetControlID_byPosition(kControl_VScroll_V001)); } //------------------------------------------------------------------------------ CCtrlVScrollWZ* uiBattlezone2List::find_vscroll_control() { return GetVScrollControlWZ(GetControlID_byPosition(kControl_VScroll_V000)); } //------------------------------------------------------------------------------ bool uiBattlezone2List::GetScrollArea(RECT& area) { if (IsOverControl(GetControlWZ_byPosition(kControl_List_L000)) == true) { area = GetControlWZ_byPosition(kControl_List_L000)->GetSizeRect(); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnVScrollThumb(SI_MESSAGE* msg) { if (vscroll_control() == NULL) { return false; } if (VScrollDialog::OnVScrollThumb(msg) == true) { GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnVScrollUp(SI_MESSAGE* msg) { if (vscroll_control() == NULL) { return false; } if (VScrollDialog::OnVScrollUp(msg) == true) { GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnVScrollDown(SI_MESSAGE* msg) { if (vscroll_control() == NULL) { return false; } if (VScrollDialog::OnVScrollDown(msg) == true) { GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::GetFindScrollArea(RECT& area) { if (IsOverControl(GetControlWZ_byPosition(kControl_List_L002)) == true) { area = GetControlWZ_byPosition(kControl_List_L002)->GetSizeRect(); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnFindVScrollThumb(SI_MESSAGE* msg) { if (find_vscroll_control() == NULL) { return false; } if (OnVScrollThumb(msg) == true) { GetListControlWZ(GetControlID_byPosition(kControl_List_L002))->SetBeginDrawIndex(find_vscroll_control()->GetScrollPosWZ()); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::FindVScrollUp(SI_MESSAGE* msg) { if (find_vscroll_control() == NULL) { return false; } int pos = find_vscroll_control()->GetScrollPosWZ(); int mmin = 0, mmax = 0; find_vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if(pos > mmin) { --pos; find_vscroll_control()->SetScrollPosWZ(pos); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::FindVScrollDown(SI_MESSAGE* msg) { if (find_vscroll_control() == NULL) { return false; } int pos = find_vscroll_control()->GetScrollPosWZ(); int mmin = 0, mmax = 0; find_vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if (pos < mmax) { ++pos; find_vscroll_control()->SetScrollPosWZ(pos); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnFindVScrollUp(SI_MESSAGE* msg) { if (find_vscroll_control() == NULL) { return false; } if (FindVScrollUp(msg) == true) { GetListControlWZ(GetControlID_byPosition(kControl_List_L002))->SetBeginDrawIndex(find_vscroll_control()->GetScrollPosWZ()); return true; } return false; } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnFindVScrollDown(SI_MESSAGE* msg) { if (find_vscroll_control() == NULL) { return false; } if (FindVScrollDown(msg) == true) { GetListControlWZ(GetControlID_byPosition(kControl_List_L002))->SetBeginDrawIndex(find_vscroll_control()->GetScrollPosWZ()); return true; } return false; } //------------------------------------------------------------------------------ void uiBattlezone2List::ShowBattlezoneTree(BYTE mode) { uiBattlezone2Tree* battlezone_tree_dialog = GET_CAST_DIALOG(uiBattlezone2Tree, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_TREE); uiBattlezone2Reservation* battlezone_reservation_dialog = GET_CAST_DIALOG(uiBattlezone2Reservation, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_RESERVATION); if (mode == uiBattlezone2Tree::kReservationMode) { battlezone_tree_dialog->ShowInterface(FALSE); battlezone_reservation_dialog->SetMode(mode); if (battlezone_reservation_dialog->IsVisible()) { battlezone_reservation_dialog->ShowInterface(FALSE); } else { battlezone_reservation_dialog->ShowInterface(TRUE); } } else { battlezone_reservation_dialog->ShowInterface(FALSE); battlezone_tree_dialog->SetMode(mode); if (battlezone_tree_dialog->IsVisible()) { battlezone_tree_dialog->ShowInterface(FALSE); } else { battlezone_tree_dialog->ShowInterface(TRUE); } } /* uiBattlezone2Tree* battlezone_tree_dialog = GET_CAST_DIALOG(uiBattlezone2Tree, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_TREE); if (battlezone_tree_dialog == NULL) { return; } if (battlezone_tree_dialog->IsVisible()) { if (battlezone_tree_dialog->battlezone_tree_mode() == mode) { battlezone_tree_dialog->ShowInterface(FALSE); } else { battlezone_tree_dialog->SetMode(mode); } } else { battlezone_tree_dialog->ShowInterfaceWithSound(TRUE); battlezone_tree_dialog->SetMode(mode); }*/ } bool uiBattlezone2List::EnterRoom(WORD party_key, const TCHAR* password, PartyRoomInfo* party_info) { TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; if (party_key != 0xFF) { if (party_info == NULL) { party_info = last_party_info_; } if (party_info) { if (party_key == 0) { party_key = party_info->link_party_key_; } /*if (party_info->current_user_num_ >= party_info->max_user_num_) { // Àοø¼ö¿¡ À§¹è //2477 ÀÔÀå ÀοøÀÌ Ãʰú µÇ¾ú½À´Ï´Ù. RC_PARTY_FAIL_MAX_MEMBER_COUNT g_InterfaceManager.GetInterfaceString(2477, string, INTERFACE_STRING_LENGTH); GlobalFunc::OutputMsg_Warning(eOUTPUT_MSG_CHAT, string); GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CENTER_SHOW, string); return false; }*/ const BattlezoneMissionTreeInfo* find_info = NULL; if(party_info) { find_info = BattlezoneMissionTreeParser::Instance()->FindData(party_info->base_party_room_info.map_code_); } if (find_info) { const sMAPINFO* map_info= MapInfoParser::Instance()->FindMapInfo((MAPCODE)find_info->map_code); if (map_info != NULL) { if (party_info->base_party_room_info.map_code_ != 0 && g_pHero && (map_info->maxLV < g_pHero->GetLevel() || map_info->minLV > g_pHero->GetLevel())) { // ·¹º§¿¡ À§¹è //2493 ·¹º§ Á¶°Ç¿¡ ¸ÂÁö ¾Ê´Â´Ù. g_InterfaceManager.GetInterfaceString(2493, string, INTERFACE_STRING_LENGTH); GlobalFunc::OutputMsg_Warning(eOUTPUT_MSG_CHAT, string); GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CENTER_SHOW, string); return false; } } else { //¸Ê ¸øÃ£À½ } } } MSG_CG_PARTY_JOIN_ROOM_SYN send_packet; send_packet.join_party_key_ = party_key; if (password) { send_packet.is_private_room_ = true; Snprintf(send_packet.password_, MAX_ROOMPASSWORD_LENGTH + 1, password); } else { send_packet.is_private_room_ = false; } GlobalFunc::SendPacket(CI_GAMESERVERIDX, &send_packet, sizeof(send_packet)); return true; } #ifdef _NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION #else else if (party_info && party_info->room_key_ == BASE_ROOM_KEY) { #ifndef _DEV_VER //#if'N'def if (!g_SsqScene.Func_Output_with_internal_timer(string, true)) { TCHAR message[INTERFACE_STRING_LENGTH] = {0,}; // 2474 Ÿ¶ôÇÑ »ç¿ø ÀÔÀå ½Ã°£ÀÌ ¾Æ´Õ´Ï´Ù. g_InterfaceManager.GetInterfaceString(2474, message); GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CENTER_SHOW, _T(message)); } else #endif//_DEV_VER { //Ÿ¶ôÇÑ »ç¿ø MSG_CG_ZONE_EX_SSQ_JOIN_INFO_SYN ssq_send_packet; POSTYPE output_position = INVALID_SLOT_POS; ssq_send_packet.m_ItemPos = 0; GlobalFunc::SendPacket(CI_GAMESERVERIDX, &ssq_send_packet, sizeof(ssq_send_packet)); } } #endif //_NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION return false; } bool uiBattlezone2List::OnDoubleButtonClick(SI_MESSAGE* message) { bool result = true; switch (GetControlPosition_byID(message->dwCtrlID)) { case kControl_List_L000: { if (list_control_) { int index = list_control_->GetCurSel(); if (index != -1) { PartyRoomInfo* data = static_cast(list_control_->GetItemData(index)); last_party_info_ = data; if (data && !strlen(data->base_party_room_info.party_room_password_)) { if (g_pHero->IsParty()) { TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; uiSystemMan* system_manager = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_SYSTEM)); if(system_manager) { // ¹æ ÀÔÀå½Ã ÇöÀç ÆÄÆ¼°¡ Å»Åð µË´Ï´Ù. °è¼Ó ÇϽðڽÀ´Ï±î? 2475 g_InterfaceManager.GetInterfaceString(2475, string, INTERFACE_STRING_LENGTH); system_manager->Sys_Confirm(string, GlobalFunc::PartyLeaveAndJoinConfirm, NULL, NULL, 100/*È®ÀÎ*/, 101/*Ãë¼Ò*/); } } else { EnterRoom(data->link_party_key_, NULL, data); } } else { //EnterRoom(data->link_party_key_); uiBattlezone2Password* battlezone2_password = GET_CAST_DIALOG(uiBattlezone2Password, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_PASSWORD); if (battlezone2_password) { battlezone2_password->set_save_party_key(data->link_party_key_); battlezone2_password->set_party_info(data); battlezone2_password->ShowInterface(TRUE); } } } else { //¼±ÅÃÇϽйæÀÌ ¾ø½À´Ï´Ù. /*TCHAR message[INTERFACE_STRING_LENGTH]; g_InterfaceManager.GetInterfaceString(eST_NO_SELECTED_ROOM, message, INTERFACE_STRING_LENGTH); uiSystemMan* system_manager = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_SYSTEM)); if (system_manager) { system_manager->Sys_VerifyLock(message); }*/ result = false; } } } break; } return result; } bool GetBattlezone2List() { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); return (battlezone2_list != NULL)?true:false; } bool SortMember(const PartyRoomInfo &a, const PartyRoomInfo &b) { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); if (battlezone2_list == NULL) { return false; } int first_remain_member = a.max_user_num_ - a.current_user_num_; int second_remain_member = b.max_user_num_ - b.current_user_num_; if (battlezone2_list->order_by()) { if (a.max_user_num_ == b.max_user_num_) { return (first_remain_member < second_remain_member); } return (a.max_user_num_ < b.max_user_num_); } else { if (a.max_user_num_ == b.max_user_num_) { return (first_remain_member > second_remain_member); } return (a.max_user_num_ > b.max_user_num_); } } bool SortNumber(const PartyRoomInfo &a, const PartyRoomInfo &b) { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); if (battlezone2_list == NULL) { return false; } if (battlezone2_list->order_by()) { return (a.room_key_ < b.room_key_); } else { return (a.room_key_ >= b.room_key_); } } bool SortState(const PartyRoomInfo &a, const PartyRoomInfo &b) { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); if (battlezone2_list == NULL) { return false; } if (a.is_mission_start_ == b.is_mission_start_)// °°À¸¸é ³²Àº Àοø¼ö { return SortMember(a, b); } if (battlezone2_list->order_by()) { return (a.is_mission_start_ < b.is_mission_start_); } else { return (a.is_mission_start_ >= b.is_mission_start_); } } bool SortType(const PartyRoomInfo &a, const PartyRoomInfo &b) { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); if (battlezone2_list == NULL) { return false; } if (a.base_party_room_info.party_room_type_ == b.base_party_room_info.party_room_type_)// °°À¸¸é ÁøÇà¿©ºÎ { return SortState(a, b); } if (battlezone2_list->order_by()) { return (a.base_party_room_info.party_room_type_ < b.base_party_room_info.party_room_type_); } else { return (a.base_party_room_info.party_room_type_ >= b.base_party_room_info.party_room_type_); } } bool SortTitle(const PartyRoomInfo &a, const PartyRoomInfo &b) { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); if (battlezone2_list == NULL) { return false; } if (strcmp(a.base_party_room_info.party_room_title_, b.base_party_room_info.party_room_title_) == 0)// °°À¸¸é ÁøÇà¿©ºÎ { return SortState(a, b); } if (battlezone2_list->order_by()) { return (strcmp(a.base_party_room_info.party_room_title_, b.base_party_room_info.party_room_title_) < 0); } else { return (strcmp(a.base_party_room_info.party_room_title_, b.base_party_room_info.party_room_title_) >= 0); } } bool SortMapName(const PartyRoomInfo &a, const PartyRoomInfo &b) { uiBattlezone2List* battlezone2_list = GET_CAST_DIALOG(uiBattlezone2List, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LIST); if (battlezone2_list == NULL) { return false; } TCHAR first_string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR second_string[INTERFACE_STRING_LENGTH] = {0,}; const sMAPINFO* first_mapInfo = MapInfoParser::Instance()->FindMapInfo(a.base_party_room_info.map_code_); if (first_mapInfo) { g_InterfaceManager.GetInterfaceString(first_mapInfo->dwNCode, first_string, INTERFACE_STRING_LENGTH); } else { //788 ¹Ì¼Ç ¾øÀ½ g_InterfaceManager.GetInterfaceString(788, first_string, INTERFACE_STRING_LENGTH); } const sMAPINFO* second_mapInfo = MapInfoParser::Instance()->FindMapInfo(b.base_party_room_info.map_code_); if (second_mapInfo) { g_InterfaceManager.GetInterfaceString(second_mapInfo->dwNCode, second_string, INTERFACE_STRING_LENGTH); } else { //788 ¹Ì¼Ç ¾øÀ½ g_InterfaceManager.GetInterfaceString(788, second_string, INTERFACE_STRING_LENGTH); } if (strcmp(first_string, second_string) == 0)// °°À¸¸é ³²Àº ÁøÇà¿©ºÎ { return SortState(a, b); } if (battlezone2_list->order_by()) { return (strcmp(first_string, second_string) < 0); } else { return (strcmp(first_string, second_string) >= 0); } } void uiBattlezone2List::SortList(int sort_by, bool order_by) { bool (*SortByFunction)(const PartyRoomInfo& a, const PartyRoomInfo& b); if(battlezone_list_.size() <= 1) { return; } last_sort_by_function_ = sort_by; order_by_ = order_by; switch (sort_by) { case kControl_Button_B012: SortByFunction = SortNumber; break; case kControl_Button_B003: SortByFunction = SortType; break; case kControl_Button_B011: SortByFunction = SortState; break; case kControl_Button_B013: SortByFunction = SortTitle; break; case kControl_Button_B014: SortByFunction = SortMember; break; case kControl_Button_B015: SortByFunction = SortMapName; break; default: SortByFunction = NULL; break; } if (SortByFunction != NULL) { std::sort(battlezone_list_.begin(), battlezone_list_.end(), SortByFunction); SetBattlezoneList(); } } //------------------------------------------------------------------------------ bool uiBattlezone2List::OnLButtonClick(SI_MESSAGE* message) { bool is_find_button = false; bool result = true; switch (GetControlPosition_byID(message->dwCtrlID)) { case kControl_Button_B004: // ´Ý±â { ShowInterface(FALSE); } break; case kControl_Button_B000://ÀÔÀ忹¾à { ShowBattlezoneTree(uiBattlezone2Tree::kReservationMode); } break; case kControl_Button_B010://¹æ¸¸µé±â { ShowBattlezoneTree(uiBattlezone2Tree::kCreateMode); } break; case kControl_Button_B001://¾Õ ÆäÀÌÁö { if (is_searched_ == false && current_page_ > 1) { --current_page_; RequestBattlezoneList(true); } } break; case kControl_Button_B002://µÚ ÆäÀÌÁö { if (is_searched_ == false && current_page_ < max_page_) { ++current_page_; RequestBattlezoneList(true); } } break; case kControl_Button_B005: { //°Ë»ö ¿É¼Ç ÆË¾÷ // 0636 ¾ÆÀ̵ð·Î ã±â // 0575 ¹øÈ£·Î ã±â } break; case kControl_VScroll_V000: { is_find_button = true; } break; case kControl_Button_B006: { if (dropdown_class_filter().CurrentUserData() == BATTLEZONE2_FIND_BY_MAP_NAME) { is_find_button = true; TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; if (edit_control_) { edit_control_->GetTextWZ(string, INTERFACE_STRING_LENGTH-1); } if (lstrcmp (string, _T(""))) { is_searched_ = true; SearchMap(string, true); } } else { OnSearch(); } } break; case kControl_Button_B007: { ToggleViewRoom(true); } break; case kControl_Button_B008://»õ·Î°íħ { is_searched_ = false; ShowWaitingButton(true); RequestBattlezoneList(); if (edit_control_ && static_edit_control_)//µå¶ø¹Ú½º°¡ º¯°æµÇ¸é °Ë»ö¾î ÃʱâÈ­ { edit_control_->SetTextWZ(""); static_edit_control_->SetTextWZ(""); } } break; case kControl_Button_B009: { ToggleViewRoom(false); } break; case kControl_Edit_E000://ÀÔ·Ââ { ShowEditControl(true); } break; case kControl_List_L000: { /*int a = 0; if (list_control_) { int index = list_control_->GetCurSel(); EnterRoom(index); }*/ } break; case kControl_List_L001: { } break; case kControl_Button_B012: case kControl_Button_B003: case kControl_Button_B011: case kControl_Button_B013: case kControl_Button_B014: case kControl_Button_B015: SortList(GetControlPosition_byID(message->dwCtrlID), !order_by()); break; case kControl_List_L002: { // °Ë»ö¾î Ãß°¡ÇØÁÖ±â if (find_list_ptr_ && edit_control_) { int select_index = find_list_ptr_->GetCurSel(); if (select_index >= 0) { BATTLEZONE_MAP_INFO select_map_name_info = searched_results_[select_index]; SendMapFind(&select_map_name_info); } } } break; default: { } break; } RECT static_edit_rect = static_edit_control_->GetSizeRect(); int mouse_x = Mouse::Instance()->GetMouseX(); int mouse_y = Mouse::Instance()->GetMouseY(); if (mouse_x > static_edit_rect.left && mouse_x < static_edit_rect.right && mouse_y > static_edit_rect.top && mouse_y < static_edit_rect.bottom) { ShowEditControl(true);//kControl_Text_T201:// ÀÔ·Ââ¿¡ ÀÖ´Â static â } else { ShowEditControl(false); } if (is_find_button == false) { ShowFindWords(false); } return result; } void uiBattlezone2List::SendMapFind(BATTLEZONE_MAP_INFO* select_map_name_info) { TCHAR select_map_name[INTERFACE_STRING_LENGTH] = {0,}; DWORD map_code = select_map_name_info->map_code; const sMAPINFO* map_info= MapInfoParser::Instance()->FindMapInfo((MAPCODE)map_code); if (map_info) { if (select_map_name_info->type == PartyOfTopOfTrialByCash #ifdef _NA_007156_20140703_TOP_OF_TRIAL_LIGHT || (select_map_name_info->type == PartyOfTopOfTrialLight_cash) #endif //_NA_007156_20140703_TOP_OF_TRIAL_LIGHT ) { TCHAR temp_string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; g_InterfaceManager.GetInterfaceString(map_info->dwNCode, temp_string); // 2443 (¹Ù·ÎÀÔÀå) g_InterfaceManager.GetInterfaceString(2443, string); sprintf(select_map_name, "%s%s", temp_string, string); } else { g_InterfaceManager.GetInterfaceString(map_info->dwNCode, select_map_name); } GlobalFunc::SetText(edit_control_, select_map_name); edit_control_->SetTextWZ(select_map_name); } //ÆÐŶ MSG_CG_PARTY_FIND_ROOM_BY_MISSION_NAME_SYN send_packet; send_packet.request_map_code_ = static_cast(map_code); send_packet.party_room_type_ = static_cast(select_map_name_info->type); GlobalFunc::SendPacket(CI_GAMESERVERIDX, &send_packet, sizeof(send_packet)); ShowAnimation(true); ShowFindWords(false); } void uiBattlezone2List::ShowWaitingButton(bool is_show) { CCtrlButtonWZ* button = NULL; button = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B009))); if (button) { button->ShowWindowWZ(is_show?WZ_SHOW:WZ_HIDE); } button = static_cast(GetControlWZ(GetControlID_byPosition(kControl_Button_B007))); if (button) { button->ShowWindowWZ(is_show?WZ_HIDE:WZ_SHOW); } } void uiBattlezone2List::ToggleViewRoom(bool is_show) { ShowWaitingButton(is_show); if (is_show) { //if (is_fast == false)//±ä±Þ µ¥ÀÌÅͰ¡ ¾Æ´Ï¶ó¸é { if (list_refresh_timer_.SpentTime() < 1200)// 1.2ÃÊ À̳»¿¡ Àç¿äû ºÒ°¡ { ShowAnimation(true); return; } } is_searched_ = false; RequestBattlezoneList(); } else { ShowAnimation(true); is_searched_ = true; MSG_CG_PARTY_FIND_WAITING_ROOM_SYN send_packet; GlobalFunc::SendPacket(CI_GAMESERVERIDX, &send_packet, sizeof(send_packet)); } if (edit_control_ && static_edit_control_)//µå¶ø¹Ú½º°¡ º¯°æµÇ¸é °Ë»ö¾î ÃʱâÈ­ { edit_control_->SetTextWZ(""); static_edit_control_->SetTextWZ(""); } } void uiBattlezone2List::RequestBattlezoneList(bool is_fast /* = false */) { if (is_fast == false)//±ä±Þ µ¥ÀÌÅͰ¡ ¾Æ´Ï¶ó¸é { if (list_refresh_timer_.SpentTime() < 1200)// 1.2ÃÊ À̳»¿¡ Àç¿äû ºÒ°¡ { ShowAnimation(true); return; } } if (vscroll_control()) { last_scroll_position_ = vscroll_control()->GetScrollPosWZ(); } ShowAnimation(true); #ifdef _DH_BATTLEZONE2_LIST_PAGE MSG_CG_PARTY_ROOM_LIST_SYN send_packet; send_packet.request_page_ = current_page_; GlobalFunc::SendPacket(CI_GAMESERVERIDX, &send_packet, sizeof(send_packet)); #else MSG_CG_PARTY_BATTLE_ZONE_INFO_SYN send_packet; GlobalFunc::SendPacket(CI_GAMESERVERIDX, &send_packet, sizeof(send_packet)); #endif//_DH_BATTLEZONE2_LIST_PAGE list_refresh_timer_.Off(); list_refresh_timer_.On(c_iCYCLE_REFRESH_ROOM_LIST); } void uiBattlezone2List::ShowBattlezoneLobby() { uiBattlezone2Lobby* battlezone_lobby_dialog = GET_CAST_DIALOG(uiBattlezone2Lobby, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LOBBY); if (battlezone_lobby_dialog == NULL) { return; } UserSlot EnterUser; EnterUser.SetPlayerKey(g_pHero->GetObjectKey()); if (ui_battlezone2_manager_) { ui_battlezone2_manager_->set_battlezone_room_state(uiBattlezone2Man::ROOM_STATE_LOBBY); } ShowInterface(FALSE); battlezone_lobby_dialog->ShowInterfaceWithSound(TRUE); } void uiBattlezone2List::SearchResult(DWORD result_code, PartyRoomInfo* party_room_info) { switch (result_code) { case RC::RC_PARTY_SUCCESS: { battlezone_list_.clear(); battlezone_list_.push_back(*party_room_info); SetBattlezoneList(); if (vscroll_control()) { #ifdef _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG int mmin = 0, mmax = 0; vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if (last_scroll_position_ <= mmax && last_scroll_position_ >= mmin) { vscroll_control()->SetScrollPosWZ(last_scroll_position_); } else { last_scroll_position_ = 0; vscroll_control()->SetScrollPosWZ(last_scroll_position_); } GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); #else vscroll_control()->SetScrollPosWZ(last_scroll_position_); #endif // _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG } is_searched_ = true; } break; case RC::RC_PARTY_NOT_FOUND_USER: { battlezone_list_.clear(); SetBattlezoneList(); if (vscroll_control()) { #ifdef _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG int mmin = 0, mmax = 0; vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if (last_scroll_position_ <= mmax && last_scroll_position_ >= mmin) { vscroll_control()->SetScrollPosWZ(last_scroll_position_); } else { last_scroll_position_ = 0; vscroll_control()->SetScrollPosWZ(last_scroll_position_); } GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); #else vscroll_control()->SetScrollPosWZ(last_scroll_position_); #endif // _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG } is_searched_ = true; } break; default: { is_searched_ = false; } } } void uiBattlezone2List::RecvBattlezoneMapNameList(MSG_BASE* message_ptr) { ShowAnimation(false); //¹èƲÁ¸ ¸®½ºÆ® MSG_CG_PARTY_FIND_ROOM_BY_MISSION_NAME_ACK* recv_packet = (MSG_CG_PARTY_FIND_ROOM_BY_MISSION_NAME_ACK*)message_ptr; #ifdef _DEV_VER GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CHAT, _T("MSG_CG_PARTY_FIND_ROOM_BY_MISSION_NAME_ACK:%d°³"), recv_packet->number_of_list_); #endif battlezone_list_.clear(); for (int i = 0; i < recv_packet->number_of_list_; ++i) { battlezone_list_.push_back(recv_packet->party_room_info_[i]); } SetPage(1,1);//current_page_, recv_packet->all_page_num_); //Á¤·Ä SortList(last_sort_by_function_, order_by()); SetBattlezoneList(); if (vscroll_control()) { #ifdef _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG int mmin = 0, mmax = 0; vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if (last_scroll_position_ <= mmax && last_scroll_position_ >= mmin) { vscroll_control()->SetScrollPosWZ(last_scroll_position_); } else { last_scroll_position_ = 0; vscroll_control()->SetScrollPosWZ(last_scroll_position_); } GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); #else vscroll_control()->SetScrollPosWZ(last_scroll_position_); #endif // _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG } } void uiBattlezone2List::RecvBattlezoneWatingList(MSG_BASE* message_ptr) { ShowAnimation(false); //¹èƲÁ¸ ¸®½ºÆ® MSG_CG_PARTY_FIND_WAITING_ROOM_ACK* recv_packet = (MSG_CG_PARTY_FIND_WAITING_ROOM_ACK*)message_ptr; #ifdef _DEV_VER GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CHAT, _T("MSG_CG_PARTY_FIND_WAITING_ROOM_ACK:%d°³"), recv_packet->number_of_list_); #endif battlezone_list_.clear(); #ifdef _NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION #else //if (is_ssq_open_)//Ÿ¶ôÇÑ »ç¿ø ÀÔ·Â //{ TCHAR message[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; PartyRoomInfo ssq_room_info; ssq_room_info.current_user_num_ = 0; ssq_room_info.is_mission_start_ = false; ssq_room_info.link_party_key_ = 0xFFFF; ssq_room_info.max_user_num_ = 15; ssq_room_info.room_key_ = BASE_ROOM_KEY; ssq_room_info.base_party_room_info.map_code_ = 12001;//Ÿ¶ôÇÑ »ç¿ø ¸ÊÄÚµå sprintf(ssq_room_info.base_party_room_info.party_room_password_, ""); g_InterfaceManager.GetInterfaceString(55015,string);//Ÿ¶ôÇÑ »ç¿ø g_SsqScene.Func_Output_with_internal_timer(message, true); Snprintf(ssq_room_info.base_party_room_info.party_room_title_,MAX_ROOMTITLE_LENGTH, "%s %s", string, message); ssq_room_info.base_party_room_info.party_room_type_ = PartyOfNone; ssq_room_info.base_party_room_info.special_type_ = eROOM_SPECIAL_NORMAL; battlezone_list_.push_back(ssq_room_info); //} #endif //_NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION for (int i = 0; i < recv_packet->number_of_list_; ++i) { //for (int j = 0; j < 30; ++j)//¸®½ºÆ® °¹¼ö Áõ°¡ test¿ë ÄÚµå { battlezone_list_.push_back(recv_packet->party_room_info_[i]); } } //current_page_ = current_page_; //max_page_ = recv_packet->all_page_num_; SetPage(1,1);//current_page_, recv_packet->all_page_num_); //Á¤·Ä SortList(last_sort_by_function_, order_by()); //if (is_searched_ == false) { SetBattlezoneList(); if (vscroll_control()) { #ifdef _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG int mmin = 0, mmax = 0; vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if (last_scroll_position_ <= mmax && last_scroll_position_ >= mmin) { vscroll_control()->SetScrollPosWZ(last_scroll_position_); } else { last_scroll_position_ = 0; vscroll_control()->SetScrollPosWZ(last_scroll_position_); } GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); #else vscroll_control()->SetScrollPosWZ(last_scroll_position_); #endif // _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG } } } void uiBattlezone2List::RecvBattlezoneList(MSG_BASE* message_ptr) { ShowAnimation(false); //¹èƲÁ¸ ¸®½ºÆ® #ifdef _DH_BATTLEZONE2_LIST_PAGE MSG_CG_PARTY_ROOM_LIST_ACK* recv_packet = (MSG_CG_PARTY_ROOM_LIST_ACK*)message_ptr; #else MSG_CG_PARTY_BATTLE_ZONE_INFO_ACK* recv_packet = (MSG_CG_PARTY_BATTLE_ZONE_INFO_ACK*)message_ptr; #endif//_DH_BATTLEZONE2_LIST_PAGE #ifdef _DEV_VER GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CHAT, _T("CG_PARTY_ROOM_LIST_ACK or CG_PARTY_BATTLE_ZONE_INFO_ACK:%d°³"), recv_packet->number_of_list_); #endif battlezone_list_.clear(); #ifdef _NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION #else //if (is_ssq_open_)//Ÿ¶ôÇÑ »ç¿ø ÀÔ·Â //{ TCHAR message[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; PartyRoomInfo ssq_room_info; ssq_room_info.current_user_num_ = 0; ssq_room_info.is_mission_start_ = false; ssq_room_info.link_party_key_ = 0xFF; ssq_room_info.max_user_num_ = 15; ssq_room_info.room_key_ = BASE_ROOM_KEY; ssq_room_info.base_party_room_info.map_code_ = 12001;//Ÿ¶ôÇÑ »ç¿ø ¸ÊÄÚµå sprintf(ssq_room_info.base_party_room_info.party_room_password_, ""); g_InterfaceManager.GetInterfaceString(55015,string); g_SsqScene.Func_Output_with_internal_timer(message, true); Snprintf(ssq_room_info.base_party_room_info.party_room_title_,MAX_ROOMTITLE_LENGTH, "%s %s", string, message); ssq_room_info.base_party_room_info.party_room_type_ = PartyOfNone; ssq_room_info.base_party_room_info.special_type_ = eROOM_SPECIAL_NORMAL; battlezone_list_.push_back(ssq_room_info); //} #endif //_NA_000000_20120914_CHAOS_ZONE_BATTLE_GROUND_ACTIVATION for (int i = 0; i < recv_packet->number_of_list_; ++i) { //for (int j = 0; j < 15; ++j) { battlezone_list_.push_back(recv_packet->party_room_info_[i]); } } //current_page_ = current_page_; max_page_ = recv_packet->all_page_num_; SetPage(current_page_, recv_packet->all_page_num_); //Á¤·Ä SortList(last_sort_by_function_, order_by()); if (is_searched_ == false) { SetBattlezoneList(); if (vscroll_control()) { #ifdef _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG int mmin = 0, mmax = 0; vscroll_control()->GetScrollRangeWZ(&mmin, &mmax); if (last_scroll_position_ <= mmax && last_scroll_position_ >= mmin) { vscroll_control()->SetScrollPosWZ(last_scroll_position_); } else { last_scroll_position_ = 0; vscroll_control()->SetScrollPosWZ(last_scroll_position_); } GetListControlWZ(GetControlID_byPosition(kControl_List_L000))->SetBeginDrawIndex(vscroll_control()->GetScrollPosWZ()); #else vscroll_control()->SetScrollPosWZ(last_scroll_position_); #endif // _NA_008502_20150922_BATTLEZONE_LOCK_ICON_BUG } } } void uiBattlezone2List::SetPage(int current_page, int max_page)//ui¿¡ °»½Å { if (max_page <= 0) { max_page = 1; } TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; sprintf(string, _T("%d/%d"), current_page, max_page); if (static_page_control_) { static_page_control_->SetTextWZ(string); } } void uiBattlezone2List::NetworkProc(MSG_BASE* message_ptr) { //¹èƲÁ¸ ÆÐŶ¸¸ ó¸®ÇÑ´Ù if (message_ptr->m_byCategory != CG_PARTY) { return; } switch (message_ptr->m_byProtocol) { case CG_PARTY_INVITE_PARTY_ROOM_REQ: { TCHAR format_string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR master_name[INTERFACE_STRING_LENGTH] = {0,}; uiSystemMan* system_manager = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_SYSTEM)); uiPartyMan* party_manager = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_PARTY)); MSG_CG_PARTY_INVITE_PARTY_ROOM_REQ* recv_packet = (MSG_CG_PARTY_INVITE_PARTY_ROOM_REQ*)message_ptr; if(system_manager && party_manager) { DWORD master_key = party_manager->GetMasterKey(); uicPartyMemberInfoPlus* member_info = party_manager->GetPartyMemberInfo(party_manager->GetMasterKey()); if (member_info) { sprintf(master_name, member_info->Get().m_szCharName); } // 2483 %s´ÔÀÌ ¹èƲÁ¸¿¡ ¹æÀ» »ý¼ºÇϼ̽À´Ï´Ù. µû¶ó °¡½Ã°Ú½À´Ï±î? g_InterfaceManager.GetInterfaceString(2483, string, INTERFACE_STRING_LENGTH); Snprintf(format_string, INTERFACE_STRING_LENGTH, string, master_name); follow_party_key_ = recv_packet->invite_party_key_; system_manager->Sys_Confirm(format_string, GlobalFunc::PartyContinueConfirm, NULL, NULL, 100/*È®ÀÎ*/, 101/*Ãë¼Ò*/); } } break; case CG_PARTY_FIND_ROOM_BY_MISSION_NAME_ACK: { RecvBattlezoneMapNameList(message_ptr); ShowWaitingButton(true); ShowEditControl(false); } break; case CG_PARTY_FIND_ROOM_BY_CHARID_ACK: { MSG_CG_PARTY_FIND_ROOM_BY_CHARID_ACK* recv_packet = (MSG_CG_PARTY_FIND_ROOM_BY_CHARID_ACK*)message_ptr; SearchResult(recv_packet->result_code_, &recv_packet->party_room_info_); ShowWaitingButton(true); ShowEditControl(false); } break; case CG_PARTY_FIND_ROOM_BY_ROOMNUMBER_ACK: { MSG_CG_PARTY_FIND_ROOM_BY_ROOMNUMBER_ACK* recv_packet = (MSG_CG_PARTY_FIND_ROOM_BY_ROOMNUMBER_ACK*)message_ptr; SearchResult(recv_packet->result_code_, &recv_packet->party_room_info_); ShowWaitingButton(true); ShowEditControl(false); } break; case CG_PARTY_FIND_WAITING_ROOM_ACK: { RecvBattlezoneWatingList(message_ptr); } break; case CG_PARTY_ROOM_LIST_ACK: { RecvBattlezoneList(message_ptr);//ÆäÀÌÁö ¿äû½Ã´Â ¿©±â¼­ ¸®½ºÆ®¸¦ ó¸® } break; case CG_PARTY_BATTLE_ZONE_INFO_ACK: { #ifdef _DH_BATTLEZONE2_LIST_PAGE //ÆäÀÌÁö ¿äû½Ã Àüü ÆäÀÌÁö ó¸® ¹× ÃßÈÄ ÇÊ¿äÇÑ ¸®½ºÆ® Á¤º¸Ã³¸® MSG_CG_PARTY_BATTLE_ZONE_INFO_ACK* recv_packet = (MSG_CG_PARTY_BATTLE_ZONE_INFO_ACK*)message_ptr; max_page_ = recv_packet->all_page_num_; SetPage(current_page_, max_page_); #else RecvBattlezoneList(message_ptr); //ÆäÀÌÁö ¿äûÀÌ ¾Æ´Ñ °æ¿ì ¿©±â¼­ ¸®½ºÆ®¸¦ ó¸® #endif//_DH_BATTLEZONE2_LIST_PAGE } break; case CG_PARTY_JOIN_ROOM_ACK: { MSG_CG_PARTY_JOIN_ROOM_ACK* recv_packet = (MSG_CG_PARTY_JOIN_ROOM_ACK*)message_ptr; if (recv_packet->result_code_ != RC::RC_PARTY_SUCCESS) { uiPartyMan* party_manager = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_PARTY)); if (party_manager) { party_manager->Reason(recv_packet->result_code_); } #ifdef _DEV_VER GlobalFunc::OutputMsg_Notice(eOUTPUT_MSG_CHAT, _T("CG_PARTY_JOIN_ROOM_ACK: result_code = %d"), recv_packet->result_code_); #endif return; } if (!g_pHero) return; #ifdef _DH_BATTLEZONE2_LOBBY_SLOT uiPartyMan* partyMan = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_PARTY)); DWORD master_key = partyMan->GetMasterKey(); if (ui_battlezone2_manager_ && partyMan) { ui_battlezone2_manager_->SetLobbyMasterPlayerKey(partyMan->GetMasterKey()); } else { assert(!"uiBattlezone2List::NetworkProc(CG_PARTY_JOIN_ROOM_ACK): Can't not find master key"); return; } UserSlot EnterUser; EnterUser.SetPlayerKey(g_pHero->GetObjectKey()); #ifdef _NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS EnterUser.SetPlayerName(g_pHero->GetName()); #endif //_NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS ui_battlezone2_manager_->AddPlayer(EnterUser); UserSlot* user_slot = ui_battlezone2_manager_->FindPlayer(EnterUser.GetPlayerKey()); if (user_slot != NULL) { if( user_slot->GetBattleZonePlayerKey() == 0 ) { DWORD battlezone_object_key = g_ObjectManager.GenerateKeyByBattleZonePlayer(PLAYER_OBJECT); Player* player = GameFunc::MakePlayer(battlezone_object_key, g_pHero, true); if (player != NULL) { user_slot->SetBattleZonePlayerKey(battlezone_object_key); } } } // ³ª¸¦ Á¦¿ÜÇÑ ³ª¸ÓÁö Ç÷¹À̾î if (ui_battlezone2_manager_ && partyMan) { for (int i = 0; i < partyMan->GetPartyNum(); ++i) { const uicPartyMemberInfoPlus member_info = partyMan->GetParty(i); const _PARTY_MEMBER_INFO party_member_info = member_info.Get(); DWORD member_key = party_member_info.m_dwMemberKey; if (member_key != 0 && member_key != g_pHero->GetObjectKey()) { UserSlot EnterUser; EnterUser.SetPlayerKey(member_key); #ifdef _NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS EnterUser.SetPlayerName(party_member_info.m_szCharName); #endif //_NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS ui_battlezone2_manager_->AddPlayer(EnterUser); } } } #else uiPartyMan* partyMan = static_cast(g_InterfaceManager.GetUserInterfaceManager(UIMAN_PARTY)); DWORD master_key = partyMan->GetMasterKey(); if (ui_battlezone2_manager_ && partyMan) { ui_battlezone2_manager_->SetLobbyMasterPlayerKey(partyMan->GetMasterKey()); UserSlot EnterUser; EnterUser.SetPlayerKey(partyMan->GetMasterKey()); #ifdef _NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS EnterUser.SetPlayerName(partyMan->GetPartyLeader()->Get().m_szCharName); #endif //_NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS ui_battlezone2_manager_->AddPlayer(EnterUser); } else { assert(!"uiBattlezone2List::NetworkProc(CG_PARTY_JOIN_ROOM_ACK): Can't not find master key"); return; } UserSlot EnterUser; EnterUser.SetPlayerKey(g_pHero->GetObjectKey()); #ifdef _NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS EnterUser.SetPlayerName(g_pHero->GetName()); #endif //_NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS ui_battlezone2_manager_->AddPlayer(EnterUser); UserSlot* user_slot = ui_battlezone2_manager_->FindPlayer(EnterUser.GetPlayerKey()); if (user_slot != NULL) { if( user_slot->GetBattleZonePlayerKey() == 0 ) { DWORD battlezone_object_key = g_ObjectManager.GenerateKeyByBattleZonePlayer(PLAYER_OBJECT); Player* player = GameFunc::MakePlayer(battlezone_object_key, g_pHero, true); if (player != NULL) { user_slot->SetBattleZonePlayerKey(battlezone_object_key); } } } // ÆÄƼÀå, ³ª¸¦ Á¦¿ÜÇÑ ³ª¸ÓÁö Ç÷¹À̾î if (ui_battlezone2_manager_ && partyMan) { for (int i = 0; i < partyMan->GetPartyNum(); ++i) { const uicPartyMemberInfoPlus member_info = partyMan->GetParty(i); const _PARTY_MEMBER_INFO party_member_info = member_info.Get(); DWORD member_key = party_member_info.m_dwMemberKey; if (member_key != 0 && member_key != g_pHero->GetObjectKey() && member_key != master_key) { UserSlot EnterUser; EnterUser.SetPlayerKey(member_key); #ifdef _NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS EnterUser.SetPlayerName(party_member_info.m_szCharName); #endif //_NA_20111220_CHANGE_DISCONNECTED_USER_PROCESS ui_battlezone2_manager_->AddPlayer(EnterUser); } } } #endif//_DH_BATTLEZONE2_LOBBY_SLOT ShowBattlezoneLobby(); uiBattlezone2Lobby* battlezone_lobby_dialog = GET_CAST_DIALOG(uiBattlezone2Lobby, IM_BATTLEZONE2_MANAGER::BATTLEZONE2_LOBBY); if (battlezone_lobby_dialog == NULL) { assert(!"uiBattlezone2List::NetworkProc(CG_PARTY_JOIN_ROOM_ACK): Can't not find lobby dialog"); return; } else { ui_battlezone2_manager_->set_current_room_info(&recv_packet->party_room_info_); battlezone_lobby_dialog->SetBaseInfo(ui_battlezone2_manager_->current_room_info()); } ChatDialog* chat_dialog = GET_CAST_DIALOG(ChatDialog, IM_CHAT_MANAGER::CHAT_DIALOG); if (chat_dialog) { chat_dialog->OnPartyChat(); } } } } void uiBattlezone2List::SetIsSSQOpen(bool val) { is_ssq_open_ = val; RequestBattlezoneList(true);//¸®½ºÆ® Àç¿äû } void uiBattlezone2List::RenderIcon() { g_pSunRenderer->Set2DMode(TRUE); std::vector::iterator begin = battlezone_list_.begin(); std::vector::iterator end = battlezone_list_.end(); int list_count = -1; const int c_zoneListHeight = 20; const int c_zoneIconHeight = 16; const int c_zoneIconGap_height = 2; const int c_zoneIconGap = 2; // ½´ÆÛ¹æÀå ¾ÆÀÌÄܰú ¸ðµÎȹµæ ¾ÆÀÌÄÜ »çÀÌ °£°Ý for (; begin != end; ++begin) { PartyRoomInfo data = (*begin); list_count += 1; if (is_searched_ && search_count_ < list_count) { break; } int scroll_pos = 0; if (vscroll_control() && (scroll_pos = vscroll_control()->GetScrollPosWZ()) > list_count) { continue; } if ((scroll_pos + c_zoneListCount) < list_count)//20°³ ±îÁö¸¸ Ãâ·Â { break; } RECT rect = list_control_->GetSizeRect(); rect.left += (kListWidth[0] + kListWidth[1] + kListWidth[2]); // Á¦¸ñÀ§Ä¡¿¡ º¸³»±â rect.top += ((list_count - scroll_pos) * c_zoneListHeight) + c_zoneIconGap_height; rect.right = rect.left + c_zoneIconHeight; rect.bottom = rect.top + c_zoneIconHeight; // ½´ÆÛ¹æÀåÀ̳ª ¶ô ¾ÆÀÌÄÜ ±×¸®±â if (strlen(data.base_party_room_info.party_room_password_)) { g_InterfaceManager.RenderBattleRoomIcon( InterfaceManager::eBATTLE_ICON_LOCKED_ROOM, &rect); rect.left += c_zoneIconHeight + c_zoneIconGap; rect.right = rect.left + c_zoneIconHeight; } else if (data.base_party_room_info.special_type_ == eROOM_SPECIAL_PCBANG_SUPER_ROOM) { g_InterfaceManager.RenderBattleRoomIcon( InterfaceManager::eBATTLE_ICON_PCBANG_SUPERMASTER_ROOM, &rect); rect.left += c_zoneIconHeight + c_zoneIconGap; rect.right = rect.left + c_zoneIconHeight; } else if (data.base_party_room_info.special_type_ == eROOM_SPECIAL_ITEM1_SUPER_ROOM) { g_InterfaceManager.RenderBattleRoomIcon( InterfaceManager::eBATTLE_ICON_ITEM_SUPERMASTER_ROOM, &rect); rect.left += c_zoneIconHeight + c_zoneIconGap; rect.right = rect.left + c_zoneIconHeight; } #ifdef _NA_004204_20120131_BATTLE_ZONE_PARTY_OBTAIN // ¸ðµÎºÐ¹è ¾ÆÀÌÄÜ ±×¸®±â MAPCODE map_code = data.base_party_room_info.map_code_; if ((map_code != 0) && (BattlezoneMissionTreeParser::Instance()->GetObtainType( map_code,data.base_party_room_info.party_room_type_) == kObtainType_Enable)) { g_InterfaceManager.RenderBattleRoomIcon( InterfaceManager::eBATTLE_ICON_PARTY_OBTAIN_ROOM, &rect); } #endif //_NA_004204_20120131_BATTLE_ZONE_PARTY_OBTAIN //#ifdef __NA_000000_20070528_TAIWAN_GUILD_PVP // RECT rect_guild_pvp = rt; //#ifndef __CHINA_PCBANG_SUPER_ROOM_BLOCK // if( battlezone_list_[i]->IsSpecialType(eROOM_SPECIAL_PCBANG) ) // { // g_InterfaceManager.RenderBattleRoomIcon( // InterfaceManager::eBATTLE_ICON_PCBANG_SUPERMASTER_ROOM, // &rt); // rect_guild_pvp.left += 20; // rect_guild_pvp.right += 20; // } // else //#endif // if ( pBaseRoomInfo->IsSpecialType(eROOM_SPECIAL_ITEM) ) // { // g_InterfaceManager.RenderBattleRoomIcon( // InterfaceManager::eBATTLE_ICON_ITEM_SUPERMASTER_ROOM, // &rt); // rect_guild_pvp.left += 20; // rect_guild_pvp.right += 20; // } // // if( pBaseRoomInfo->IsSpecialType(eROOM_SPECIAL_GUILD_PVP) ) // { // g_InterfaceManager.RenderBattleRoomIcon( // InterfaceManager::eBATTLE_ICON_GUILD_PVP_ROOM, // &rect_guild_pvp); // } //#else // switch ( pBaseRoomInfo->m_SpecialType ) // { //#ifndef __CHINA_PCBANG_SUPER_ROOM_BLOCK // case eROOM_SPECIAL_PCBANG_SUPER_ROOM: // { // g_InterfaceManager.RenderBattleRoomIcon( // InterfaceManager::eBATTLE_ICON_PCBANG_SUPERMASTER_ROOM, // &rt); // } // break; //#endif // case eROOM_SPECIAL_ITEM1_SUPER_ROOM: // { // g_InterfaceManager.RenderBattleRoomIcon( // InterfaceManager::eBATTLE_ICON_ITEM_SUPERMASTER_ROOM, // &rt); // } // break; // } //#endif } } void uiBattlezone2List::SearchMap(TCHAR* search_map, bool is_button /* = false */) { static TCHAR last_string[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string_buffer[INTERFACE_STRING_LENGTH] = {0,}; if (edit_control_) { edit_control_->GetTextWZ(string_buffer, INTERFACE_STRING_LENGTH-1); g_InterfaceManager.Trim(string_buffer); if (dropdown_class_filter().CurrentUserData() == BATTLEZONE2_FIND_BY_MAP_NAME && (is_button == true || edit_control_->GetState() == WZ_SHOW) && strlen(string_buffer) > 0) { ShowFindWords(true); //if (strcmp(last_string, string_buffer) != 0) { sprintf(last_string, string_buffer); FillFindListData(string_buffer); } } else { ShowFindWords(false); } } } void uiBattlezone2List::SearchID(TCHAR* search_id) { MSG_CG_PARTY_FIND_ROOM_BY_CHARID_SYN sync; StrnCopy(sync.find_char_name_, search_id, MAX_CHARNAME_LENGTH); GlobalFunc::SendPacketToGameServer(&sync, sizeof(sync)); } void uiBattlezone2List::SearchNo(WORD number) { #if 0 // Ŭ¶ó ÀÚü °Ë»ö(¾È¾¸) std::list::iterator begin = battlezone_list_.begin(); std::list::iterator end = battlezone_list_.end(); int index = 0; list_control_->SetBeginDrawIndex(0); for (; begin != end; ++begin) { PartyRoomInfo data = (*begin); if (data.room_key_ == (number + BASE_ROOM_KEY)) { battlezone_list_.clear(); battlezone_list_.push_back(data); is_searched_ = true; SetBattlezoneList(); return; } } if (begin == end) { battlezone_list_.clear();//¸øÃ£À¸¸é Ŭ¸®¾î //is_searched_ = false; SetBattlezoneList(); } #else // ¹æ ¹øÈ£·Î ã±â MSG_CG_PARTY_FIND_ROOM_BY_ROOMNUMBER_SYN sync; sync.find_room_key_ = (number + BASE_ROOM_KEY); GlobalFunc::SendPacketToGameServer(&sync, sizeof(sync)); #endif// } DWORD uiBattlezone2List::LoadMapNameCode() { TCHAR map_name[INTERFACE_STRING_LENGTH] = {0,}; TCHAR string[INTERFACE_STRING_LENGTH] = {0,}; static bool once_make_list = false; BYTE* menu_depth_count = BattlezoneMissionTreeParser::Instance()->max_menu_depth(); const BattlezoneMissionTreeInfo* find_info; //Æ®¸® ¸®½ºÆ® »ý¼ºÇϱâ if (once_make_list == false) { once_make_list = true; for (BYTE LGroupCount = 1; LGroupCount <= menu_depth_count[0]; ++LGroupCount) { BATTLEZONE_MAP_INFO data; if (LGroupCount == 1)//1, 0, 0 ¹Ì¼Ç¾øÀ½ 1ȸ ¿¹¿Üó¸® { find_info = BattlezoneMissionTreeParser::Instance()->GetTreeMenu(LGroupCount, 0, 0); if (find_info) { const sMAPINFO* map_info= MapInfoParser::Instance()->FindMapInfo((MAPCODE)find_info->map_code); if (map_info != NULL) { g_InterfaceManager.GetInterfaceString(map_info->dwNCode, map_name); } g_InterfaceManager.Trim(map_name); data.map_code = static_cast(find_info->map_code); data.type = find_info->kind_of_room; sprintf(data.map_name, map_name); map_infomations_.push_back(data); } } for (BYTE SGroupCount = 1; SGroupCount <= menu_depth_count[1]; ++SGroupCount) { for (BYTE OrderCount = 1; OrderCount <= menu_depth_count[2]; ++OrderCount) { find_info = BattlezoneMissionTreeParser::Instance()->GetTreeMenu(LGroupCount, SGroupCount, OrderCount); if (find_info != NULL) { const sMAPINFO* map_info= MapInfoParser::Instance()->FindMapInfo((MAPCODE)find_info->map_code); if (map_info != NULL) { g_InterfaceManager.GetInterfaceString(map_info->dwNCode, map_name); } g_InterfaceManager.Trim(map_name); data.map_code = static_cast(find_info->map_code); data.type = find_info->kind_of_room; if (find_info->kind_of_room == PartyOfTopOfTrialByCash #ifdef _NA_007156_20140703_TOP_OF_TRIAL_LIGHT || (find_info->kind_of_room == PartyOfTopOfTrialLight_cash) #endif //_NA_007156_20140703_TOP_OF_TRIAL_LIGHT ) { // 2443 (¹Ù·ÎÀÔÀå) g_InterfaceManager.GetInterfaceString(2443, string); sprintf(data.map_name, "%s%s", map_name, string); } else { sprintf(data.map_name, map_name); } map_infomations_.push_back(data); } else { break; } } } } } return 0; } void uiBattlezone2List::InsertFindList(const char* item_name) { if (find_list_ptr_ == NULL) { return; } int index = find_list_ptr_->InsertItemBack(); #ifdef _INTERNATIONAL_UI DWORD dwListFont = StrToWzID("st10"); #else DWORD dwListFont = StrToWzID("mn12"); #endif//_INTERNATIONAL_UI TCHAR szTitle[MAX_VENDOR_TITLE_LENGTH+1] = {0,}; Snprintf(szTitle , MAX_VENDOR_TITLE_LENGTH , item_name); GlobalFunc::SetItem(find_list_ptr_ , index , 1, szTitle ,dwListFont ,DT_VCENTER| DT_CENTER , RGBA(0,0,0,0), RGBA(180,180,180,255), RGBA(100,100,180,255)); } void uiBattlezone2List::FillFindListData(TCHAR* map_name) { unsigned int search_count = 0; BATTLEZONE_MAP_INFO search_buffer; BATTLEZONE_MAP_INFO first_search_buffer; std::vector::iterator battlezone_find_iterator; g_InterfaceManager.Trim(map_name); int search_index_ = 0; //if (search_new_) // °Ë»öÀÌ Ã³À½À̶ó¸é { // »õ·Î °Ë»ö find_list_ptr_->DeleteItemAll(); // ±âÁ¸¿¡ ¸®½ºÆ® ¸ðµÎ Áö¿ö¹ö¸°´Ù. battlezone_find_iterator = map_infomations_.begin(); /*search_index_ = 0; search_new_ = false;*/ //ShowFindWords(true); searched_results_.clear(); } while (battlezone_find_iterator != map_infomations_.end()) { search_buffer.map_code = battlezone_find_iterator->map_code; sprintf(search_buffer.map_name, battlezone_find_iterator->map_name); search_buffer.type = battlezone_find_iterator->type; // °Ë»ö ¾Ë°í¸®Áò Àû¿ë if (strstr(search_buffer.map_name, map_name) != NULL) { if (search_index_ == 0) { first_search_buffer = search_buffer; } searched_results_.push_back(search_buffer); InsertFindList(search_buffer.map_name); find_list_ptr_->SetItemData(search_index_, &(searched_results_[search_index_])); ++search_index_; } // °Ë»ö ¾Ë°í¸®Áò Á¾·á //++search_count; ++battlezone_find_iterator; /*if (search_count >= number_of_searching_per_a_frame_) { break; }*/ } const int find_size = 6; int list_size = search_index_ - find_size; if (find_vscroll_control()) { find_vscroll_control()->SetScrollRangeWZ(0, (list_size>0)?list_size:0); find_vscroll_control()->SetScrollPosWZ(0); } if (search_index_ == 1) { ShowFindWords(false); SendMapFind(&first_search_buffer); } /*if (item_name_info_iterator_ == item_name_info_iterator_end_) { set_search_end(true); search_new_ = true; //°Ë»ö ½ÃÀÛ ÃʱâÈ­ if (search_index_ > 0 && find_list_ptr_ && m_pEdit) { _ITEM_NAME_INFO select_item_name_info = searched_results_[0]; TCHAR select_item_name[MAX_VENDOR_SEARCH_LENGTH+1] = ""; find_list_ptr_->SetCurSel(0); item_code_ = select_item_name_info.m_dwItemCode; strncpy(select_item_name, select_item_name_info.m_stName.c_str(), MAX_VENDOR_SEARCH_LENGTH); GlobalFunc::SetText(m_pEdit, select_item_name); m_pEdit->SetTextWZ(select_item_name); } else { HideFindWord(); } }*/ /*find_scroll_current_value_ = 0; find_scroll_value_max_ = search_index_ - MAX_VISIBLE_FINDLIST_NUM; // ½ºÅ©·Ñ ¹üÀ§ ÁöÁ¤. find_scroll_->SetScrollPosWZ(find_scroll_current_value_); find_scroll_->SetScrollRangeWZ(0,find_scroll_value_max_);*/ find_list_ptr_->SetBeginDrawIndex(0/*find_scroll_current_value_*/); } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND //------------------------------------------------------------------------------ void uiBattlezone2List::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_C001) { uiChaosSystemMan* chaos_manager = GET_DIALOG_MANAGER(uiChaosSystemMan, UIMAN_CHAOS); if (chaos_manager) { chaos_manager->ToggleChaoszoneDialog(); } } } CCtrlButtonCheckWZ* check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C000)); if (check_control) { check_control->SetCheckState(true); } check_control = static_cast(GetControlWZ_byPosition(kControl_Check_C001)); if (check_control) { check_control->SetCheckState(false); } } 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 = 2.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; } } #endif //_NA_008679_20160202_REWORK_BATTLEGROUND #endif //_DH_BATTLEZONE2_