BOOL _XWindow_IME::CheckArea(void) { if( !m_pMyManager ) return FALSE; if(CheckMousePosition()) { return TRUE; } return FALSE; }
BOOL _XWindow_TradeItemTooltip::Process(_XGUIObject*& pfocusobject) { if(!this->m_Enable) return FALSE; if(!this->m_ShowWindow) return FALSE; MouseState* mousestate = gpInput->GetMouseState(); if(mousestate) { if(!pfocusobject) { if(mousestate->bButton[0]) if(CheckMousePosition()) this->ShowWindow(FALSE); } } if(!_XWindow::Process(pfocusobject)) return FALSE; return TRUE; }
BOOL _XWindow_PartyMasterMiniBar::Process( _XGUIObject*& pfocusobject ) { if( !this->m_ShowWindow ) return FALSE; if( !this->m_Enable ) return FALSE; MouseState* mousestate = gpInput->GetMouseState(); if(mousestate) { if(!pfocusobject) { if(mousestate->bButton[0]) { if( CheckMousePosition() ) { if( m_PartyMasterMode == _XPARTYMASTERMODE_MAXIMUM) { if( !m_btnPartyMasterMinimize->CheckMousePosition() && !m_btnPartyMasterClose->CheckMousePosition() && !m_btnPartyExperienceSharing->CheckMousePosition() && !m_btnPartyItemSharing->CheckMousePosition() ) { if( m_bIsCurrentUser ) { g_pLocalUser->SetViewTarget(g_pLocalUser, _XPICKINGTARGET_SELF); g_pLocalUser->SetAttackTarget(g_pLocalUser, _XPICKINGTARGET_SELF); } else { _XUser* pUser = NULL; pUser = (_XUser*)g_Userlist.FindUser(m_PlayerUniqueid); if( pUser ) { g_pLocalUser->SetViewTarget((_XItem*)pUser, _XPICKINGTARGET_PC); } #ifdef _XDEF_SEARCHPARTYMEMBER _XWindow_WorldMinimap* pWorldMinimap_Window = (_XWindow_WorldMinimap*)g_MainWindowManager.FindWindow(_XDEF_WTITLE_MINIMAPWINDOW); if(pWorldMinimap_Window) { pWorldMinimap_Window->m_bDrawPartyMemberSearchEffect = TRUE; pWorldMinimap_Window->m_nSearchPartyMemberIndex = m_PartyIndex; } #endif } } }//if( m_PartyMasterMode == _XPARTYMASTERMODE_MAXIMUM) }//if( CheckMousePosition() ) } else if( mousestate->bButton[1] ) { // 오른쪽 클릭 if(CheckMousePosition()) { if( !m_btnPartyMasterMinimize->CheckMousePosition() && !m_btnPartyMasterClose->CheckMousePosition() && !m_btnPartyExperienceSharing->CheckMousePosition() && !m_btnPartyItemSharing->CheckMousePosition() ) { if( !m_bIsCurrentUser ) { m_WindowMouseState = _XW_STATE_RIGHTCLICK; } } } } } if(!mousestate->bButton[1]) { if(m_WindowMouseState == _XW_STATE_RIGHTCLICK) { bool bchangetarget = false; char usefultype = 0; char targettype = 0; if(g_pLocalUser->m_SelectedSkillID > 0) { usefultype = g_pLocalUser->GetUsefulType(g_pLocalUser->m_SelectedSkillID); targettype = _XSkillItem::GetTargetType(g_pLocalUser->m_SelectedSkillID); } else usefultype = _XSI_USEFULTYPE_ACTIVESKILL; switch(usefultype) { case _XSI_USEFULTYPE_PASSIVESKILL : case _XSI_USEFULTYPE_PASSIVESPELL : case _XSI_USEFULTYPE_HIDDENMA : bchangetarget = true; break; case _XSI_USEFULTYPE_ACTIVESKILL : { if( g_pLocalUser->m_CurrentBattleState == _XUSER_STATE_NONE || g_pLocalUser->m_CurrentBattleState == _XUSER_STATE_1 || g_pLocalUser->m_CurrentBattleState == _XUSER_STATE_LAST ) { bchangetarget = true; } } break; case _XSI_USEFULTYPE_CHARGESKILL : case _XSI_USEFULTYPE_CASTINGSPELL : case _XSI_USEFULTYPE_CHANNELINGSPELL : case _XSI_USEFULTYPE_FINISHSKILL : case _XSI_USEFULTYPE_ROUNDINGSPELL : case _XSI_USEFULTYPE_SMASHINGSKILL : { if( g_pLocalUser->m_CurrentBattleState == _XUSER_STATE_NONE || g_pLocalUser->m_CurrentBattleState == _XUSER_STATE_LAST ) { bchangetarget = true; } } break; } if( bchangetarget ) { _XUser* pUser = NULL; pUser = (_XUser*)g_Userlist.FindUser(m_PlayerUniqueid); if( pUser ) { if(pUser->m_AttackTarget) { if(pUser->m_AttackTarget == g_pLocalUser) { // user의 target이 나 인경우 g_pLocalUser->SetViewTarget(g_pLocalUser, _XPICKINGTARGET_SELF); g_pLocalUser->SetAttackTarget(g_pLocalUser, _XPICKINGTARGET_SELF); } else if(pUser->m_AttackTarget == pUser) { // user의 target이 그 user(자기자신) 인경우 g_pLocalUser->SetViewTarget(pUser, _XPICKINGTARGET_PC); g_pLocalUser->SetAttackTarget(g_pLocalUser, _XPICKINGTARGET_PC); } else { g_pLocalUser->SetViewTarget((_XItem*)pUser->m_AttackTarget, pUser->m_AttackTargetObjectType); g_pLocalUser->SetAttackTarget((_XItem*)pUser->m_AttackTarget, pUser->m_AttackTargetObjectType ); } } } } m_WindowMouseState = _XW_STATE_NONE; } } } if( !_XWindow::Process(pfocusobject) ) return FALSE; return TRUE; }
void _XWindow_PartyMasterMiniBar::Draw( _XGUIObject*& pfocusobject ) { if( !this->m_ShowWindow ) return; _XWindow::Draw(pfocusobject); #ifdef _XDEF_INTERFACE_RENEWAL_071002_KUKURI if( m_PartyMasterMode == _XPARTYMASTERMODE_MAXIMUM ) { if( m_pClassBorderIcon ) m_pClassBorderIcon->Draw( m_WindowPosition.x - 43, m_WindowPosition.y + 4 ); if( m_pClassIcon ) m_pClassIcon->Draw( m_WindowPosition.x - 35, m_WindowPosition.y + 12 ); ScrnPos* scrnpos = gpInput->GetMouseVirScreenPos(); if( ((scrnpos->x > m_WindowPosition.x-43) ) && (scrnpos->x < m_WindowPosition.x-1) && (scrnpos->z > m_WindowPosition.y+4 ) && (scrnpos->z < m_WindowPosition.y+4+48) ) { int classid = g_pLocalUser->m_PartyInfo[m_PartyIndex].clanclass; if(classid > 0) { if(g_pLocalUser->m_PartyInfo[m_PartyIndex].clan == _XGROUP_BEEGOONG) { if(classid == 7) // 섭혼녀 classid = 4; } else if(g_pLocalUser->m_PartyInfo[m_PartyIndex].clan == _XGROUP_NOCKRIM) { if(classid == 8) // 철갑귀 classid = 4; } g_InterfaceTooltip.SetToolTipString(m_WindowPosition.x, m_WindowPosition.y + 12, _XGETINTERFACETEXT(ID_STRING_NEW_2660+classid-1), _XSC_INFORMATION, FALSE); } else if(g_pLocalUser->m_CharacterInfo.Get_cClass() == 0) { g_InterfaceTooltip.SetToolTipString(m_WindowPosition.x, m_WindowPosition.y + 12, _XGETINTERFACETEXT(ID_STRING_NEW_3713), _XSC_INFORMATION, FALSE); } } } else { if( m_pClassBorderIcon ) m_pClassBorderIcon->Draw( m_WindowPosition.x - 40, m_WindowPosition.y ); if( m_pClassIcon ) m_pClassIcon->Draw( m_WindowPosition.x - 35, m_WindowPosition.y + 3 ); ScrnPos* scrnpos = gpInput->GetMouseVirScreenPos(); if( ((scrnpos->x > m_WindowPosition.x-40) ) && (scrnpos->x < m_WindowPosition.x) && (scrnpos->z > m_WindowPosition.y ) && (scrnpos->z < m_WindowPosition.y+36) ) { int classid = g_pLocalUser->m_PartyInfo[m_PartyIndex].clanclass; if(classid > 0) { if(g_pLocalUser->m_PartyInfo[m_PartyIndex].clan == _XGROUP_BEEGOONG) { if(classid == 7) // 섭혼녀 classid = 4; } else if(g_pLocalUser->m_PartyInfo[m_PartyIndex].clan == _XGROUP_NOCKRIM) { if(classid == 8) // 철갑귀 classid = 4; } g_InterfaceTooltip.SetToolTipString(m_WindowPosition.x, m_WindowPosition.y+3, _XGETINTERFACETEXT(ID_STRING_NEW_2660+classid-1), _XSC_INFORMATION, FALSE); } else if(g_pLocalUser->m_CharacterInfo.Get_cClass() == 0) { g_InterfaceTooltip.SetToolTipString(m_WindowPosition.x, m_WindowPosition.y+3, _XGETINTERFACETEXT(ID_STRING_NEW_3713), _XSC_INFORMATION, FALSE); } } } #endif switch(m_PartyMasterMode) { case _XPARTYMASTERMODE_MAXIMUM: { if( !m_bDangerous ) { g_XBaseFont->SetColor( _XSC_DEFAULT_HIGHLIGHT ); g_XBaseFont->SetGrowMode( _XFONT_EDGEMODE_EDGE, 0xFF000000 ); g_XBaseFont->Puts( m_WindowPosition.x +52, m_WindowPosition.y + 4, m_PartyMasterName ); g_XBaseFont->Flush(); g_XBaseFont->DisableGrowMode(); g_XBaseFont->SetColor( _XSC_DEFAULT ); g_XBaseFont->Puts( m_WindowPosition.x +8, m_WindowPosition.y + 39, g_stringExperienceSharingForm[m_indexPartyExperienceSharing] ); g_XBaseFont->Puts( m_WindowPosition.x +88, m_WindowPosition.y + 39, g_stringItemSharingForm[m_indexPartyItemSharing] ); if( !m_bIsCurrentZone ) { // ( 132 X 14 ) _XDrawSolidBar( m_WindowPosition.x+29, m_WindowPosition.y+19, m_WindowPosition.x+161, m_WindowPosition.y+33 , D3DCOLOR_ARGB(255,11,12,18) ); _XDrawRectAngle( m_WindowPosition.x+28, m_WindowPosition.y+18, m_WindowPosition.x+161, m_WindowPosition.y+33 , 0.0f, D3DCOLOR_ARGB(255,0,0,0) ); TCHAR messagestring[64]; memset( messagestring, 0, sizeof(TCHAR)*64 ); sprintf( messagestring, _XGETINTERFACETEXT(ID_STRING_PARTY_2292), g_ZoneInfoTable[ m_ZoneIndex - 1].zoneshortname ); g_XBaseFont->Puts( m_WindowPosition.x+35, m_WindowPosition.y+21, messagestring ); } g_XBaseFont->Flush(); } else { if( !m_bDeathUser ) { DrawDangerMode(); g_XBaseFont->SetColor( _XSC_WARNING_HIGHLIGHT ); g_XBaseFont->SetGrowMode( _XFONT_EDGEMODE_EDGE, 0xFF000000 ); g_XBaseFont->Puts( m_WindowPosition.x +52, m_WindowPosition.y + 4, m_PartyMasterName ); g_XBaseFont->Flush(); g_XBaseFont->DisableGrowMode(); g_XBaseFont->SetColor( _XSC_DEFAULT ); g_XBaseFont->Puts( m_WindowPosition.x +8, m_WindowPosition.y + 39, g_stringExperienceSharingForm[m_indexPartyExperienceSharing] ); g_XBaseFont->Puts( m_WindowPosition.x +88, m_WindowPosition.y + 39, g_stringItemSharingForm[m_indexPartyItemSharing] ); g_XBaseFont->Flush(); } else { g_XBaseFont->SetColor( D3DCOLOR_ARGB( 255, 100, 100, 100 ) ); g_XBaseFont->SetGrowMode( _XFONT_EDGEMODE_EDGE, 0xFF000000 ); g_XBaseFont->Puts( m_WindowPosition.x +52, m_WindowPosition.y + 4, m_PartyMasterName ); g_XBaseFont->Flush(); g_XBaseFont->DisableGrowMode(); _XDrawSolidBar( m_WindowPosition.x+29, m_WindowPosition.y+19, m_WindowPosition.x+161, m_WindowPosition.y+33 , D3DCOLOR_ARGB(255,11,12,18) ); _XDrawRectAngle( m_WindowPosition.x+28, m_WindowPosition.y+18, m_WindowPosition.x+161, m_WindowPosition.y+33 , 0.0f, D3DCOLOR_ARGB(255,0,0,0) ); g_XBaseFont->SetColor( _XSC_WARNING_HIGHLIGHT ); g_XBaseFont->Puts( m_WindowPosition.x+45, m_WindowPosition.y+21, _XGETINTERFACETEXT(ID_STRING_PARTY_2293) ); g_XBaseFont->Flush(); g_XBaseFont->SetColor( _XSC_DEFAULT ); g_XBaseFont->Puts( m_WindowPosition.x +8, m_WindowPosition.y + 39, g_stringExperienceSharingForm[m_indexPartyExperienceSharing] ); g_XBaseFont->Puts( m_WindowPosition.x +88, m_WindowPosition.y + 39, g_stringItemSharingForm[m_indexPartyItemSharing] ); g_XBaseFont->Flush(); } } bool flag = false; if( CheckMousePositionExperienceSharingBox() ) { if( g_pMainFrame_Window && !g_pMainFrame_Window->GetShowStatus() ) { g_InterfaceTooltip.SetToolTipString( m_WindowPosition.x +4, m_WindowPosition.y + 15, _XGETINTERFACETEXT(ID_STRING_PARTYMASTERMINIBAR_DIVISIONEXP), _XSC_INFORMATION, FALSE ); //_T("경험치분배") g_InterfaceTooltip.Draw(); } } else if( CheckMousePositionItemSharingBox() ) { if( g_pMainFrame_Window && !g_pMainFrame_Window->GetShowStatus() ) { g_InterfaceTooltip.SetToolTipString( m_WindowPosition.x +83, m_WindowPosition.y + 15, _XGETINTERFACETEXT(ID_STRING_PARTYMASTERMINIBAR_DIVISIONITEM), _XSC_INFORMATION, FALSE ); // _T("전리품분배") g_InterfaceTooltip.Draw(); } } else if( CheckMousePosition() ) { if( g_pMainFrame_Window && !g_pMainFrame_Window->GetShowStatus() ) { if( !g_InterfaceTooltip.GetShowStatus() ) { flag = true; if( g_pMiniTooltip_Window ) { if( !m_bDangerous ) { if( g_pMiniTooltip_Window->SetTooltipMode( MTMODE_PARTYINFO, m_PartyIndex, 0, (int)m_bOut, (DWORD)m_bFarAway ) ) g_pMiniTooltip_Window->ShowWindow( TRUE ); } else { if( m_bDeathUser) { if( g_pMiniTooltip_Window->SetTooltipMode( MTMODE_PARTYINFO, m_PartyIndex, 1, 0, (int)m_bOut, (DWORD)m_bFarAway ) ) g_pMiniTooltip_Window->ShowWindow( TRUE ); } else { if( g_pMiniTooltip_Window->SetTooltipMode( MTMODE_PARTYINFO, m_PartyIndex, 0, 0, (int)m_bOut, (DWORD)m_bFarAway ) ) g_pMiniTooltip_Window->ShowWindow( TRUE ); } } } } } } if( flag == false && g_pMiniTooltip_Window->GetMiniTooltipMode() == MTMODE_PARTYINFO && m_PartyIndex == g_pMiniTooltip_Window->GetCurrentSlotNumber() ) g_pMiniTooltip_Window->ShowWindow( FALSE ); #ifdef _XDEF_PARTY_NOTAVAILABLE m_pFarActionIcon->Draw(m_WindowPosition.x+164, m_WindowPosition.y+19); m_pOutActionIcon->Draw(m_WindowPosition.x+164, m_WindowPosition.y+32); #endif #ifdef _XTS_TARGET_STATE _XUser* pUser = g_Userlist.FindUser(g_pLocalUser->m_PartyInfo[m_PartyIndex].playeruniqueid); if(pUser) { for( int i = 0; i < m_StateCount; i++ ) { m_StateImage[i].MoveWindow(m_WindowPosition.x+m_WindowSize.cx+3+17*(i%8), m_WindowPosition.y+2+17*(i/8)); m_StateImage[i].Draw(); if( m_StateImage[i].CheckMousePosition() ) { map <int, _XCharacterState*>::iterator iter_state = pUser->m_StateList.m_mapCharacterStateList.begin(); advance( iter_state, i ); if( iter_state != pUser->m_StateList.m_mapCharacterStateList.end() ) { _XCharacterState* pState = iter_state->second; if(pState) { POINT pos = m_StateImage[i].GetWindowPos(); if(pState->m_FromType == 0) // spell { g_InterfaceTooltip.SetToolTipString( pos.x+32, pos.y+32, g_SkillProperty[pState->m_sSkillID]->skillName, _XSC_INFORMATION, TRUE); } else if(pState->m_FromType == 1) // effect { g_InterfaceTooltip.SetToolTipString( pos.x+32, pos.y+32, g_CharacterStateTable[pState->m_sEffectID]->name, _XSC_INFORMATION, TRUE); } } } } } } #endif } break; case _XPARTYMASTERMODE_MINIMUM: { if( !m_bDangerous ) { g_XBaseFont->SetColor( _XSC_DEFAULT_HIGHLIGHT); g_XBaseFont->SetGrowMode( _XFONT_EDGEMODE_EDGE, 0xFF000000 ); g_XBaseFont->Puts( m_WindowPosition.x +52, m_WindowPosition.y + 4, m_PartyMasterName ); g_XBaseFont->Flush(); g_XBaseFont->DisableGrowMode(); g_XBaseFont->SetColor( _XSC_DEFAULT ); g_XBaseFont->Print( m_WindowPosition.x +18, m_WindowPosition.y + 21, 1.0f, _XGETINTERFACETEXT(ID_STRING_PARTYMASTERMINIBAR_PARTYCOUNT), g_pLocalUser->m_PartyMemberCount ); // "동행인원 : %d명" g_XBaseFont->Flush(); } else { DrawDangerMode(); g_XBaseFont->SetColor( _XSC_WARNING_HIGHLIGHT ); g_XBaseFont->SetGrowMode( _XFONT_EDGEMODE_EDGE, 0xFF000000 ); g_XBaseFont->Puts( m_WindowPosition.x +52, m_WindowPosition.y + 4, m_PartyMasterName ); g_XBaseFont->Flush(); g_XBaseFont->DisableGrowMode(); g_XBaseFont->SetColor( _XSC_DEFAULT ); g_XBaseFont->Print( m_WindowPosition.x +18, m_WindowPosition.y + 21, 1.0f, _XGETINTERFACETEXT(ID_STRING_PARTYMASTERMINIBAR_PARTYCOUNT), g_pLocalUser->m_PartyMemberCount ); // "동행인원 : %d명" g_XBaseFont->Flush(); } if( g_pMiniTooltip_Window->GetShowStatus() ) { if( g_pMiniTooltip_Window->GetMiniTooltipMode() == MTMODE_PARTYINFO ) g_pMiniTooltip_Window->ShowWindow( FALSE ); } } break; } }
int Win::DoModal() { WinID lastParentFC = parent ? parent->lastFocusChild : 0; bool visibled = IsVisible(); bool enabled = IsEnabled(); try { if (!visibled) Show(); if (!enabled) Enable(true); if (parent && type != WT_POPUP) parent->RecalcLayouts(); AppBlock(GetID()); UnblockTree(GetID()); ModalStruct modalStruct; modal = &modalStruct; MSG msg; while (!modalStruct.end) { wth_DoEvents(); if (modalStruct.end) break; if (!PeekMessage(&msg, NULL, 0, 0,PM_NOREMOVE)) { unsigned waitTime = RunTimers(); if (waitTime > 5000) waitTime = 5000; if (modalStruct.end) break; HANDLE thEvent = wthInternalEvent.SignalFD(); DWORD res = MsgWaitForMultipleObjects(1,&thEvent,FALSE, waitTime, QS_ALLINPUT); if (res == WAIT_TIMEOUT) CheckMousePosition(); continue; } if (!GetMessage(&msg, NULL, 0, 0)) break; DispatchMessage(&msg); } modal = 0; AppUnblock(GetID()); if (!visibled) Hide(); /// if (type == WT_POPUP || type == WT_CHILD && parent) { Win *w = GetWinByID(lastParentFC); if (w) w->SetFocus(); } return modalStruct.id; } catch (...) { modal = 0; AppUnblock(GetID()); if (!visibled) Hide(); throw; } }
BOOL _XWindow_NPCResource_New::Process(_XGUIObject*& pfocusobject) { if(!this->m_Enable) return FALSE; if(!this->m_ShowWindow) return FALSE; // TODO MouseState* mousestate = gpInput->GetMouseState(); ScrnPos* scrnpos = gpInput->GetMouseVirScreenPos(); if(mousestate) { if(!pfocusobject) { if(mousestate->bButton[0]) { if(CheckMousePosition()) { if(m_nSelectedTab == _TAB_ITEM) { // Drag & Drop if(g_pInventory_Window) { if(g_pInventory_Window->m_bHaveMouseSlot && g_pInventory_Window->m_MouseSlotItem.m_InventoryNumber >= _XINVENTORY_SLOTTYPE_POCKETSTART) { int index = 0; if(CheckItem(g_pInventory_Window->m_MouseSlotItem.Get_m_cType(), g_pInventory_Window->m_MouseSlotItem.Get_m_sID(), g_pInventory_Window->m_MouseSlotItem.m_InventoryNumber, index)) { SetItem(index, g_pInventory_Window->m_MouseSlotItem.m_InventoryNumber); } g_pInventory_Window->ResetMouseSlot(); } else { // 툴팁 처리 if( m_nSelectedResourceItem != -1 && m_nSelectedResourceItem < g_ResourceManager.m_TotalCountResourceItem) { BOOL bfinditem = FALSE; for(int i = 0 ; i < 17 ; ++i) { if(scrnpos->x >= m_tItemInfo[i].x && scrnpos->x <= m_tItemInfo[i].x+30 && scrnpos->z >= m_tItemInfo[i].y && scrnpos->z <= m_tItemInfo[i].y+30) { bfinditem = TRUE; break; } } if(bfinditem) { if(g_pDefaultTooltip_Window) { if(g_pDefaultTooltip_Window->SetTooltipMode(TMODE_NPCRESOURCEITEM, i, m_tItemInfo[i].cType, m_tItemInfo[i].sID)) { g_pDefaultTooltip_Window->ShowWindow(TRUE); } } } else { if(g_pDefaultTooltip_Window) { if(g_pDefaultTooltip_Window->GetShowStatus()) g_pDefaultTooltip_Window->ShowWindow(FALSE); } } } } } } } m_WindowMouseState = _XW_STATE_LEFTCLICK; } if(mousestate->bButton[1]) { if(CheckMousePosition()) { if(m_nSelectedTab == _TAB_ITEM) { for(int i = 1 ; i < 17 ; ++i) { if(scrnpos->x >= m_tItemInfo[i].x && scrnpos->x <= m_tItemInfo[i].x+30 && scrnpos->z >= m_tItemInfo[i].y && scrnpos->z <= m_tItemInfo[i].y+30) { m_tItemInfo[i].bDragComplete = FALSE; m_tItemInfo[i].nInvenNumber = 0; break; } } } } m_WindowMouseState = _XW_STATE_RIGHTCLICK; } } if(!mousestate->bButton[1]) { if(m_WindowMouseState == _XW_STATE_RIGHTCLICK) { m_WindowMouseState = _XW_STATE_NONE; } } if(!mousestate->bButton[0]) { if(m_WindowMouseState == _XW_STATE_LEFTCLICK) { m_WindowMouseState = _XW_STATE_NONE; } } } if(CheckAllResourceItem()) { if(!m_pExchangeBtn->GetEnableStatus()) m_pExchangeBtn->EnableWindow(TRUE); } else { if(m_pExchangeBtn->GetEnableStatus()) m_pExchangeBtn->EnableWindow(FALSE); } if(!_XWindow::Process(pfocusobject)) return FALSE; return TRUE; }
BOOL _XWindow_Pocket::Process( _XGUIObject*& pfocusobject ) { if(!this->m_Enable) return FALSE; if(!this->m_ShowWindow) return FALSE; MouseState* mousestate = gpInput->GetMouseState(); ScrnPos* scrnpos = gpInput->GetMousePrevScreenPos(); if(mousestate) { if(!pfocusobject) { if(mousestate->bButton[1]) { // right down if(CheckMousePosition()) m_WindowMouseState = _XW_STATE_RIGHTCLICK; else { if(m_bHaveMouseSlot) { m_bHaveMouseSlot = FALSE; m_MouseSlotItem.ResetMouseSlotItem(); } } } if(mousestate->bButton[0]) { // left down if(CheckMousePosition()) { // Focus if(scrnpos->x > m_WindowPosition.x+16 && scrnpos->z < m_WindowPosition.x+150) { if(scrnpos->z > m_WindowPosition.y+27 && scrnpos->z < m_WindowPosition.y+95) { pfocusobject = _XDEF_DUMMYID_POCKET; } } if(!m_bHaveMouseSlot) { // Mouse down 위치 저장 m_IconDragStartPos.x = scrnpos->x; m_IconDragStartPos.y = scrnpos->z; m_LastDraggingSlot = SearchSlotIndex(); m_bDragState = TRUE; } else { m_MouseSlotItem.ResetMouseSlotItem(); m_bHaveMouseSlot = FALSE; } } // if(CheckMousePosition()) } } // if(!pfocusobject) if(pfocusobject == _XDEF_DUMMYID_POCKET) { if(mousestate->bButton[0]) { // 드래그 처리 if(m_bDragState && !m_bHaveMouseSlot) { if(scrnpos->x != m_IconDragStartPos.x || scrnpos->z != m_IconDragStartPos.y) { m_MouseSlotItem.Copy(m_AccessoryItemList[m_LastDraggingSlot]); m_MouseSlotItem.m_InventoryNumber = m_LastDraggingSlot; m_bHaveMouseSlot = TRUE; m_LastDraggingSlot = -1; } } // if(m_bDragState && !m_bHaveMouseSlot) } if(!mousestate->bButton[0]) { if(m_bDragState) { if(scrnpos->x == m_IconDragStartPos.x && scrnpos->z == m_IconDragStartPos.y) { if( m_AccessoryItemList[m_LastDraggingSlot].Get_m_sID() > 0 ) { // 제자리에서 클릭 m_MouseSlotItem.Copy(m_AccessoryItemList[m_LastDraggingSlot]); m_MouseSlotItem.m_InventoryNumber = m_LastDraggingSlot; if( g_pDefaultTooltip_Window ) { // 툴팁 보이기 } m_LastDraggingSlot = -1; } else { if( g_pDefaultTooltip_Window ) { if( g_pDefaultTooltip_Window->GetShowStatus() ) g_pDefaultTooltip_Window->ShowWindow( FALSE ); } } } else { if(m_bDragState && m_bHaveMouseSlot) { int selectedslot = SearchSlotIndex(); if(selectedslot == m_MouseSlotItem.m_InventoryNumber) { // drag한 상태에서 그 slot을 빠져나오지 못함 m_MouseSlotItem.ResetMouseSlotItem(); m_bHaveMouseSlot = FALSE; m_bDragState = FALSE; m_LastDraggingSlot = -1; } else { // Drag 성공 m_bDragState = FALSE; } } // if(m_bDragState && m_bHaveMouseSlot) } } // if(m_bDragState) } } // if(pfocusobject == _XDEF_DUMMYID_POCKET) if(!mousestate->bButton[1]) { if(m_WindowMouseState == _XW_STATE_RIGHTCLICK) { BOOL resetmouse = TRUE; if(!m_bHaveMouseSlot) { m_LastDraggingSlot = SearchSlotIndex(); if( m_AccessoryItemList[m_LastDraggingSlot].Get_m_sID() > 0 ) { // SendPacket g_NetworkKernel.SendPacket( MSG_NO_TEMP_INVEN_CTRL, m_LastDraggingSlot ); m_LastDraggingSlot = -1; } m_WindowMouseState = _XW_STATE_NONE; resetmouse = FALSE; } if(resetmouse) { m_bHaveMouseSlot = FALSE; m_MouseSlotItem.ResetMouseSlotItem(); m_WindowMouseState = _XW_STATE_NONE; m_LastDraggingSlot = -1; } } // if(m_WindowMouseState == _XW_STATE_RIGHTCLICK) } if(!mousestate->bButton[0]) { if(pfocusobject == _XDEF_DUMMYID_POCKET) pfocusobject = NULL; } } if(!_XWindow::Process(pfocusobject)) return FALSE; return TRUE; }