Mercurial > mm7
diff mm7_4.cpp @ 832:dfd683c4f538
Hotkeys fixed
Moved GUIButton.h to GUIWindow.h
author | Nomad |
---|---|
date | Wed, 27 Mar 2013 19:50:37 +0200 |
parents | 08d90b633131 |
children | ceef50611567 710cf848ad24 |
line wrap: on
line diff
--- a/mm7_4.cpp Wed Mar 27 15:04:59 2013 +0200 +++ b/mm7_4.cpp Wed Mar 27 19:50:37 2013 +0200 @@ -6,7 +6,6 @@ #include "MapInfo.h" #include "Game.h" #include "GUIWindow.h" -#include "GUIButton.h" #include "GUIFont.h" #include "Party.h" #include "AudioPlayer.h" @@ -7341,7 +7340,7 @@ while ( 1 ) { v16 = v52.GetControl(v56); - v17 = v16->uControlParam; + v17 = v16->msg_param; pInString = (char *)v16; if ( (signed int)v17 > 24 ) { @@ -7398,7 +7397,7 @@ v15 = (char *)pNPCTopics[v23-1].pTopic;//(&dword_721660)[8 * v23]; if ( !v15 ) { - v16->uControlParam = 0; + v16->msg_param = 0; v15 = ""; } goto LABEL_49; @@ -7418,7 +7417,7 @@ v15 = (char *)pNPCTopics[v58->evt_B-1].pTopic;//(&dword_721660)[8 * v58->evtb]; if ( !v15 ) { - v16->uControlParam = 0; + v16->msg_param = 0; v15 = ""; } if ( uDialogueType != 84 ) @@ -7537,7 +7536,7 @@ //----- (004B36CC) -------------------------------------------------------- void CreateButtonInColumn( int column_pos, unsigned int control_id ) { - pDialogueWindow->CreateButton( 480, 30 * column_pos + 146, 140, 30, 1, 0, 0x195u, control_id, 0, "", 0); + pDialogueWindow->CreateButton( 480, 30 * column_pos + 146, 140, 30, 1, 0, UIMSG_SelectShopDialogueOption, control_id, 0, "", 0); } //----- (004B3A72) -------------------------------------------------------- @@ -7798,10 +7797,10 @@ pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 1, 0); if ( pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) { - pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, 136, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); + pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0); v1 = 1; } - pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять + pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); } @@ -7813,10 +7812,10 @@ ContractSelectText(pEventCode); pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, pEventCode, 0); - pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], - (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); - pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); - pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); + pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7, 0x1BD, 0xA9, 0x23, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], // Cancel + pIcons_LOD->GetTexture(uExitCancelTextureId), 0); + pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); + pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x52u, 0, pGlobalTXT_LocalizationStrings[122], 0); pDialogueWindow->_41D08F(1, 1, 0, 2); dialog_menu_id = HOUSE_DIALOGUE_OTHER; } @@ -7835,14 +7834,14 @@ pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); v2 = ""; - pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, + pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); - pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); + pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); if ( contract_approved ) v2 = pGlobalTXT_LocalizationStrings[535]; - pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Fu, 0, v2, 0); + pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0); pDialogueWindow->_41D08F(1, 1, 0, 2); dialog_menu_id = HOUSE_DIALOGUE_OTHER; } @@ -7859,18 +7858,18 @@ v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); - pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, 0x71u, 0, 0, + pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], //"Cancel" (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); - pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, "", 0); + pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); if ( pNPCStats->pProfessions[v1->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v1->uProfession) ) { - pDialogueWindow->CreateButton( 0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Du, 0, + pDialogueWindow->CreateButton( 0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//"More Information" v0 = 1; } - pDialogueWindow->CreateButton( 0x1E0u, 30 * v0 + 160, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x4Cu, 0, + pDialogueWindow->CreateButton( 0x1E0u, 30 * v0 + 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0); //"Hire" pDialogueWindow->_41D08F(v0 + 1, 1, 0, 2); dialog_menu_id = HOUSE_DIALOGUE_OTHER; @@ -7897,14 +7896,14 @@ pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); sprintfex(sHouseName, pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S], pMapStats->pInfos[uHouse_ExitPic].pName); - pBtn_ExitCancel = pDialogueWindow->CreateButton( 566, 445, 75, 33, 1, 0, 0x71u, 0, 0x4Eu, + pBtn_ExitCancel = pDialogueWindow->CreateButton( 566, 445, 75, 33, 1, 0, UIMSG_Escape, 0, 0x4Eu, pGlobalTXT_LocalizationStrings[34],// "Cancel" (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0),0); - pBtn_YES = pDialogueWindow->CreateButton( 486u, 445u, 75u, 33u, 1, 0, 0xBFu, 1u, 0x59u, + pBtn_YES = pDialogueWindow->CreateButton( 486u, 445u, 75u, 33u, 1, 0, UIMSG_BF, 1u, 0x59u, sHouseName, (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0), 0); - pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, 0xBFu, 1u, 0x20u, sHouseName, 0); - pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, 0xBFu, 1u, 0x59u, sHouseName, 0); + pDialogueWindow->CreateButton( pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63u, 73u, 1, 0, UIMSG_BF, 1u, 0x20u, sHouseName, 0); + pDialogueWindow->CreateButton(8u, 8u, 460u, 344u, 1, 0, UIMSG_BF, 1u, 0x59u, sHouseName, 0); } else { @@ -7919,10 +7918,10 @@ ((GUIButton *)HouseNPCData[i + 7])->Release(); } pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); - pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, 0x71u, 0, 0, + pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[74],// "End Conversation" (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0); - pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, 0x51u, 0, 0, "", 0); + pDialogueWindow->CreateButton(8u, 8u, 0x1C2u, 0x140u, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); if ( pDialogueNPCCount == 1 && dword_591080 ) { sub_4B3B42(in_current_building_type); @@ -7932,7 +7931,7 @@ if ( v17->joins ) { num_menu_buttons = 1; - pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, 0xAFu, 0xDu, 0, "", 0); + pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, UIMSG_ClickNPCTopic, 0xDu, 0, "", 0); } if ( v17->evt_A) { @@ -7940,7 +7939,7 @@ { v6 = NPC_EventProcessor(v17->evt_A); if ( v6 == 1 || v6 == 2 ) - pDialogueWindow->CreateButton( 480u, 30 * num_menu_buttons++ + 160, 140u, 30u, 1, 0, 0xAFu, 0x13u, 0, "", 0); + pDialogueWindow->CreateButton( 480u, 30 * num_menu_buttons++ + 160, 140u, 30u, 1, 0, UIMSG_ClickNPCTopic, 0x13u, 0, "", 0); } } if ( v17->evt_B ) @@ -7949,7 +7948,7 @@ { v8 = NPC_EventProcessor(v17->evt_B); if ( v8 == 1 || v8 == 2 ) - pDialogueWindow->CreateButton( 480u, 30 * num_menu_buttons++ + 160, 140u, 30u, 1, 0, 0xAFu, 0x14u, 0, "", 0); + pDialogueWindow->CreateButton( 480u, 30 * num_menu_buttons++ + 160, 140u, 30u, 1, 0, UIMSG_ClickNPCTopic, 0x14u, 0, "", 0); } } if ( v17->evt_C ) @@ -7958,7 +7957,7 @@ { v10 = NPC_EventProcessor(v17->evt_C); if ( v10 == 1 || v10 == 2 ) - pDialogueWindow->CreateButton( 480u, 30 * num_menu_buttons++ + 160, 140u, 30u, 1, 0, 0xAFu, 0x15u, 0, "", 0); + pDialogueWindow->CreateButton( 480u, 30 * num_menu_buttons++ + 160, 140u, 30u, 1, 0, UIMSG_ClickNPCTopic, 0x15u, 0, "", 0); } } @@ -7968,7 +7967,7 @@ { v12 = NPC_EventProcessor(v17->evt_D); if ( v12 == 1 || v12 == 2 ) - pDialogueWindow->CreateButton( 0x1E0u, 30 * num_menu_buttons++ + 160, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x16u, 0, "", 0); + pDialogueWindow->CreateButton( 0x1E0u, 30 * num_menu_buttons++ + 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x16u, 0, "", 0); } } if ( v17->evt_E ) @@ -7977,7 +7976,7 @@ { v14 = NPC_EventProcessor(v17->evt_E); if ( v14 == 1 || v14 == 2 ) - pDialogueWindow->CreateButton( 0x1E0u, 30 * num_menu_buttons++ + 160, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x17u, 0, "", 0); + pDialogueWindow->CreateButton( 0x1E0u, 30 * num_menu_buttons++ + 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x17u, 0, "", 0); } } if ( v17->evt_F ) @@ -7986,7 +7985,7 @@ { v16 = NPC_EventProcessor(v17->evt_F); if ( v16 == 1 || v16 == 2 ) - pDialogueWindow->CreateButton( 0x1E0u, 30 * num_menu_buttons++ + 160, 0x8Cu, 0x1Eu, 1, 0, 0xAFu, 0x18u, 0, "", 0); + pDialogueWindow->CreateButton( 0x1E0u, 30 * num_menu_buttons++ + 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x18u, 0, "", 0); } } pDialogueWindow->_41D08F(num_menu_buttons, 1, 0, 2); @@ -8481,7 +8480,7 @@ goto LABEL_40; do { - v11 = v8->GetControl(v35)->uControlParam - 36; + v11 = v8->GetControl(v35)->msg_param - 36; if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] ) { v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0); @@ -8517,7 +8516,7 @@ do { v14 = v8->GetControl(v35); - v15 = v14->uControlParam - 36; + v15 = v14->msg_param - 36; if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] ) { v16 = 0;