comparison mm7_5.cpp @ 1031:f93d17337113

UI stuff.
author Nomad
date Tue, 21 May 2013 14:34:14 +0200
parents c94d6a37d298
children 3a5c8df8381d
comparison
equal deleted inserted replaced
1030:7735bdb3c30f 1031:f93d17337113
622 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0); 622 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0);
623 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0); 623 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0);
624 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0); 624 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0);
625 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0); 625 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0);
626 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0); 626 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0);
627 dword_506E68 = -1; 627 uGameMenuUI_CurentlySelectedKeyIdx = -1;
628 KeyboardPageNum = 1; 628 KeyboardPageNum = 1;
629 memset(KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray)); 629 memset(GameMenuUI_InvaligKeyBindingsFlags, 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
630 //*(_WORD *)KeyButtonArray[28] = 0; 630 //*(_WORD *)KeyButtonArray[28] = 0;
631 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u); 631 memcpy(pPrevVirtualCidesMapping, pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
632 //v1 = ""; 632 //v1 = "";
633 //v0 = 1; 633 //v0 = 1;
634 continue; 634 continue;
635 case UIMSG_ChangeKeyButton: 635 case UIMSG_ChangeKeyButton:
636 if ( dword_506E68 != -1 ) 636 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
637 { 637 {
638 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 638 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
639 continue; 639 continue;
640 } 640 }
641 v14 = uMessageParam; 641 v14 = uMessageParam;
642 if ( KeyboardPageNum != 1 ) 642 if ( KeyboardPageNum != 1 )
643 v14 = uMessageParam + 14; 643 v14 = uMessageParam + 14;
644 dword_506E68 = v14; 644 uGameMenuUI_CurentlySelectedKeyIdx = v14;
645 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu); 645 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
646 continue; 646 continue;
647 case UIMSG_ResetKeyMapping: 647 case UIMSG_ResetKeyMapping:
648 v197 = 1; 648 v197 = 1;
649 pKeyActionMap->SetDefaultMapping(); 649 pKeyActionMap->SetDefaultMapping();
667 } 667 }
668 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction); 668 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
669 v18 = uAction++; 669 v18 = uAction++;
670 v13 = uAction > 28; 670 v13 = uAction > 28;
671 v12 = uAction - 28 < 0; 671 v12 = uAction - 28 < 0;
672 KeyButtonFlagChangesArray[v18] = 0; 672 GameMenuUI_InvaligKeyBindingsFlags[v18] = 0;
673 } 673 }
674 while ( v12 ^ v13 ); 674 while ( v12 ^ v13 );
675 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); 675 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
676 continue; 676 continue;
677 case UIMSG_SelectKeyPage1: 677 case UIMSG_SelectKeyPage1:
1197 //v30 = uGammaPos; 1197 //v30 = uGammaPos;
1198 //v31 = "GammaPos"; 1198 //v31 = "GammaPos";
1199 WriteWindowsRegistryInt("GammaPos", uGammaPos); 1199 WriteWindowsRegistryInt("GammaPos", uGammaPos);
1200 stru_506E40.Release(); 1200 stru_506E40.Release();
1201 break; 1201 break;
1202
1202 case SCREEN_KEYBOARD_OPTIONS://Return to game 1203 case SCREEN_KEYBOARD_OPTIONS://Return to game
1203 v197 = 1; 1204 v197 = 1;
1204 v32 = 0; 1205 v32 = 0;
1205 while ( KeyButtonFlagChangesArray[v32] != 1 ) 1206 while ( !GameMenuUI_InvaligKeyBindingsFlags[v32])
1206 { 1207 {
1207 ++v32; 1208 ++v32;
1208 if ( v32 >= 28 ) 1209 if ( v32 >= 28 )
1209 { 1210 {
1210 thisb = (signed int)&uTextureID_Optkb; 1211 thisb = (signed int)&uTextureID_Optkb;
1212 assert(false && "Invalid condition values");
1211 do 1213 do
1212 { 1214 {
1213 if ( *(int *)thisb ) 1215 if ( *(int *)thisb )
1214 pIcons_LOD->pTextures[*(int *)thisb].Release(); 1216 pIcons_LOD->pTextures[*(int *)thisb].Release();
1215 thisb += 4; 1217 thisb += 4;
1216 } 1218 }
1217 while ( thisb < (signed int)&dword_507C08 ); 1219 while ( thisb < (signed int)0x00507C08 );
1220
1218 memset(&uTextureID_Optkb, 0, 0x14u); 1221 memset(&uTextureID_Optkb, 0, 0x14u);
1219 pIcons_LOD->SyncLoadedFilesCount(); 1222 pIcons_LOD->SyncLoadedFilesCount();
1220 uAction = 0; 1223 uAction = 0;
1221 do 1224 do
1222 { 1225 {
10063 } 10066 }
10064 10067
10065 10068
10066 10069
10067 //----- (004156F0) -------------------------------------------------------- 10070 //----- (004156F0) --------------------------------------------------------
10068 void __cdecl GUI_UpdateWindows() 10071 void GUI_UpdateWindows()
10069 { 10072 {
10070 GUIWindow *pWindow; // esi@4 10073 GUIWindow *pWindow; // esi@4
10071 unsigned int pWindowType; // eax@4 10074 unsigned int pWindowType; // eax@4
10072 char *pHint; // edx@66 10075 char *pHint; // edx@66
10073 GUIButton *pButtonPtr_1C; // ebp@79 10076 GUIButton *pButtonPtr_1C; // ebp@79
10111 CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]); 10114 CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]);
10112 continue; 10115 continue;
10113 } 10116 }
10114 case WINDOW_Options: 10117 case WINDOW_Options:
10115 { 10118 {
10116 DrawGameOptions(); 10119 GameMenuUI_Options_Draw();
10117 continue; 10120 continue;
10118 } 10121 }
10119 case WINDOW_Book: 10122 case WINDOW_Book:
10120 { 10123 {
10121 BookUI_Draw((WindowType)(int)pWindow->ptr_1C); 10124 BookUI_Draw((WindowType)(int)pWindow->ptr_1C);