comparison mm7_2.cpp @ 547:4475d81889e6

BankDialog clean
author zipi
date Sun, 03 Mar 2013 19:47:48 +0000
parents 0193f10fecbf
children 0ca16f606be8
comparison
equal deleted inserted replaced
546:0193f10fecbf 547:4475d81889e6
317 _this.uFrameZ = 334; 317 _this.uFrameZ = 334;
318 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 318 *(int *)v13 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
319 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 319 *(int *)v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
320 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank); 320 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[25], pParty->uNumGoldInBank);
321 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u); 321 _this.DrawTitleText(pFontArrus, 0, 0xDCu, v14[0], pTmpBuf, 3u);
322 if ( dword_F8B19C != 1 ) 322 switch(dword_F8B19C)
323 { 323 {
324 if ( dword_F8B19C == 7 ) 324 case 1:
325 { 325 {
326 v0 = window_SpeakInHouse; 326 v8 = v14[0];
327 if ( window_SpeakInHouse->field_40 != 1 ) 327 if ( pDialogueWindow->pCurrentPosActiveItem != 2 )
328 { 328 v8 = v13[0];
329 v1 = window_SpeakInHouse->field_40 - 2; 329 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u);
330 if ( window_SpeakInHouse->field_40 == 2 ) 330 v9 = v14[0];
331 { 331 if ( pDialogueWindow->pCurrentPosActiveItem != 3 )
332 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); 332 v9 = v13[0];
333 v7 = v6; 333 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u);
334 if ( !v6 ) 334 break;
335 { 335 }
336 LABEL_17: 336 case 7:
337 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); 337 {
338 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) 338 v0 = window_SpeakInHouse;
339 { 339 if ( window_SpeakInHouse->field_40 != 1 )
340 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113; 340 {
341 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; 341 v1 = window_SpeakInHouse->field_40 - 2;
342 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 342 if ( window_SpeakInHouse->field_40 == 2 )
343 ++pMessageQueue_50CBD0->uNumMessages; 343 {
344 }*/ 344 v6 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
345 return; 345 v7 = v6;
346 } 346 if ( !v6 )
347 if ( v6 > pParty->uNumGold ) 347 {
348 { 348 //LABEL_17:
349 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); 349 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
350 v7 = pParty->uNumGold; 350 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
351 } 351 {
352 if ( v7 ) 352 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)113;
353 { 353 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1;
354 Party::TakeGold(v7); 354 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
355 pParty->uNumGoldInBank += v7; 355 ++pMessageQueue_50CBD0->uNumMessages;
356 if ( uActiveCharacter ) 356 }*/
357 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0); 357 return;
358 } 358 }
359 v0 = window_SpeakInHouse; 359 if ( v6 > pParty->uNumGold )
360 LABEL_16: 360 {
361 v0->field_40 = 0; 361 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
362 goto LABEL_17; 362 v7 = pParty->uNumGold;
363 } 363 }
364 LABEL_15: 364 if ( v7 )
365 if ( v1 != 1 ) 365 {
366 return; 366 Party::TakeGold(v7);
367 goto LABEL_16; 367 pParty->uNumGoldInBank += v7;
368 } 368 if ( uActiveCharacter )
369 v11 = pGlobalTXT_LocalizationStrings[112]; 369 pPlayers[uActiveCharacter]->PlaySound(SPEECH_81, 0);
370 v10 = pGlobalTXT_LocalizationStrings[60]; 370 }
371 } 371 v0 = window_SpeakInHouse;
372 else 372 v0->field_40 = 0;
373 { 373 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
374 if ( dword_F8B19C != 8 ) 374 return;
375 return; 375 }
376 v0 = window_SpeakInHouse; 376 if ( v1 != 1 )
377 if ( window_SpeakInHouse->field_40 != 1 ) 377 return;
378 { 378 v0->field_40 = 0;
379 v1 = window_SpeakInHouse->field_40 - 2; 379 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
380 if ( window_SpeakInHouse->field_40 == 2 ) 380 return;
381 { 381 }
382 window_SpeakInHouse->field_40 = 0; 382 v11 = pGlobalTXT_LocalizationStrings[112];
383 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer); 383 v10 = pGlobalTXT_LocalizationStrings[60];
384 v3 = v2; 384 sprintf(pTmpBuf, "%s\n%s", v10, v11);
385 if ( v2 ) 385 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
386 { 386 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
387 if ( v2 > pParty->uNumGoldInBank ) 387 v4 = pFontArrus;
388 { 388 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
389 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2); 389 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
390 v3 = pParty->uNumGoldInBank; 390 break;
391 } 391 }
392 if ( v3 ) 392
393 { 393 case 8:
394 Party::SetGold(pParty->uNumGold + v3); 394 {
395 pParty->uNumGoldInBank -= v3; 395 v0 = window_SpeakInHouse;
396 } 396 if ( window_SpeakInHouse->field_40 != 1 )
397 } 397 {
398 goto LABEL_17; 398 v1 = window_SpeakInHouse->field_40 - 2;
399 } 399 if ( window_SpeakInHouse->field_40 == 2 )
400 goto LABEL_15; 400 {
401 } 401 window_SpeakInHouse->field_40 = 0;
402 v11 = pGlobalTXT_LocalizationStrings[112]; 402 v2 = atoi((const char *)pKeyActionMap->pPressedKeysBuffer);
403 v10 = pGlobalTXT_LocalizationStrings[244]; 403 v3 = v2;
404 } 404 if ( v2 )
405 sprintf(pTmpBuf, "%s\n%s", v10, v11); 405 {
406 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u); 406 if ( v2 > pParty->uNumGoldInBank )
407 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u); 407 {
408 v4 = pFontArrus; 408 HousePlaySomeSound((unsigned int)window_SpeakInHouse->ptr_1C, 2);
409 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer); 409 v3 = pParty->uNumGoldInBank;
410 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4); 410 }
411 return; 411 if ( v3 )
412 } 412 {
413 v8 = v14[0]; 413 Party::SetGold(pParty->uNumGold + v3);
414 if ( pDialogueWindow->pCurrentPosActiveItem != 2 ) 414 pParty->uNumGoldInBank -= v3;
415 v8 = v13[0]; 415 }
416 _this.DrawTitleText(pFontArrus, 0, 0x92u, v8, pGlobalTXT_LocalizationStrings[60], 3u); 416 }
417 v9 = v14[0]; 417 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
418 if ( pDialogueWindow->pCurrentPosActiveItem != 3 ) 418 return;
419 v9 = v13[0]; 419 }
420 _this.DrawTitleText(pFontArrus, 0, 0xB0u, v9, pGlobalTXT_LocalizationStrings[244], 3u); 420 if ( v1 != 1 )
421 return;
422 v0->field_40 = 0;
423 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
424 return;
425 }
426 v11 = pGlobalTXT_LocalizationStrings[112];
427 v10 = pGlobalTXT_LocalizationStrings[244];
428 sprintf(pTmpBuf, "%s\n%s", v10, v11);
429 _this.DrawTitleText(pFontArrus, 0, 0x92u, v14[0], pTmpBuf, 3u);
430 _this.DrawTitleText(pFontArrus, 0, 0xBAu, v13[0], (const char *)pKeyActionMap->pPressedKeysBuffer, 3u);
431 v4 = pFontArrus;
432 v5 = pFontArrus->GetLineWidth((const char *)pKeyActionMap->pPressedKeysBuffer);
433 _this.DrawFlashingInputCursor(v5 / 2 + 80, 185, v4);
434 return;
435 break;
436 }
437
438 default:
439 {
440 break;
441 }
442 }
421 } 443 }
422 // F8B19C: using guessed type int dword_F8B19C; 444 // F8B19C: using guessed type int dword_F8B19C;
423 445
424 //----- (004B8285) -------------------------------------------------------- 446 //----- (004B8285) --------------------------------------------------------
425 void __cdecl TavernDialog() 447 void __cdecl TavernDialog()