comparison UI/UIMainMenu.cpp @ 1671:4bbb80c7dba7

Merge
author Ritor1
date Wed, 18 Sep 2013 20:04:49 +0600
parents bd28d08e2c75 c586fa9e4cbb
children 2a5f2aaec367
comparison
equal deleted inserted replaced
1670:014eb02bd0e6 1671:4bbb80c7dba7
13 #include "..\PaletteManager.h" 13 #include "..\PaletteManager.h"
14 #include "..\IconFrameTable.h" 14 #include "..\IconFrameTable.h"
15 #include "..\texts.h" 15 #include "..\texts.h"
16 16
17 #include "..\mm7_data.h" 17 #include "..\mm7_data.h"
18
19 18
20 19
21 //----- (0041B578) -------------------------------------------------------- 20 //----- (0041B578) --------------------------------------------------------
22 void MainMenuUI_LoadFontsAndSomeStuff() 21 void MainMenuUI_LoadFontsAndSomeStuff()
23 { 22 {
66 } 65 }
67 66
68 //----- (0041B690) -------------------------------------------------------- 67 //----- (0041B690) --------------------------------------------------------
69 void MainMenuUI_Create() 68 void MainMenuUI_Create()
70 { 69 {
71 Texture *v6; // ST78_4@1 70 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC"));
72 //const char *v7; // ST5C_4@1 71 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB"));
73 unsigned __int8 v8; // al@1 72 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA"));
74 //Texture *v9; // ST60_4@1 73 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC"));
75 Texture *v10; // ST78_4@1 74 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB"));
76 //const char *v11; // ST5C_4@1 75 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA"));
77 unsigned __int8 v12; // al@1 76
78 //Texture *v13; // ST60_4@1 77 pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE);
79 unsigned int v14; // eax@1 78 pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE);
80 Texture *v15; // ST78_4@1 79 pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE);
81 //const char *v16; // ST5C_4@1 80 pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE);
82 unsigned __int8 v17; // al@1 81 pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE);
83 //Texture *v18; // ST60_4@1 82 pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE);
84 unsigned int uTextureID_ib_td4_A; // eax@1 83 pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE);
85 Texture *v20; // ST78_4@1 84 pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE);
86 unsigned __int8 v22; // al@1 85
87 //Texture *v23; // ST60_4@1 86 uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE);
88 Texture *v24; // eax@1 87 uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE);
89 //Texture *v25; // esi@1 88 uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE);
90 //Texture *v26; // ST60_4@1 89 uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE);
91 //const char *v27; // ST5C_4@1 90 uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE);
92 unsigned __int8 v28; // al@1 91 uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE);
93 Texture *v29; // eax@1 92 uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE);
94 //Texture *v30; // esi@1 93 uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE);
95 //Texture *v31; // ST60_4@1 94 uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE);
96 //const char *v32; // ST5C_4@1 95 uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE);
97 unsigned __int8 v33; // al@1 96 uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE);
98 97 pTexture_Leather = pIcons_LOD->LoadTexturePtr("ibground", TEXTURE_16BIT_PALETTE);
99 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC")); 98 uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE);
100 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB")); 99 uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE);
101 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA")); 100 uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE);
102 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC")); 101 uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE);
103 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); 102 uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE);
104 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); 103 uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE);
105 104
106 pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); 105 pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0);
107 pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); 106 pPrimaryWindow->CreateButton(7, 8, 460, 343, 1, 0, UIMSG_MouseLeftClickInGame, 0, 0, "", 0);
108 pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); 107
109 pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); 108 pPrimaryWindow->CreateButton(61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
110 pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); 109 pPrimaryWindow->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
111 pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); 110 pPrimaryWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
112 pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); 111 pPrimaryWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
113 pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); 112
114 113 pPrimaryWindow->CreateButton(24, 404, 5, 49, 1, 93, UIMSG_0, 1, 0, "", 0);
115 uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); 114 pPrimaryWindow->CreateButton(139, 404, 5, 49, 1, 93, UIMSG_0, 2, 0, "", 0);
116 uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); 115 pPrimaryWindow->CreateButton(255, 404, 5, 49, 1, 93, UIMSG_0, 3, 0, "", 0);
117 uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); 116 pPrimaryWindow->CreateButton(370, 404, 5, 49, 1, 93, UIMSG_0, 4, 0, "", 0);
118 uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); 117
119 uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); 118 pPrimaryWindow->CreateButton(97, 404, 5, 49, 1, 93, UIMSG_0, 1, 0, "", 0);
120 uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); 119 pPrimaryWindow->CreateButton(212, 404, 5, 49, 1, 93, UIMSG_0, 2, 0, "", 0);
121 uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); 120 pPrimaryWindow->CreateButton(328, 404, 5, 49, 1, 93, UIMSG_0, 3, 0, "", 0);
122 uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); 121 pPrimaryWindow->CreateButton(443, 404, 5, 49, 1, 93, UIMSG_0, 4, 0, "", 0);
123 uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); 122
124 uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); 123 uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE);
125 uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); 124 pBtn_Quests = pPrimaryWindow->CreateButton(491, 353, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)->uTextureWidth,
126 pTexture_Leather = pIcons_LOD->LoadTexturePtr("ibground", TEXTURE_16BIT_PALETTE); 125 pIcons_LOD->GetTexture(uTextureID_ib_td1_A)->uTextureHeight, 1, 0, UIMSG_OpenQuestBook, 0, pKeyActionMap->GetActionVKey(INPUT_Quest),
127 uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); 126 pGlobalTXT_LocalizationStrings[174], pIcons_LOD->GetTexture(uTextureID_ib_td1_A), 0); //Quests
128 uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); 127
129 uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); 128 uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE);
130 uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); 129 pBtn_Autonotes = pPrimaryWindow->CreateButton(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)->uTextureWidth,
131 uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); 130 pIcons_LOD->GetTexture(uTextureID_ib_td2_A)->uTextureHeight, 1, 0, UIMSG_OpenAutonotes, 0, pKeyActionMap->GetActionVKey(INPUT_Autonotes),
132 uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); 131 pGlobalTXT_LocalizationStrings[154], pIcons_LOD->GetTexture(uTextureID_ib_td2_A), 0);//Autonotes
133 132
134 pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); 133 uTextureID_ib_td3_A = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE);
135 pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, UIMSG_MouseLeftClickInGame, 0, 0, "", 0); 134 pBtn_Maps = pPrimaryWindow->CreateButton(546, 353, pIcons_LOD->GetTexture(uTextureID_ib_td3_A)->uTextureWidth,
136 pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); 135 pIcons_LOD->GetTexture(uTextureID_ib_td3_A)->uTextureHeight, 1, 0, UIMSG_OpenMapBook, 0, pKeyActionMap->GetActionVKey(INPUT_Mapbook),
137 pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); 136 pGlobalTXT_LocalizationStrings[139], pIcons_LOD->GetTexture(uTextureID_ib_td3_A), 0); //Maps
138 pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); 137
139 pPrimaryWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); 138 uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE);
140 pPrimaryWindow->CreateButton(0x18u, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 1, 0, "", 0); 139 pBtn_Calendar = pPrimaryWindow->CreateButton(570, 353, pIcons_LOD->GetTexture(uTextureID_ib_td4_A)->uTextureWidth,
141 pPrimaryWindow->CreateButton(0x8Bu, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 2, 0, "", 0); 140 pIcons_LOD->GetTexture(uTextureID_ib_td4_A)->uTextureHeight, 1, 0, UIMSG_OpenCalendar, 0, pKeyActionMap->GetActionVKey(INPUT_TimeCal),
142 pPrimaryWindow->CreateButton(0xFFu, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 3, 0, "", 0); 141 pGlobalTXT_LocalizationStrings[78], pIcons_LOD->GetTexture(uTextureID_ib_td4_A), 0);//Calendar
143 pPrimaryWindow->CreateButton(0x172u, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 4, 0, "", 0); 142
144 pPrimaryWindow->CreateButton(0x61u, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 1, 0, "", 0); 143 uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE);
145 pPrimaryWindow->CreateButton(0xD4u, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 2, 0, "", 0); 144 pBtn_History = pPrimaryWindow->CreateButton(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureWidth,
146 pPrimaryWindow->CreateButton(0x148u, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 3, 0, "", 0); 145 pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureHeight, 1, 0, UIMSG_OpenHistoryBook, 0, 72,//ascii
147 pPrimaryWindow->CreateButton(0x1BBu, 0x194u, 5u, 0x31u, 1, 93, UIMSG_0, 4, 0, "", 0); 146 pGlobalTXT_LocalizationStrings[602], pIcons_LOD->GetTexture(uTextureID_ib_td5_A), 0);//History
148 147
149 uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); 148 bFlashAutonotesBook = 0;
150 v6 = pIcons_LOD->GetTexture(uTextureID_ib_td1_A); 149 bFlashQuestBook = 0;
151 v8 = pKeyActionMap->GetActionVKey(INPUT_Quest); 150 bFlashHistoryBook = 0;
152 pBtn_Quests = pPrimaryWindow->CreateButton(0x1EBu, 0x161u, v6->uTextureWidth, v6->uTextureHeight, 1, 0, UIMSG_OpenQuestBook, 0, v8, pGlobalTXT_LocalizationStrings[174], v6, 0); //Quests 151
153 152 pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn].uTextureWidth,
154 uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); 153 pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn].uTextureHeight, 2, 0, UIMSG_ClickZoomInBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomIn),
155 v10 = pIcons_LOD->GetTexture(uTextureID_ib_td2_A); 154 pGlobalTXT_LocalizationStrings[252], &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], 0); // Zoom In
156 v12 = pKeyActionMap->GetActionVKey(INPUT_Autonotes); 155
157 pBtn_Autonotes = pPrimaryWindow->CreateButton(0x20Fu, 0x161u, v10->uTextureWidth, v10->uTextureHeight, 1, 0, UIMSG_OpenAutonotes, 0, v12, pGlobalTXT_LocalizationStrings[154], v10, 0);//Autonotes 156 pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut].uTextureWidth,
158 157 pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut].uTextureHeight, 2, 0, UIMSG_ClickZoomOutBtn, 0, pKeyActionMap->GetActionVKey(INPUT_ZoomOut),
159 v14 = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); 158 pGlobalTXT_LocalizationStrings[251], &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], 0); // Zoom Out
160 v15 = pIcons_LOD->GetTexture(v14); 159
161 v17 = pKeyActionMap->GetActionVKey(INPUT_Mapbook); 160 pPrimaryWindow->CreateButton(481, 0, 153, 67, 1, 92, UIMSG_0, 0, 0, "", 0);
162 pBtn_Maps = pPrimaryWindow->CreateButton(0x222u, 0x161u, v15->uTextureWidth, v15->uTextureHeight, 1, 0, UIMSG_OpenMapBook, 0, v17, pGlobalTXT_LocalizationStrings[139], v15, 0); //Maps 161 pPrimaryWindow->CreateButton(491, 149, 64, 74, 1, 0, UIMSG_StartHireling1Dialogue, 0, '5', "", 0);
163 162 pPrimaryWindow->CreateButton(561, 149, 64, 74, 1, 0, UIMSG_StartHireling2Dialogue, 0, '6', "", 0);
164 uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); 163 pPrimaryWindow->CreateButton(476, 322, 77, 17, 1, 100, UIMSG_0, 0, 0, "", 0);
165 v20 = pIcons_LOD->GetTexture(uTextureID_ib_td4_A); 164 pPrimaryWindow->CreateButton(555, 322, 77, 17, 1, 101, UIMSG_0, 0, 0, "", 0);
166 v22 = pKeyActionMap->GetActionVKey(INPUT_TimeCal); 165
167 pBtn_Calendar = pPrimaryWindow->CreateButton(0x23Au, 0x161u, v20->uTextureWidth, v20->uTextureHeight, 1, 0, UIMSG_OpenCalendar, 0, v22, 166 pBtn_CastSpell = pPrimaryWindow->CreateButton(476, 450,
168 pGlobalTXT_LocalizationStrings[78],//Calendar 167 pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureWidth,
169 v20, 0); 168 pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureHeight,
170 169 1, 0, UIMSG_SpellBookWindow, 0, 67, pGlobalTXT_LocalizationStrings[38], pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell), 0);
171 uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); 170 pBtn_Rest = pPrimaryWindow->CreateButton(518, 450,
172 pBtn_History = pPrimaryWindow->CreateButton(0x258u, 0x169u, 171 pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureWidth,
173 pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureWidth, 172 pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureHeight,
174 pIcons_LOD->GetTexture(uTextureID_ib_td5_A)->uTextureHeight, 173 1, 0, UIMSG_RestWindow, 0, 82, pGlobalTXT_LocalizationStrings[182], pIcons_LOD->GetTexture(uTextureID_Btn_Rest), 0);
175 1, 0, UIMSG_OpenHistoryBook, 0, 0x48u, pGlobalTXT_LocalizationStrings[602],//History 174 pBtn_QuickReference = pPrimaryWindow->CreateButton(560, 450,
176 pIcons_LOD->GetTexture(uTextureID_ib_td5_A), 0); 175 pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureWidth,
177 176 pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureHeight,
178 bFlashAutonotesBook = 0; 177 1, 0, UIMSG_QuickReference, 0, 90, pGlobalTXT_LocalizationStrings[173], pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference), 0);
179 bFlashQuestBook = 0; 178 pBtn_GameSettings = pPrimaryWindow->CreateButton(602, 450,
180 bFlashHistoryBook = 0; 179 pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureWidth,
181 180 pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureHeight,
182 v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; 181 1, 0, UIMSG_GameMenuButton, 0, 0, pGlobalTXT_LocalizationStrings[93], pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings), 0);
183 v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); 182
184 pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, UIMSG_ClickZoomInBtn, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In 183 pBtn_NPCLeft = pPrimaryWindow->CreateButton(469, 178,
185 v24, 0); 184 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth,
186 v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; 185 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight,
187 v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); 186 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0);
188 pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, UIMSG_ClickZoomOutBtn, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out 187 pBtn_NPCRight = pPrimaryWindow->CreateButton(626, 178,
189 v29, 0); 188 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
190 pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, UIMSG_0, 0, 0, "", 0); 189 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
191 pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, UIMSG_StartHireling1Dialogue, 0, '5', "", 0); 190 1, 0, UIMSG_ScrollNPCPanel, 1, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
192 pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, UIMSG_StartHireling2Dialogue, 0, '6', "", 0); 191 LoadPartyBuffIcons();
193 pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, UIMSG_0, 0, 0, "", 0);
194 pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, UIMSG_0, 0, 0, "", 0);
195 pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u,
196 pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureWidth,
197 pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell)->uTextureHeight,
198 1, 0, UIMSG_SpellBookWindow, 0, 0x43u, pGlobalTXT_LocalizationStrings[38], pIcons_LOD->GetTexture(uTextureID_Btn_CastSpell),
199 0);
200 pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u,
201 pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureWidth,
202 pIcons_LOD->GetTexture(uTextureID_Btn_Rest)->uTextureHeight,
203 1, 0, UIMSG_RestWindow, 0, 0x52u, pGlobalTXT_LocalizationStrings[182], pIcons_LOD->GetTexture(uTextureID_Btn_Rest), 0);
204 pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u,
205 pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureWidth,
206 pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference)->uTextureHeight,
207 1, 0, UIMSG_QuickReference, 0, 0x5Au, pGlobalTXT_LocalizationStrings[173], pIcons_LOD->GetTexture(uTextureID_Btn_QuickReference), 0);
208 pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u,
209 pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureWidth,
210 pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings)->uTextureHeight,
211 1, 0, UIMSG_GameMenuButton, 0, 0, pGlobalTXT_LocalizationStrings[93], pIcons_LOD->GetTexture(uTextureID_Btn_GameSettings), 0);
212 pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u,
213 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth,
214 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight,
215 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0);
216 pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u,
217 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureWidth,
218 pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight)->uTextureHeight,
219 1, 0, UIMSG_ScrollNPCPanel, 1u, 0, "", pIcons_LOD->GetTexture(uTextureID_Btn_NPCRight), 0);
220 LoadPartyBuffIcons();
221 } 192 }
222 193
223 //----- (004979D2) -------------------------------------------------------- 194 //----- (004979D2) --------------------------------------------------------
224 MENU_STATE MainMenuUI_Credits_Loop() 195 MENU_STATE MainMenuUI_Credits_Loop()
225 { 196 {
226 char *v0; // eax@5 197 char *v1; // edi@5
227 char *v1; // edi@5 198 FILE *pFile; // eax@5
228 FILE *pFile; // eax@5 199 unsigned int pSize; // esi@7
229 unsigned int pSize; // esi@7 200 __int16 pHeight; // ax@9
230 GUIFont *pFont; // edx@9 201 void *v7; // eax@9
231 GUIFont *pFont2; // ecx@9 202 unsigned int pNumPixels; // ST2C_4@9
232 __int16 pHeight; // ax@9 203 unsigned int v10; // ST2C_4@19
233 void *v7; // eax@9 204 MSG Msg; // [sp+84h] [bp-B8h]@10
234 unsigned int pNumPixels; // ST2C_4@9 205 int v17; // [sp+A0h] [bp-9Ch]@9
235 unsigned int teal; // eax@9 206 GUIWindow credit_window;
236 unsigned int v10; // ST2C_4@19 207 int a5; // [sp+128h] [bp-14h]@1
237 MSG Msg; // [sp+84h] [bp-B8h]@10 208 char *pString; // [sp+12Ch] [bp-10h]@9
238 int v17; // [sp+A0h] [bp-9Ch]@9 209 char *ptr; // [sp+130h] [bp-Ch]@5
239 GUIWindow a2; 210 GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1
240 int pColor2; // [sp+F8h] [bp-44h]@9 211 GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1
241 int pColor1; // [sp+FCh] [bp-40h]@9 212 RGBTexture pTexture; // [sp+54h] [bp-E8h]@1
242 int a5; // [sp+128h] [bp-14h]@1 213 RGBTexture pTexture2; // [sp+100h] [bp-3Ch]@1
243 char *pString; // [sp+12Ch] [bp-10h]@9 214 Texture pTexture3; // [sp+Ch] [bp-130h]@5
244 char *ptr; // [sp+130h] [bp-Ch]@5 215
245 GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1 216 a5 = 0;
246 GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1 217 pFontQuick = LoadFont("quick.fnt", "FONTPAL", NULL);
247 RGBTexture pTexture; // [sp+54h] [bp-E8h]@1 218 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL);
248 RGBTexture pTexture2; // [sp+100h] [bp-3Ch]@1 219 if ( pMessageQueue_50CBD0->uNumMessages )
249 Texture pTexture3; // [sp+Ch] [bp-130h]@5 220 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
250 221 ++pIcons_LOD->uTexturePacksCount;
251 a5 = 0; 222 if ( !pIcons_LOD->uNumPrevLoadedFiles )
252 pFontQuick = LoadFont("quick.fnt", "FONTPAL", NULL); 223 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
253 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL); 224 dword_A74C88 = 0;
254 if ( pMessageQueue_50CBD0->uNumMessages ) 225 pAudioPlayer->PlayMusicTrack(MUSIC_Credits);
255 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 226 pTexture.Load("mm6title.pcx", 0);
256 ++pIcons_LOD->uTexturePacksCount; 227 ptr = (char *)pEvents_LOD->LoadRaw("credits.txt", 0);
257 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 228 v1 = ptr;
258 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 229 pFile = pEvents_LOD->FindContainer("credits.txt", 0);
259 dword_A74C88 = 0; 230 if ( !pFile )
260 pAudioPlayer->PlayMusicTrack(MUSIC_Credits); 231 Error(pGlobalTXT_LocalizationStrings[63]); // "Might and Magic VII is having trouble loading files.
261 pTexture.Load("mm6title.pcx", 0); 232
262 v0 = (char *)pEvents_LOD->LoadRaw("credits.txt", 0); 233 // Please re-install to fix this problem. Note: Re-installing will not destroy your save games."
263 v1 = v0; 234 fread(&pTexture3, 1, 0x30, pFile);
264 ptr = v0; 235 pSize = pTexture3.uDecompressedSize;
265 pFile = pEvents_LOD->FindContainer("credits.txt", 0); 236 if ( !pTexture3.uDecompressedSize )
266 if ( !pFile ) 237 pSize = pTexture3.uTextureSize;
267 Error(pGlobalTXT_LocalizationStrings[63]); // "Might and Magic VII is having trouble loading files. 238 memset(&pTexture3, 0, 0x48);
268 239 v1[pSize] = 0;
269 // Please re-install to fix this problem. Note: Re-installing will not destroy your save games." 240
270 fread(&pTexture3, 1, 0x30, pFile); 241 credit_window.uFrameWidth = 250;
271 pSize = pTexture3.uDecompressedSize; 242 credit_window.uFrameHeight = 440;
272 if ( !pTexture3.uDecompressedSize ) 243 credit_window.uFrameX = 389;
273 pSize = pTexture3.uTextureSize; 244 credit_window.uFrameY = 19;
274 memset(&pTexture3, 0, 0x48); 245
275 pFont = pFontCChar; 246 pTexture2.uWidth = 250;
276 pFont2 = pFontQuick; 247 pHeight = pFontQuick->GetStringHeight2(pFontCChar, v1, &credit_window, 0, 1);
277 v1[pSize] = 0; 248 pTexture2.uHeight = pHeight + 2 * credit_window.uFrameHeight;
278 249 pTexture2.uNumPixels = (signed __int16)pTexture2.uWidth * (signed __int16)pTexture2.uHeight;
279 a2.uFrameWidth = 250; 250 v7 = malloc(2 * pTexture2.uNumPixels);//, "scrollermap");
280 a2.uFrameHeight = 440; 251 pNumPixels = pTexture2.uNumPixels;
281 a2.uFrameX = 389; 252 pTexture2.pPixels = (unsigned __int16 *)v7;
282 a2.uFrameY = 19; 253 fill_pixels_fast(TargetColor(0, 0xFFu, 0xFFu), pTexture2.pPixels, pNumPixels);
283 254 pTexture2._allocation_flags = 0;
284 pTexture2.uWidth = 250; 255 pString = (char *)malloc(2 * pSize);
285 pHeight = pFont2->GetStringHeight2(pFont, v1, &a2, 0, 1); 256 strncpy(pString, ptr, pSize);
286 pTexture2.uHeight = pHeight + 2 * a2.uFrameHeight; 257 pString[pSize]=0;
287 pTexture2.uNumPixels = (signed __int16)pTexture2.uWidth * (signed __int16)pTexture2.uHeight; 258 pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, credit_window.uFrameHeight, (signed __int16)pTexture2.uWidth,
288 v7 = malloc(2 * pTexture2.uNumPixels);//, "scrollermap"); 259 (signed __int16)pTexture2.uHeight, TargetColor(0x70u, 0x8Fu, 0xFEu), TargetColor(0xECu, 0xE6u, 0x9Cu), pString, pTexture2.pPixels,
289 pNumPixels = pTexture2.uNumPixels; 260 (signed __int16)pTexture2.uWidth);
290 pTexture2.pPixels = (unsigned __int16 *)v7; 261 free(pString);
291 teal = TargetColor(0, 0xFFu, 0xFFu); 262 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, ptr);
292 fill_pixels_fast(teal, pTexture2.pPixels, pNumPixels); 263 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 0x1Bu, "", 0);
293 pTexture2._allocation_flags = 0; 264 pCurrentScreen = SCREEN_CREATORS;
294 pColor1 = TargetColor(0x70u, 0x8Fu, 0xFEu); 265 SetCurrentMenuID(MENU_CREDITSPROC);
295 pColor2 = TargetColor(0xECu, 0xE6u, 0x9Cu); 266 do
296 pString = (char *)malloc(2 * pSize); 267 {
297 strncpy(pString, ptr, pSize); 268 while ( PeekMessageA(&Msg, 0, 0, 0, 1) )
298 pString[pSize]=0; 269 {
299 pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a2.uFrameHeight, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1, 270 if ( Msg.message == 18 )
300 pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth); 271 Game_DeinitializeAndTerminate(0);
301 free(pString); 272 TranslateMessage(&Msg);
302 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, ptr); 273 DispatchMessageA(&Msg);
303 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 0x1Bu, "", 0); 274 }
304 pCurrentScreen = SCREEN_CREATORS; 275 if ( BYTE1(dword_6BE364_game_settings_1) & 1 )
305 SetCurrentMenuID(MENU_CREDITSPROC); 276 {
306 do 277 WaitMessage();
307 { 278 }
308 while ( PeekMessageA(&Msg, 0, 0, 0, 1) ) 279 else
309 { 280 {
310 if ( Msg.message == 18 ) 281 pRenderer->BeginScene();
311 Game_DeinitializeAndTerminate(0); 282 pRenderer->DrawTextureRGB(0, 0, &pTexture);
312 TranslateMessage(&Msg); 283 pRenderer->SetTextureClipRect(credit_window.uFrameX, credit_window.uFrameY, credit_window.uFrameX + credit_window.uFrameWidth,
313 DispatchMessageA(&Msg); 284 credit_window.uFrameY + credit_window.uFrameHeight);
314 } 285 pRenderer->_4A5D33(credit_window.uFrameX, credit_window.uFrameY, 0, a5, &pTexture2);
315 if ( BYTE1(dword_6BE364_game_settings_1) & 1 ) 286 pRenderer->ResetTextureClipRect();
316 { 287 pRenderer->EndScene();
317 WaitMessage(); 288 ++a5;
318 } 289 if ( a5 >= (signed __int16)pTexture2.uHeight )
319 else 290 SetCurrentMenuID(MENU_MAIN);
320 { 291 pRenderer->Present();
321 pRenderer->BeginScene(); 292 pCurrentScreen = SCREEN_GAME;//Ritor1: temporarily, must be corrected GUI_MainMenuMessageProc()
322 pRenderer->DrawTextureRGB(0, 0, &pTexture); 293 GUI_MainMenuMessageProc();
323 pRenderer->SetTextureClipRect(a2.uFrameX, a2.uFrameY, a2.uFrameX + a2.uFrameWidth, a2.uFrameY + a2.uFrameHeight); 294 }
324 pRenderer->_4A5D33(a2.uFrameX, a2.uFrameY, 0, a5, &pTexture2); 295 }
325 pRenderer->ResetTextureClipRect(); 296 while ( GetCurrentMenuID() == MENU_CREDITSPROC );
326 pRenderer->EndScene(); 297 pAudioPlayer->_4AA258(1);
327 ++a5; 298 free(ptr);
328 if ( a5 >= (signed __int16)pTexture2.uHeight ) 299 free(pFontQuick);
329 SetCurrentMenuID(MENU_MAIN); 300 free(pFontCChar);
330 pRenderer->Present(); 301 pWindow_MainMenu->Release();
331 pCurrentScreen = SCREEN_GAME;//Ritor1: temporarily, must be corrected GUI_MainMenuMessageProc() 302 pIcons_LOD->RemoveTexturesPackFromTextureList();
332 GUI_MainMenuMessageProc(); 303 pTexture.Release();
333 } 304 pTexture2.Release();
334 } 305 return MENU_MAIN; // return MENU_Main
335 while ( GetCurrentMenuID() == MENU_CREDITSPROC ); 306 }
336 pAudioPlayer->_4AA258(1);
337 free(ptr);
338 free(pFontQuick);
339 free(pFontCChar);
340 pWindow_MainMenu->Release();
341 pIcons_LOD->RemoveTexturesPackFromTextureList();
342 pTexture.Release();
343 pTexture2.Release();
344 return MENU_MAIN; // return MENU_Main
345 }