comparison UiGame.cpp @ 783:b27dd658ea77

Taveling by foot fixed.
author Nomad
date Sun, 24 Mar 2013 21:14:28 +0200
parents 585490c29945
children 7bb33867d2cb
comparison
equal deleted inserted replaced
778:64cef5a0782a 783:b27dd658ea77
379 } 379 }
380 380
381 381
382 382
383 //----- (0041C047) -------------------------------------------------------- 383 //----- (0041C047) --------------------------------------------------------
384 void __cdecl GameUI_DrawStatusBar_2() 384 void __cdecl GameUI_Footer_2()
385 { 385 {
386 unsigned int v0; // eax@1 386 unsigned int v0; // eax@1
387 char *v1; // edx@2 387 char *v1; // edx@2
388 unsigned int v2; // ST18_4@5 388 unsigned int v2; // ST18_4@5
389 const char *v3; // ST0C_4@5 389 const char *v3; // ST0C_4@5
390 unsigned int v4; // ST08_4@5 390 unsigned int v4; // ST08_4@5
391 int v5; // eax@5 391 int v5; // eax@5
392 392
393 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); 393 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar);
394 if ( GameUI_StatusBar_TimedStringTimeLeft ) 394 if ( GameUI_Footer_TimeLeft )
395 { 395 {
396 v1 = GameUI_StatusBar_TimedString; 396 v1 = GameUI_Footer_TimedString;
397 } 397 }
398 else 398 else
399 { 399 {
400 if ( !pStatusBarString[0] ) 400 if ( !pFooterString[0] )
401 return; 401 return;
402 v1 = pStatusBarString; 402 v1 = pFooterString;
403 } 403 }
404 LOWORD(v0) = uGameUIFontShadow; 404 LOWORD(v0) = uGameUIFontShadow;
405 v2 = v0; 405 v2 = v0;
406 LOWORD(v0) = uGameUIFontMain; 406 LOWORD(v0) = uGameUIFontMain;
407 v3 = v1; 407 v3 = v1;
416 const char *v1; // esi@1 416 const char *v1; // esi@1
417 int i; // eax@7 417 int i; // eax@7
418 int j; // eax@11 418 int j; // eax@11
419 419
420 v1 = pStr; 420 v1 = pStr;
421 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) 421 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_Footer_TimeLeft) )
422 { 422 {
423 if ( GameUI_StatusBar_TimedStringTimeLeft ) 423 if ( GameUI_Footer_TimeLeft )
424 { 424 {
425 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); 425 for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
426 i > 450; 426 i > 450;
427 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) 427 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString) )
428 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; 428 byte_5C3427[strlen(GameUI_Footer_TimedString)] = 0;
429 } 429 }
430 else 430 else
431 { 431 {
432 strcpy(pStatusBarString, v1); 432 strcpy(pFooterString, v1);
433 for ( j = pFontLucida->GetLineWidth(pStatusBarString); 433 for ( j = pFontLucida->GetLineWidth(pFooterString);
434 j > 450; 434 j > 450;
435 j = pFontLucida->GetLineWidth(pStatusBarString) ) 435 j = pFontLucida->GetLineWidth(pFooterString) )
436 GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; 436 GameUI_Footer_TimedString[strlen(pFooterString) + 199] = 0;
437 } 437 }
438 } 438 }
439 } 439 }
440 440
441 //----- (0041C179) -------------------------------------------------------- 441 //----- (0041C179) --------------------------------------------------------
442 void __cdecl GameUI_DrawStatusBar() 442 void GameUI_Footer()
443 { 443 {
444 unsigned int v0; // ebp@1 444 unsigned int v0; // ebp@1
445 char *v1; // edi@5 445 char *v1; // edi@5
446 int v2; // eax@5 446 int v2; // eax@5
447 unsigned int v3; // esi@5 447 unsigned int v3; // esi@5
448 size_t v4; // eax@6 448 size_t v4; // eax@6
453 char v9; // zf@12 453 char v9; // zf@12
454 unsigned int v10; // ST08_4@13 454 unsigned int v10; // ST08_4@13
455 int v11; // eax@13 455 int v11; // eax@13
456 456
457 v0 = uGameUIFontShadow; 457 v0 = uGameUIFontShadow;
458 if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) 458 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter )
459 { 459 {
460 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); 460 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar);
461 if ( GameUI_StatusBar_TimedStringTimeLeft ) 461 if ( GameUI_Footer_TimeLeft )
462 { 462 {
463 v1 = GameUI_StatusBar_TimedString; 463 v1 = GameUI_Footer_TimedString;
464 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); 464 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
465 v3 = 450; 465 v3 = 450;
466 while ( v2 > 450 ) 466 while ( v2 > 450 )
467 { 467 {
468 v4 = strlen(GameUI_StatusBar_TimedString); 468 v4 = strlen(GameUI_Footer_TimedString);
469 v5 = pFontLucida; 469 v5 = pFontLucida;
470 byte_5C3427[v4] = 0; 470 byte_5C3427[v4] = 0;
471 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); 471 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString);
472 } 472 }
473 } 473 }
474 else 474 else
475 { 475 {
476 v1 = pStatusBarString; 476 v1 = pFooterString;
477 v6 = pFontLucida->GetLineWidth(pStatusBarString); 477 v6 = pFontLucida->GetLineWidth(pFooterString);
478 v3 = 450; 478 v3 = 450;
479 while ( v6 > 450 ) 479 while ( v6 > 450 )
480 { 480 {
481 v7 = strlen(pStatusBarString); 481 v7 = strlen(pFooterString);
482 v8 = pFontLucida; 482 v8 = pFontLucida;
483 GameUI_StatusBar_TimedString[v7 + 199] = 0; 483 GameUI_Footer_TimedString[v7 + 199] = 0;
484 v6 = pFontLucida->GetLineWidth(pStatusBarString); 484 v6 = pFontLucida->GetLineWidth(pFooterString);
485 } 485 }
486 } 486 }
487 v9 = *v1 == 0; 487 v9 = *v1 == 0;
488 bForceDrawStatusBar = 0; 488 bForceDrawFooter = 0;
489 if ( !v9 ) 489 if ( !v9 )
490 { 490 {
491 v10 = uGameUIFontMain; 491 v10 = uGameUIFontMain;
492 v11 = pFontLucida->AlignText_Center(v3, v1); 492 v11 = pFontLucida->AlignText_Center(v3, v1);
493 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); 493 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0);
494 } 494 }
495 } 495 }
496 } 496 }
497 // 5C35BC: using guessed type int bForceDrawStatusBar; 497 // 5C35BC: using guessed type int bForceDrawFooter;
498 498
499 499
500 //----- (00420EFF) -------------------------------------------------------- 500 //----- (00420EFF) --------------------------------------------------------
501 void __cdecl GameUI_WritePointedObjectStatusString() 501 void __cdecl GameUI_WritePointedObjectStatusString()
502 { 502 {
570 pMouse->uPointingObjectID = 0; 570 pMouse->uPointingObjectID = 0;
571 if ( pMouse->uPointingObjectID == 0 ) 571 if ( pMouse->uPointingObjectID == 0 )
572 { 572 {
573 if ( uLastPointedObjectID != 0 ) 573 if ( uLastPointedObjectID != 0 )
574 { 574 {
575 pStatusBarString[0] = 0; 575 pFooterString[0] = 0;
576 bForceDrawStatusBar = 1; 576 bForceDrawFooter = 1;
577 } 577 }
578 } 578 }
579 uLastPointedObjectID = pMouse->uPointingObjectID; 579 uLastPointedObjectID = pMouse->uPointingObjectID;
580 return; 580 return;
581 } 581 }
597 uLastPointedObjectID = 1; 597 uLastPointedObjectID = 1;
598 if ( pMouse->uPointingObjectID == 0 ) 598 if ( pMouse->uPointingObjectID == 0 )
599 { 599 {
600 if ( uLastPointedObjectID != 0 ) 600 if ( uLastPointedObjectID != 0 )
601 { 601 {
602 pStatusBarString[0] = 0; 602 pFooterString[0] = 0;
603 bForceDrawStatusBar = 1; 603 bForceDrawFooter = 1;
604 } 604 }
605 } 605 }
606 uLastPointedObjectID = pMouse->uPointingObjectID; 606 uLastPointedObjectID = pMouse->uPointingObjectID;
607 return; 607 return;
608 } 608 }
615 sub_41C0B8_set_status_string(v26); 615 sub_41C0B8_set_status_string(v26);
616 if ( pMouse->uPointingObjectID == 0 ) 616 if ( pMouse->uPointingObjectID == 0 )
617 { 617 {
618 if ( uLastPointedObjectID != 0 ) 618 if ( uLastPointedObjectID != 0 )
619 { 619 {
620 pStatusBarString[0] = 0; 620 pFooterString[0] = 0;
621 bForceDrawStatusBar = 1; 621 bForceDrawFooter = 1;
622 } 622 }
623 } 623 }
624 uLastPointedObjectID = pMouse->uPointingObjectID; 624 uLastPointedObjectID = pMouse->uPointingObjectID;
625 return; 625 return;
626 } 626 }
647 sub_41C0B8_set_status_string(v26); 647 sub_41C0B8_set_status_string(v26);
648 if ( pMouse->uPointingObjectID == 0 ) 648 if ( pMouse->uPointingObjectID == 0 )
649 { 649 {
650 if ( uLastPointedObjectID != 0 ) 650 if ( uLastPointedObjectID != 0 )
651 { 651 {
652 pStatusBarString[0] = 0; 652 pFooterString[0] = 0;
653 bForceDrawStatusBar = 1; 653 bForceDrawFooter = 1;
654 } 654 }
655 } 655 }
656 uLastPointedObjectID = pMouse->uPointingObjectID; 656 uLastPointedObjectID = pMouse->uPointingObjectID;
657 return; 657 return;
658 } 658 }
662 { 662 {
663 if ( pMouse->uPointingObjectID == 0 ) 663 if ( pMouse->uPointingObjectID == 0 )
664 { 664 {
665 if ( uLastPointedObjectID != 0 ) 665 if ( uLastPointedObjectID != 0 )
666 { 666 {
667 pStatusBarString[0] = 0; 667 pFooterString[0] = 0;
668 bForceDrawStatusBar = 1; 668 bForceDrawFooter = 1;
669 } 669 }
670 } 670 }
671 uLastPointedObjectID = pMouse->uPointingObjectID; 671 uLastPointedObjectID = pMouse->uPointingObjectID;
672 return; 672 return;
673 } 673 }
677 sub_41C0B8_set_status_string(v26); 677 sub_41C0B8_set_status_string(v26);
678 if ( pMouse->uPointingObjectID == 0 ) 678 if ( pMouse->uPointingObjectID == 0 )
679 { 679 {
680 if ( uLastPointedObjectID != 0 ) 680 if ( uLastPointedObjectID != 0 )
681 { 681 {
682 pStatusBarString[0] = 0; 682 pFooterString[0] = 0;
683 bForceDrawStatusBar = 1; 683 bForceDrawFooter = 1;
684 } 684 }
685 } 685 }
686 uLastPointedObjectID = pMouse->uPointingObjectID; 686 uLastPointedObjectID = pMouse->uPointingObjectID;
687 return; 687 return;
688 } 688 }
702 uLastPointedObjectID = 1; 702 uLastPointedObjectID = 1;
703 if ( pMouse->uPointingObjectID == 0 ) 703 if ( pMouse->uPointingObjectID == 0 )
704 { 704 {
705 if ( uLastPointedObjectID != 0 ) 705 if ( uLastPointedObjectID != 0 )
706 { 706 {
707 pStatusBarString[0] = 0; 707 pFooterString[0] = 0;
708 bForceDrawStatusBar = 1; 708 bForceDrawFooter = 1;
709 } 709 }
710 } 710 }
711 uLastPointedObjectID = pMouse->uPointingObjectID; 711 uLastPointedObjectID = pMouse->uPointingObjectID;
712 return; 712 return;
713 } 713 }
717 sub_41C0B8_set_status_string(v26); 717 sub_41C0B8_set_status_string(v26);
718 if ( pMouse->uPointingObjectID == 0 ) 718 if ( pMouse->uPointingObjectID == 0 )
719 { 719 {
720 if ( uLastPointedObjectID != 0 ) 720 if ( uLastPointedObjectID != 0 )
721 { 721 {
722 pStatusBarString[0] = 0; 722 pFooterString[0] = 0;
723 bForceDrawStatusBar = 1; 723 bForceDrawFooter = 1;
724 } 724 }
725 } 725 }
726 uLastPointedObjectID = pMouse->uPointingObjectID; 726 uLastPointedObjectID = pMouse->uPointingObjectID;
727 return; 727 return;
728 } 728 }
739 uLastPointedObjectID = 1; 739 uLastPointedObjectID = 1;
740 if ( pMouse->uPointingObjectID == 0 ) 740 if ( pMouse->uPointingObjectID == 0 )
741 { 741 {
742 if ( uLastPointedObjectID != 0 ) 742 if ( uLastPointedObjectID != 0 )
743 { 743 {
744 pStatusBarString[0] = 0; 744 pFooterString[0] = 0;
745 bForceDrawStatusBar = 1; 745 bForceDrawFooter = 1;
746 } 746 }
747 } 747 }
748 uLastPointedObjectID = pMouse->uPointingObjectID; 748 uLastPointedObjectID = pMouse->uPointingObjectID;
749 return; 749 return;
750 } 750 }
754 sub_41C0B8_set_status_string(v26); 754 sub_41C0B8_set_status_string(v26);
755 if ( pMouse->uPointingObjectID == 0 ) 755 if ( pMouse->uPointingObjectID == 0 )
756 { 756 {
757 if ( uLastPointedObjectID != 0 ) 757 if ( uLastPointedObjectID != 0 )
758 { 758 {
759 pStatusBarString[0] = 0; 759 pFooterString[0] = 0;
760 bForceDrawStatusBar = 1; 760 bForceDrawFooter = 1;
761 } 761 }
762 } 762 }
763 uLastPointedObjectID = pMouse->uPointingObjectID; 763 uLastPointedObjectID = pMouse->uPointingObjectID;
764 return; 764 return;
765 } 765 }
770 uLastPointedObjectID = 1; 770 uLastPointedObjectID = 1;
771 if ( pMouse->uPointingObjectID == 0 ) 771 if ( pMouse->uPointingObjectID == 0 )
772 { 772 {
773 if ( uLastPointedObjectID != 0 ) 773 if ( uLastPointedObjectID != 0 )
774 { 774 {
775 pStatusBarString[0] = 0; 775 pFooterString[0] = 0;
776 bForceDrawStatusBar = 1; 776 bForceDrawFooter = 1;
777 } 777 }
778 } 778 }
779 uLastPointedObjectID = pMouse->uPointingObjectID; 779 uLastPointedObjectID = pMouse->uPointingObjectID;
780 return; 780 return;
781 } 781 }
784 //goto _return; 784 //goto _return;
785 if ( pMouse->uPointingObjectID == 0 ) 785 if ( pMouse->uPointingObjectID == 0 )
786 { 786 {
787 if ( uLastPointedObjectID != 0 ) 787 if ( uLastPointedObjectID != 0 )
788 { 788 {
789 pStatusBarString[0] = 0; 789 pFooterString[0] = 0;
790 bForceDrawStatusBar = 1; 790 bForceDrawFooter = 1;
791 } 791 }
792 } 792 }
793 uLastPointedObjectID = pMouse->uPointingObjectID; 793 uLastPointedObjectID = pMouse->uPointingObjectID;
794 return; 794 return;
795 } 795 }
799 pMouse->uPointingObjectID = 0; 799 pMouse->uPointingObjectID = 0;
800 if ( pMouse->uPointingObjectID == 0 ) 800 if ( pMouse->uPointingObjectID == 0 )
801 { 801 {
802 if ( uLastPointedObjectID != 0 ) 802 if ( uLastPointedObjectID != 0 )
803 { 803 {
804 pStatusBarString[0] = 0; 804 pFooterString[0] = 0;
805 bForceDrawStatusBar = 1; 805 bForceDrawFooter = 1;
806 } 806 }
807 } 807 }
808 uLastPointedObjectID = pMouse->uPointingObjectID; 808 uLastPointedObjectID = pMouse->uPointingObjectID;
809 return; 809 return;
810 } 810 }
823 //goto _return; 823 //goto _return;
824 if ( pMouse->uPointingObjectID == 0 ) 824 if ( pMouse->uPointingObjectID == 0 )
825 { 825 {
826 if ( uLastPointedObjectID != 0 ) 826 if ( uLastPointedObjectID != 0 )
827 { 827 {
828 pStatusBarString[0] = 0; 828 pFooterString[0] = 0;
829 bForceDrawStatusBar = 1; 829 bForceDrawFooter = 1;
830 } 830 }
831 } 831 }
832 uLastPointedObjectID = pMouse->uPointingObjectID; 832 uLastPointedObjectID = pMouse->uPointingObjectID;
833 return; 833 return;
834 } 834 }
964 //goto _return; 964 //goto _return;
965 if ( pMouse->uPointingObjectID == 0 ) 965 if ( pMouse->uPointingObjectID == 0 )
966 { 966 {
967 if ( uLastPointedObjectID != 0 ) 967 if ( uLastPointedObjectID != 0 )
968 { 968 {
969 pStatusBarString[0] = 0; 969 pFooterString[0] = 0;
970 bForceDrawStatusBar = 1; 970 bForceDrawFooter = 1;
971 } 971 }
972 } 972 }
973 uLastPointedObjectID = pMouse->uPointingObjectID; 973 uLastPointedObjectID = pMouse->uPointingObjectID;
974 return; 974 return;
975 } 975 }
982 { 982 {
983 if ( pMouse->uPointingObjectID == 0 ) 983 if ( pMouse->uPointingObjectID == 0 )
984 { 984 {
985 if ( uLastPointedObjectID != 0 ) 985 if ( uLastPointedObjectID != 0 )
986 { 986 {
987 pStatusBarString[0] = 0; 987 pFooterString[0] = 0;
988 bForceDrawStatusBar = 1; 988 bForceDrawFooter = 1;
989 } 989 }
990 } 990 }
991 uLastPointedObjectID = pMouse->uPointingObjectID; 991 uLastPointedObjectID = pMouse->uPointingObjectID;
992 return; 992 return;
993 } 993 }
1000 //_return: 1000 //_return:
1001 if ( pMouse->uPointingObjectID == 0 ) 1001 if ( pMouse->uPointingObjectID == 0 )
1002 { 1002 {
1003 if ( uLastPointedObjectID != 0 ) 1003 if ( uLastPointedObjectID != 0 )
1004 { 1004 {
1005 pStatusBarString[0] = 0; 1005 pFooterString[0] = 0;
1006 bForceDrawStatusBar = 1; 1006 bForceDrawFooter = 1;
1007 } 1007 }
1008 } 1008 }
1009 uLastPointedObjectID = pMouse->uPointingObjectID; 1009 uLastPointedObjectID = pMouse->uPointingObjectID;
1010 return; 1010 return;
1011 } 1011 }
1017 { 1017 {
1018 if ( pMouse->uPointingObjectID == 0 ) 1018 if ( pMouse->uPointingObjectID == 0 )
1019 { 1019 {
1020 if ( uLastPointedObjectID != 0 ) 1020 if ( uLastPointedObjectID != 0 )
1021 { 1021 {
1022 pStatusBarString[0] = 0; 1022 pFooterString[0] = 0;
1023 bForceDrawStatusBar = 1; 1023 bForceDrawFooter = 1;
1024 } 1024 }
1025 } 1025 }
1026 uLastPointedObjectID = pMouse->uPointingObjectID; 1026 uLastPointedObjectID = pMouse->uPointingObjectID;
1027 return; 1027 return;
1028 } 1028 }
1033 uLastPointedObjectID = 1; 1033 uLastPointedObjectID = 1;
1034 if ( pMouse->uPointingObjectID == 0 ) 1034 if ( pMouse->uPointingObjectID == 0 )
1035 { 1035 {
1036 if ( uLastPointedObjectID != 0 ) 1036 if ( uLastPointedObjectID != 0 )
1037 { 1037 {
1038 pStatusBarString[0] = 0; 1038 pFooterString[0] = 0;
1039 bForceDrawStatusBar = 1; 1039 bForceDrawFooter = 1;
1040 } 1040 }
1041 } 1041 }
1042 uLastPointedObjectID = pMouse->uPointingObjectID; 1042 uLastPointedObjectID = pMouse->uPointingObjectID;
1043 return; 1043 return;
1044 } 1044 }
1161 //goto _return; 1161 //goto _return;
1162 if ( pMouse->uPointingObjectID == 0 ) 1162 if ( pMouse->uPointingObjectID == 0 )
1163 { 1163 {
1164 if ( uLastPointedObjectID != 0 ) 1164 if ( uLastPointedObjectID != 0 )
1165 { 1165 {
1166 pStatusBarString[0] = 0; 1166 pFooterString[0] = 0;
1167 bForceDrawStatusBar = 1; 1167 bForceDrawFooter = 1;
1168 } 1168 }
1169 } 1169 }
1170 uLastPointedObjectID = pMouse->uPointingObjectID; 1170 uLastPointedObjectID = pMouse->uPointingObjectID;
1171 return; 1171 return;
1172 } 1172 }