# HG changeset patch # User Ritor1 # Date 1351162741 -21600 # Node ID 6b3a5283b1070430ed857bea7b706b65637dee81 # Parent 1f161a887c69d1e4c63d3d357c97bd0645da0ae1 UIMSG_PlayerCreation diff -r 1f161a887c69 -r 6b3a5283b107 GUIWindow.h --- a/GUIWindow.h Thu Oct 25 09:02:49 2012 +0600 +++ b/GUIWindow.h Thu Oct 25 16:59:01 2012 +0600 @@ -116,6 +116,16 @@ UIMSG_MainMenu_ShowLoadWindow = 0x37, UIMSG_ShowCredits = 0x38, UIMSG_ExitToWindows = 0x39, + UIMSG_3C = 0x3C, + UIMSG_PlayerCreationClickPlus = 0x3E, + UIMSG_PlayerCreationClickMinus = 0x3F, + UIMSG_PlayerCreationSelectActiveSkill = 0x40, + UIMSG_41 = 0x41, + UIMSG_PlayerCreationClickOK = 0x42, + UIMSG_PlayerCreationClickReset = 0x43, + UIMSG_PlayerCreationRemoveUpSkill = 0x4A, + UIMSG_PlayerCreationRemoveDownSkill = 0x4B, + UIMSG_4B = 0x4B, UIMSG_LoadGame = 0x52, UIMSG_SaveGame = 0x53, UIMSG_ShowStatus_DateTime = 0x5C, @@ -123,16 +133,20 @@ UIMSG_ShowStatus_Player = 0x5E, UIMSG_ShowStatus_Food = 0x64, UIMSG_ShowStatus_Funds = 0x65, + UIMSG_6B = 0x6B, UIMSG_SelectCharacter = 0x6E, UIMSG_ChangeSoundVolume = 0x6F, UIMSG_ChangeMusicVolume = 0x70, UIMSG_CloseBook = 0x71, + UIMSG_PlayerCreationSelectQuality = 0x76, UIMSG_SkillUp = 0x79, UIMSG_StartNewGame = 0x7C, UIMSG_Game_OpenLoadGameDialog = 0x7D, UIMSG_Game_OpenOptionsDialog = 0x7F, UIMSG_SetGraphicsMode = 0x83, UIMSG_Quit = 0x84, + UIMSG_PlayerCreationVoiceBack = 0x90, + UIMSG_PlayerCreationVoiceForward = 0x91, UIMSG_StartNPCDialogue = 0xA1, UIMSG_A2 = 0xA2, UIMSG_A3 = 0xA3, @@ -143,8 +157,8 @@ UIMSG_A8 = 0xA8, UIMSG_A9 = 0xA9, UIMSG_AA = 0xAA, - UIMSG_AB = 0xAB, - UIMSG_AC = 0xAC, + UIMSG_SelectFacePlayerBack = 0xAB, + UIMSG_SelectFacePlayerForward = 0xAC, UIMSG_AD = 0xAD, UIMSG_AE = 0xAE, UIMSG_AF = 0xAF, diff -r 1f161a887c69 -r 6b3a5283b107 mm7_5.cpp --- a/mm7_5.cpp Thu Oct 25 09:02:49 2012 +0600 +++ b/mm7_5.cpp Thu Oct 25 16:59:01 2012 +0600 @@ -3416,7 +3416,7 @@ int v42; // [sp-10h] [bp-20h]@36 int v43; // [sp-10h] [bp-20h]@56 int uNum; // [sp+4h] [bp-Ch]@3 - UIMessageType v45; // [sp+8h] [bp-8h]@3 + UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3 int v46; // [sp+Ch] [bp-4h]@3 Player *pPlayer; @@ -3427,8 +3427,8 @@ pPlayer = pParty->pPlayers; do { - pMessageQueue_50CBD0->PopMessage(&v45, &uNum, &v46); - switch (v45) + pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &uNum, &v46); + switch (pUIMessageType) { case UIMSG_MainMenu_ShowPartyCreationWnd: { @@ -3469,15 +3469,14 @@ } - switch (v45) + switch (pUIMessageType) { case UIMSG_A5: // WINDOW_5A { //main menu save/load wnd clicking on savegame lines if (pGUIWindow_CurrentMenu->field_40 == 1) pKeyActionMap->_459ED1(0); - if ( pCurrentScreen != 11 - || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) + if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != uNum + dword_6A0C9C ) { //load clicked line v26 = uNum + dword_6A0C9C; @@ -3504,18 +3503,17 @@ case UIMSG_A4: { - GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, - pGUIWindow_CurrentMenu->uFrameY + 302, + GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_5E, (int)ptr_69BD64, 0); } continue; } - if ( (signed int)v45 > 75 ) - { - if ( v45 > UIMSG_A3 ) - { - if ( v45 == UIMSG_A6 ) + if ( (signed int)pUIMessageType > 75 ) + { + if ( pUIMessageType > UIMSG_A3 ) + { + if ( pUIMessageType == UIMSG_A6 ) { v43 = 0; v39 = (int)ptr_69BD60; @@ -3527,7 +3525,7 @@ GUIWindow::Create(v18, v8, v33, v35, v37, v39, v43); continue; } - if ( v45 == UIMSG_AB ) // sellect face -1 + if ( pUIMessageType == UIMSG_SelectFacePlayerBack ) { pPlayer = &pParty->pPlayers[uNum]; v12 = (char)((int)pPlayer->uFace - 1) < 0; @@ -3547,9 +3545,11 @@ //v0 = pAudioPlayer; pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0.0, 0); v22 = pPlayer; - goto LABEL_117; - } - if ( v45 == UIMSG_AC ) //sellect face +1 + v22->PlaySound(102, 0); + v1 = (char *)pParty->pPlayers; + continue; + } + if ( pUIMessageType == UIMSG_SelectFacePlayerForward ) { pPlayer = &pParty->pPlayers[uNum]; v20 = (char)((int)pPlayer->uFace + 1) % 20; @@ -3567,29 +3567,27 @@ //v0 = pAudioPlayer; pAudioPlayer->PlaySound((SoundID)66, 0, 0, -1, 0, 0, 0, 0); v22 = pPlayer; -LABEL_117: v22->PlaySound(102, 0); v1 = (char *)pParty->pPlayers; continue; } - if ( v45 == UIMSG_AD ) //Press NEW + if ( pUIMessageType == UIMSG_AD ) { GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnNew, 0); SetCurrentMenuID(MENU_LOAD); continue; } - if ( v45 != 174 )//Press EXIT + if ( pUIMessageType != UIMSG_AE ) continue; GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, (enum WindowType)90, (int)pMainMenu_BtnExit, 0); LABEL_114: v40 = 10; LABEL_89: v2 = v40; -LABEL_90: SetCurrentMenuID((MENU_STATE)v2); continue; } - if ( v45 == UIMSG_A3 ) + if ( pUIMessageType == UIMSG_A3 ) { ++dword_6A0C9C; if ( dword_6A0C9C >= uNum ) @@ -3602,7 +3600,7 @@ v8 = pGUIWindow_CurrentMenu->uFrameY + 323; goto LABEL_105; } - if ( v45 == 107 ) + if ( pUIMessageType == UIMSG_6B ) { if ( pCurrentScreen ) { @@ -3617,7 +3615,7 @@ pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; goto LABEL_93; } - if ( v45 == UIMSG_CloseBook ) + if ( pUIMessageType == UIMSG_CloseBook ) { if ( ptr_507BDC ) { @@ -3659,8 +3657,7 @@ } v16 = GetCurrentMenuID() == 8; v17 = pCurrentScreen; - if ( v16 - && !pCurrentScreen ) + if ( v16 && !pCurrentScreen ) goto LABEL_83; if ( pCurrentScreen == 12 ) { @@ -3692,12 +3689,11 @@ } else { - if ( v45 == 118 ) - { - v14 = uNum; + if ( pUIMessageType == UIMSG_PlayerCreationSelectQuality ) + { pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; - uPlayerCreationUI_SelectedCharacter = v14; + uPlayerCreationUI_SelectedCharacter = uNum; LABEL_36: v42 = 0; v38 = 0; @@ -3711,7 +3707,7 @@ pAudioPlayer->PlaySound(pSoundID, v30, v31, v32, v34, v36, v38, v42); continue; } - if ( v45 == 144 ) + if ( pUIMessageType == UIMSG_PlayerCreationVoiceBack ) { v9 = &pPlayer[uNum]; v46 = v9->GetSexByVoice(); @@ -3726,7 +3722,7 @@ v11 = pCreationUI_BtnPressLeft2[uNum]; goto LABEL_60; } - if ( v45 == 145 ) + if ( pUIMessageType == UIMSG_PlayerCreationVoiceForward ) { v9 = &pPlayer[uNum]; v46 = v9->GetSexByVoice(); @@ -3743,7 +3739,7 @@ v9->PlaySound(102, 0); continue; } - if ( v45 == UIMSG_A2 ) + if ( pUIMessageType == UIMSG_A2 ) { --dword_6A0C9C; if ( dword_6A0C9C < 0 ) @@ -3760,7 +3756,7 @@ } else { - if ( v45 == 75 ) //sellect quality + if ( pUIMessageType == UIMSG_PlayerCreationRemoveDownSkill ) { uPlayerCreationUI_SelectedCharacter = uNum; v41 = 3; @@ -3769,9 +3765,9 @@ + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * uNum; goto LABEL_44; } - if ( (signed int)v45 > 60 ) - { - if ( v45 == 62 ) //click + + if ( (signed int)pUIMessageType > UIMSG_3C ) + { + if ( pUIMessageType == UIMSG_PlayerCreationClickPlus ) { GUIWindow::Create(613, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnPlus, 1); (&pPlayer[uPlayerCreationUI_SelectedCharacter])->IncreaseAttribute( @@ -3786,7 +3782,7 @@ pSoundID = (SoundID)20; goto LABEL_40; } - if ( v45 == 63 ) // click - + if ( pUIMessageType == UIMSG_PlayerCreationClickMinus ) { GUIWindow::Create(523, 393, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnMinus, 1); (&pPlayer[uPlayerCreationUI_SelectedCharacter])->DecreaseAttribute( @@ -3801,7 +3797,7 @@ pSoundID = (SoundID)23; goto LABEL_40; } - if ( v45 == 64 ) // sellect active skill + if ( pUIMessageType == UIMSG_PlayerCreationSelectActiveSkill ) { auto _t = &pPlayer[uPlayerCreationUI_SelectedCharacter]; v6 = _t->GetSkillIdxByOrder(uNum + 4); @@ -3817,34 +3813,34 @@ pSoundID = (SoundID)24; goto LABEL_40; } - if ( v45 == 65 ) + if ( pUIMessageType == UIMSG_41 ) { (&pPlayer[uPlayerCreationUI_SelectedCharacter])->Reset(0); goto LABEL_36; } - if ( v45 == 66 ) // click ok - { - GUIWindow::Create(0x244u, 0x1AFu, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); + if ( pUIMessageType == UIMSG_PlayerCreationClickOK ) + { + GUIWindow::Create(580, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnOK, 0); if ( PlayerCreation_ComputeAttributeBonus() || !sub_4908DE() ) GameUI_StatusBar_TimedStringTimeLeft = GetTickCount() + 4000; else uGameState = 6; continue; } - if ( v45 == 67 ) // click reset - { - GUIWindow::Create(0x20Fu, 0x1AFu, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); + if ( pUIMessageType == UIMSG_PlayerCreationClickReset ) + { + GUIWindow::Create(527, 431, 0, 0, (enum WindowType)90, (int)pPlayerCreationUI_BtnReset, 0); pParty->Reset(); } else { - if ( v45 == 74 ) + if ( pUIMessageType == UIMSG_PlayerCreationRemoveUpSkill ) { uPlayerCreationUI_SelectedCharacter = uNum; v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem; v46 = pGUIWindow_CurrentMenu->pStartingPosActiveItem; v41 = 2; - v5 = (v4 % 7) + v46 + 7 * uNum; + v5 = v4 % 7 + v46 + 7 * uNum; LABEL_44: pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5; pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41) @@ -3855,7 +3851,7 @@ } else { - switch ( v45 ) + switch ( pUIMessageType ) { case 60: pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0); @@ -3871,7 +3867,7 @@ pMouse->SetCursorBitmap("MICON2"); break; default: - if ( v45 == 58 ) + if ( pUIMessageType == 58 ) goto LABEL_114; break; }