Mercurial > mm7
comparison Actor.cpp @ 1033:3a5c8df8381d
* UI cleans and moves
* Deleted many junk global variables.
author | Nomad |
---|---|
date | Tue, 21 May 2013 23:44:51 +0200 |
parents | 9ac94d00012e |
children | 7f8be9f9769e |
comparison
equal
deleted
inserted
replaced
1031:f93d17337113 | 1033:3a5c8df8381d |
---|---|
224 } | 224 } |
225 } | 225 } |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 //----- (00445D4A) -------------------------------------------------------- | |
230 void Actor::InitializeDialogue(int bPlayerSaysHello) | |
231 { | |
232 NPCData *pNPCInfo; // ebp@1 | |
233 int v9; // esi@8 | |
234 int pNumberContacts; // eax@11 | |
235 char pContainer[32]; // [sp+14h] [bp-28h]@3 | |
236 | |
237 dword_A74CDC = -1; | |
238 dword_AE336C = -1; | |
239 pEventTimer->Pause(); | |
240 pMiscTimer->Pause(); | |
241 pAudioPlayer->StopChannels(-1, -1); | |
242 uDialogueType = 0; | |
243 sDialogue_SpeakingActorNPC_ID = this->sNPC_ID; | |
244 pDialogue_SpeakingActor = this; | |
245 pNPCInfo = GetNPCData(this->sNPC_ID); | |
246 if ( (pNPCInfo->uFlags & 3) != 2 ) | |
247 pNPCInfo->uFlags = pNPCInfo->uFlags + 1; | |
248 | |
249 switch (pParty->alignment) | |
250 { | |
251 case PartyAlignment_Good: sprintf(pContainer, "evt%02d-b", const_2()); break; | |
252 case PartyAlignment_Neutral: sprintf(pContainer, "evt%02d", const_2()); break; | |
253 case PartyAlignment_Evil: sprintf(pContainer, "evt%02d-c", const_2()); break; | |
254 } | |
255 | |
256 pDialogueNPCCount = 0; | |
257 uNumDialogueNPCPortraits = 1; | |
258 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
259 sprintf(pContainer, "npc%03u", pNPCInfo->uPortraitID); | |
260 v9 = 0; | |
261 pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | |
262 dword_591084 = areWeLoadingTexture; | |
263 uTextureID_right_panel_loop = uTextureID_right_panel; | |
264 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 ) | |
265 { | |
266 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame | |
267 || (pNumberContacts = pNPCInfo->uFlags & 0xFFFFFF7F, (pNumberContacts & 0x80000000u) != 0) ) | |
268 { | |
269 v9 = 1; | |
270 } | |
271 else | |
272 { | |
273 if ( pNumberContacts > 1 ) | |
274 { | |
275 if ( pNumberContacts == 2 ) | |
276 { | |
277 v9 = 3; | |
278 } | |
279 else | |
280 { | |
281 if ( pNumberContacts != 3 ) | |
282 { | |
283 if ( pNumberContacts != 4 ) | |
284 v9 = 1; | |
285 } | |
286 else | |
287 { | |
288 v9 = 2; | |
289 } | |
290 } | |
291 } | |
292 else if ( pNPCInfo->rep ) | |
293 { | |
294 v9 = 2; | |
295 } | |
296 } | |
297 } | |
298 if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) != 0 ) | |
299 v9 = 4; | |
300 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, v9, 0);//pNumberContacts = 1, v9 = 0; pNumberContacts = 2, v9 = 3; | |
301 if (pNPCInfo->Hired()) | |
302 { | |
303 if ( !pNPCInfo->bHasUsedTheAbility ) | |
304 { | |
305 if ( pNPCInfo->uProfession >= 10 ) | |
306 { | |
307 if ( pNPCInfo->uProfession <= 12 || pNPCInfo->uProfession > 32 && (pNPCInfo->uProfession <= 34 | |
308 || pNPCInfo->uProfession > 38 && (pNPCInfo->uProfession <= 43 || pNPCInfo->uProfession == 52)) ) | |
309 { | |
310 pDialogueWindow->CreateButton(480, 250, 140, LOBYTE(pFontArrus->uFontHeight) - 3, 1, 0, UIMSG_SelectNPCDialogueOption, 9, 0, "", 0); | |
311 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); | |
312 } | |
313 } | |
314 } | |
315 } | |
316 | |
317 pDialogueWindow->CreateButton( 61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | |
318 pDialogueWindow->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | |
319 pDialogueWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | |
320 pDialogueWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | |
321 | |
322 if (bPlayerSaysHello && uActiveCharacter && !pNPCInfo->Hired()) | |
323 { | |
324 if (pParty->uCurrentHour < 5 || pParty->uCurrentHour > 21) | |
325 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodEvening, 0); | |
326 else | |
327 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodDay, 0); | |
328 } | |
329 } | |
330 | 229 |
331 //----- (0040894B) -------------------------------------------------------- | 230 //----- (0040894B) -------------------------------------------------------- |
332 bool Actor::CanAct() | 231 bool Actor::CanAct() |
333 { | 232 { |
334 signed int v1; // esi@1 | 233 signed int v1; // esi@1 |