Mercurial > mm7
changeset 2020:b123afb8246b
WritePointedObjectStatusString() clear
author | Ritor1 |
---|---|
date | Mon, 11 Nov 2013 22:03:16 +0600 |
parents | ab7d10b66503 |
children | b60eaf28bf0c |
files | UI/UiGame.cpp _deleted.cpp |
diffstat | 2 files changed, 312 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/UI/UiGame.cpp Mon Nov 11 21:01:54 2013 +0600 +++ b/UI/UiGame.cpp Mon Nov 11 22:03:16 2013 +0600 @@ -1495,68 +1495,122 @@ } } }//конец пределов основного экрана------------------------ - if ( pX > 467 && pX <=639 && pY <= 479 )//пределы нижней области + if ( pX > 467 && pX <=639 && pY <= 479 )//пределы правой области { if ( pCurrentScreen == SCREEN_GAME ) + { pWindow = &pWindowList[0]; - else - pWindow = &pWindowList[pVisibleWindowsIdxs[uNumVisibleWindows] - 1]; - if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ - && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) - { - for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) + if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ + && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) { - if ( !pButton ) - break; - switch ( pButton->uButtonType ) + for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) { - case 1://for dialogue window - if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) - { - pMessageType1 = (UIMessageType)pButton->field_1C; - if ( pMessageType1 ) - pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); - GameUI_SetFooterString(pButton->pButtonName); - uLastPointedObjectID = 1; - return; - } + if ( !pButton ) break; - case 2: - if ( pX >= pButton->uX && pX <= pButton->uZ - && pY >= pButton->uY && pY <= pButton->uW ) - { - pMessageType1 = (UIMessageType)pButton->field_1C; - if ( pMessageType1 ) - pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); - GameUI_SetFooterString(pButton->pButtonName); - uLastPointedObjectID = 1; - return; - } - break; - case 3:// click on skill - if ( pX >= pButton->uX && pX <= pButton->uZ - && pY >= pButton->uY && pY <= pButton->uW ) - { - v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; - if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) - sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" - else - sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" - GameUI_SetFooterString(Str1); - uLastPointedObjectID = 1; - return; - } - break; + switch ( pButton->uButtonType ) + { + case 1://for dialogue window + if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ + && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) + { + pMessageType1 = (UIMessageType)pButton->field_1C; + if ( pMessageType1 ) + pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); + GameUI_SetFooterString(pButton->pButtonName); + uLastPointedObjectID = 1; + return; + } + break; + case 2: + if ( pX >= pButton->uX && pX <= pButton->uZ + && pY >= pButton->uY && pY <= pButton->uW ) + { + pMessageType1 = (UIMessageType)pButton->field_1C; + if ( pMessageType1 ) + pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); + GameUI_SetFooterString(pButton->pButtonName); + uLastPointedObjectID = 1; + return; + } + break; + case 3:// click on skill + if ( pX >= pButton->uX && pX <= pButton->uZ + && pY >= pButton->uY && pY <= pButton->uW ) + { + v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; + if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) + sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" + else + sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" + GameUI_SetFooterString(Str1); + uLastPointedObjectID = 1; + return; + } + break; + } } } } - //} + else + { + for ( v1 = uNumVisibleWindows; v1 > 0; --v1 ) + { + pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; + if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ + && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) + { + for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) + { + if ( !pButton ) + break; + switch ( pButton->uButtonType ) + { + case 1://for dialogue window + if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ + && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW ) + { + pMessageType1 = (UIMessageType)pButton->field_1C; + if ( pMessageType1 ) + pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); + GameUI_SetFooterString(pButton->pButtonName); + uLastPointedObjectID = 1; + return; + } + break; + case 2: + if ( pX >= pButton->uX && pX <= pButton->uZ + && pY >= pButton->uY && pY <= pButton->uW ) + { + pMessageType1 = (UIMessageType)pButton->field_1C; + if ( pMessageType1 ) + pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); + GameUI_SetFooterString(pButton->pButtonName); + uLastPointedObjectID = 1; + return; + } + break; + case 3:// click on skill + if ( pX >= pButton->uX && pX <= pButton->uZ + && pY >= pButton->uY && pY <= pButton->uW ) + { + v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; + if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) + sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" + else + sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" + GameUI_SetFooterString(Str1); + uLastPointedObjectID = 1; + return; + } + break; + } + } + } + } + } } if ( pX <= 467 && pY > 351 && pY <= 479 )//пределы нижней области { - //for ( v1 = uNumVisibleWindows; v1 >= 0; --v1 ) // some other fullscreen ui - //{ pWindow = &pWindowList[0]; if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW ) @@ -1608,9 +1662,8 @@ } } } - //} } - //pMouse->uPointingObjectID = sub_46A99B(); + //pMouse->uPointingObjectID = sub_46A99B(); //for software if ( pMouse->uPointingObjectID == 0 ) { if ( uLastPointedObjectID != 0 )
--- a/_deleted.cpp Mon Nov 11 21:01:54 2013 +0600 +++ b/_deleted.cpp Mon Nov 11 22:03:16 2013 +0600 @@ -13838,4 +13838,211 @@ }; #undef CASE } + +//----- (0046A99B) -------------------------------------------------------- +int sub_46A99B() +{ + int v0; // ebx@1 + signed int v1; // ecx@1 + signed int v2; // esi@1 + int v3; // edx@1 + signed int v4; // eax@1 + int v5; // ecx@2 + int *v6; // eax@3 + int v7; // ecx@3 + int v8; // edx@5 + int v9; // edi@6 + unsigned __int8 v10; // zf@14 + char v11; // sf@14 + char v12; // of@14 + int *v14; // esi@19 + signed int v15; // ebx@19 + int i; // edi@20 + int v17; // ecx@21 + int v18; // edi@26 + int v19; // esi@27 + unsigned int v20; // ecx@27 + BLVFace *v21; // eax@32 + unsigned int v22; // ecx@33 + const char *v23; // eax@35 + const char *v24; // ecx@36 + LevelDecoration *v25; // ecx@43 + LevelDecoration *v26; // edi@43 + __int16 v27; // ax@43 + int v28; // [sp+Ch] [bp-18h]@1 + int v29; // [sp+14h] [bp-10h]@2 + int v30; // [sp+18h] [bp-Ch]@1 + signed int v31; // [sp+1Ch] [bp-8h]@3 + int v32; // [sp+20h] [bp-4h]@1 + + v0 = 0; + v1 = (signed int)(viewparams->uScreen_BttmR_Y + viewparams->uScreen_topL_Y) >> 1; + v2 = (signed int)(viewparams->uScreen_topL_X + viewparams->uScreen_BttmR_X) >> 1; + v3 = v1 - 50; + v32 = 0; + v4 = 100; + v30 = v1 - 50; + v28 = v1 + 50; + if ( v1 - 50 >= v1 + 50 ) + return 0; + v5 = 640 * v3; + v29 = 640 * v3; + while ( 2 ) + { + v6 = &pRenderer->pActiveZBuffer[v2 + v5 - v4 / 2]-1; + v7 = v0; + //while ( 1 ) + for( int i = 0; i < 100; i++) + { + ++v6; + v8 = *v6; + if ( (unsigned int)*v6 <= 0x2000000 ) + { + v9 = 0; + if ( v7 > 0 ) + { + do + { + if ( dword_7201B0_zvalues[v9] == (unsigned __int16)v8 ) + break; + ++v9; + } + while ( v9 < v0 ); + } + if ( v9 == v0 ) + { + if ( v8 & 7 ) + { + dword_720020_zvalues[v7] = v8; + dword_7201B0_zvalues[v7] = (unsigned __int16)v8; + ++v7; + ++v0; + v32 = v0; + if ( v7 == 99 ) + { + v12 = 0; + v10 = v0 == 0; + v11 = v0 < 0; + goto LABEL_18; + } + } + } + } + } + v4 = -1; + ++v30; + v5 = v29 + 640; + v29 += 640; + if ( v30 >= v28 ) + break; + } + v12 = 0; + v10 = v0 == 0; + v11 = v0 < 0; + if ( !v0 ) + return 0; +LABEL_18: + if ( !((unsigned __int8)(v11 ^ v12) | v10) ) + { + v14 = dword_720020_zvalues.data(); + v15 = 1; + do + { + for ( i = v15; i < v32; ++i ) + { + v17 = dword_720020_zvalues[i]; + if ( v17 < *v14 ) + { + dword_720020_zvalues[i] = *v14; + *v14 = v17; + } + } + ++v15; + ++v14; + } + while ( v15 - 1 < v32 ); + v0 = v32; + } + v18 = 0; + if ( v0 <= 0 ) + return 0; + while ( 1 ) + { + v19 = dword_720020_zvalues[v18] & 0xFFFF; + v20 = PID_ID(dword_720020_zvalues[v18]); + if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_Item) + { + if ( v20 >= 0x3E8 ) + return 0; + if ( !(pSpriteObjects[v20].uAttributes & 0x10) ) + { + v23 = pSpriteObjects[v20].stru_24.GetDisplayName(); + v24 = v23; + GameUI_SetFooterString(v24); + return v19; + } + } + else + { + if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_Actor) + { + if ( v20 >= 0xBB8 ) + return 0; + v24 = (const char *)&pActors[v20]; + GameUI_SetFooterString(v24); + return v19; + } + if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_Decoration) + break; + if ( PID_TYPE(dword_720020_zvalues[v18]) == OBJECT_BModel) + { + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) + { + v21 = &pIndoor->pFaces[v20]; + if ( BYTE3(v21->uAttributes) & 2 ) + v22 = pIndoor->pFaceExtras[v21->uFaceExtraID].uEventID; + } + else + { + if ( (dword_720020_zvalues[v18] & 0xFFFFu) >> 9 < pOutdoor->uNumBModels ) + { + v22 = pOutdoor->pBModels[(dword_720020_zvalues[v18] & 0xFFFFu) >> 9].pFaces[v20 & 0x3F].sCogTriggeredID; + if ( v22 ) + { + v23 = GetEventHintString(v22); + if ( v23 ) + { + v24 = v23; + GameUI_SetFooterString(v24); + return v19; + } + } + } + } + } + } + ++v18; + if ( v18 >= v0 ) + return 0; + } + v25 = &pLevelDecorations[v20]; + v26 = v25; + v27 = pLevelDecorations[v20].uEventID; + if ( v27 ) + { + v23 = GetEventHintString(v27); + if ( !v23 ) + return v19; + v24 = v23; + GameUI_SetFooterString(v24); + return v19; + } + if ( v25->IsInteractive() ) + v24 = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[v26->_idx_in_stru123 - 75] + 379].pTopic; + else + v24 = pDecorationList->pDecorations[v26->uDecorationDescID].field_20; + GameUI_SetFooterString(v24); + return v19; +} + */ \ No newline at end of file