Mercurial > mm7
diff mm7_5.cpp @ 558:81856e97664f
sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62 clean
author | zipi |
---|---|
date | Mon, 04 Mar 2013 21:03:52 +0000 |
parents | 9caf59edb1ee |
children | 5eb2c6286c49 |
line wrap: on
line diff
--- a/mm7_5.cpp Mon Mar 04 20:18:06 2013 +0000 +++ b/mm7_5.cpp Mon Mar 04 21:03:52 2013 +0000 @@ -16248,79 +16248,161 @@ } pEventTimer->Pause(); - if ( pCurrentScreen <= SCREEN_CHEST ) - { - if ( pCurrentScreen == SCREEN_CHEST ) - { - // __debugbreak(); - if ( !pPlayers[uActiveCharacter]->CanAct() ) - { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s - pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы - pWindow.Hint = pTmpBuf; - pWindow.uFrameWidth = 384; - pWindow.uFrameHeight = 180; - pWindow.uFrameY = 40; - if ( (signed int)pX <= 320 ) - v10 = pX + 30; - else - v10 = pX - 414; - pWindow.uFrameX = v10; - pWindow.DrawMessageBox(0); - goto LABEL_132; - } - v9 = pX + pSRZBufferLineOffsets[pY]; - if ( !(pRenderer->pActiveZBuffer[v9] & 0xFFFF) ) - goto LABEL_132; - v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime - + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); - } - else - { - if ( pCurrentScreen ) - { - if ( pCurrentScreen != SCREEN_BOOKS ) - { - if ( pCurrentScreen != SCREEN_CHARACTERS ) - { - if ( pCurrentScreen == SCREEN_SPELL_BOOK ) - { - if ( dword_507B00_spell_info_to_draw_in_popup ) - DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); - } - goto LABEL_132; - } -LABEL_119: - if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) - { - identify_item(); - goto LABEL_132; - } - if ( (signed int)pY >= 345 ) - goto LABEL_132; - if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats - { - CharacterUI_StatsTab_ShowHint(); - goto LABEL_132; - } - if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills - { - CharacterUI_SkillsTab_ShowHint(); - goto LABEL_132; - } - v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory - if ( !v11 ) - goto LABEL_132; - identify_item(); - goto LABEL_132; - } + + switch(pCurrentScreen) + { + case SCREEN_CASTING: + { + identify_item(); + break; + } + + case SCREEN_CHEST: + { + if ( !pPlayers[uActiveCharacter]->CanAct() ) + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s не в состоянии %s + pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//Опознать предметы + pWindow.Hint = pTmpBuf; + pWindow.uFrameWidth = 384; + pWindow.uFrameHeight = 180; + pWindow.uFrameY = 40; + if ( (signed int)pX <= 320 ) + v10 = pX + 30; + else + v10 = pX - 414; + pWindow.uFrameX = v10; + pWindow.DrawMessageBox(0); + } + else + { + v9 = pX + pSRZBufferLineOffsets[pY]; + if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF ) + { + v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime + + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); + GameUI_DrawItemInfo(v8); + } + } + break; + } + case SCREEN_GAME: + { + if (GetCurrentMenuID() > 0) + break; + + if ( (signed int)pY > (signed int)pViewport->uViewportW ) + { + pWindow.ptr_1C = (void *)((signed int)pX / 118); + if ( (signed int)pX / 118 < 4 ) + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 200; + pWindow.uFrameX = 38; + pWindow.uFrameY = 60; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawQuickCharRecord(); + } + } + else if ( (signed int)pX > (signed int)pViewport->uViewportZ ) + { + if ( (signed int)pY >= 130 ) + { + if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 200; + pWindow.uFrameX = 38; + pWindow.uFrameY = 60; + pAudioPlayer->StopChannels(-1, -1); + pWindow._41D73D_draw_buff_tooltip(); + } + else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) + { + if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) + { + pAudioPlayer->StopChannels(-1, -1); + v3 = (void *)1; + } + else + { + sub_416B01(v3); + } + } + else + { + pAudioPlayer->StopChannels(-1, -1); + v3 = 0; + sub_416B01(v3); + } + } + else + { + pWindow.Hint = _4443D5_GetMinimapRightClickText(); + pWindow.uFrameWidth = 256; + pWindow.uFrameX = 130; + pWindow.uFrameY = 140; + pWindow.uFrameHeight = 64; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawMessageBox(0); + } + } + else + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 320; + pWindow.uFrameHeight = 320; + v4 = pX - 350; + if ( (signed int)pX <= 320 ) + v4 = pX + 30; + pWindow.uFrameX = v4; + pWindow.uFrameY = 40; + if ( pRenderer->pRenderD3D ) + LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); + else + v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; + v6 = (unsigned __int16)v5; + if ( (v6 & 7) != OBJECT_Item) + { + if ( (v6 & 7) == OBJECT_Actor) + { + if ( pRenderer->uNumSceneBegins ) + { + pWindow.DrawMessageBox(1); + MonsterPopup_Draw(v6 >> 3, &pWindow); + } + else + { + pRenderer->BeginScene(); + pWindow.DrawMessageBox(1); + MonsterPopup_Draw(v6 >> 3, &pWindow); + pRenderer->EndScene(); + } + } + } + else + { + v7 = v6 >> 3; + if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) ) + { + v8 = &pSpriteObjects[v7].stru_24; + GameUI_DrawItemInfo(v8); + } + } + } + break; + } + case SCREEN_BOOKS: + { if ( !dword_506364 || (signed int)pX < (signed int)pViewport->uViewportX || (signed int)pX > (signed int)pViewport->uViewportZ || (signed int)pY < (signed int)pViewport->uViewportY || (signed int)pY > (signed int)pViewport->uViewportW || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) ) - goto LABEL_132; + break; v30 = (double)(pFontArrus->GetLineWidth(v2) + 32); v27 = v30 + 6.7553994e15; v29 = (char *)LODWORD(v27); @@ -16330,205 +16412,137 @@ pWindow.uFrameHeight = 64; pAudioPlayer->StopChannels(-1, -1); pWindow.DrawMessageBox(0); - goto LABEL_132; - } - if (GetCurrentMenuID() > 0) - goto LABEL_132; - - if ( (signed int)pY > (signed int)pViewport->uViewportW ) - { - pWindow.ptr_1C = (void *)((signed int)pX / 118); - if ( (signed int)pX / 118 < 4 ) - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 400; - pWindow.uFrameHeight = 200; - pWindow.uFrameX = 38; - pWindow.uFrameY = 60; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawQuickCharRecord(); - } - goto LABEL_132; - } - if ( (signed int)pX > (signed int)pViewport->uViewportZ ) - { - if ( (signed int)pY >= 130 ) - { - if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 400; - pWindow.uFrameHeight = 200; - pWindow.uFrameX = 38; - pWindow.uFrameY = 60; - pAudioPlayer->StopChannels(-1, -1); - pWindow._41D73D_draw_buff_tooltip(); - goto LABEL_132; - } - if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) - { - if ( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 ) - goto LABEL_132; - pAudioPlayer->StopChannels(-1, -1); - v3 = (void *)1; - } - else - { - pAudioPlayer->StopChannels(-1, -1); - v3 = 0; - } - sub_416B01(v3); - goto LABEL_132; - } - pWindow.Hint = _4443D5_GetMinimapRightClickText(); - pWindow.uFrameWidth = 256; - pWindow.uFrameX = 130; - pWindow.uFrameY = 140; - pWindow.uFrameHeight = 64; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawMessageBox(0); - goto LABEL_132; - } - pWindow.Hint = 0; - pWindow.uFrameWidth = 320; - pWindow.uFrameHeight = 320; - v4 = pX - 350; - if ( (signed int)pX <= 320 ) - v4 = pX + 30; - pWindow.uFrameX = v4; - pWindow.uFrameY = 40; - if ( pRenderer->pRenderD3D ) - LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); - else - v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - v6 = (unsigned __int16)v5; - if ( (v6 & 7) != OBJECT_Item) - { - if ( (v6 & 7) == OBJECT_Actor) - { - if ( pRenderer->uNumSceneBegins ) - { - pWindow.DrawMessageBox(1); - MonsterPopup_Draw(v6 >> 3, &pWindow); - } - else - { - pRenderer->BeginScene(); - pWindow.DrawMessageBox(1); - MonsterPopup_Draw(v6 >> 3, &pWindow); - pRenderer->EndScene(); - } - } - goto LABEL_132; - } - v7 = v6 >> 3; - if ( pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) - goto LABEL_132; - v8 = &pSpriteObjects[v7].stru_24; - } - GameUI_DrawItemInfo(v8); - goto LABEL_132; - } - if ( pCurrentScreen == SCREEN_HOUSE ) - { - if ( (signed int)pY < 345 && (signed int)pX < 469 ) - sub_4B1A2D();//identify item in inventory - goto LABEL_132; - } - if ( pCurrentScreen <= SCREEN_HOUSE ) - goto LABEL_132; - if ( pCurrentScreen <= SCREEN_F ) - goto LABEL_119; - if ( pCurrentScreen != SCREEN_PARTY_CREATION ) - { - v11 = pCurrentScreen == SCREEN_CASTING; - if ( !v11 ) - goto LABEL_132; - identify_item(); - goto LABEL_132; - } - pWindow.Hint = 0; - pStr = 0; - for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) - { - if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (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 ) - { - pControlID = pButton->uControlID; - switch ( pControlID ) - { - case 0: //stats info - pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; - pStr = aAttributeNames[(signed int)pButton->uControlParam % 7]; - break; - case 62: //Plus button info - pStr = pGlobalTXT_LocalizationStrings[670];//Добавить - pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" - break; - case 63: //Minus button info - pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть - pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" - break; - case 64: //Available skill button info - v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4); - pStr = pSkillNames[v18]; - pWindow.Hint = pSkillDesc[v18]; - break; - case 65: //Available Class Info - pWindow.Hint = pClassDescriptions[pButton->uControlParam]; - pStr = pClassNames[pButton->uControlParam]; - break; - case 66: //OK Info - pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. - pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК - break; - case 67: //Clear info - pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. - pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить - break; - case 118: // Character info - pStr = pParty->pPlayers[pButton->uControlParam].pName; - pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType]; - break; - } - if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info - { - pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); - pY = 0; - if ( (signed int)pSkillId < 37 ) - { - pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId); - strcpy(pTmpBuf2, pSkillInfo); - pWindow.Hint = pTmpBuf2; - pStr = pSkillNames[pSkillId]; - } - } - } - } - if ( pWindow.Hint ) - { - pHint = pWindow.Hint; - pWindow.Hint = 0; - pWindow.uFrameWidth = 384; - pWindow.uFrameHeight = 256; - pWindow.uFrameX = 128; - pWindow.uFrameY = 40; - pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; - pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; - pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - pWindow.DrawMessageBox(0); - pWindow.uFrameX += 12; - pWindow.uFrameWidth -= 24; - pWindow.uFrameY += 12; - pWindow.uFrameHeight -= 12; - pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; - pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); - sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" - pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); - pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); - } -LABEL_132: + break; + } + case SCREEN_CHARACTERS: + case SCREEN_E: + case SCREEN_F: + { + if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) + { + identify_item(); + } + else if ( (signed int)pY >= 345 ) + break; + else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats + { + CharacterUI_StatsTab_ShowHint(); + } + else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills + { + CharacterUI_SkillsTab_ShowHint(); + } + else + { + v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory + if ( v11 ) + identify_item(); + } + break; + } + case SCREEN_SPELL_BOOK: + { + if ( dword_507B00_spell_info_to_draw_in_popup ) + DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); + break; + } + case SCREEN_HOUSE: + { + if ( (signed int)pY < 345 && (signed int)pX < 469 ) + sub_4B1A2D();//identify item in inventory + break; + } + + case SCREEN_PARTY_CREATION: + { + pWindow.Hint = 0; + pStr = 0; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) + { + if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (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 ) + { + pControlID = pButton->uControlID; + switch ( pControlID ) + { + case 0: //stats info + pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; + pStr = aAttributeNames[(signed int)pButton->uControlParam % 7]; + break; + case 62: //Plus button info + pStr = pGlobalTXT_LocalizationStrings[670];//Добавить + pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//"Добавляет очко к выделенному навыку, забирая его из накопителя очков" + break; + case 63: //Minus button info + pStr = pGlobalTXT_LocalizationStrings[668];//Вычесть + pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//"Вычитает очко из выделенного навыка, возвращая его в накопитель очков" + break; + case 64: //Available skill button info + v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4); + pStr = pSkillNames[v18]; + pWindow.Hint = pSkillDesc[v18]; + break; + case 65: //Available Class Info + pWindow.Hint = pClassDescriptions[pButton->uControlParam]; + pStr = pClassNames[pButton->uControlParam]; + break; + case 66: //OK Info + pWindow.Hint = pGlobalTXT_LocalizationStrings[664];//Щелкните здесь для утверждения состава отряда и продолжения игры. + pStr = pGlobalTXT_LocalizationStrings[665];//Кнопка ОК + break; + case 67: //Clear info + pWindow.Hint = pGlobalTXT_LocalizationStrings[666];//Сбрасывает все параметры и навыки отряда. + pStr = pGlobalTXT_LocalizationStrings[667];//Кнопка Очистить + break; + case 118: // Character info + pStr = pParty->pPlayers[pButton->uControlParam].pName; + pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType]; + break; + } + if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info + { + pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); + pY = 0; + if ( (signed int)pSkillId < 37 ) + { + pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId); + strcpy(pTmpBuf2, pSkillInfo); + pWindow.Hint = pTmpBuf2; + pStr = pSkillNames[pSkillId]; + } + } + } + } + if ( pWindow.Hint ) + { + pHint = pWindow.Hint; + pWindow.Hint = 0; + pWindow.uFrameWidth = 384; + pWindow.uFrameHeight = 256; + pWindow.uFrameX = 128; + pWindow.uFrameY = 40; + pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; + pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; + pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; + pWindow.DrawMessageBox(0); + pWindow.uFrameX += 12; + pWindow.uFrameWidth -= 24; + pWindow.uFrameY += 12; + pWindow.uFrameHeight -= 12; + pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; + pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; + pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); + sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" + pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); + pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); + } + break; + } + default: + { + break; + } + } dword_507BF0_is_there_popup_onscreen = 1; viewparams->bRedrawGameUI = 1; }