Mercurial > might-and-magic-trilogy
diff mm7_5.cpp @ 179:dd1e818a6b4c
Слияние
author | Ritor1 |
---|---|
date | Wed, 19 Dec 2012 09:36:10 +0600 |
parents | f87034a41fb8 b1f67710227f |
children | d8aa322a19e5 |
line wrap: on
line diff
--- a/mm7_5.cpp Wed Dec 19 09:35:53 2012 +0600 +++ b/mm7_5.cpp Wed Dec 19 09:36:10 2012 +0600 @@ -3378,11 +3378,11 @@ signed int v4; // eax@29 int v5; // ecx@29 enum PLAYER_SKILL_TYPE v6; // edi@37 - GUIWindow *v7; // eax@56 + GUIWindow *pWindow; // eax@56 unsigned int v8; // edx@56 - Player *v9; // edi@57 + Player *pCurrentPlayer; // edi@57 signed int v10; // eax@58 - GUIButton *v11; // eax@59 + GUIButton *pButton; // eax@59 unsigned __int8 v12; // sf@62 signed int v13; // eax@64 unsigned int v14; // eax@66 @@ -3413,7 +3413,7 @@ int v43; // [sp-10h] [bp-20h]@56 int uNum; // [sp+4h] [bp-Ch]@3 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 - int v46; // [sp+Ch] [bp-4h]@3 + int pSex; // [sp+Ch] [bp-4h]@3 Player *pPlayer; if ( pMessageQueue_50CBD0->uNumMessages ) @@ -3423,7 +3423,7 @@ pPlayer = pParty->pPlayers; do { - pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &v46); + pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &pSex); switch (pUIMessageType) { case UIMSG_MainMenu_ShowPartyCreationWnd: @@ -3432,39 +3432,32 @@ SetCurrentMenuID(MENU_NEWGAME); } continue; - case UIMSG_MainMenu_ShowLoadWindow: { GUIWindow::Create(495, 227, 0, 0, WINDOW_5A, (int)pMainMenu_BtnLoad, 0); SetCurrentMenuID(MENU_SAVELOAD); } continue; - case UIMSG_ShowCredits: { GUIWindow::Create(495, 282, 0, 0, WINDOW_5A, (int)pMainMenu_BtnCredits, 0); SetCurrentMenuID(MENU_CREDITS); } continue; - case UIMSG_ExitToWindows: { GUIWindow::Create(495, 337, 0, 0, WINDOW_5A, (int)pMainMenu_BtnExit, 0); SetCurrentMenuID(MENU_FINISHED); } continue; - case UIMSG_LoadGame: { if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot]) continue; - SetCurrentMenuID(MENU_LOAD); } continue; } - - switch (pUIMessageType) { case UIMSG_A5: // WINDOW_5A @@ -3493,15 +3486,12 @@ } } continue; - - case UIMSG_A4: { GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)ptr_69BD64, 0); } continue; } - if ( (signed int)pUIMessageType > UIMSG_PlayerCreationRemoveDownSkill ) { if ( pUIMessageType > UIMSG_A3 ) @@ -3580,7 +3570,7 @@ dword_6A0C9C = uNum - 1; if ( dword_6A0C9C < 1 ) dword_6A0C9C = 0; - v7 = pGUIWindow_CurrentMenu; + pWindow = pGUIWindow_CurrentMenu; v43 = 0; v39 = (int)ptr_69BD58; v8 = pGUIWindow_CurrentMenu->uFrameY + 323; @@ -3680,49 +3670,41 @@ pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; uPlayerCreationUI_SelectedCharacter = uNum; -LABEL_36: - v42 = 0; - v38 = 0; - v36 = 0; - v34 = 0; - v32 = -1; - v31 = 0; - v30 = 0; - pSoundID = (SoundID)66; -LABEL_40: - pAudioPlayer->PlaySound(pSoundID, v30, v31, v32, v34, v36, v38, v42); + pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); continue; } if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack ) { - v9 = &pPlayer[uNum]; - v46 = v9->GetSexByVoice(); + pCurrentPlayer = &pPlayer[uNum]; + pSex = pCurrentPlayer->GetSexByVoice(); do { - v12 = ((v9->uVoiceID-- - 1) & 0x80000000u) != 0; + v12 = ((pCurrentPlayer->uVoiceID-- - 1) & 0x80000000u) != 0; if ( v12 ) - v9->uVoiceID = 19; - v13 = v9->GetSexByVoice(); - } - while ( v13 != v46 ); - v11 = pCreationUI_BtnPressLeft2[uNum]; - goto LABEL_60; + pCurrentPlayer->uVoiceID = 19; + v13 = pCurrentPlayer->GetSexByVoice(); + } + while ( v13 != pSex ); + pButton = pCreationUI_BtnPressLeft2[uNum]; + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1); + pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); + pCurrentPlayer->PlaySound(102, 0); + continue; } if ( pUIMessageType == UIMSG_PlayerCreationVoiceForward ) { - v9 = &pPlayer[uNum]; - v46 = v9->GetSexByVoice(); + pCurrentPlayer = &pPlayer[uNum]; + pSex = pCurrentPlayer->GetSexByVoice(); do { - v9->uVoiceID = (signed int)(v9->uVoiceID + 1) % 20; - v10 = v9->GetSexByVoice(); - } - while ( v10 != v46 ); - v11 = pCreationUI_BtnPressRight2[uNum]; -LABEL_60: - GUIWindow::Create(v11->uX, v11->uY, 0, 0, (enum WindowType)92, (int)v11, 1); + pCurrentPlayer->uVoiceID = (signed int)(pCurrentPlayer->uVoiceID + 1) % 20; + v10 = pCurrentPlayer->GetSexByVoice(); + } + while ( v10 != pSex ); + pButton = pCreationUI_BtnPressRight2[uNum]; + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, (enum WindowType)92, (int)pButton, 1); pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); - v9->PlaySound(102, 0); + pCurrentPlayer->PlaySound(102, 0); continue; } if ( pUIMessageType == UIMSG_A2 ) @@ -3730,12 +3712,12 @@ --dword_6A0C9C; if ( dword_6A0C9C < 0 ) dword_6A0C9C = 0; - v7 = pGUIWindow_CurrentMenu; + pWindow = pGUIWindow_CurrentMenu; v43 = 0; v39 = (int)ptr_69BD5C; v8 = pGUIWindow_CurrentMenu->uFrameY + 197; LABEL_105: - GUIWindow::Create(v7->uFrameX + 215, v8, 0, 0, (WindowType)90, v39, v43); + GUIWindow::Create(pWindow->uFrameX + 215, v8, 0, 0, (WindowType)90, v39, v43); continue; } } @@ -3749,7 +3731,10 @@ v1 = (char *)pParty->pPlayers; v5 = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; - goto LABEL_44; + pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; + pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) + + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; + continue; } if ( (signed int)pUIMessageType > UIMSG_3C ) { @@ -3758,30 +3743,16 @@ GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute( (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); - v42 = 0; - v38 = 0; - v36 = 0; - v34 = 0; - v32 = -1; - v31 = 0; - v30 = 0; - pSoundID = (SoundID)20; - goto LABEL_40; + pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); + continue; } if ( pUIMessageType == UIMSG_PlayerCreationClickMinus ) { GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); (&pPlayer[uPlayerCreationUI_SelectedCharacter])->DecreaseAttribute( (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); - v42 = 0; - v38 = 0; - v36 = 0; - v34 = 0; - v32 = -1; - v31 = 0; - v30 = 0; - pSoundID = (SoundID)23; - goto LABEL_40; + pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); + continue; } if ( pUIMessageType == UIMSG_PlayerCreationSelectActiveSkill ) { @@ -3789,20 +3760,14 @@ v6 = _t->GetSkillIdxByOrder(uNum + 4); if ( _t->GetSkillIdxByOrder(3) == 37 ) pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1; - v42 = 0; - v38 = 0; - v36 = 0; - v34 = 0; - v32 = -1; - v31 = 0; - v30 = 0; - pSoundID = (SoundID)24; - goto LABEL_40; + pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); + continue; } if ( pUIMessageType == UIMSG_PlayerCreationSelectClass ) { (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(uNum); - goto LABEL_36; + pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); + continue; } if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) { @@ -3824,10 +3789,9 @@ { uPlayerCreationUI_SelectedCharacter = uNum; v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; - v46 = pGUIWindow_CurrentMenu->pStartingPosActiveItem; + pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem; v41 = 2; - v5 = v4 % 7 + v46 + 7 * uNum; -LABEL_44: + v5 = v4 % 7 + pSex + 7 * uNum; pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) + 3486 * uPlayerCreationUI_SelectedCharacter] = 0; @@ -15794,11 +15758,11 @@ enum PLAYER_SKILL_TYPE v18; // eax@98 char *pStr2; // eax@99 unsigned int v20; // eax@108 - unsigned int v21; // eax@109 - const char *v22; // eax@111 - char *v23; // ebx@112 - char *v24; // edx@113 - unsigned int v25; // eax@113 + unsigned int pSkillId; // eax@109 + const char *pSkillInfo; // eax@111 + //char *v23; // ebx@112 + char *pHint; // edx@113 + unsigned int pColor; // eax@113 GUIWindow pWindow; // [sp+4h] [bp-74h]@32 double v27; // [sp+58h] [bp-20h]@33 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 @@ -16045,11 +16009,6 @@ goto LABEL_132; } pWindow.Hint = 0; - pButton = pGUIWindow_CurrentMenu->pControlsHead; - if ( !pButton ) - goto LABEL_132; - v13 = pY; - //pStr = v29; pStr = 0; for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) { @@ -16057,7 +16016,7 @@ && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) { pControlID = pButton->uControlID; - switch (pControlID) + switch ( pControlID ) { case 0: //stats info pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; @@ -16065,65 +16024,57 @@ break; case 62: //Plus button info pStr = pGlobalTXT_LocalizationStrings[670];// - pStr2 = pGlobalTXT_LocalizationStrings[671];//" , " - pWindow.Hint = pStr2; + pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//" , " break; case 63: //Minus button info pStr = pGlobalTXT_LocalizationStrings[668];// - pStr2 = pGlobalTXT_LocalizationStrings[669];//" , " - pWindow.Hint = pStr2; + 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]; - v13 = pY; break; case 65: //Available Class Info pWindow.Hint = pClassDescriptions[pButton->uControlParam]; pStr = pClassNames[pButton->uControlParam]; break; case 66: //OK Info - pStr2 = pGlobalTXT_LocalizationStrings[664];// . + pWindow.Hint = pGlobalTXT_LocalizationStrings[664];// . pStr = pGlobalTXT_LocalizationStrings[665];// - pWindow.Hint = pStr2; - break; + break; case 67: //Clear info - pStr2 = pGlobalTXT_LocalizationStrings[666];// . + pWindow.Hint = pGlobalTXT_LocalizationStrings[666];// . pStr = pGlobalTXT_LocalizationStrings[667];// - pWindow.Hint = pStr2; break; case 118: // Character info - v20 = pButton->uControlParam; - pStr = pParty->pPlayers[v20].pName; - pStr2 = pClassDescriptions[pParty->pPlayers[v20].uClass]; - pWindow.Hint = pStr2; + pStr = pParty->pPlayers[pButton->uControlParam].pName; + pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].uClass]; break; } if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info { - v21 = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); - pY = v21; - if ( (v21 & 0x80000000u) == 0 || (signed int)v21 < 37 ) - { - v22 = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)v21); - strcpy(pTmpBuf2, v22); + 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[pY]; + pStr = pSkillNames[pSkillId]; } } } } - v23 = pWindow.Hint; if ( pWindow.Hint ) { - v24 = pWindow.Hint; + pHint = pWindow.Hint; pWindow.Hint = 0; pWindow.uFrameWidth = 384; pWindow.uFrameHeight = 256; pWindow.uFrameX = 128; pWindow.uFrameY = 40; - pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(v24, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; + 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); @@ -16133,10 +16084,10 @@ pWindow.uFrameHeight -= 12; pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - v25 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); - sprintf(pTmpBuf, pStr, v25, format_4E2D80);//sprintfex - sprintfex(pTmpBuf, format_4E2D80, v25, pStr) + pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); + sprintf(pTmpBuf, pStr, pColor, format_4E2D80);//sprintfex - sprintfex(pTmpBuf, format_4E2D80, v25, pStr) pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); - pWindow.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v23, 0, 0, 0); + pWindow.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, pHint, 0, 0, 0); } LABEL_132: dword_507BF0_is_there_popup_onscreen = 1;