comparison mm7_5.cpp @ 1296:c423f946dc99

moving files continue
author Ritor1
date Tue, 18 Jun 2013 17:28:11 +0600
parents fbb7428fa58c
children 5450af4f57ef
comparison
equal deleted inserted replaced
1295:86a83e12d795 1296:c423f946dc99
10375 v0->PlaySound(SPEECH_16, 0); 10375 v0->PlaySound(SPEECH_16, 0);
10376 dword_4E455C = 0; 10376 dword_4E455C = 0;
10377 } 10377 }
10378 } 10378 }
10379 10379
10380
10381
10382
10383
10384 //----- (004175C0) --------------------------------------------------------
10385 void UI_OnMouseLeftClick(int *pXY)
10386 {
10387 int *pXY_; // esi@1
10388 signed int y; // eax@7
10389 signed int x; // ecx@7
10390 unsigned int v4; // eax@11
10391 signed int v5; // eax@17
10392 signed int v6; // esi@19
10393 int v7; // esi@30
10394 GUIWindow *v8; // edx@31
10395 GUIButton *i; // esi@37
10396 signed int v10; // eax@50
10397 int v11; // ecx@52
10398 unsigned int pX; // [sp+14h] [bp-8h]@7
10399 unsigned int pY; // [sp+18h] [bp-4h]@7
10400
10401 pXY_ = pXY;
10402 if ( pCurrentScreen == SCREEN_VIDEO
10403 || sub_4637E0_is_there_popup_onscreen() )
10404 return;
10405 if ( pGUIWindow2 && pGUIWindow2->ptr_1C == (void *)33 )
10406 {
10407 sub_4452BB();
10408 return;
10409 }
10410 if ( pXY_ )
10411 {
10412 x = *pXY_;
10413 y = pXY_[1];
10414 pX = *pXY_;
10415 pY = y;
10416 }
10417 else
10418 {
10419 pMouse->GetClickPos(&pX, &pY);
10420 y = pY;
10421 x = pX;
10422 }
10423 if ( pCurrentScreen != SCREEN_GAME || !dword_507B98_ctrl_pressed )
10424 goto LABEL_30;
10425 v4 = GetCurrentMenuID();
10426 x = pX;
10427 if ( (v4 & 0x80000000u) == 0
10428 || (signed int)pX < (signed int)pViewport->uViewportTL_X
10429 || (signed int)pX > (signed int)pViewport->uViewportBR_X )
10430 {
10431 y = pY;
10432 LABEL_30:
10433 v7 = uNumVisibleWindows;
10434 if ( uNumVisibleWindows < 0 )
10435 return;
10436 while ( 1 )
10437 {
10438 //v8 = (GUIWindow *)&pWindowList_at_506F50_minus1_indexing[21 * pVisibleWindowsIdxs[v7]];
10439 v8 = &pWindowList[pVisibleWindowsIdxs[v7] - 1];
10440 if ( x >= (signed int)v8->uFrameX )
10441 {
10442 if ( x <= (signed int)v8->uFrameZ && y >= (signed int)v8->uFrameY && y <= (signed int)v8->uFrameW )
10443 break;
10444 }
10445 --v7;
10446 if ( v7 < 0 )
10447 return;
10448 }
10449 for ( i = v8->pControlsHead; ; i = i->pNext )
10450 {
10451 if ( !i )
10452 return;
10453 if ( i->uButtonType == 1 )
10454 goto LABEL_41;
10455 if ( i->uButtonType != 2 )
10456 break;
10457 if ( (signed int)(signed __int64)sqrt((double)((x - i->uX) * (x - i->uX) + (y - i->uY) * (y - i->uY))) < (signed int)i->uWidth )
10458 goto LABEL_50;
10459 y = pY;
10460 x = pX;
10461 LABEL_45:
10462 ;
10463 }
10464 if ( i->uButtonType != 3 )
10465 goto LABEL_45;
10466 LABEL_41:
10467 if ( x >= (signed int)i->uX && x <= (signed int)i->uZ && y >= (signed int)i->uY && y <= (signed int)i->uW )
10468 {
10469 LABEL_50:
10470 i->field_2C_is_pushed = 1;
10471 v10 = pMessageQueue_50CBD0->uNumMessages;
10472 if ( pMessageQueue_50CBD0->uNumMessages )
10473 {
10474 v10 = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
10475 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
10476 }
10477 //v11 = i->uControlParam;
10478 pMessageQueue_50CBD0->AddMessage(i->msg, i->msg_param, 0);
10479 return;
10480 }
10481 goto LABEL_45;
10482 }
10483 y = pY;
10484 if ( (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y )
10485 goto LABEL_30;
10486 if ( pRenderer->pRenderD3D )
10487 v5 = pGame->pVisInstance->get_picked_object_zbuf_val();
10488 else
10489 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
10490 v6 = (unsigned __int16)v5;
10491 if (PID_TYPE(v5) == OBJECT_Actor
10492 && uActiveCharacter
10493 && v5 < 0x2000000
10494 && pPlayers[uActiveCharacter]->CanAct()
10495 && pPlayers[uActiveCharacter]->CanSteal() )
10496 {
10497 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
10498 {
10499 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_1B;
10500 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6 >> 3;
10501 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
10502 ++pMessageQueue_50CBD0->uNumMessages;
10503 }*/
10504 pMessageQueue_50CBD0->AddMessage(UIMSG_1B, PID_ID(v6), 0);
10505
10506 if ( pParty->bTurnBasedModeOn == 1 )
10507 {
10508 if ( pTurnEngine->field_4 == 3 )
10509 pTurnEngine->field_18 |= 8u;
10510 }
10511 }
10512 }
10513
10514
10515
10516 //----- (00417871) --------------------------------------------------------
10517 void __thiscall sub_417871(int *pXY)
10518 {
10519 POINT v1; // [sp+0h] [bp-18h]@5
10520 POINT a2; // [sp+8h] [bp-10h]@5
10521 unsigned int pY; // [sp+10h] [bp-8h]@3
10522 unsigned int pX; // [sp+14h] [bp-4h]@3
10523
10524 if ( !pRenderer->pRenderD3D )
10525 {
10526 if ( pXY )
10527 {
10528 pX = *pXY;
10529 pY = pXY[1];
10530 }
10531 else
10532 {
10533 pMouse->GetClickPos(&pX, &pY);
10534 }
10535 pMouse->GetCursorPos(&a2);
10536 pMouse->GetCursorPos(&v1);
10537 }
10538 }
10539
10540 //----- (004178FE) -------------------------------------------------------- 10380 //----- (004178FE) --------------------------------------------------------
10541 unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2) 10381 unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2)
10542 { 10382 {
10543 unsigned __int16 v2; // dx@2 10383 unsigned __int16 v2; // dx@2
10544 unsigned __int16 v3; // cx@2 10384 unsigned __int16 v3; // cx@2
10690 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level ) 10530 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level )
10691 return red; 10531 return red;
10692 } 10532 }
10693 return white; 10533 return white;
10694 } 10534 }
10695
10696
10697 //----- (00419220) --------------------------------------------------------
10698 void __cdecl sub_419220()
10699 {
10700 GUIButton *i; // eax@2
10701
10702 if ( !dword_507CBC )
10703 {
10704 dword_507CBC = 1;
10705 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext )
10706 {
10707 if ( i->msg == UIMSG_InventoryLeftClick )
10708 {
10709 dword_50698C_uX = i->uX;
10710 dword_506988_uY = i->uY;
10711 dword_506984_uZ = i->uZ;
10712 dword_506980_uW = i->uW;
10713 i->uW = 0;
10714 i->uZ = 0;
10715 i->uY = 0;
10716 i->uX = 0;
10717 }
10718 }
10719 pBtn_Up = pGUIWindow_CurrentMenu->CreateButton(438, 46,
10720 pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureWidth,
10721 pIcons_LOD->GetTexture(uTextureID_ar_up_up)->uTextureHeight,
10722 1, 0, UIMSG_ClickAwardsUpBtn, 0, 0, "",
10723 pIcons_LOD->GetTexture(uTextureID_ar_up_up),
10724 pIcons_LOD->GetTexture(uTextureID_ar_up_dn), 0);
10725 pBtn_Down = pGUIWindow_CurrentMenu->CreateButton(438, 292,
10726 pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureWidth,
10727 pIcons_LOD->GetTexture(uTextureID_ar_dn_up)->uTextureHeight,
10728 1, 0, UIMSG_ClickAwardsDownBtn, 0, 0, "",
10729 pIcons_LOD->GetTexture(uTextureID_ar_dn_up),
10730 pIcons_LOD->GetTexture(uTextureID_ar_dn_dn), 0);
10731 ptr_507BA4 = pGUIWindow_CurrentMenu->CreateButton(440, 62, 16, 232, 1, 0, UIMSG_ClickAwardScrollBar, 0, 0, "", 0);
10732 }
10733 }
10734
10735
10736
10737 //----- (00419379) --------------------------------------------------------
10738 void __cdecl sub_419379()
10739 {
10740 GUIButton *pButton; // esi@2
10741
10742 if ( dword_507CBC )
10743 {
10744 dword_507CBC = 0;
10745 ptr_507BA4->Release();
10746 pBtn_Up->Release();
10747 pBtn_Down->Release();
10748 pBtn_Down = 0;
10749 pBtn_Up = 0;
10750 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext )
10751 {
10752 if ( pButton->msg == UIMSG_InventoryLeftClick )
10753 {
10754 pButton->uX = dword_50698C_uX;
10755 pButton->uY = dword_506988_uY;
10756 pButton->uZ = dword_506984_uZ;
10757 pButton->uW = dword_506980_uW;
10758 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0);
10759 }
10760 }
10761 }
10762 }
10763
10764