Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 00506 00507 00508 00509 00510 00511 00512 00513 00514 00515 00516 00517 00518 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 00549 00550 00551 00552 00553 00554 00555 00556 00557 00558 00559 00560 00561 00562 00563 00564 00565 00566 00567 00568 00569 00570 00571 00572 00573 00574 00575 00576 00577 00578 00579 00580 00581 00582 00583 00584 00585 00586 00587 00588 00589 00590 00591 00592 00593 00594 00595 00596 00597 00598 00599 00600 00601 00602 00603 00604 00605 00606 00607 00608 00609 00610 00611 00612 00613 00614 00615 00616 00617 00618 00619 00620 00621 00622 00623 00624 00625 00626 00627 00628 00629 00630 00631 00632 00633 00634 00635 00636 00637 00638 00639 00640 00641 00642 00643 00644 00645 00646 00647 00648 00649 00650 00651 00652 00653 00654 00655 00656 00657 00658 00659 00660 00661 00662 00663 00664 00665 00666 00667 00668 00669 00670 00671 00672 00673 00674 00675 00676 00677 00678 00679 00680 00681 00682 00683 00684 00685 00686 00687 00688 00689 00690 00691 00692 00693 00694 00695 00696 00697 00698 00699 00700 00701 00702 00703 00704 00705 00706 00707 00708 00709 00710 00711 00712 00713 00714 00715 00716 00717 00718 00719 00720 00721 00722 00723 00724 00725 00726 00727 00728 00729 00730 00731 00732 00733 00734 00735 00736 00737 00738 00739 00740 00741 00742 00743 00744 00745 00746 00747 00748 00749 00750 00751 00752 00753 00754 00755 00756 00757 00758 00759 00760 00761 00762 00763 00764 00765 00766 00767 00768 00769 00770 00771 00772 00773 00774 00775 00776 00777 00778 00779 00780 00781 00782 00783 00784 00785 00786 00787 00788 00789 00790 00791 00792 00793 00794 00795 00796 00797 00798 00799 00800 00801 00802 00803 00804 00805 00806 00807 00808 00809 00810 00811 00812 00813 00814 00815 00816 00817 00818 00819 00820 00821 00822 00823 00824 00825 00826 00827 00828 00829 00830 00831 00832 00833 00834 00835 00836 00837 00838 00839 00840 00841 00842 00843 00844 00845 00846 00847 00848 00849 00850 00851 00852 00853 00854 00855 00856 00857 00858 00859 00860 00861 00862 00863 00864 00865 00866 00867 00868 00869 00870 00871 00872 00873 00874 00875 00876 00877 00878 00879 00880 00881 00882 00883 00884 00885 00886 00887 00888 00889 00890 00891 00892 00893 00894 00895 00896 00897 00898 00899 00900 00901 00902 00903 00904 00905 00906 00907 00908 00909 00910 00911 00912 00913 00914 00915 00916 00917 00918 00919 00920 00921 00922 00923 00924 00925 00926 00927 00928 00929 00930 00931 00932 00933 00934 00935 00936 00937 00938 00939 00940 00941 00942 00943 00944 00945 00946 00947 00948 00949 00950 00951 00952 00953 00954 00955 00956 00957 00958 00959 00960 00961 00962 00963 00964 00965 00966 00967 00968 00969 00970 00971 00972 00973 00974 00975 00976 00977 00978 00979 00980 00981 00982 00983 00984 00985 00986 00987 00988 00989 00990 00991 00992 00993 00994 00995 00996 00997 00998 00999 01000 01001 01002 01003 01004 01005 01006 01007 01008 01009 01010 01011 01012 01013 01014 01015 01016 01017 01018 01019 01020 01021 01022 01023 01024 01025 01026 01027 01028 01029 01030 01031 01032 01033 01034 01035 01036 01037 01038 01039 01040 01041 01042 01043 01044 01045 01046 01047 01048 01049 01050 01051 01052 01053 01054 01055 01056 01057 01058 01059 01060 01061 01062 01063 01064 01065 01066 01067 01068 01069 01070 01071 01072 01073 01074 01075 01076 01077 01078 01079 01080 01081 01082 01083 01084 01085 01086 01087 01088 01089 01090 01091 01092 01093 01094 01095 01096 01097 01098 01099 01100 01101 01102 01103 01104 01105 01106 01107 01108 01109 01110 01111 01112 01113 01114 01115 01116 01117 01118 01119 01120 01121 01122 01123 01124 01125 01126 01127 01128 01129 01130 01131 01132 01133 01134 01135 01136 01137 01138 01139 01140 01141 01142 01143 01144 01145 01146 01147 01148 01149 01150 01151 01152 01153 01154 01155 01156 01157 01158 01159 01160 01161 01162 01163 01164 01165 01166 01167 01168 01169 01170 01171 01172 01173 01174 01175 01176 01177 01178 01179 01180 01181 01182 01183 01184 01185 01186 01187 01188 01189 01190 01191 01192 01193 01194 01195 01196 01197 01198 01199 01200 01201 01202 01203 01204 01205 01206 01207 01208 01209 01210 01211 01212 01213 01214 01215 01216 01217 01218 01219 01220 01221 01222 01223 01224 01225 01226 01227 01228 01229 01230 01231 01232 01233 01234 01235 01236 01237 01238 01239 01240 01241 01242 01243 01244 01245 01246 01247 01248 01249 01250 01251 01252 01253 01254 01255 01256 01257 01258 01259 01260 01261 01262 01263 01264 01265 01266 01267 01268 01269 01270 01271 01272 01273 01274 01275 01276 01277 01278 01279 01280 01281 01282 01283 01284 01285 01286 01287 01288 01289 01290 01291 01292 01293 01294 01295 01296 01297 01298 01299 01300 01301 01302 01303 01304 01305 01306 01307 01308 01309 01310 01311 01312 01313 01314 01315 01316 01317 01318 01319 01320 01321 01322 01323 01324 01325 01326 01327 01328 01329 01330 01331 01332 01333 01334 01335 01336 01337 01338 01339 01340 01341 01342 01343 01344 01345 01346 01347 01348 01349 01350 01351 01352 01353 01354 01355 01356 01357 01358 01359 01360 01361 01362 01363 01364 01365 01366 01367 01368 01369 01370 01371 01372 01373 01374 01375 01376 01377 01378 01379 01380 01381 01382 01383 01384 01385 01386 01387 01388 01389 01390 01391 01392 01393 01394 01395 01396 01397 01398 01399 01400 01401 01402 01403 01404 01405 01406 01407 01408 01409 01410 01411 01412 01413 01414 01415 01416 01417 01418 01419 01420 01421 01422 01423 01424 01425 01426 01427 01428 01429 01430 01431 01432 01433 01434 01435 01436 01437 01438 01439 01440 01441 01442 01443 01444 01445 01446 01447 01448 01449 01450 01451 01452 01453 01454 01455 01456 01457 01458 01459 01460 01461 01462 01463 01464 01465 01466 01467 01468 01469 01470 01471 01472 01473 01474 01475 01476 01477 01478 01479 01480 01481 01482 01483 01484 01485 01486 01487 01488 01489 01490 01491 01492 01493 01494 01495 01496 01497 01498 01499 01500 01501 01502 01503 01504 01505 01506 01507 01508 01509 01510 01511 01512 01513 01514 01515 01516 01517 01518 01519 01520 01521 01522 01523 01524 01525 01526 01527 01528 01529 01530 01531 01532 01533 01534 01535 01536 01537 01538 01539 01540 01541 01542 01543 01544 01545 01546 01547 01548 01549 01550 01551 01552 01553 01554 01555 01556 01557 01558 01559 01560 01561 01562 01563 01564 01565 01566 01567 01568 01569 01570 01571 01572 01573 01574 01575 01576 01577 01578 01579 01580 01581 01582 01583 01584 01585 01586 01587 01588 01589 01590 01591 01592 01593 01594 01595 01596 01597 01598 01599 01600 01601 01602 01603 01604 01605 01606 01607 01608 01609 01610 01611 01612 01613 01614 01615 01616 01617 01618 01619 01620 01621 01622 01623 01624 01625 01626 01627 01628 01629 01630 01631 01632 01633 01634 01635 01636 01637 01638 01639 01640 01641 01642 01643 01644 01645 01646 01647 01648 01649 01650 01651 01652 01653 01654 01655 01656 01657 01658 01659 01660 01661 01662 01663 01664 01665 01666 01667 01668 01669 01670 01671 01672 01673 01674 01675 01676 01677 01678 01679 01680 01681 01682 01683 01684 01685 01686 01687 01688 01689 01690 01691 01692 01693 01694 01695 01696 01697 01698 01699 01700 01701 01702 01703 01704 01705 01706 01707 01708 01709 01710 01711 01712 01713 01714 01715 01716 01717 01718 01719 01720 01721 01722 01723 01724 01725 01726 01727 01728 01729 01730 01731 01732 01733 01734 01735 01736 01737 01738 01739 01740 01741 01742 01743 01744 01745 01746 01747 01748 01749 01750 01751 01752 01753 01754 01755 01756 01757 01758 01759 01760 01761 01762 01763 01764 01765 01766 01767 01768 01769 01770 01771 01772 01773 01774 01775 01776 01777 01778 01779 01780 01781 01782 01783 01784 01785 01786 01787 01788 01789 01790 01791 01792 01793 01794 01795 01796 01797 01798 01799 01800 01801 01802 01803 01804 01805 01806 01807 01808 01809 01810 01811 01812 01813 01814 01815 01816 01817 01818 01819 01820 01821 01822 01823 01824 01825 01826 01827 01828 01829 01830 01831 01832 01833 01834 01835 01836 01837 01838 01839 01840 01841 01842 01843 01844 01845 01846 01847 01848 01849 01850 01851 01852 01853 01854 01855 01856 01857 01858 01859 01860 01861 01862 01863 01864 01865 01866 01867 01868 01869 01870 01871 01872 01873 01874 01875 01876 01877 01878 01879 01880 01881 01882 01883 01884 01885 01886 01887 01888 01889 01890 01891 01892 01893 01894 01895 01896 01897 01898 01899 01900 01901 01902 01903 01904 01905 01906 01907 01908 01909 01910 01911 01912 01913 01914 01915 01916 01917 01918 01919 01920 01921 01922 01923 01924 01925 01926 01927 01928 01929 01930 01931 01932 01933 01934 01935 01936 01937 01938 01939 01940 01941 01942 01943 01944 01945 01946 01947 01948 01949 01950 01951 01952 01953 01954 01955 01956 01957 01958 01959 01960 01961 01962 01963 01964 01965 01966 01967 01968 01969 01970 01971 01972 01973 01974 01975 01976 01977 01978 01979 01980 01981 01982 01983 01984 01985 01986 01987 01988 01989 01990 01991 01992 01993 01994 01995 01996 01997 01998 01999 02000 02001 02002 02003 02004 02005 02006 02007 02008 02009 02010 02011 02012 02013 02014 02015 02016 02017 02018 02019 02020 02021 02022 02023 02024 02025 02026 02027 02028 02029 02030 02031 02032 02033 02034 02035 02036 02037 02038 02039 02040 02041 02042 02043 02044 02045 02046 02047 02048 02049 02050 02051 02052 02053 02054 02055 02056 02057 02058 02059 02060 02061 02062 02063 02064 02065 02066 02067 02068 02069 02070 02071 02072 02073 02074 02075 02076 |
// ============================================================================ // JBInterfaceScores // Copyright 2003 by Mychaeel <mychaeel@planetjailbreak.com> // $Id: JBInterfaceScores.uc,v 1.32 2011-01-04 18:15:59 wormbo Exp $ // // Scoreboard for Jailbreak. // ============================================================================ class JBInterfaceScores extends ScoreBoardTeamDeathMatch notplaceable; // ============================================================================ // Imports // ============================================================================ #exec texture import file=Textures\SpriteWidgetScores.dds mips=on alpha=on lodset=LODSET_Interface #exec texture import file=Textures\PadlockMapIcon.tga dxt=5 mips=on alpha=on lodset=LODSET_Interface // ============================================================================ // Types // ============================================================================ // ======================================================== // TEntryPosition // // Describes a logical position of an entry in one of the // scoreboard tables. // ======================================================== struct TEntryPosition { var bool bIsSet; // position stored here is valid var int iTable; // table containing entry var int iRow; // row in table for entry var bool bOutside; // coming from or going to outside }; // ======================================================== // TEntryLayout // // Describes the layout of an entry at a given logical // position, realized for the current canvas metrics. // ======================================================== struct TEntryLayout { var vector Location; // pivot location of whole entry var vector OffsetName; // offset of player name var vector OffsetInfoGame; // offset of orders and player status var vector OffsetInfoTime; // offset of playing time var vector OffsetInfoNet; // offset of network ping var vector OffsetScore; // offset of main score display var vector OffsetStats; // offset of stats bars var vector OffsetLine; // offset of start of location line var Color ColorMain; // color base for name, score and line var Color ColorInfo; // color for additional information }; // ======================================================== // TEntry // // Describes a single entry in the scoreboard and stores // all information required to render it on the screen. // ======================================================== struct TEntry { var string Name; // player name var string InfoGame; // orders and player status var string InfoTime; // playing time var string InfoNet; // network ping var vector Location; // last known location var int iTeam; // team index var bool bIsFree; // player is not jailed or in arena var bool bIsLocal; // player is local on this machine var int Score; // total score var int ScorePartialAttack; // partial score for frags in attack var int ScorePartialDefense; // partial score for frags in defense var int ScorePartialRelease; // partial score for released teammates var int nDeaths; // number of deaths var int Health; // last acknowledged player health var float FadeDamage; // fadeout ratio for damage indicator var float FadeMain; // fadeout ratio for name and position var float AlphaPosition; // alpha between previous and current var TEntryPosition PositionPrevious; // previous position; movement origin var TEntryPosition PositionCurrent; // current position; movement target var TEntryPosition PositionPending; // next target position when finished var bool bOverrideColor; // override main color var Color ColorOverride; // color to override main color with var bool bBroadcastPlayer; // show player to everybody var JBTagPlayer TagPlayer; // reference to player game info }; // ======================================================== // TTableLayout // // Describes the layout for a table, realized for the // current canvas metrics. // ======================================================== struct TTableLayout { var vector Location; // pivot location of whole table var int HeightEntry; // height of single entry var int SpacingEntry; // spacing between two entries var int WidthLineMain; // width of main line var int WidthLineStats; // width of secondard stats lines var int WidthBarStats; // width of stats bars var vector OffsetLineStats[3]; // offset of stats lines var vector OffsetMain; // offset of main content area var vector OffsetScore; // offset of score area }; // ======================================================== // TTable // // Describes a table on the scoreboard that provides a // docking area for an arbitrary number of entries. // ======================================================== struct TTable { var int nEntries; // number of entries in this table var float nEntriesDisplayed; // displayed number of entries var int iTable; // index of this table; left or right var Color ColorMain; // main color base var Color ColorMainLocal; // main color base for local player var Color ColorInfo; // additional color var Color ColorInfoLocal; // additional color for local player var TTableLayout Layout; // current layout for this table }; // ======================================================== // SpriteWidget // // Slim version of the same structure in HudBase. Defines // the location and size of a sprite in a larger texture. // ======================================================== struct SpriteWidget { var Material WidgetTexture; // texture to retrieve sprite from var IntBox TextureCoords; // texture coordinates of sprite var float TextureScale; // sprite scale relative to screen size var float PosX; // relative horizontal pivot location var float PosY; // relative vertical pivot location var int OffsetX; // scaled horizontal displacement var int OffsetY; // scaled vertical displacement var Color Color; // color to draw sprite with }; // ======================================================== // RotatedWidget // // Structure describing a SpriteWidget that is rotated // before it is drawn. (Attempts to extend that from the // SpriteWidget struct above crash the game.) // ======================================================== struct RotatedWidget { var Material WidgetTexture; // texture to retrieve sprite from var IntBox TextureCoords; // texture coordinates of sprite var float TextureScale; // sprite scale relative to screen size var float PosX; // relative horizontal pivot location var float PosY; // relative vertical pivot location var int OffsetX; // scaled horizontal displacement var int OffsetY; // scaled vertical displacement var Color Color; // color to draw sprite with var int Angle; // rotation angle in Unreal units var int OffsetCenterX; // offset of rotation center, relative var int OffsetCenterY; // to unrotated upper-left corner var int OffsetRotatedX; // horizontal and vertical displacement var int OffsetRotatedY; // scaled and rotated with the sprite }; // ============================================================================ // Localization // ============================================================================ var localized string TextGameBotmatch; // instant action game var localized string TextGameOnline; // online game var localized string TextSkill[8]; // bot skill used in botmatch var localized string TextLimitPrefix; // text before game limits var localized string TextLimitTime; // time limit in minutes var localized string TextLimitScore; // score limit in captures var localized string TextLimitSuffix; // text after game limits var localized string TextInfoWaiting; // player is waiting before match var localized string TextInfoDead; // player is dead var localized string TextInfoArena; // player is fighting in arena var localized string TextInfoJail; // player is in jail var localized string TextOrdersUndisclosed; // player is on enemy team var localized string TextOrdersAttack; // human player attacking var localized string TextOrdersDefense; // human player defending var localized string TextOrdersFreelance; // human player is freelancing var localized string TextScoresNone; // no kills or releases var localized string TextScoresAttack; // partial attack score var localized string TextScoresDefense; // partial defense score var localized string TextScoresRelease; // partial release score var localized string TextRelationElapsed; // displaying elapsed time var localized string TextRelationRemaining; // displaying remaining time var localized string TextRelationOvertime; // displaying overtime var localized string TextConnecting; // player is connecting var localized string TextReady; // player is ready var localized string TextNotReady; // player is not ready var localized string TextSpectators; // there are spectators var localized string TextNoSpectators; // there are no spectators var localized string TextSpectatorsAnd; // to complete spectators sentence var localized string TextSpectatorsOther; // to complete spectators sentence var localized string TextSpectatorsOthers; // to complete spectators sentence // ============================================================================ // Variables // ============================================================================ var JBPanorama Panorama; // minimap panorama actor var private bool bIsMatchRunning; // normal gameplay running var private float TimeUpdateDisplay; // time of last scoreboard update var private string TextTitle; // human-readable map title var private string TextSubtitle; // description of current game var private TTable Table[2]; // tables for red and blue teams var private int iEntryOwner; // index of scoreboard owner's entry var private int ScorePartialMax; // maximum partial score in all entries var private array<TEntry> ListEntry; // player entries for both tables var Color ColorLineStats[3]; // color of stats background lines var Color ColorBarStats[3]; // color of stats bars themselves var SpriteWidget SpriteWidgetIconStats[3]; // icons for stats bar headers var SpriteWidget SpriteWidgetDot; // dot used for location splines var SpriteWidget SpriteWidgetPlayer; // icon for player on minimap var SpriteWidget SpriteWidgetDamage; // damage fadeout for player on minimap var SpriteWidget SpriteWidgetGradient; // background gradient for scoreboard var RotatedWidget RotatedWidgetDirection; // player direction indicator var SpriteWidget SpriteWidgetObjective; // minimap icon for release switches var Color ColorMarkerTie; // color for marker on tie var Color ColorMarkerCaptured[2]; // color for marker when team captured var SpriteWidget SpriteWidgetClockAnchor; // visual clock anchor var SpriteWidget SpriteWidgetClockCircle; // clock background circle var SpriteWidget SpriteWidgetClockFillFirst; // complete fill, first half var RotatedWidget RotatedWidgetClockFillFirst; // gradual fill, first half var RotatedWidget RotatedWidgetClockFillSecond; // gradual fill, second half var RotatedWidget RotatedWidgetClockTick; // clock section tick var RotatedWidget RotatedWidgetClockMarker; // capture marker arrow var private Font FontObjectMain; // loaded font for name and score var private Font FontObjectInfo; // loaded font for additional info var private int iTexRotatorPool; // index into TexRotator object pool var private float TimeTexRotatorPool; // time of last TexRotator pool reset var private array<TexRotator> ListTexRotatorPool; // TexRotator object pool // ============================================================================ // UpdatePrecacheMaterials // // Adds the sprite widget material to the global list of precached materials. // ============================================================================ simulated function UpdatePrecacheMaterials() { Level.AddPrecacheMaterial(Material'SpriteWidgetScores'); Super.UpdatePrecacheMaterials(); } // ============================================================================ // Init // // Finds the JBPanorama actor if there is one, and takes certain localized // strings from other classes. // ============================================================================ simulated function Init() { foreach DynamicActors(Class'JBPanorama', Panorama) break; TextOrdersAttack = Class'SquadAI'.Default.AttackString; TextOrdersDefense = Class'SquadAI'.Default.DefendString; TextOrdersFreelance = Class'SquadAI'.Default.FreelanceString; Super.Init(); } // ============================================================================ // UpdateScoreBoard // // Draws Jailbreak's scoreboard and tactics display on the screen. // ============================================================================ simulated event UpdateScoreBoard(Canvas Canvas) { local int iEntry; local int iTable; local int HeightTables; local float TimeDelta; local HudCTeamDeathMatch HudCTeamDeathMatch; local JBTagObjective firstTagObjective; local JBTagObjective thisTagObjective; UpdateGRI(); HudCTeamDeathMatch = HudCTeamDeathMatch(PlayerController(Owner).myHUD); if (TimeUpdateDisplay > 0.0) TimeDelta = Level.TimeSeconds - TimeUpdateDisplay; TimeUpdateDisplay = Level.TimeSeconds; FontObjectMain = GetSmallerFontFor(Canvas, 2); FontObjectInfo = GetSmallFontFor(FMin(Canvas.ClipX, Canvas.ClipY * 1.25), 1); UpdateListEntry(); for (iTable = 0; iTable < ArrayCount(Table); iTable++) { MoveTable(Table[iTable], TimeDelta); Table[iTable].ColorMain = HudCTeamDeathMatch.TeamSymbols[iTable].Tints[HudCTeamDeathMatch.TeamIndex]; Table[iTable].Layout = CalcTableLayout(Canvas, Table[iTable]); HeightTables = Max(HeightTables, Canvas.ClipY - Table[iTable].Layout.Location.Y); } DrawGradient(Canvas, HeightTables); DrawHeader(Canvas); DrawClock(Canvas); bIsMatchRunning = GRI.bMatchHasBegun && !UnrealPlayer(Owner).bDisplayWinner && !UnrealPlayer(Owner).bDisplayLoser && !JBGameReplicationInfo(GRI).bIsExecuting; if (bIsMatchRunning || !GRI.bMatchHasBegun) { DrawPanorama(Canvas); firstTagObjective = JBGameReplicationInfo(GRI).firstTagObjective; for (thisTagObjective = firstTagObjective; thisTagObjective != None; thisTagObjective = thisTagObjective.nextTag) { DrawObjective(Canvas, thisTagObjective.GetObjective()); } } for (iTable = 0; iTable < ArrayCount(Table); iTable++) DrawTable(Canvas, Table[iTable]); for (iEntry = 0; iEntry < ListEntry.Length; iEntry++) { MoveEntry(ListEntry[iEntry], TimeDelta); DrawEntry(Canvas, ListEntry[iEntry]); } if (Level.NetMode != NM_StandAlone) DrawSpectators(Canvas); DrawCrosshair(Canvas); } // ============================================================================ // DrawGradient // // Draws a scoreboard background gradient for the given table height. // ============================================================================ simulated function DrawGradient(Canvas Canvas, int HeightTables) { HeightTables = Max(HeightTables, Canvas.ClipX / 5); Canvas.DrawColor = SpriteWidgetGradient.Color; Canvas.SetPos(0, Canvas.ClipY - HeightTables * 2); Canvas.DrawTile( SpriteWidgetGradient.WidgetTexture, Canvas.ClipX, HeightTables * 2, SpriteWidgetGradient.TextureCoords.X1, SpriteWidgetGradient.TextureCoords.Y1, SpriteWidgetGradient.TextureCoords.X2 - SpriteWidgetGradient.TextureCoords.X1, SpriteWidgetGradient.TextureCoords.Y2 - SpriteWidgetGradient.TextureCoords.Y1); } // ============================================================================ // DrawHeader // // Draws the scoreboard header showing general map information. // ============================================================================ simulated function DrawHeader(Canvas Canvas) { local FloatBox OldClipArea; if (TextTitle == "") TextTitle = GetGameTitle(Level); Canvas.Font = GetSmallerFontFor(Canvas, 0); Canvas.SetDrawColor(255, 255, 255); Canvas.DrawScreenText(TextTitle, 0.050, 0.050, DP_UpperLeft); if (TextSubtitle == "") TextSubtitle = GetGameDescription(Level) @ GetGameLimits(Level); Canvas.Font = GetSmallFontFor(FMin(Canvas.ClipX, Canvas.ClipY * 1.25), 0); Canvas.SetDrawColor(255, 255, 255); // remember current clipping area OldClipArea.X1 = Canvas.OrgX; OldClipArea.Y1 = Canvas.OrgY; OldClipArea.X2 = Canvas.ClipX; OldClipArea.Y2 = Canvas.ClipY; // limit drawing area so server name and match info doesn't disappear behind the clock Canvas.SetOrigin(0.050 * Canvas.SizeX, 0.110 * Canvas.SizeY); Canvas.SetClip(0.8 * Canvas.SizeX, 0.2 * Canvas.SizeY); Canvas.SetPos(0, 0); Canvas.DrawText(TextSubtitle); // restore previous clipping area Canvas.SetOrigin(OldClipArea.X1, OldClipArea.Y1); Canvas.SetClip(OldClipArea.X2, OldClipArea.Y2); } // ============================================================================ // DrawSpectators // // Draws the players spectating the game. // ============================================================================ simulated function DrawSpectators(Canvas Canvas) { local int i; local string SpectatorString; local PlayerReplicationInfo PRI; local array<string> TextArray; local array<string> SpectatorArray; Canvas.Font = GetSmallerFontFor(Canvas, 4); Canvas.SetDrawColor(255, 255, 0); for (i = 0; i < GRI.PRIArray.Length; i++) { PRI = GRI.PRIArray[i]; if (PRI != None && PRI.bOnlySpectator && xPlayerReplicationInfo(PRI) != None) SpectatorArray[SpectatorArray.Length] = PRI.GetHumanReadableName(); } if (SpectatorArray.Length > 0) { // At least one spectator while (SpectatorArray.Length > 0) { TextArray.Length = 0; if (SpectatorString == "") Canvas.WrapStringToArray(TextSpectators @ SpectatorArray[0], TextArray, 0.700 * Canvas.ClipX, "|"); else Canvas.WrapStringToArray(TextSpectators @ SpectatorString $ "," @ SpectatorArray[0], TextArray, 0.700 * Canvas.ClipX, "|"); if (TextArray.Length == 1) { // fits the screen if (SpectatorString == "") SpectatorString = SpectatorArray[0]; else SpectatorString $= "," @ SpectatorArray[0]; SpectatorArray.Remove(0, 1); } else break; // No more names of spectators can be added } SpectatorString = TextSpectators @ SpectatorString; if (SpectatorArray.Length > 0) { // add how many spectators couldn't be added to the list if (SpectatorArray.Length == 1) SpectatorString @= TextSpectatorsAnd @ SpectatorArray.Length @ TextSpectatorsOther; else SpectatorString @= TextSpectatorsAnd @ SpectatorArray.Length @ TextSpectatorsOthers; } } else SpectatorString = TextNoSpectators; Canvas.DrawScreenText(SpectatorString, 0.500, 1.000, DP_LowerMiddle); } // ============================================================================ // GetGameTitle // // Returns the current level's title. If the mapper didn't set a title, // processes the map package name to create one. // ============================================================================ static function string GetGameTitle(LevelInfo Level) { local int iChar; local int iCharSeparator; local string TextTitle; if (Level.Title != Level.Default.Title) return Level.Title; TextTitle = string(Level); TextTitle = Left(TextTitle, InStr(TextTitle, ".")); iCharSeparator = InStr(TextTitle, "-"); if (iCharSeparator >= 0) TextTitle = Mid(TextTitle, iCharSeparator + 1); for (iChar = 0; iChar < Len(TextTitle); iChar++) if (Caps(Mid(TextTitle, iChar, 1)) < "A" || Caps(Mid(TextTitle, iChar, 1)) > "Z") break; TextTitle = Left(TextTitle, iChar); for (iChar = Len(TextTitle) - 1; iChar > 0; iChar--) if (Mid(TextTitle, iChar, 1) >= "A" && Mid(TextTitle, iChar, 1) <= "Z") TextTitle = Left(TextTitle, iChar) @ Mid(TextTitle, iChar); return TextTitle; } // ============================================================================ // GetGameReplicationInfo // // Returns a reference to the GameReplicationInfo actor corresponding to the // given LevelInfo object. // ============================================================================ static function GameReplicationInfo GetGameReplicationInfo(LevelInfo Level) { if (Level.Game != None) return Level.Game.GameReplicationInfo; return Level.GetLocalPlayerController().GameReplicationInfo; } // ============================================================================ // GetGameDescription // // Returns a description of the current type of game. // ============================================================================ static function string GetGameDescription(LevelInfo Level) { local int iSkill; if (Level.NetMode != NM_Standalone) return Default.TextGameOnline @ GetGameReplicationInfo(Level).ServerName; iSkill = Level.Game.GameDifficulty; if (Level.Game.CurrentGameProfile != None) iSkill = Level.Game.CurrentGameProfile.BaseDifficulty; return Default.TextSkill[iSkill] @ Default.TextGameBotmatch; } // ============================================================================ // GetGameLimits // // Returns a description of the game limits. // ============================================================================ static function string GetGameLimits(LevelInfo Level) { local string TextLimits; if (GetGameReplicationInfo(Level).TimeLimit > 0) TextLimits = GetGameReplicationInfo(Level).TimeLimit @ Default.TextLimitTime; if (GetGameReplicationInfo(Level).GoalScore > 0) { if (TextLimits != "") TextLimits = TextLimits $ ", "; TextLimits = TextLimits $ GetGameReplicationInfo(Level).GoalScore @ Default.TextLimitScore; } if (TextLimits == "") return ""; else return Default.TextLimitPrefix $ TextLimits $ Default.TextLimitSuffix; } // ============================================================================ // DrawClock // // Draws the clock that shows the current game time and the time of recent // captures, and the textual time display that goes with it. // ============================================================================ simulated function DrawClock(Canvas Canvas) { local int iCapture; local int iTeam; local int nCaptures; local int nSecondsMax; local int nSecondsCurrent; local int nSecondsDisplayed; local int nSecondsInterval; local int nSecondsTick; local int TimeCapture; local string TextTime; local string TextRelation; local TeamInfo TeamCaptured; local HudCTeamDeathMatch HudCTeamDeathMatch; if (PlayerController(Owner).PlayerReplicationInfo.Team != None) iTeam = PlayerController(Owner).PlayerReplicationInfo.Team.TeamIndex; DrawSpriteWidget(Canvas, SpriteWidgetClockAnchor); DrawSpriteWidget(Canvas, SpriteWidgetClockCircle); if (GRI.TimeLimit > 0) { nSecondsMax = 60 * GRI.TimeLimit; TextRelation = TextRelationRemaining; if (GRI.ElapsedTime > nSecondsMax) TextRelation = TextRelationOvertime; TextTime = FormatTime(Abs(nSecondsMax - GRI.ElapsedTime)); } else { nSecondsMax = 60 * 12; while (nSecondsMax <= GRI.ElapsedTime) nSecondsMax *= 2; TextRelation = TextRelationElapsed; TextTime = FormatTime(GRI.ElapsedTime); } nSecondsInterval = nSecondsMax / 15 + 59; nSecondsInterval -= nSecondsInterval % 60; nSecondsCurrent = GRI.ElapsedTime; nSecondsDisplayed = nSecondsCurrent % nSecondsMax; for (nSecondsTick = 0; nSecondsTick < nSecondsMax; nSecondsTick += nSecondsInterval) { RotatedWidgetClockTick.Angle = -65536 * nSecondsTick / nSecondsMax; DrawRotatedWidget(Canvas, RotatedWidgetClockTick); } if (nSecondsDisplayed < nSecondsMax / 2) { RotatedWidgetClockFillFirst.Angle = -65536 * nSecondsDisplayed / nSecondsMax; DrawRotatedWidget(Canvas, RotatedWidgetClockFillFirst); } else { RotatedWidgetClockFillSecond.Angle = -65536 * nSecondsDisplayed / nSecondsMax; DrawSpriteWidget(Canvas, SpriteWidgetClockFillFirst); DrawRotatedWidget(Canvas, RotatedWidgetClockFillSecond); } HudCTeamDeathMatch = HudCTeamDeathMatch(PlayerController(Owner).myHUD); ColorMarkerCaptured[0] = HudCTeamDeathMatch.TeamSymbols[1].Tints[HudCTeamDeathMatch.TeamIndex]; ColorMarkerCaptured[1] = HudCTeamDeathMatch.TeamSymbols[0].Tints[HudCTeamDeathMatch.TeamIndex]; Canvas.SetDrawColor(255, 255, 255); Canvas.Font = GetSmallFontFor(FMin(Canvas.ClipX, Canvas.ClipY * 1.25), 0); Canvas.DrawScreenText(TextTime, 0.930, 0.100, DP_LowerMiddle); Canvas.DrawScreenText(TextRelation, 0.930, 0.100, DP_UpperMiddle); nCaptures = JBGameReplicationInfo(GRI).CountCaptures(); for (iCapture = 0; iCapture < nCaptures; iCapture++) { TimeCapture = JBGameReplicationInfo(GRI).GetCaptureTime(iCapture); TeamCaptured = JBGameReplicationInfo(GRI).GetCaptureTeam(iCapture); RotatedWidgetClockMarker.Angle = -65536 * TimeCapture / nSecondsMax; RotatedWidgetClockMarker.Color = ColorMarkerTie; if (TeamCaptured != None) RotatedWidgetClockMarker.Color = ColorMarkerCaptured[TeamCaptured.TeamIndex]; DrawRotatedWidget(Canvas, RotatedWidgetClockMarker); } } // ============================================================================ // FormatTime // // Formats a given number of seconds as a string specifying hours, minutes and // seconds. Somewhat similar to the overwritten superclass method, but sticks // to one leading zero max. // ============================================================================ simulated function string FormatTime(int nSeconds) { local int nHours; local int nMinutes; local string TextFormatted; nHours = nSeconds / 3600; nSeconds = nSeconds % 3600; nMinutes = nSeconds / 60; nSeconds = nSeconds % 60; if (nHours > 0) { TextFormatted = nHours $ ":"; if (nMinutes < 10) TextFormatted = TextFormatted $ "0"; } TextFormatted = TextFormatted $ nMinutes $ ":"; if (nSeconds < 10) TextFormatted = TextFormatted $ "0"; TextFormatted = TextFormatted $ nSeconds; return TextFormatted; } // ============================================================================ // DrawCrosshair // // Draws the current crosshair if appropriate. // ============================================================================ simulated function DrawCrosshair(Canvas Canvas) { local Hud Hud; Hud = PlayerController(Owner).myHUD; if (Hud.PawnOwner != None && Hud.PawnOwner.Weapon != None) Hud.DrawCrosshair(Canvas); } // ============================================================================ // DrawPanorama // // Draws the map panorama on the screen. Individual player locations are drawn // later when the player entries are rendered on the screen. // ============================================================================ simulated function DrawPanorama(Canvas Canvas) { if (Panorama != None) Panorama.Draw(Canvas); else if (Level.NetMode == NM_Standalone) Class'JBPanorama'.Static.DrawStatus(Canvas, Class'JBPanorama'.Default.TextSetup); } // ============================================================================ // UpdateListEntry // // Updates the list of displayed entries. Removes entries that have completely // moved out; adds entries for players who joined; sorts all entries and // updates their positions. Also updates iEntryOwner and ScorePartialMax. // ============================================================================ simulated function UpdateListEntry() { local int iEntry; local int iEntryNew; local int iTable; local JBTagPlayer firstTagPlayer; local JBTagPlayer thisTagPlayer; firstTagPlayer = JBGameReplicationInfo(GRI).firstTagPlayer; for (thisTagPlayer = firstTagPlayer; thisTagPlayer != None; thisTagPlayer = thisTagPlayer.nextTag) thisTagPlayer.bIsInScoreboard = False; for (iEntry = 0; iEntry < ListEntry.Length; iEntry++) { if (ListEntry[iEntry].TagPlayer != None) ListEntry[iEntry].TagPlayer.bIsInScoreboard = True; if (!UpdateEntry(ListEntry[iEntry])) SetEntryPosition( ListEntry[iEntry], ListEntry[iEntry].PositionCurrent.iTable, ListEntry[iEntry].PositionCurrent.iRow, True); } for (thisTagPlayer = firstTagPlayer; thisTagPlayer != None; thisTagPlayer = thisTagPlayer.nextTag) if (thisTagPlayer.GetTeam() != None && !thisTagPlayer.bIsInScoreboard) { iEntryNew = ListEntry.Length; ListEntry.Insert(iEntryNew, 1); ListEntry[iEntryNew].TagPlayer = thisTagPlayer; UpdateEntry(ListEntry[iEntryNew]); } for (iEntry = ListEntry.Length - 1; iEntry >= 0; iEntry--) if (ListEntry[iEntry].AlphaPosition == 1.0 && ListEntry[iEntry].PositionCurrent.bIsSet && ListEntry[iEntry].PositionCurrent.bOutside) ListEntry.Remove(iEntry, 1); SortListEntry(0, ListEntry.Length - 1); for (iTable = 0; iTable < ArrayCount(Table); iTable++) Table[iTable].nEntries = 0; iEntryOwner = -1; // owner not found ScorePartialMax = 0; for (iEntry = 0; iEntry < ListEntry.Length; iEntry++) { if (ListEntry[iEntry].PositionCurrent.bIsSet && ListEntry[iEntry].PositionCurrent.bOutside) continue; if (ListEntry[iEntry].bIsLocal) iEntryOwner = iEntry; ScorePartialMax = Max(ScorePartialMax, Max(ListEntry[iEntry].ScorePartialAttack, Max(ListEntry[iEntry].ScorePartialDefense, ListEntry[iEntry].ScorePartialRelease))); SetEntryPosition( ListEntry[iEntry], ListEntry[iEntry].iTeam, Table[ListEntry[iEntry].iTeam].nEntries); if (!ListEntry[iEntry].PositionCurrent.bOutside) Table[ListEntry[iEntry].PositionCurrent.iTable].nEntries += 1; } } // ============================================================================ // SetEntryPosition // // Sets the given entry's next position. // ============================================================================ simulated function SetEntryPosition(out TEntry Entry, int iTable, int iRow, optional bool bOutside) { if (Entry.PositionCurrent.bIsSet) { if (Entry.PositionCurrent.iTable != iTable || Entry.PositionCurrent.iRow != iRow || Entry.PositionCurrent.bOutside != bOutside) { if (Entry.AlphaPosition == 1.0) { Entry.AlphaPosition = 0.0; Entry.PositionPrevious = Entry.PositionCurrent; Entry.PositionCurrent.iTable = iTable; Entry.PositionCurrent.iRow = iRow; Entry.PositionCurrent.bOutside = bOutside; Entry.PositionPending.bIsSet = False; } else { Entry.PositionPending.bIsSet = True; Entry.PositionPending.iTable = iTable; Entry.PositionPending.iRow = iRow; Entry.PositionPending.bOutside = bOutside; } } } else { Entry.PositionCurrent.bIsSet = True; Entry.PositionCurrent.iTable = iTable; Entry.PositionCurrent.iRow = iRow; Entry.PositionCurrent.bOutside = bOutside; Entry.AlphaPosition = 0.0; Entry.PositionPrevious = Entry.PositionCurrent; Entry.PositionPrevious.bOutside = True; } } // ============================================================================ // SortListEntry // // Sorts all entries using a QuickSort implementation. // ============================================================================ private simulated function SortListEntry(int iEntryStart, int iEntryEnd) { local int iEntryLeft; local int iEntryRight; local TEntry EntryMiddle; local TEntry EntrySwapped; if (iEntryStart >= iEntryEnd) return; iEntryLeft = iEntryStart; iEntryRight = iEntryEnd; EntryMiddle = ListEntry[(iEntryStart + iEntryEnd) / 2]; while (iEntryLeft < iEntryRight) { while (iEntryLeft < iEntryEnd && IsEntryInOrder(ListEntry[iEntryLeft], EntryMiddle)) iEntryLeft += 1; while (iEntryStart < iEntryRight && IsEntryInOrder(EntryMiddle, ListEntry[iEntryRight])) iEntryRight -= 1; if (iEntryLeft < iEntryRight) { EntrySwapped = ListEntry[iEntryLeft]; ListEntry[iEntryLeft] = ListEntry[iEntryRight]; ListEntry[iEntryRight] = EntrySwapped; } iEntryLeft += 1; iEntryRight -= 1; } SortListEntry(iEntryStart, iEntryRight); SortListEntry(iEntryLeft, iEntryEnd); } // ============================================================================ // IsEntryInOrder // // Checks and returns whether two given entries are in the correct order. // ============================================================================ simulated function bool IsEntryInOrder(TEntry Entry1, TEntry Entry2) { return (Entry1.Score > Entry2.Score || (Entry1.Score == Entry2.Score && (Entry1.nDeaths < Entry2.nDeaths || (Entry1.nDeaths == Entry2.nDeaths && Entry1.Name < Entry2.Name)))); } // ============================================================================ // UpdateEntry // // Updates an entry. Returns whether the given player is still in the game. // ============================================================================ simulated function bool UpdateEntry(out TEntry Entry) { local int HealthCurrent; local TeamPlayerReplicationInfo TeamPlayerReplicationInfo; if (Entry.TagPlayer == None) return False; TeamPlayerReplicationInfo = TeamPlayerReplicationInfo(Entry.TagPlayer.GetPlayerReplicationInfo()); if (TeamPlayerReplicationInfo == None) return False; Entry.Name = TeamPlayerReplicationInfo.PlayerName; Entry.Score = TeamPlayerReplicationInfo.Score; Entry.nDeaths = TeamPlayerReplicationInfo.Deaths; Entry.iTeam = TeamPlayerReplicationInfo.Team.TeamIndex; Entry.bIsFree = Entry.TagPlayer.IsFree(); Entry.bIsLocal = Entry.TagPlayer.GetController() == Owner; Entry.Location = Entry.TagPlayer.GetLocationPawn(); if (UnrealPlayer(Owner).bDisplayWinner || UnrealPlayer(Owner).bDisplayLoser || JBGameReplicationInfo(GRI).bIsExecuting) Entry.InfoGame = GetInfoScores(Entry.TagPlayer); else Entry.InfoGame = GetInfoOrders(Entry.TagPlayer); while (Right(Entry.InfoGame, 1) == " ") Entry.InfoGame = Left(Entry.InfoGame, Len(Entry.InfoGame) - 1); if (Level.NetMode != NM_Standalone && !TeamPlayerReplicationInfo.bBot) { Entry.InfoTime = FormatTime(GRI.ElapsedTime - TeamPlayerReplicationInfo.StartTime); Entry.InfoNet = (TeamPlayerReplicationInfo.Ping * 4) @ "ms"; } HealthCurrent = Entry.TagPlayer.GetHealth(True); if (Entry.Health > HealthCurrent && Entry.FadeDamage == 0.0) Entry.FadeDamage = 1.0; Entry.Health = HealthCurrent; Entry.ScorePartialAttack = Entry.TagPlayer.ScorePartialAttack; Entry.ScorePartialDefense = Entry.TagPlayer.ScorePartialDefense; Entry.ScorePartialRelease = Entry.TagPlayer.ScorePartialRelease; return True; } // ============================================================================ // GetInfoOrders // // Returns a string describing the given player's current orders. // ============================================================================ simulated function string GetInfoOrders(JBTagPlayer TagPlayer) { local int iTeamPlayer; local string CallSign; local string IsAdmin; local GameObjective GameObjective; local TeamPlayerReplicationInfo TeamPlayerReplicationInfo; TeamPlayerReplicationInfo = TeamPlayerReplicationInfo(TagPlayer.GetPlayerReplicationInfo()); if (TeamPlayerReplicationInfo.bAdmin) IsAdmin = "[" $ AdminText $ "] "; if (TeamPlayerReplicationInfo.bWaitingPlayer) { if (Level.NetMode == NM_Standalone) return TeamPlayerReplicationInfo.StringSpectating; if (!TagPlayer.HasReceivedPing()) return IsAdmin $ TextConnecting; if (!GRI.bMatchHasBegun && JBGameReplicationInfo(GRI).bPlayersMustBeReady) { if (TeamPlayerReplicationInfo.bReadyToPlay) return IsAdmin $ TextReady; else return IsAdmin $ TextNotReady; } return IsAdmin $ TextInfoWaiting; } if (TagPlayer.GetHealth(True) <= 0) return IsAdmin $ TextInfoDead; if (TagPlayer.IsInArena()) return IsAdmin $ TextInfoArena; if (TagPlayer.IsInJail()) return IsAdmin $ TextInfoJail; iTeamPlayer = TeamPlayerReplicationInfo.Team.TeamIndex; if (iEntryOwner >= 0 && ListEntry[iEntryOwner].iTeam != iTeamPlayer) return IsAdmin $ TextOrdersUndisclosed; if (TeamPlayerReplicationInfo.bBot) { CallSign = TeamPlayerReplicationInfo.GetCallSign(); if (CallSign != "") CallSign = "[" $ CallSign $ "] "; } if (TeamPlayerReplicationInfo.Squad != None) return IsAdmin $ CallSign $ TeamPlayerReplicationInfo.Squad.GetOrderStringFor(TeamPlayerReplicationInfo); GameObjective = TagPlayer.GetObjectiveGuessed(); if (GameObjective == None) return IsAdmin $ CallSign $ TextOrdersFreelance; if (GameObjective.DefenderTeamIndex == iTeamPlayer) return IsAdmin $ CallSign $ TextOrdersDefense @ GameObjective.ObjectiveName; else return IsAdmin $ CallSign $ TextOrdersAttack @ GameObjective.ObjectiveName; } // ============================================================================ // GetInfoScores // // Returns a string describing the given player's partial scores. // ============================================================================ static function string GetInfoScores(JBTagPlayer TagPlayer) { local string TextInfoScores; if (TagPlayer.ScorePartialAttack > 0) TextInfoScores = TagPlayer.ScorePartialAttack @ Default.TextScoresAttack; if (TagPlayer.ScorePartialDefense > 0) { if (TextInfoScores != "") TextInfoScores = TextInfoScores $ ", "; TextInfoScores = TextInfoScores $ TagPlayer.ScorePartialDefense @ Default.TextScoresDefense; } if (TagPlayer.ScorePartialRelease > 0) { if (TextInfoScores != "") TextInfoScores = TextInfoScores $ ", "; TextInfoScores = TextInfoScores $ TagPlayer.ScorePartialRelease @ Default.TextScoresRelease; } if (TextInfoScores != "") return TextInfoScores; return Default.TextScoresNone; } // ============================================================================ // CalcTableLayout // // Realizes and returns a layout for the given table. // ============================================================================ simulated function TTableLayout CalcTableLayout(Canvas Canvas, TTable Table) { local int OffsetBarHorz; local int OffsetStatsHorz; local int SpacingStatsHorz; local vector SizeText; local TTableLayout Layout; Canvas.Font = FontObjectMain; Canvas.TextSize("X", SizeText.X, SizeText.Y); Layout.HeightEntry = SizeText.Y; Canvas.Font = FontObjectInfo; Canvas.TextSize("X", SizeText.X, SizeText.Y); Layout.HeightEntry += SizeText.Y; Layout.SpacingEntry = Min(Layout.HeightEntry * 0.4, Canvas.ClipY * 0.7 / Table.nEntriesDisplayed - Layout.HeightEntry); Layout.WidthLineMain = Canvas.ClipX * 0.003; Layout.WidthLineStats = Canvas.ClipX * 0.002; Layout.WidthBarStats = Canvas.ClipX * 0.006; Layout.WidthBarStats += (Layout.WidthBarStats - Layout.WidthLineStats) % 2; SpacingStatsHorz = Layout.WidthBarStats + Layout.WidthLineStats; OffsetBarHorz = (Layout.WidthBarStats - Layout.WidthLineStats) / 2; switch (Table.iTable) { case 0: OffsetStatsHorz = -3 * SpacingStatsHorz - OffsetBarHorz - Layout.WidthLineStats; break; case 1: OffsetStatsHorz = SpacingStatsHorz + OffsetBarHorz + Layout.WidthLineMain; break; } Layout.OffsetLineStats[0].X = OffsetStatsHorz; Layout.OffsetLineStats[1].X = OffsetStatsHorz + SpacingStatsHorz; Layout.OffsetLineStats[2].X = OffsetStatsHorz + 2 * SpacingStatsHorz; Layout.OffsetLineStats[0].Y = Canvas.ClipY * -0.010; Layout.OffsetLineStats[1].Y = Canvas.ClipY * -0.050; Layout.OffsetLineStats[2].Y = Canvas.ClipY * -0.026; switch (Table.iTable) { case 0: Layout.Location.X = Canvas.ClipX * 0.100; break; case 1: Layout.Location.X = Canvas.ClipX * 0.900 - Layout.WidthLineMain; break; } Layout.Location.Y = int(Canvas.ClipY * 0.960 - Table.nEntriesDisplayed * (Layout.HeightEntry + Layout.SpacingEntry)); switch (Table.iTable) { case 0: Layout.OffsetMain.X = Canvas.ClipX * 0.014 + Layout.WidthLineMain; break; case 1: Layout.OffsetMain.X = Canvas.ClipX * -0.010; break; } switch (Table.iTable) { case 0: Layout.OffsetScore.X = Layout.OffsetLineStats[0].X - SpacingStatsHorz - OffsetBarHorz; break; case 1: Layout.OffsetScore.X = Layout.OffsetLineStats[2].X + SpacingStatsHorz + OffsetBarHorz + Layout.WidthLineStats; break; } return Layout; } // ============================================================================ // CalcEntryLayout // // Realizes and returns a layout for the given entry at the specified table // position. // ============================================================================ simulated function TEntryLayout CalcEntryLayout(Canvas Canvas, TEntry Entry, TEntryPosition Position) { local float AlphaHighlight; local vector SizeTextName; local vector SizeTextInfoGame; local vector SizeTextInfoTime; local vector SizeTextInfoNet; local vector SizeTextScore; local TEntryLayout LayoutEntry; local TTableLayout LayoutTable; Canvas.Font = FontObjectMain; Canvas.TextSize(Entry.Name, SizeTextName .X, SizeTextName .Y); Canvas.Font = FontObjectInfo; Canvas.TextSize(Entry.InfoGame, SizeTextInfoGame.X, SizeTextInfoGame.Y); Canvas.Font = FontObjectInfo; Canvas.TextSize(Entry.InfoTime, SizeTextInfoTime.X, SizeTextInfoTime.Y); Canvas.Font = FontObjectInfo; Canvas.TextSize(Entry.InfoNet, SizeTextInfoNet .X, SizeTextInfoNet .Y); Canvas.Font = FontObjectMain; Canvas.TextSize(Entry.Score, SizeTextScore .X, SizeTextScore .Y); LayoutTable = Table[Position.iTable].Layout; LayoutEntry.Location = LayoutTable.Location; LayoutEntry.Location.Y += Position.iRow * (LayoutTable.HeightEntry + LayoutTable.SpacingEntry); if (Position.bOutside) switch (Position.iTable) { case 0: LayoutEntry.Location.X -= Canvas.ClipX * 0.500; break; case 1: LayoutEntry.Location.X += Canvas.ClipX * 0.500; break; } LayoutEntry.OffsetName = LayoutTable.OffsetMain; LayoutEntry.OffsetScore = LayoutTable.OffsetScore; LayoutEntry.OffsetInfoTime = LayoutTable.OffsetScore + SizeTextName.Y * vect(0.0, 1.1, 0.0); LayoutEntry.OffsetInfoGame = LayoutTable.OffsetMain + SizeTextName.Y * vect(0.0, 1.1, 0.0); LayoutEntry.OffsetInfoNet = LayoutTable.OffsetMain + SizeTextName.Y * vect(0.0, 1.1, 0.0); LayoutEntry.OffsetLine = LayoutTable.OffsetMain + SizeTextName.Y * vect(0.0, 0.5, 0.0); LayoutEntry.OffsetStats = LayoutTable.OffsetLineStats[0]; LayoutEntry.OffsetStats.X -= (LayoutTable.WidthBarStats - LayoutTable.WidthLineStats) / 2; LayoutEntry.OffsetStats.Y = 0; switch (Position.iTable) { case 0: if (Entry.InfoGame != "") LayoutEntry.OffsetInfoNet.X += Canvas.ClipX * 0.016; LayoutEntry.OffsetScore .X -= SizeTextScore .X; LayoutEntry.OffsetInfoNet .X += SizeTextInfoGame.X; LayoutEntry.OffsetInfoTime.X -= SizeTextInfoTime.X + Canvas.ClipX * 0.002; LayoutEntry.OffsetLine .X += SizeTextName .X + Canvas.ClipX * 0.008; break; case 1: if (Entry.InfoGame != "") LayoutEntry.OffsetInfoNet.X -= Canvas.ClipX * 0.016; LayoutEntry.OffsetName .X -= SizeTextName .X; LayoutEntry.OffsetInfoGame.X -= SizeTextInfoGame.X; LayoutEntry.OffsetInfoNet .X -= SizeTextInfoGame.X + SizeTextInfoNet.X; LayoutEntry.OffsetInfoTime.X += Canvas.ClipX * 0.002; LayoutEntry.OffsetLine .X -= SizeTextName .X + Canvas.ClipX * 0.008; break; } if (Entry.bIsLocal) { AlphaHighlight = FClamp(Sin(Level.TimeSeconds * 10.0), 0.0, 1.0); LayoutEntry.ColorMain = AlphaHighlight * Table[Position.iTable].ColorMainLocal + (1.0 - AlphaHighlight) * Table[Position.iTable].ColorMain; LayoutEntry.ColorInfo = AlphaHighlight * Table[Position.iTable].ColorInfoLocal + (1.0 - AlphaHighlight) * Table[Position.iTable].ColorInfo; } else { LayoutEntry.ColorMain = Table[Position.iTable].ColorMain; LayoutEntry.ColorInfo = Table[Position.iTable].ColorInfo; } if (Position.bOutside) { LayoutEntry.ColorMain.A = 0; LayoutEntry.ColorInfo.A = 0; } return LayoutEntry; } // ============================================================================ // InterpolateEntryLayout // // Interpolates between two entry layouts and returns the result. // ============================================================================ simulated function TEntryLayout InterpolateEntryLayout(float Alpha, TEntryLayout Layout1, TEntryLayout Layout2) { local TEntryLayout LayoutInterpolated; LayoutInterpolated.Location = Layout1.Location + Alpha * (Layout2.Location - Layout1.Location); if (Layout1.Location.X == Layout2.Location.X) LayoutInterpolated.Location.X += (Layout1.Location.Y - Layout2.Location.Y) * (0.25 - Square(Alpha - 0.5)); LayoutInterpolated.OffsetName = Layout1.OffsetName + Alpha * (Layout2.OffsetName - Layout1.OffsetName); LayoutInterpolated.OffsetInfoGame = Layout1.OffsetInfoGame + Alpha * (Layout2.OffsetInfoGame - Layout1.OffsetInfoGame); LayoutInterpolated.OffsetInfoTime = Layout1.OffsetInfoTime + Alpha * (Layout2.OffsetInfoTime - Layout1.OffsetInfoTime); LayoutInterpolated.OffsetInfoNet = Layout1.OffsetInfoNet + Alpha * (Layout2.OffsetInfoNet - Layout1.OffsetInfoNet); LayoutInterpolated.OffsetScore = Layout1.OffsetScore + Alpha * (Layout2.OffsetScore - Layout1.OffsetScore); LayoutInterpolated.OffsetStats = Layout1.OffsetStats + Alpha * (Layout2.OffsetStats - Layout1.OffsetStats); LayoutInterpolated.OffsetLine = Layout1.OffsetLine + Alpha * (Layout2.OffsetLine - Layout1.OffsetLine); LayoutInterpolated.ColorMain = (1.0 - Alpha) * Layout1.ColorMain + Alpha * Layout2.ColorMain; LayoutInterpolated.ColorMain.A = FClamp((1.0 - Alpha) * Layout1.ColorMain.A + Alpha * Layout2.ColorMain.A, 0, 255); LayoutInterpolated.ColorInfo = (1.0 - Alpha) * Layout1.ColorInfo + Alpha * Layout2.ColorInfo; LayoutInterpolated.ColorInfo.A = FClamp((1.0 - Alpha) * Layout1.ColorInfo.A + Alpha * Layout2.ColorInfo.A, 0, 255); return LayoutInterpolated; } // ============================================================================ // MoveTable // // Gradually moves the table layout to accommodate the current requirements. // ============================================================================ simulated function MoveTable(out TTable Table, float TimeDelta) { Table.nEntriesDisplayed += (Table.nEntries - Table.nEntriesDisplayed) * FMin(1.0, 4.0 * TimeDelta); } // ============================================================================ // MoveEntry // // Gradually moves an entry from its previous to its current position. When // a movement is finished and another movement is pending, initiates that // movement. // ============================================================================ simulated function MoveEntry(out TEntry Entry, float TimeDelta) { if (!bIsMatchRunning) Entry.FadeMain = 1.0; else if (Entry.Health > 0 && Entry.bIsFree) Entry.FadeMain = FMin(1.0, Entry.FadeMain + 2.0 * TimeDelta); else Entry.FadeMain = FMax(0.0, Entry.FadeMain - 2.0 * TimeDelta); Entry.FadeDamage = FMax(0.0, Entry.FadeDamage - 2.0 * TimeDelta); Entry.AlphaPosition = FMin(1.0, Entry.AlphaPosition + 2.0 * TimeDelta); if (Entry.AlphaPosition < 1.0 || !Entry.PositionPending.bIsSet) return; Entry.PositionPrevious = Entry.PositionCurrent; Entry.PositionCurrent = Entry.PositionPending; Entry.PositionPending.bIsSet = False; if (TimeDelta < 1.0) // otherwise skip movement Entry.AlphaPosition = 0.0; } // ============================================================================ // DrawTable // // Realizes the layout of the given table for the current screen metrics and // draws the table. // ============================================================================ simulated function DrawTable(Canvas Canvas, out TTable Table) { local int iStats; local int WidthShadow; local int WidthTick; local string TextScore; local vector LocationStats; local vector LocationLineMain; local vector LocationTextScore; local vector ScaleIconStats; local vector SizeTextScore; local vector SizeIconStats; Table.Layout = CalcTableLayout(Canvas, Table); WidthTick = Canvas.ClipX * 0.010; if (Table.iTable == 1) WidthTick = Table.Layout.WidthLineMain - WidthTick; WidthShadow = Table.Layout.WidthLineMain * 2/3; LocationLineMain = Table.Layout.Location; LocationLineMain.Y -= Canvas.ClipY * 0.010; Canvas.SetDrawColor(0, 0, 0); // shadow Canvas.SetPos(LocationLineMain.X + WidthShadow, LocationLineMain.Y + WidthShadow); Canvas.DrawRect(Texture'BlackTexture', Table.Layout.WidthLineMain, Canvas.ClipY - Canvas.CurY); Canvas.SetPos(LocationLineMain.X + WidthShadow, LocationLineMain.Y + WidthShadow); Canvas.DrawRect(Texture'BlackTexture', WidthTick, Table.Layout.WidthLineMain); Canvas.DrawColor = Table.ColorMain; Canvas.SetPos(LocationLineMain.X, LocationLineMain.Y); Canvas.DrawRect(Texture'WhiteTexture', Table.Layout.WidthLineMain, Canvas.ClipY - Canvas.CurY); Canvas.SetPos(LocationLineMain.X, LocationLineMain.Y); Canvas.DrawRect(Texture'WhiteTexture', WidthTick, Table.Layout.WidthLineMain); for (iStats = 0; iStats < 3; iStats++) { LocationStats = Table.Layout.Location + Table.Layout.OffsetLineStats[iStats]; Canvas.DrawColor = ColorLineStats[iStats]; Canvas.SetPos(LocationStats.X, LocationStats.Y); Canvas.DrawRect(Texture'WhiteTexture', Table.Layout.WidthLineStats, Canvas.ClipY - Canvas.CurY); ScaleIconStats.X = SpriteWidgetIconStats[iStats].TextureScale * Canvas.ClipX / 640; ScaleIconStats.Y = SpriteWidgetIconStats[iStats].TextureScale * Canvas.ClipY / 480; SizeIconStats = ScaleIconStats; SizeIconStats.X *= Abs(SpriteWidgetIconStats[iStats].TextureCoords.X2 - SpriteWidgetIconStats[iStats].TextureCoords.X1); SizeIconStats.Y *= Abs(SpriteWidgetIconStats[iStats].TextureCoords.Y2 - SpriteWidgetIconStats[iStats].TextureCoords.Y1); Canvas.DrawColor = SpriteWidgetIconStats[iStats].Color; Canvas.SetPos( LocationStats.X - SizeIconStats.X / 2 + SpriteWidgetIconStats[iStats].OffsetX * ScaleIconStats.X, LocationStats.Y - SizeIconStats.Y + SpriteWidgetIconStats[iStats].OffsetY * ScaleIconStats.Y); Canvas.DrawTile( SpriteWidgetIconStats[iStats].WidgetTexture, SizeIconStats.X, SizeIconStats.Y, SpriteWidgetIconStats[iStats].TextureCoords.X1, SpriteWidgetIconStats[iStats].TextureCoords.Y1, SpriteWidgetIconStats[iStats].TextureCoords.X2 - SpriteWidgetIconStats[iStats].TextureCoords.X1, SpriteWidgetIconStats[iStats].TextureCoords.Y2 - SpriteWidgetIconStats[iStats].TextureCoords.Y1); } TextScore = string(int(GRI.Teams[Table.iTable].Score)); Canvas.Font = GetSmallerFontFor(Canvas, 0); Canvas.TextSize(TextScore, SizeTextScore.X, SizeTextScore.Y); LocationTextScore = Table.Layout.Location; LocationTextScore.Y -= Canvas.ClipY * 0.010 + SizeTextScore.Y; switch (Table.iTable) { case 0: LocationTextScore.X += Canvas.ClipX * 0.020; break; case 1: LocationTextScore.X -= Canvas.ClipX * 0.020 + SizeTextScore.X; break; } Canvas.DrawColor = Table.ColorMain; Canvas.SetPos(LocationTextScore.X, LocationTextScore.Y); Canvas.DrawTextClipped(TextScore); } // ============================================================================ // OverrideEntryColor // // Overrides the main color of a given entry. Alpha values are ignored. The // color override is effective until ResetEntryColor is called. // ============================================================================ simulated function OverrideEntryColor(JBTagPlayer TagPlayerEntry, color ColorOverride) { local int iEntry; for (iEntry = 0; iEntry < ListEntry.Length; iEntry++) if (ListEntry[iEntry].TagPlayer == TagPlayerEntry) { ListEntry[iEntry].bOverrideColor = True; ListEntry[iEntry].ColorOverride = ColorOverride; break; } } // ============================================================================ // ResetEntryColor // // Resets the main color of a given entry to its normal behavior. // ============================================================================ simulated function ResetEntryColor(JBTagPlayer TagPlayerEntry) { local int iEntry; for (iEntry = 0; iEntry < ListEntry.Length; iEntry++) if (ListEntry[iEntry].TagPlayer == TagPlayerEntry) { ListEntry[iEntry].bOverrideColor = False; break; } } // ============================================================================ // BroadcastPlayer // // Enables or disables broadcasts the player's location to all players. // ============================================================================ simulated function BroadcastPlayer(JBTagPlayer TagPlayerEntry, bool bValue) { local int iEntry; for (iEntry = 0; iEntry < ListEntry.Length; iEntry++) if (ListEntry[iEntry].TagPlayer == TagPlayerEntry) { ListEntry[iEntry].bBroadcastPlayer = bValue; break; } } // ============================================================================ // DrawEntry // // Draws the given entry at its current position in its current layout. // Interpolates between layouts if the positions are changing. // ============================================================================ simulated function DrawEntry(Canvas Canvas, TEntry Entry) { local int iStats; local int HeightBarStats; local int HeightBarStatsMax; local int HeightBarStatsMin; local int ScorePartial; local float iTableEntry; local float iTableOwner; local vector LocationPlayer; local vector LocationDirection; local vector LocationStats; local TEntry EntryOwner; local TEntryLayout LayoutEntry; local TTableLayout LayoutTable; LayoutEntry = CalcEntryLayout(Canvas, Entry, Entry.PositionCurrent); if (Entry.AlphaPosition < 1.0) LayoutEntry = InterpolateEntryLayout(Entry.AlphaPosition, CalcEntryLayout(Canvas, Entry, Entry.PositionPrevious), LayoutEntry); LayoutTable = Table[Entry.PositionCurrent.iTable].Layout; if (Entry.bOverrideColor) Canvas.DrawColor = Entry.ColorOverride; else Canvas.DrawColor = LayoutEntry.ColorMain; Canvas.DrawColor.A = FClamp(LayoutEntry.ColorMain.A * (0.5 + 0.5 * Entry.FadeMain), 0, 255); Canvas.Font = FontObjectMain; Canvas.SetPos( LayoutEntry.Location.X + LayoutEntry.OffsetName.X, LayoutEntry.Location.Y + LayoutEntry.OffsetName.Y); Canvas.DrawTextClipped(Entry.Name); Canvas.SetPos( LayoutEntry.Location.X + LayoutEntry.OffsetScore.X, LayoutEntry.Location.Y + LayoutEntry.OffsetScore.Y); Canvas.DrawTextClipped(Entry.Score); Canvas.DrawColor = LayoutEntry.ColorInfo; Canvas.DrawColor.A = FClamp(LayoutEntry.ColorInfo.A * (0.5 + 0.5 * Entry.FadeMain), 0, 255); Canvas.Font = FontObjectInfo; Canvas.SetPos( LayoutEntry.Location.X + LayoutEntry.OffsetInfoGame.X, LayoutEntry.Location.Y + LayoutEntry.OffsetInfoGame.Y); Canvas.DrawTextClipped(Entry.InfoGame); Canvas.DrawColor = LayoutEntry.ColorInfo; Canvas.DrawColor.A = LayoutEntry.ColorInfo.A / 2; Canvas.SetPos( LayoutEntry.Location.X + LayoutEntry.OffsetInfoTime.X, LayoutEntry.Location.Y + LayoutEntry.OffsetInfoTime.Y); Canvas.DrawTextClipped(Entry.InfoTime); Canvas.SetPos( LayoutEntry.Location.X + LayoutEntry.OffsetInfoNet.X, LayoutEntry.Location.Y + LayoutEntry.OffsetInfoNet.Y); Canvas.DrawTextClipped(Entry.InfoNet); LocationStats = LayoutEntry.Location + LayoutEntry.OffsetStats; for (iStats = 0; iStats < 3; iStats++) { switch (iStats) { case 0: ScorePartial = Entry.ScorePartialAttack; break; case 1: ScorePartial = Entry.ScorePartialDefense; break; case 2: ScorePartial = Entry.ScorePartialRelease; break; } if (iStats > 0) LocationStats.X += LayoutTable.OffsetLineStats[iStats ].X - LayoutTable.OffsetLineStats[iStats - 1].X; HeightBarStatsMin = Max(1, LayoutTable.WidthBarStats / 2); HeightBarStatsMax = LayoutTable.HeightEntry - HeightBarStatsMin; HeightBarStats = HeightBarStatsMin + HeightBarStatsMax * ScorePartial / Max(6, ScorePartialMax); Canvas.DrawColor = ColorBarStats[iStats]; Canvas.SetPos( LocationStats.X, LocationStats.Y + LayoutTable.HeightEntry - HeightBarStats); Canvas.DrawRect(Texture'WhiteTexture', LayoutTable.WidthBarStats, HeightBarStats); } if (Panorama != None && bIsMatchRunning && Entry.FadeMain > 0) { if (Entry.bOverrideColor) Canvas.DrawColor = Entry.ColorOverride; else Canvas.DrawColor = LayoutEntry.ColorMain; Canvas.DrawColor.A = FClamp(LayoutEntry.ColorMain.A * Entry.FadeMain, 0, 255); if (iEntryOwner >= 0 && !Entry.bBroadcastPlayer) { EntryOwner = ListEntry[iEntryOwner]; iTableOwner = EntryOwner.PositionCurrent .iTable * EntryOwner.AlphaPosition + EntryOwner.PositionPrevious.iTable * (1.0 - EntryOwner.AlphaPosition); iTableEntry = Entry .PositionCurrent .iTable * Entry .AlphaPosition + Entry .PositionPrevious.iTable * (1.0 - Entry .AlphaPosition); Canvas.DrawColor.A = FClamp(Canvas.DrawColor.A * (1.0 - Abs(iTableEntry - iTableOwner)), 0, 255); } if (Canvas.DrawColor.A > 0) { LocationPlayer = Panorama.CalcLocation(Canvas, Entry.Location); DrawSpline(Canvas, LayoutEntry.Location + LayoutEntry.OffsetLine, LocationPlayer); if (Entry.bIsLocal && Controller(Owner) != None && Controller(Owner).Pawn != None) { LocationDirection = Panorama.CalcLocation(Canvas, Entry.Location + 100.0 * vector(Controller(Owner).Pawn.Rotation)); LocationDirection -= LocationPlayer; RotatedWidgetDirection.Angle = 16384 - 32768 * Atan(LocationDirection.Y, LocationDirection.X) / Pi; RotatedWidgetDirection.PosX = LocationPlayer.X / Canvas.ClipX; RotatedWidgetDirection.PosY = LocationPlayer.Y / Canvas.ClipY; RotatedWidgetDirection.Color = Canvas.DrawColor; DrawRotatedWidget(Canvas, RotatedWidgetDirection); } if (Entry.FadeDamage > 0.0) { SpriteWidgetDamage.PosX = LocationPlayer.X / Canvas.ClipX; SpriteWidgetDamage.PosY = LocationPlayer.Y / Canvas.ClipY; SpriteWidgetDamage.Color = Canvas.DrawColor; SpriteWidgetDamage.Color.A = FClamp(Canvas.DrawColor.A * Entry.FadeDamage, 0, 255); SpriteWidgetDamage.TextureScale = Default.SpriteWidgetDamage.TextureScale * (3.0 - Entry.FadeDamage * 2.0); DrawSpriteWidget(Canvas, SpriteWidgetDamage); } } } } // ============================================================================ // DrawObjective // // Draws the given GameObjective onto the panorama minimap. // ============================================================================ simulated function DrawObjective(Canvas Canvas, GameObjective Objective) { local HudCTeamDeathMatch HudCTeamDeathMatch; local vector LocationObjective; HudCTeamDeathMatch = HudCTeamDeathMatch(PlayerController(Owner).MyHud); if (HudCTeamDeathMatch != None) { if (Panorama == None || Objective == None || Objective.DefenderTeamIndex >= ArrayCount(HudCTeamDeathMatch.TeamSymbols)) return; // neutral or no objective or panorama setup, don't draw LocationObjective = Panorama.CalcLocation(Canvas, Objective.Location); SpriteWidgetObjective.PosX = LocationObjective.X / Canvas.ClipX; SpriteWidgetObjective.PosY = LocationObjective.Y / Canvas.ClipY; SpriteWidgetObjective.Color = HudCTeamDeathMatch.TeamSymbols[Abs(int(Class'Jailbreak'.Default.bReverseSwitchColors) - Objective.DefenderTeamIndex)].Tints[HudCTeamDeathMatch.TeamIndex]; SpriteWidgetObjective.Color.A = 255; DrawSpriteWidget(Canvas, SpriteWidgetObjective); } } // ============================================================================ // DrawSpriteWidget // // Draws a SpriteWidget sprite on the given canvas. The sprite's pivot point // is assumed to be its upper-left corner. // ============================================================================ simulated function DrawSpriteWidget(Canvas Canvas, SpriteWidget SpriteWidget) { local vector LocationWidget; local vector ScaleWidget; local vector SizeWidget; ScaleWidget.X = SpriteWidget.TextureScale * Canvas.ClipX / 640; ScaleWidget.Y = SpriteWidget.TextureScale * Canvas.ClipY / 480; SizeWidget.X = Abs(SpriteWidget.TextureCoords.X2 - SpriteWidget.TextureCoords.X1) * ScaleWidget.X; SizeWidget.Y = Abs(SpriteWidget.TextureCoords.Y2 - SpriteWidget.TextureCoords.Y1) * ScaleWidget.Y; LocationWidget.X = SpriteWidget.PosX * Canvas.ClipX + SpriteWidget.OffsetX * ScaleWidget.X; LocationWidget.Y = SpriteWidget.PosY * Canvas.ClipY + SpriteWidget.OffsetY * ScaleWidget.Y; Canvas.DrawColor = SpriteWidget.Color; Canvas.SetPos( LocationWidget.X, LocationWidget.Y); Canvas.DrawTile( SpriteWidget.WidgetTexture, SizeWidget.X, SizeWidget.Y, SpriteWidget.TextureCoords.X1, SpriteWidget.TextureCoords.Y1, SpriteWidget.TextureCoords.X2 - SpriteWidget.TextureCoords.X1, SpriteWidget.TextureCoords.Y2 - SpriteWidget.TextureCoords.Y1); } // ============================================================================ // DrawRotatedWidget // // Draws a RotatedWidget sprite on the given Canvas. The sprite's pivot point // is assumed to be the point it is rotated about. // ============================================================================ simulated function DrawRotatedWidget(Canvas Canvas, RotatedWidget RotatedWidget) { local float AngleInRadian; local float SinAngle; local float CosAngle; local vector OffsetWidgetRotated; local vector LocationWidget; local vector ScaleWidget; local vector SizeWidget; local TexRotator TexRotator; if (TimeTexRotatorPool != Level.TimeSeconds) iTexRotatorPool = 0; else iTexRotatorPool += 1; TimeTexRotatorPool = Level.TimeSeconds; if (iTexRotatorPool >= ListTexRotatorPool.Length) ListTexRotatorPool[iTexRotatorPool] = new Class'TexRotator'; TexRotator = ListTexRotatorPool[iTexRotatorPool]; TexRotator.Material = RotatedWidget.WidgetTexture; TexRotator.UOffset = RotatedWidget.OffsetCenterX + RotatedWidget.TextureCoords.X1; TexRotator.VOffset = RotatedWidget.OffsetCenterY + RotatedWidget.TextureCoords.Y1; TexRotator.Rotation.Yaw = RotatedWidget.Angle; TexRotator.Rotation.Pitch = 0; TexRotator.Rotation.Roll = 0; TexRotator.TexRotationType = TR_FixedRotation; ScaleWidget.X = RotatedWidget.TextureScale * Canvas.ClipX / 640; ScaleWidget.Y = RotatedWidget.TextureScale * Canvas.ClipY / 480; SizeWidget.X = Abs(RotatedWidget.TextureCoords.X2 - RotatedWidget.TextureCoords.X1) * ScaleWidget.X; SizeWidget.Y = Abs(RotatedWidget.TextureCoords.Y2 - RotatedWidget.TextureCoords.Y1) * ScaleWidget.Y; if (RotatedWidget.OffsetRotatedX != 0 || RotatedWidget.OffsetRotatedY != 0) { AngleInRadian = Pi * RotatedWidget.Angle / 32768; SinAngle = Sin(AngleInRadian); CosAngle = Cos(AngleInRadian); OffsetWidgetRotated.X = RotatedWidget.OffsetRotatedX * CosAngle + RotatedWidget.OffsetRotatedY * SinAngle; OffsetWidgetRotated.Y = RotatedWidget.OffsetRotatedY * CosAngle - RotatedWidget.OffsetRotatedX * SinAngle; } LocationWidget.X = RotatedWidget.PosX * Canvas.ClipX; LocationWidget.Y = RotatedWidget.PosY * Canvas.ClipY; LocationWidget.X += (OffsetWidgetRotated.X + RotatedWidget.OffsetX - RotatedWidget.OffsetCenterX) * ScaleWidget.X; LocationWidget.Y += (OffsetWidgetRotated.Y + RotatedWidget.OffsetY - RotatedWidget.OffsetCenterY) * ScaleWidget.Y; Canvas.DrawColor = RotatedWidget.Color; Canvas.SetPos( LocationWidget.X, LocationWidget.Y); Canvas.DrawTile( TexRotator, SizeWidget.X, SizeWidget.Y, RotatedWidget.TextureCoords.X1, RotatedWidget.TextureCoords.Y1, RotatedWidget.TextureCoords.X2 - RotatedWidget.TextureCoords.X1, RotatedWidget.TextureCoords.Y2 - RotatedWidget.TextureCoords.Y1); } // ============================================================================ // DrawSpline // // Draws a dotted spline starting with a horizontal tangent and ending sloped // towards the end point. As UnrealScript execution performance suffers more // from a high number of statements than from optimizing code towards // efficient use of integer numbers, we're just using float vector maths here. // ============================================================================ simulated function DrawSpline(Canvas Canvas, vector LocationStart, vector LocationEnd) { local byte AlphaColorDraw; local int iSegment; local float AlphaSpline; local float DistanceDots; local float DistanceDotLast; local float DistanceDotNext; local float DistanceSegment; local float LengthSegment; local float LengthTotal; local vector LocationDot; local vector LocationMiddle; local vector LocationSegment; local vector VectorSegment; local vector ScaleDot; local vector ScalePlayer; local vector SizeDot; local vector SizePlayer; local array<float> ListLengthSegment; local array<vector> ListLocationSegment; LocationStart.Z = 0; LocationEnd .Z = 0; LocationMiddle.X = LocationStart.X + (LocationEnd.X - LocationStart.X) * 0.75; LocationMiddle.Y = LocationStart.Y; for (AlphaSpline = 0.0; AlphaSpline <= 1.0; AlphaSpline += 0.0625) { iSegment = ListLocationSegment.Length; ListLocationSegment[iSegment] = (1.0 - AlphaSpline) * (LocationStart + AlphaSpline * (LocationMiddle - LocationStart)) + AlphaSpline * (LocationEnd + (1.0 - AlphaSpline) * (LocationMiddle - LocationEnd)); if (iSegment > 0) { LengthSegment = VSize(ListLocationSegment[iSegment ] - ListLocationSegment[iSegment - 1]); ListLengthSegment[iSegment - 1] = LengthSegment; LengthTotal += LengthSegment; } } AlphaColorDraw = Canvas.DrawColor.A; Canvas.DrawColor.A = AlphaColorDraw / 2; ScaleDot.X = SpriteWidgetDot.TextureScale * Canvas.ClipX / 640; ScaleDot.Y = SpriteWidgetDot.TextureScale * Canvas.ClipY / 480; SizeDot.X = Abs(SpriteWidgetDot.TextureCoords.X2 - SpriteWidgetDot.TextureCoords.X1) * ScaleDot.X; SizeDot.Y = Abs(SpriteWidgetDot.TextureCoords.Y2 - SpriteWidgetDot.TextureCoords.Y1) * ScaleDot.Y; ScalePlayer.X = SpriteWidgetPlayer.TextureScale * Canvas.ClipX / 640; ScalePlayer.Y = SpriteWidgetPlayer.TextureScale * Canvas.ClipY / 480; SizePlayer.X = Abs(SpriteWidgetPlayer.TextureCoords.X2 - SpriteWidgetPlayer.TextureCoords.X1) * ScalePlayer.X; SizePlayer.Y = Abs(SpriteWidgetPlayer.TextureCoords.Y2 - SpriteWidgetPlayer.TextureCoords.Y1) * ScalePlayer.Y; DistanceDots = SizeDot .X * 1.5; // distance between dots DistanceDotLast = SizePlayer.X * 0.5; // distance between last dot and line end for (iSegment = 0; iSegment < ListLengthSegment.Length; iSegment++) { if (LengthTotal < DistanceDotLast) break; LengthSegment = ListLengthSegment[iSegment]; if (LengthSegment == 0.0) continue; LocationSegment = ListLocationSegment[iSegment]; VectorSegment = (ListLocationSegment[iSegment + 1] - LocationSegment) / LengthSegment; DistanceSegment = 0.0; while (LengthSegment >= DistanceDotNext && LengthTotal >= DistanceDotLast) { DistanceSegment += DistanceDotNext; LocationDot = LocationSegment + VectorSegment * DistanceSegment; LocationDot -= SizeDot / 2; Canvas.SetPos( LocationDot.X, LocationDot.Y); Canvas.DrawTile( SpriteWidgetDot.WidgetTexture, SizeDot.X, SizeDot.Y, SpriteWidgetDot.TextureCoords.X1, SpriteWidgetDot.TextureCoords.Y1, SpriteWidgetDot.TextureCoords.X2 - SpriteWidgetDot.TextureCoords.X1, SpriteWidgetDot.TextureCoords.Y2 - SpriteWidgetDot.TextureCoords.Y1); LengthSegment -= DistanceDotNext; LengthTotal -= DistanceDotNext; DistanceDotNext = DistanceDots; } DistanceDotNext -= LengthSegment; LengthTotal -= LengthSegment; } Canvas.DrawColor.A = AlphaColorDraw; Canvas.SetPos( LocationEnd.X - SizePlayer.X / 2, LocationEnd.Y - SizePlayer.Y / 2); Canvas.DrawTile( SpriteWidgetPlayer.WidgetTexture, SizePlayer.X, SizePlayer.Y, SpriteWidgetPlayer.TextureCoords.X1, SpriteWidgetPlayer.TextureCoords.Y1, SpriteWidgetPlayer.TextureCoords.X2 - SpriteWidgetPlayer.TextureCoords.X1, SpriteWidgetPlayer.TextureCoords.Y2 - SpriteWidgetPlayer.TextureCoords.Y1); } // ============================================================================ // DrawLine // // Draws a line connecting two points on the screen, using one horizontal and // one vertical segment and ending in a dot. Dead code; used to be used to // connect player names with their locations on the minimap. // ============================================================================ simulated function DrawLine(Canvas Canvas, vector LocationStart, vector LocationEnd) { local byte AlphaColorDraw; local int WidthLine; local vector ScaleDot; local vector SizeDot; WidthLine = Canvas.ClipX * 0.002; LocationStart.Y = int(LocationStart.Y - WidthLine / 2); LocationEnd .X = int(LocationEnd .X - WidthLine / 2); AlphaColorDraw = Canvas.DrawColor.A; Canvas.DrawColor.A = AlphaColorDraw / 2; if (LocationStart.Y + WidthLine >= LocationEnd.Y && LocationStart.Y <= LocationEnd.Y) { Canvas.SetPos(LocationStart.X, LocationStart.Y); Canvas.DrawRect(Texture'WhiteTexture', LocationEnd.X - LocationStart.X, WidthLine); } else { Canvas.SetPos(LocationStart.X, LocationStart.Y); if (LocationStart.X < LocationEnd.X) LocationStart.X -= WidthLine; Canvas.DrawRect(Texture'WhiteTexture', LocationEnd.X - LocationStart.X, WidthLine); if (LocationStart.Y < LocationEnd.Y) LocationStart.Y += WidthLine; Canvas.SetPos(LocationEnd.X, LocationStart.Y); Canvas.DrawRect(Texture'WhiteTexture', WidthLine, LocationEnd.Y - LocationStart.Y); } Canvas.DrawColor.A = AlphaColorDraw; ScaleDot.X = SpriteWidgetPlayer.TextureScale * Canvas.ClipX / 640; ScaleDot.Y = SpriteWidgetPlayer.TextureScale * Canvas.ClipY / 480; SizeDot.X = int(Abs(SpriteWidgetPlayer.TextureCoords.X2 - SpriteWidgetPlayer.TextureCoords.X1) * ScaleDot.X); SizeDot.Y = int(Abs(SpriteWidgetPlayer.TextureCoords.Y2 - SpriteWidgetPlayer.TextureCoords.Y1) * ScaleDot.Y); SizeDot.X += (SizeDot.X - WidthLine) % 2; SizeDot.Y += (SizeDot.Y - WidthLine) % 2; Canvas.SetPos( LocationEnd.X + (WidthLine - SizeDot.X) / 2, LocationEnd.Y - SizeDot.Y / 2); Canvas.DrawTile( SpriteWidgetPlayer.WidgetTexture, SizeDot.X, SizeDot.Y, SpriteWidgetPlayer.TextureCoords.X1, SpriteWidgetPlayer.TextureCoords.Y1, SpriteWidgetPlayer.TextureCoords.X2 - SpriteWidgetPlayer.TextureCoords.X1, SpriteWidgetPlayer.TextureCoords.Y2 - SpriteWidgetPlayer.TextureCoords.Y1); } // ============================================================================ // GetSmallerFontFor // // Widescreen fix for font size selection. // ============================================================================ function Font GetSmallerFontFor(Canvas Canvas, int offset) { local int i; for (i = 0; i < 8 - offset; i++) { if (HUDClass.default.FontScreenWidthMedium[i] <= FMin(Canvas.ClipX, Canvas.ClipY * 1.25)) return HUDClass.static.LoadFontStatic(i + offset); } return HUDClass.static.LoadFontStatic(8); } // ============================================================================ // Defaults // ============================================================================ defaultproperties { TextGameBotmatch = "Botmatch"; TextGameOnline = "Online Match on"; TextSkill[0] = "Novice"; TextSkill[1] = "Average"; TextSkill[2] = "Experienced"; TextSkill[3] = "Skilled"; TextSkill[4] = "Adept"; TextSkill[5] = "Masterful"; TextSkill[6] = "Inhuman"; TextSkill[7] = "Godlike"; TextLimitPrefix = " ["; TextLimitTime = "minutes"; TextLimitScore = "captures"; TextLimitSuffix = " max]"; TextInfoWaiting = "waiting"; TextInfoDead = "dead"; TextInfoArena = "arena"; TextInfoJail = "jailed"; TextOrdersUndisclosed = "undisclosed"; TextOrdersAttack = "attacking"; TextOrdersDefense = "defending"; TextOrdersFreelance = "Sweeper"; TextScoresNone = ""; TextScoresAttack = "attack"; TextScoresDefense = "defense"; TextScoresRelease = "release"; TextRelationElapsed = "played"; TextRelationRemaining = "to play"; TextRelationOvertime = "overtime"; TextConnecting = "connecting"; TextReady = "ready"; TextNotReady = "not ready"; TextSpectators = "Spectators:"; TextNoSpectators = "No Spectators"; TextSpectatorsAnd = "and"; TextSpectatorsOther = "other"; TextSpectatorsOthers = "others"; Table[0] = (iTable=0,ColorMainLocal=(R=255,G=160,B=160,A=255),ColorInfo=(R=255,G=255,B=255,A=255),ColorInfoLocal=(R=255,G=255,B=255,A=255)); Table[1] = (iTable=1,ColorMainLocal=(R=160,G=160,B=255,A=255),ColorInfo=(R=255,G=255,B=255,A=255),ColorInfoLocal=(R=255,G=255,B=255,A=255)); ColorLineStats[0] = (R=255,G=000,B=000,A=064); ColorLineStats[1] = (R=255,G=255,B=000,A=064); ColorLineStats[2] = (R=000,G=255,B=000,A=064); ColorBarStats[0] = (R=128,G=000,B=000,A=255); ColorBarStats[1] = (R=128,G=128,B=000,A=255); ColorBarStats[2] = (R=000,G=128,B=000,A=255); ColorMarkerTie = (R=128,G=128,B=128,A=255); SpriteWidgetIconStats[0] = (WidgetTexture=Material'SpriteWidgetHud',TextureCoords=(X1=272,Y1=400,X2=351,Y2=488),TextureScale=0.10,OffsetX=06,OffsetY=10,Color=(R=255,G=000,B=000,A=128)); SpriteWidgetIconStats[1] = (WidgetTexture=Material'SpriteWidgetHud',TextureCoords=(X1=400,Y1=128,X2=496,Y2=223),TextureScale=0.10,OffsetX=06,OffsetY=10,Color=(R=255,G=255,B=000,A=128)); SpriteWidgetIconStats[2] = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=342,Y1=87,X2=428,Y2=174),TextureScale=0.10,OffsetX=26,OffsetY=0,Color=(R=000,G=255,B=000,A=128)); SpriteWidgetDot = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=112,Y1=304,X2=176,Y2=368),TextureScale=0.04); SpriteWidgetPlayer = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=112,Y1=304,X2=176,Y2=368),TextureScale=0.09); SpriteWidgetDamage = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=112,Y1=304,X2=176,Y2=368),TextureScale=0.09,OffsetX=-32,OffsetY=-32); SpriteWidgetGradient = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=144,Y1=399,X2=145,Y2=401),Color=(R=0,G=0,B=0,A=128)); RotatedWidgetDirection = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=112,Y1=384,X2=176,Y2=448),TextureScale=0.08,OffsetCenterX=32,OffsetCenterY=32,OffsetRotatedX=0,OffsetRotatedY=48); SpriteWidgetObjective = (WidgetTexture=Material'PadlockMapIcon',TextureCoords=(X1=5,Y1=1,X2=26,Y2=29),TextureScale=0.45,OffsetX=-10,OffsetY=-15); SpriteWidgetClockAnchor = (WidgetTexture=Texture'HUDContent.Generic.HUD',TextureCoords=(X1=168,Y1=211,X2=210,Y2=255),TextureScale=1.40,PosX=1.0,PosY=0,OffsetX=-042,OffsetY=012,Color=(R=000,G=000,B=000,A=150)); SpriteWidgetClockCircle = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=016,Y1=016,X2=272,Y2=272),TextureScale=0.3,PosX=0.99,PosY=0.02,OffsetX=-256,OffsetY=000,Color=(R=255,G=255,B=255,A=255)); SpriteWidgetClockFillFirst = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=400,Y1=496,X2=288,Y2=272),TextureScale=0.3,PosX=0.99,PosY=0.02,OffsetX=-128,OffsetY=016,Color=(R=056,G=056,B=056,A=255)); RotatedWidgetClockFillFirst = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=400,Y1=272,X2=512,Y2=496),TextureScale=0.3,PosX=0.99,PosY=0.02,OffsetX=-127,OffsetY=128,OffsetCenterX=000,OffsetCenterY=112,Color=(R=056,G=056,B=056,A=255)); RotatedWidgetClockFillSecond = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=288,Y1=272,X2=400,Y2=496),TextureScale=0.3,PosX=0.99,PosY=0.02,OffsetX=-127,OffsetY=128,OffsetCenterX=112,OffsetCenterY=112,Color=(R=056,G=056,B=056,A=255)); RotatedWidgetClockTick = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=112,Y1=448,X2=176,Y2=512),TextureScale=0.3,PosX=0.99,PosY=0.02,OffsetX=-127,OffsetY=128,OffsetCenterX=032,OffsetCenterY=032,OffsetRotatedX=0,OffsetRotatedY=-121,Color=(R=255,G=255,B=255,A=255)); RotatedWidgetClockMarker = (WidgetTexture=Material'SpriteWidgetScores',TextureCoords=(X1=112,Y1=384,X2=176,Y2=448),TextureScale=0.3,PosX=0.99,PosY=0.02,OffsetX=-127,OffsetY=128,OffsetCenterX=032,OffsetCenterY=032,OffsetRotatedX=0,OffsetRotatedY=-118,Color=(R=255,A=255)); } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |