diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/bg_misc.c | 214 | ||||
-rw-r--r-- | src/game/bg_public.h | 8 | ||||
-rw-r--r-- | src/ui/ui_local.h | 102 | ||||
-rw-r--r-- | src/ui/ui_main.c | 660 |
4 files changed, 495 insertions, 489 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index c4d374ae..8a4e7a8c 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -38,6 +38,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_SPAWN, //int buildNum; "eggpod", //char *buildName; "Egg", //char *humanName; + "The most basic alien structure. It allows aliens to spawn " + "and protect the Overmind. Without any of these, the Overmind " + "is left nearly defenseless and defeat is imminent.", "team_alien_spawn", //char *entityName; { "models/buildables/eggpod/eggpod.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -74,6 +77,8 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_BARRICADE, //int buildNum; "barricade", //char *buildName; "Barricade", //char *humanName; + "Used to obstruct corridors and doorways, hindering humans from " + "threatening the spawns and Overmind.", "team_alien_barricade",//char *entityName; { "models/buildables/barricade/barricade.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -110,6 +115,11 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_BOOSTER, //int buildNum; "booster", //char *buildName; "Booster", //char *humanName; + "Provides any alien with a poison ability on all its " + "attacks. In addition to the default attack damage, the victim loses " + "health over time unless they heal themselves with a medkit." + "The booster also increases the rate of health regeneration for " + "any nearby aliens.", "team_alien_booster", //char *entityName; { "models/buildables/booster/booster.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -146,6 +156,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_ACIDTUBE, //int buildNum; "acid_tube", //char *buildName; "Acid Tube", //char *humanName; + "Ejects lethal poisonous acid at an approaching human. These " + "are highly effective when used in conjunction with a trapper " + "to hold the victim in place.", "team_alien_acid_tube",//char *entityName; { "models/buildables/acid_tube/acid_tube.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -182,6 +195,8 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_HIVE, //int buildNum; "hive", //char *buildName; "Hive", //char *humanName; + "Houses millions of tiny insectoid aliens. When a human " + "approaches this structure, the insectoids attack.", "team_alien_hive", //char *entityName; { "models/buildables/acid_tube/acid_tube.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -218,6 +233,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_TRAPPER, //int buildNum; "trapper", //char *buildName; "Trapper", //char *humanName; + "Fires a blob of adhesive spit at any non-alien in its line of " + "sight. This hinders their movement, making them an easy target " + "for other defensive structures or aliens.", "team_alien_trapper", //char *entityName; { "models/buildables/trapper/trapper.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -254,6 +272,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_OVERMIND, //int buildNum; "overmind", //char *buildName; "Overmind", //char *humanName; + "A collective consciousness that controls all the alien structures " + "in its vicinity. It must be protected at all costs, since its " + "death will render alien structures defenseless.", "team_alien_overmind", //char *entityName; { "models/buildables/overmind/overmind.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -290,6 +311,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_A_HOVEL, //int buildNum; "hovel", //char *buildName; "Hovel", //char *humanName; + "An armoured shell used by the builder class to hide in, while " + "the alien base is under attack. It may be entered or " + "exited at any time.", "team_alien_hovel", //char *entityName; { "models/buildables/hovel/hovel.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -326,6 +350,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_SPAWN, //int buildNum; "telenode", //char *buildName; "Telenode", //char *humanName; + "The most basic human structure. It provides a means for humans " + "to enter the battle arena. Without any of these the humans " + "cannot spawn and defeat is imminent.", "team_human_spawn", //char *entityName; { "models/buildables/telenode/telenode.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -362,6 +389,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_MEDISTAT, //int buildNum; "medistat", //char *buildName; "Medistation", //char *humanName; + "A structure providing an automated healing energy that restores " + "the health of any human that stands inside it. It may only be used " + "by one person at a time.", "team_human_medistat", //char *entityName; { "models/buildables/medistat/medistat.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -398,6 +428,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_MGTURRET, //int buildNum; "mgturret", //char *buildName; "Machinegun Turret", //char *humanName; + "Automated base defense that is effective against fast moving targets, " + "but does not cause much damage on its own and should always be " + "backed up by physical support.", "team_human_mgturret", //char *entityName; { "models/buildables/mgturret/turret_base.md3", "models/buildables/mgturret/turret_barrel.md3", @@ -436,6 +469,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_TESLAGEN, //int buildNum; "tesla", //char *buildName; "Tesla Generator", //char *humanName; + "A structure equipped with a strong electrical attack that always " + "hits its target. It is useful against larger aliens " + "and for consolidating basic defense.", "team_human_tesla", //char *entityName; { "models/buildables/tesla/tesla.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -472,6 +508,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_DCC, //int buildNum; "dcc", //char *buildName; "Defence Computer", //char *humanName; + "A structure coordinating the action of base defense so that " + "defense is distributed evenly among the enemy. This structure " + "is required for building the Tesla Generator.", "team_human_dcc", //char *entityName; { "models/buildables/dcc/dcc.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -508,6 +547,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_ARMOURY, //int buildNum; "arm", //char *buildName; "Armoury", //char *humanName; + "An essential part of the human base, providing a means " + "to upgrade the basic human. A range of upgrades and weapons are " + "available from the armoury, each with a price.", "team_human_armoury", //char *entityName; { "models/buildables/arm/arm.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -544,6 +586,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_REACTOR, //int buildNum; "reactor", //char *buildName; "Reactor", //char *humanName; + "All structures except the telenode rely on a reactor to operate." + "The reactor provides power for all the human structures either " + "directly or via repeaters. There can only be a single reactor.", "team_human_reactor", //char *entityName; { "models/buildables/reactor/reactor.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -580,6 +625,9 @@ buildableAttributes_t bg_buildableList[ ] = BA_H_REPEATER, //int buildNum; "repeater", //char *buildName; "Repeater", //char *humanName; + "A power distributor that transmits power from the reactor " + "to remote locations, so that bases may be built far " + "from the reactor.", "team_human_repeater", //char *entityName; { "models/buildables/repeater/repeater.md3", 0, 0, 0 }, 1.0f, //float modelScale; @@ -697,6 +745,25 @@ char *BG_FindHumanNameForBuildable( int bclass ) /* ============== +BG_FindInfoForBuildable +============== +*/ +char *BG_FindInfoForBuildable( int bclass ) +{ + int i; + + for( i = 0; i < bg_numBuildables; i++ ) + { + if( bg_buildableList[ i ].buildNum == bclass ) + return bg_buildableList[ i ].info; + } + + //wimp out + return 0; +} + +/* +============== BG_FindEntityNameForBuildNum ============== */ @@ -1495,6 +1562,7 @@ classAttributes_t bg_classList[ ] = PCL_NONE, //int classnum; "spectator", //char *className; "Spectator", //char *humanName; + "", "", //char *modelname; 1.0f, //float modelScale; "", //char *skinname; @@ -1533,6 +1601,7 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_BUILDER0, //int classnum; "builder", //char *className; "Builder", //char *humanName; + "Responsible for building and maintaining all the alien structures.", "builder", //char *modelname; 1.0f, //float modelScale; "default", //char *skinname; @@ -1571,6 +1640,9 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_BUILDER0_UPG, //int classnum; "builderupg", //char *classname; "Advanced Builder", //char *humanname; + "Similar to the base Granger, except that in addition to " + "being able to build structures it has a melee attack " + "and the ability to crawl on walls.", "builder", //char *modelname; 1.0f, //float modelScale; "advanced", //char *skinname; @@ -1609,6 +1681,7 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL0, //int classnum; "level0", //char *classname; "Soldier", //char *humanname; + "Has a lethal bite and the ability to crawl on walls and ceilings.", "jumper", //char *modelname; 0.2f, //float modelScale; "default", //char *skinname; @@ -1648,6 +1721,8 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL1, //int classnum; "level1", //char *classname; "Hydra", //char *humanname; + "Able to crawl on walls and ceilings. Its melee attack is most " + "effective when combined with the ability to grab its foe.", "spitter", //char *modelname; 0.6f, //float modelScale; "default", //char *skinname; @@ -1687,6 +1762,9 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL1_UPG, //int classnum; "level1upg", //char *classname; "Hydra Upgrade", //char *humanname; + "In addition to the basic Basilisk abilities, the Advanced " + "Basilisk sprays a poisonous gas which disorientaits any " + "nearby humans.", "spitter", //char *modelname; 0.7f, //float modelScale; "blue", //char *skinname; @@ -1726,6 +1804,8 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL2, //int classnum; "level2", //char *classname; "Chimera", //char *humanname; + "Has a melee attack and the ability to jump off walls. This " + "allows the Marauder to gather great speed in enclosed areas.", "tarantula", //char *modelname; 0.75f, //float modelScale; "default", //char *skinname; @@ -1765,6 +1845,8 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL2_UPG, //int classnum; "level2upg", //char *classname; "Chimera Upgrade", //char *humanname; + "The Advanced Marauder has all the abilities of the base Marauder " + "including an area effect electric shock attack.", "tarantula", //char *modelname; 0.9f, //float modelScale; "red", //char *skinname; @@ -1804,6 +1886,9 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL3, //int classnum; "level3", //char *classname; "Dragoon", //char *humanname; + "Possesses a melee attack and the pounce ability, which may " + "be used as an attack, or a means to reach a remote " + "location inaccessible from the ground.", "prowl", //char *modelname; 1.0f, //float modelScale; "default", //char *skinname; @@ -1843,6 +1928,9 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL3_UPG, //int classnum; "level3upg", //char *classname; "Dragoon Upgrade", //char *humanname; + "In addition to the basic Dragoon abilities, the Dragoon " + "Upgrade has 3 barbs which may be used to attack humans " + "from a distance.", "prowl", //char *modelname; 1.0f, //float modelScale; "default", //char *skinname; @@ -1882,6 +1970,9 @@ classAttributes_t bg_classList[ ] = PCL_ALIEN_LEVEL4, //int classnum; "level4", //char *classname; "Big Mofo", //char *humanname; + "Provides a healing aura in which nearby aliens regenerate health " + "faster than usual. As well as a melee attack, this class can charge " + "at enemy humans and structures, inflicting great damage.", "mofo", //char *modelname; 1.0f, //float modelScale; "default", //char *skinname; @@ -1921,6 +2012,7 @@ classAttributes_t bg_classList[ ] = PCL_HUMAN, //int classnum; "human_base", //char *classname; "Human", //char *humanname; + "", "sarge", //char *modelname; 1.0f, //float modelScale; "default", //char *skinname; @@ -1959,7 +2051,8 @@ classAttributes_t bg_classList[ ] = { PCL_HUMAN_BSUIT, //int classnum; "human_bsuit", //char *classname; - "bsuit", //char *humanname; + "Battlesuit", //char *humanname; + "", "keel", //char *modelname; 1.0f, //float modelScale; "default", //char *skinname; @@ -2066,6 +2159,26 @@ char *BG_FindHumanNameForClassNum( int pclass ) /* ============== +BG_FindInfoForClassNum +============== +*/ +char *BG_FindInfoForClassNum( int pclass ) +{ + int i; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( bg_classList[ i ].classNum == pclass ) + return bg_classList[ i ].info; + } + + Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindInfoForClassNum\n" ); + //wimp out + return 0; +} + +/* +============== BG_FindModelNameForClass ============== */ @@ -3040,6 +3153,7 @@ weaponAttributes_t bg_weapons[ ] = 0, //int slots; "blaster", //char *weaponName; "Blaster", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3065,6 +3179,8 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "rifle", //char *weaponName; "Rifle", //char *weaponHumanName; + "Basic weapon. Cased projectile weapon, with a slow clip based " + "reload system.", RIFLE_CLIPSIZE, //int maxAmmo; RIFLE_MAXCLIPS, //int maxClips; qfalse, //int infiniteAmmo; @@ -3090,6 +3206,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "shotgun", //char *weaponName; "Shotgun", //char *weaponHumanName; + "Close range weapon that is useful against larger foes. " + "It has a slow repeat rate, but can be devastatingly " + "effective.", SHOTGUN_SHELLS, //int maxAmmo; SHOTGUN_MAXCLIPS, //int maxClips; qfalse, //int infiniteAmmo; @@ -3115,6 +3234,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "flamer", //char *weaponName; "Flame Thrower", //char *weaponHumanName; + "Sprays fire at its target. It is powered by compressed " + "gas. The relatively low rate of fire means this weapon is most " + "effective against static targets.", FLAMER_GAS, //int maxAmmo; 0, //int maxClips; qfalse, //int infiniteAmmo; @@ -3140,6 +3262,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "chaingun", //char *weaponName; "Chaingun", //char *weaponHumanName; + "Belt drive, cased projectile weapon. It has a high repeat " + "rate but a wide firing angle and is therefore relatively " + "inaccurate.", CHAINGUN_BULLETS, //int maxAmmo; 0, //int maxClips; qfalse, //int infiniteAmmo; @@ -3165,6 +3290,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "mdriver", //char *weaponName; "Mass Driver", //char *weaponHumanName; + "A portable particle accelerator which causes minor nuclear " + "reactions at the point of impact. It has a very large " + "payload, but fires slowly.", MDRIVER_CLIPSIZE, //int maxAmmo; MDRIVER_MAXCLIPS, //int maxClips; qfalse, //int infiniteAmmo; @@ -3190,6 +3318,8 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "prifle", //char *weaponName; "Pulse Rifle", //char *weaponHumanName; + "An energy weapon that fires pulses of concentrated energy " + "at a fast rate. It requires re-energising every 50 pulses.", PRIFLE_CLIPS, //int maxAmmo; PRIFLE_MAXCLIPS, //int maxClips; qfalse, //int infiniteAmmo; @@ -3215,6 +3345,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "lcannon", //char *weaponName; "Lucifer Cannon", //char *weaponHumanName; + "Similar to the pulse rifle, but more powerful. Additionally, " + "it has a secondary attack where energy can be charged " + "up to shoot a devastating ball of energy.", LCANNON_AMMO, //int maxAmmo; 0, //int maxClips; qfalse, //int infiniteAmmo; @@ -3240,6 +3373,8 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "lgun", //char *weaponName; "Las Gun", //char *weaponHumanName; + "Slightly more powerful than the basic rifle, but " + "instead of bullets it fires small packets of energy.", LASGUN_AMMO, //int maxAmmo; 0, //int maxClips; qfalse, //int infiniteAmmo; @@ -3265,6 +3400,9 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "psaw", //char *weaponName; "Pain Saw", //char *weaponHumanName; + "Similar to a chainsaw, but instead of a chain it has an " + "electric arc capable of dealing a great deal of damage at " + "close range.", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3290,6 +3428,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_NONE, //int slots; "grenade", //char *weaponName; "Grenade", //char *weaponHumanName; + "", 1, //int maxAmmo; 0, //int maxClips; qfalse, //int infiniteAmmo; @@ -3315,6 +3454,8 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "ckit", //char *weaponName; "Construction Kit", //char *weaponHumanName; + "Used for building all basic structures. This includes " + "spawns, power and basic defense.", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3340,6 +3481,8 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "ackit", //char *weaponName; "Adv Construction Kit",//char *weaponHumanName; + "Used for building advanced structures. This includes " + "combat computers and advanced defense.", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3365,6 +3508,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "abuild", //char *weaponName; "Alien build weapon", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3390,6 +3534,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "abuildupg", //char *weaponName; "Alien build weapon2",//char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3415,6 +3560,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level0", //char *weaponName; "Bite", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3440,6 +3586,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level1", //char *weaponName; "Claws", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3465,6 +3612,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level1upg", //char *weaponName; "Claws Upgrade", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3490,6 +3638,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level2", //char *weaponName; "Bite", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3515,6 +3664,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level2upg", //char *weaponName; "Zap", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3540,6 +3690,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level3", //char *weaponName; "Pounce", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3565,6 +3716,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level3upg", //char *weaponName; "Pounce (upgrade)", //char *weaponHumanName; + "", 3, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3590,6 +3742,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "level4", //char *weaponName; "Charge", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3615,6 +3768,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "lockblob", //char *weaponName; "Lock Blob", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3640,6 +3794,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "hive", //char *weaponName; "Hive", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3665,6 +3820,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "mgturret", //char *weaponName; "Machinegun Turret", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3690,6 +3846,7 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "teslagen", //char *weaponName; "Tesla Generator", //char *weaponHumanName; + "", 0, //int maxAmmo; 0, //int maxClips; qtrue, //int infiniteAmmo; @@ -3834,6 +3991,25 @@ char *BG_FindHumanNameForWeapon( int weapon ) /* ============== +BG_FindInfoForWeapon +============== +*/ +char *BG_FindInfoForWeapon( int weapon ) +{ + int i; + + for( i = 0; i < bg_numWeapons; i++ ) + { + if( bg_weapons[ i ].weaponNum == weapon ) + return bg_weapons[ i ].info; + } + + //wimp out + return 0; +} + +/* +============== BG_FindAmmoForWeapon ============== */ @@ -4161,6 +4337,8 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, //int slots; "larmour", //char *upgradeName; "Light Armour", //char *upgradeHumanName; + "Protective armour that helps to defend against light alien melee " + "attacks.", "icons/iconu_larmour", qtrue, //qboolean purchasable qfalse, //qboolean usable @@ -4173,6 +4351,9 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_HEAD, //int slots; "helmet", //char *upgradeName; "Helmet", //char *upgradeHumanName; + "In addition to protecting your head, the helmet provides a " + "scanner indicating the presence of any non-human lifeforms in your " + "immediate vicinity.", "icons/iconu_helmet", qtrue, //qboolean purchasable qfalse, //qboolean usable @@ -4185,6 +4366,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_NONE, //int slots; "medkit", //char *upgradeName; "Medkit", //char *upgradeHumanName; + "", "icons/iconu_atoxin", qfalse, //qboolean purchasable qtrue, //qboolean usable @@ -4197,6 +4379,8 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_BACKPACK, //int slots; "battpack", //char *upgradeName; "Battery Pack", //char *upgradeHumanName; + "Back-mounted battery pack that permits storage of one and a half " + "times the normal energy capacity for energy weapons.", "icons/iconu_battpack", qtrue, //qboolean purchasable qfalse, //qboolean usable @@ -4209,6 +4393,9 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_BACKPACK, //int slots; "jetpack", //char *upgradeName; "Jet Pack", //char *upgradeHumanName; + "Back-mounted jet pack that enables the user to fly to remote " + "locations. It is very useful against alien spawns in hard " + "to reach spots.", "icons/iconu_jetpack", qtrue, //qboolean purchasable qtrue, //qboolean usable @@ -4221,6 +4408,9 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS|SLOT_BACKPACK, //int slots; "bsuit", //char *upgradeName; "Battlesuit", //char *upgradeHumanName; + "A full body armour that is highly effective at repelling alien attacks. " + "It allows the user to enter hostile situations with a greater degree " + "of confidence.", "icons/iconu_bsuit", qtrue, //qboolean purchasable qfalse, //qboolean usable @@ -4233,6 +4423,8 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_NONE, //int slots; "gren", //char *upgradeName; "Grenade", //char *upgradeHumanName; + "A small incendinary device ideal for damaging tightly packed " + "alien structures. Has a five second timer.", 0, qtrue, //qboolean purchasable qtrue, //qboolean usable @@ -4245,6 +4437,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_NONE, //int slots; "ammo", //char *upgradeName; "Ammunition", //char *upgradeHumanName; + "Ammunition for the currently held weapon.", 0, qtrue, //qboolean purchasable qfalse, //qboolean usable @@ -4376,6 +4569,25 @@ char *BG_FindHumanNameForUpgrade( int upgrade ) /* ============== +BG_FindInfoForUpgrade +============== +*/ +char *BG_FindInfoForUpgrade( int upgrade ) +{ + int i; + + for( i = 0; i < bg_numUpgrades; i++ ) + { + if( bg_upgrades[ i ].upgradeNum == upgrade ) + return bg_upgrades[ i ].info; + } + + //wimp out + return 0; +} + +/* +============== BG_FindIconForUpgrade ============== */ diff --git a/src/game/bg_public.h b/src/game/bg_public.h index a48669d6..9be0d73b 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -879,6 +879,7 @@ typedef struct char *className; char *humanName; + char *info; char *modelName; float modelScale; @@ -963,6 +964,7 @@ typedef struct char *buildName; char *humanName; + char *info; char *entityName; char *models[ MAX_BUILDABLE_MODELS ]; @@ -1032,6 +1034,7 @@ typedef struct char *weaponName; char *weaponHumanName; + char *info; int maxAmmo; int maxClips; @@ -1070,6 +1073,7 @@ typedef struct char *upgradeName; char *upgradeHumanName; + char *info; char *icon; @@ -1104,6 +1108,7 @@ int BG_FindBuildNumForEntityName( char *name ); char *BG_FindNameForBuildable( int bclass ); char *BG_FindHumanNameForBuildable( int bclass ); char *BG_FindEntityNameForBuildable( int bclass ); +char *BG_FindInfoForBuildable( int bclass ); char *BG_FindModelsForBuildable( int bclass, int modelNum ); float BG_FindModelScaleForBuildable( int bclass ); void BG_FindBBoxForBuildable( int bclass, vec3_t mins, vec3_t maxs ); @@ -1138,6 +1143,7 @@ void BG_InitBuildableOverrides( void ); int BG_FindClassNumForName( char *name ); char *BG_FindNameForClassNum( int pclass ); char *BG_FindHumanNameForClassNum( int pclass ); +char *BG_FindInfoForClassNum( int pclass ); char *BG_FindModelNameForClass( int pclass ); float BG_FindModelScaleForClass( int pclass ); char *BG_FindSkinNameForClass( int pclass ); @@ -1175,6 +1181,7 @@ int BG_FindSlotsForWeapon( int weapon ); char *BG_FindNameForWeapon( int weapon ); int BG_FindWeaponNumForName( char *name ); char *BG_FindHumanNameForWeapon( int weapon ); +char *BG_FindInfoForWeapon( int weapon ); char *BG_FindModelsForWeapon( int weapon, int modelNum ); char *BG_FindIconForWeapon( int weapon ); char *BG_FindCrosshairForWeapon( int weapon ); @@ -1202,6 +1209,7 @@ int BG_FindSlotsForUpgrade( int upgrade ); char *BG_FindNameForUpgrade( int upgrade ); int BG_FindUpgradeNumForName( char *name ); char *BG_FindHumanNameForUpgrade( int upgrade ); +char *BG_FindInfoForUpgrade( int upgrade ); char *BG_FindIconForUpgrade( int upgrade ); qboolean BG_FindPurchasableForUpgrade( int upgrade ); qboolean BG_FindUsableForUpgrade( int upgrade ); diff --git a/src/ui/ui_local.h b/src/ui/ui_local.h index ad7d38b3..ff8367ba 100644 --- a/src/ui/ui_local.h +++ b/src/ui/ui_local.h @@ -744,44 +744,29 @@ typedef struct { const char *modDescr; } modInfo_t; -#define MAX_INFOPANE_TEXT 4096 -#define MAX_INFOPANE_GRAPHICS 16 -#define MAX_INFOPANES 128 - typedef enum { - INFOPANE_TOP, - INFOPANE_BOTTOM, - INFOPANE_LEFT, - INFOPANE_RIGHT -} tremIPSide_t; - -typedef struct -{ - qhandle_t graphic; - - tremIPSide_t side; - int offset; - - int width, height; -} tremIPGraphic_t; + INFOTYPE_TEXT, + INFOTYPE_BUILDABLE, + INFOTYPE_CLASS, + INFOTYPE_WEAPON, + INFOTYPE_UPGRADE +} infoType_t; typedef struct { - const char *name; - char text[ MAX_INFOPANE_TEXT ]; - int align; - - tremIPGraphic_t graphics[ MAX_INFOPANE_GRAPHICS ]; - int numGraphics; -} tremInfoPane_t; - -typedef struct -{ - const char *text; - const char *cmd; - tremInfoPane_t *infopane; -} tremMenuItem_t; + const char *text; + const char *cmd; + infoType_t type; + union + { + const char *text; + buildable_t buildable; + pClass_t pclass; + weapon_t weapon; + upgrade_t upgrade; + } v; +} menuItem_t; typedef struct { displayContextDef_t uiDC; @@ -848,40 +833,37 @@ typedef struct { int movieIndex; int previewMovie; - tremInfoPane_t tremInfoPanes[ MAX_INFOPANES ]; - int tremInfoPaneCount; - - tremMenuItem_t tremTeamList[ 4 ]; - int tremTeamCount; - int tremTeamIndex; + menuItem_t tremTeamList[ 4 ]; + int tremTeamCount; + int tremTeamIndex; - tremMenuItem_t tremAlienClassList[ 3 ]; - int tremAlienClassCount; - int tremAlienClassIndex; + menuItem_t alienClassList[ 3 ]; + int alienClassCount; + int alienClassIndex; - tremMenuItem_t tremHumanItemList[ 3 ]; - int tremHumanItemCount; - int tremHumanItemIndex; + menuItem_t humanItemList[ 3 ]; + int humanItemCount; + int humanItemIndex; - tremMenuItem_t tremHumanArmouryBuyList[ 32 ]; - int tremHumanArmouryBuyCount; - int tremHumanArmouryBuyIndex; + menuItem_t humanArmouryBuyList[ 32 ]; + int humanArmouryBuyCount; + int humanArmouryBuyIndex; - tremMenuItem_t tremHumanArmourySellList[ 32 ]; - int tremHumanArmourySellCount; - int tremHumanArmourySellIndex; + menuItem_t humanArmourySellList[ 32 ]; + int humanArmourySellCount; + int humanArmourySellIndex; - tremMenuItem_t tremAlienUpgradeList[ 16 ]; - int tremAlienUpgradeCount; - int tremAlienUpgradeIndex; + menuItem_t alienUpgradeList[ 16 ]; + int alienUpgradeCount; + int alienUpgradeIndex; - tremMenuItem_t tremAlienBuildList[ 32 ]; - int tremAlienBuildCount; - int tremAlienBuildIndex; + menuItem_t alienBuildList[ 32 ]; + int alienBuildCount; + int alienBuildIndex; - tremMenuItem_t tremHumanBuildList[ 32 ]; - int tremHumanBuildCount; - int tremHumanBuildIndex; + menuItem_t humanBuildList[ 32 ]; + int humanBuildCount; + int humanBuildIndex; serverStatus_t serverStatus; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index bdc2466c..f3a17f1e 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -999,203 +999,6 @@ void UI_ParseMenu(const char *menuFile) { trap_Parse_FreeSource(handle); } -/* -=============== -UI_FindInfoPaneByName -=============== -*/ -tremInfoPane_t *UI_FindInfoPaneByName( const char *name ) -{ - int i; - - for( i = 0; i < uiInfo.tremInfoPaneCount; i++ ) - { - if( !Q_stricmp( uiInfo.tremInfoPanes[ i ].name, name ) ) - return &uiInfo.tremInfoPanes[ i ]; - } - - //create a dummy infopane demanding the user write the infopane - uiInfo.tremInfoPanes[ i ].name = String_Alloc( name ); - strncpy( uiInfo.tremInfoPanes[ i ].text, "Not implemented.\n\nui/infopanes.def\n", MAX_INFOPANE_TEXT ); - Q_strcat( uiInfo.tremInfoPanes[ i ].text, MAX_INFOPANE_TEXT, String_Alloc( name ) ); - - uiInfo.tremInfoPaneCount++; - - return &uiInfo.tremInfoPanes[ i ]; -} - -/* -=============== -UI_LoadInfoPane -=============== -*/ -qboolean UI_LoadInfoPane( int handle ) -{ - pc_token_t token; - qboolean valid = qfalse; - - while( 1 ) - { - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - if( !Q_stricmp( token.string, "name" ) ) - { - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].name = String_Alloc( token.string ); - valid = qtrue; - } - else if( !Q_stricmp( token.string, "graphic" ) ) - { - int *graphic; - - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - graphic = &uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].numGraphics; - - if( !Q_stricmp( token.string, "top" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_TOP; - else if( !Q_stricmp( token.string, "bottom" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_BOTTOM; - else if( !Q_stricmp( token.string, "left" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_LEFT; - else if( !Q_stricmp( token.string, "right" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].side = INFOPANE_RIGHT; - else - break; - - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - if( !Q_stricmp( token.string, "center" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].offset = -1; - else - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].offset = token.intvalue; - - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].graphic = - trap_R_RegisterShaderNoMip( token.string ); - - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].width = token.intvalue; - - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].graphics[ *graphic ].height = token.intvalue; - - //increment graphics - (*graphic)++; - - if( *graphic == MAX_INFOPANE_GRAPHICS ) - break; - } - else if( !Q_stricmp( token.string, "text" ) ) - { - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - Q_strcat( uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].text, MAX_INFOPANE_TEXT, token.string ); - } - else if( !Q_stricmp( token.string, "align" ) ) - { - memset( &token, 0, sizeof( pc_token_t ) ); - - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - if( !Q_stricmp( token.string, "left" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].align = ITEM_ALIGN_LEFT; - else if( !Q_stricmp( token.string, "right" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].align = ITEM_ALIGN_RIGHT; - else if( !Q_stricmp( token.string, "center" ) ) - uiInfo.tremInfoPanes[ uiInfo.tremInfoPaneCount ].align = ITEM_ALIGN_CENTER; - } - else if( token.string[ 0 ] == '}' ) - { - //reached the end, break - break; - } - else - break; - } - - if( valid ) - { - uiInfo.tremInfoPaneCount++; - return qtrue; - } - else - { - return qfalse; - } -} - -/* -=============== -UI_LoadInfoPanes -=============== -*/ -void UI_LoadInfoPanes( const char *file ) -{ - pc_token_t token; - int handle; - int count; - - uiInfo.tremInfoPaneCount = count = 0; - - handle = trap_Parse_LoadSource( file ); - - if( !handle ) - { - trap_Error( va( S_COLOR_YELLOW "infopane file not found: %s\n", file ) ); - return; - } - - while( 1 ) - { - if( !trap_Parse_ReadToken( handle, &token ) ) - break; - - if( token.string[ 0 ] == 0 ) - break; - - if( token.string[ 0 ] == '{' ) - { - if( UI_LoadInfoPane( handle ) ) - count++; - - if( count == MAX_INFOPANES ) - break; - } - } - - trap_Parse_FreeSource( handle ); -} - qboolean Load_Menu(int handle) { pc_token_t token; @@ -1405,81 +1208,26 @@ static void UI_DrawPreviewCinematic(rectDef_t *rect, float scale, vec4_t color) } -#define GRAPHIC_BWIDTH 8.0f /* =============== UI_DrawInfoPane =============== */ -static void UI_DrawInfoPane( tremInfoPane_t *pane, rectDef_t *rect, float text_x, float text_y, +static void UI_DrawInfoPane( menuItem_t *item, rectDef_t *rect, float text_x, float text_y, float scale, vec4_t color, int textStyle ) { - int i; float maxLeft = 0, maxTop = 0; float maxRight = 0, maxBottom = 0; float x = rect->x - text_x, y = rect->y - text_y, w, h; - float xoffset = 0, yoffset = 0; menuDef_t dummyParent; itemDef_t textItem; + int value = 0; + char *string = ""; + int class, credits; + char ui_currentClass[ MAX_STRING_CHARS ]; - //iterate through graphics - for( i = 0; i < pane->numGraphics; i++ ) - { - float width = pane->graphics[ i ].width; - float height = pane->graphics[ i ].height; - qhandle_t graphic = pane->graphics[ i ].graphic; - - if( pane->graphics[ i ].side == INFOPANE_TOP || pane->graphics[ i ].side == INFOPANE_BOTTOM ) - { - //set horizontal offset of graphic - if( pane->graphics[ i ].offset < 0 ) - xoffset = ( rect->w / 2 ) - ( pane->graphics[ i ].width / 2 ); - else - xoffset = pane->graphics[ i ].offset + GRAPHIC_BWIDTH; - } - else if( pane->graphics[ i ].side == INFOPANE_LEFT || pane->graphics[ i ].side == INFOPANE_RIGHT ) - { - //set vertical offset of graphic - if( pane->graphics[ i ].offset < 0 ) - yoffset = ( rect->h / 2 ) - ( pane->graphics[ i ].height / 2 ); - else - yoffset = pane->graphics[ i ].offset + GRAPHIC_BWIDTH; - } - - if( pane->graphics[ i ].side == INFOPANE_LEFT ) - { - //set the horizontal offset of the text - if( pane->graphics[ i ].width > maxLeft ) - maxLeft = pane->graphics[ i ].width + GRAPHIC_BWIDTH; - - xoffset = GRAPHIC_BWIDTH; - } - else if( pane->graphics[ i ].side == INFOPANE_RIGHT ) - { - if( pane->graphics[ i ].width > maxRight ) - maxRight = pane->graphics[ i ].width + GRAPHIC_BWIDTH; - - xoffset = rect->w - width - GRAPHIC_BWIDTH; - } - else if( pane->graphics[ i ].side == INFOPANE_TOP ) - { - //set the vertical offset of the text - if( pane->graphics[ i ].height > maxTop ) - maxTop = pane->graphics[ i ].height + GRAPHIC_BWIDTH; - - yoffset = GRAPHIC_BWIDTH; - } - else if( pane->graphics[ i ].side == INFOPANE_BOTTOM ) - { - if( pane->graphics[ i ].height > maxBottom ) - maxBottom = pane->graphics[ i ].height + GRAPHIC_BWIDTH; - - yoffset = rect->h - height - GRAPHIC_BWIDTH; - } - - //draw the graphic - UI_DrawHandlePic( x + xoffset, y + yoffset, width, height, graphic ); - } + trap_Cvar_VariableStringBuffer( "ui_currentClass", ui_currentClass, MAX_STRING_CHARS ); + sscanf( ui_currentClass, "%d %d", &class, &credits ); //offset the text x = rect->x + maxLeft; @@ -1487,31 +1235,93 @@ static void UI_DrawInfoPane( tremInfoPane_t *pane, rectDef_t *rect, float text_x w = rect->w - ( maxLeft + maxRight + 16 + ( 2 * text_x ) ); //16 to ensure text within frame h = rect->h - ( maxTop + maxBottom ); - textItem.text = pane->text; - - textItem.parent = &dummyParent; - memcpy( textItem.window.foreColor, color, sizeof( vec4_t ) ); - textItem.window.flags = 0; - - switch( pane->align ) + switch( item->type ) { - case ITEM_ALIGN_LEFT: - textItem.window.rect.x = x; + case INFOTYPE_TEXT: + textItem.text = item->v.text; break; - case ITEM_ALIGN_RIGHT: - textItem.window.rect.x = x + w; + case INFOTYPE_CLASS: + value = BG_ClassCanEvolveFromTo( class, item->v.pclass, credits, 0 ); + if( value < 1 ) + { + textItem.text = va( "%s\n\n%s", + BG_FindHumanNameForClassNum( item->v.pclass ), + BG_FindInfoForClassNum( item->v.pclass ) ); + } + else + { + textItem.text = va( "%s\n\n%s\n\nKills: %d", + BG_FindHumanNameForClassNum( item->v.pclass ), + BG_FindInfoForClassNum( item->v.pclass ), + value ); + } break; - case ITEM_ALIGN_CENTER: - textItem.window.rect.x = x + ( w / 2 ); + case INFOTYPE_WEAPON: + value = BG_FindPriceForWeapon( item->v.weapon ); + if( value == 0 ) + { + textItem.text = va( "%s\n\n%s\n\nCredits: Free", + BG_FindHumanNameForWeapon( item->v.weapon ), + BG_FindInfoForWeapon( item->v.weapon ) ); + } + else + { + textItem.text = va( "%s\n\n%s\n\nCredits: %d", + BG_FindHumanNameForWeapon( item->v.weapon ), + BG_FindInfoForWeapon( item->v.weapon ), + value ); + } break; - default: - textItem.window.rect.x = x; + case INFOTYPE_UPGRADE: + value = BG_FindPriceForUpgrade( item->v.upgrade ); + if( value == 0 ) + { + textItem.text = va( "%s\n\n%s\n\nCredits: Free", + BG_FindHumanNameForUpgrade( item->v.upgrade ), + BG_FindInfoForUpgrade( item->v.upgrade ) ); + } + else + { + textItem.text = va( "%s\n\n%s\n\nCredits: %d", + BG_FindHumanNameForUpgrade( item->v.upgrade ), + BG_FindInfoForUpgrade( item->v.upgrade ), + value ); + } + break; + + case INFOTYPE_BUILDABLE: + value = BG_FindBuildPointsForBuildable( item->v.buildable ); + switch( BG_FindTeamForBuildable( item->v.buildable ) ) + { + case BIT_ALIENS: string = "Sentience"; break; + case BIT_HUMANS: string = "Power"; break; + default: break; + } + + if( value == 0 ) + { + textItem.text = va( "%s\n\n%s", + BG_FindHumanNameForBuildable( item->v.buildable ), + BG_FindInfoForBuildable( item->v.buildable ) ); + } + else + { + textItem.text = va( "%s\n\n%s\n\n%s: %d", + BG_FindHumanNameForBuildable( item->v.buildable ), + BG_FindInfoForBuildable( item->v.buildable ), + string, value ); + } break; } + textItem.parent = &dummyParent; + memcpy( textItem.window.foreColor, color, sizeof( vec4_t ) ); + textItem.window.flags = 0; + + textItem.window.rect.x = x; textItem.window.rect.y = y; textItem.window.rect.w = w; textItem.window.rect.h = h; @@ -1520,7 +1330,7 @@ static void UI_DrawInfoPane( tremInfoPane_t *pane, rectDef_t *rect, float text_x textItem.textRect.y = 0; textItem.textRect.w = 0; textItem.textRect.h = 0; - textItem.textalignment = pane->align; + textItem.textalignment = ITEM_ALIGN_LEFT; textItem.textalignx = text_x; textItem.textaligny = text_y; textItem.textscale = scale; @@ -2346,7 +2156,6 @@ static void UI_OwnerDraw( float x, float y, float w, float h, float scale, vec4_t color, qhandle_t shader, int textStyle ) { rectDef_t rect; - tremInfoPane_t *pane = NULL; rect.x = x + text_x; rect.y = y + text_y; @@ -2356,43 +2165,43 @@ static void UI_OwnerDraw( float x, float y, float w, float h, switch( ownerDraw ) { case UI_TEAMINFOPANE: - if( ( pane = uiInfo.tremTeamList[ uiInfo.tremTeamIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.tremTeamList[ uiInfo.tremTeamIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_ACLASSINFOPANE: - if( ( pane = uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.alienClassList[ uiInfo.alienClassIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_AUPGRADEINFOPANE: - if( ( pane = uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.alienUpgradeList[ uiInfo.alienUpgradeIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_HITEMINFOPANE: - if( ( pane = uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.humanItemList[ uiInfo.humanItemIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_HBUYINFOPANE: - if( ( pane = uiInfo.tremHumanArmouryBuyList[ uiInfo.tremHumanArmouryBuyIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.humanArmouryBuyList[ uiInfo.humanArmouryBuyIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_HSELLINFOPANE: - if( ( pane = uiInfo.tremHumanArmourySellList[ uiInfo.tremHumanArmourySellIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.humanArmourySellList[ uiInfo.humanArmourySellIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_ABUILDINFOPANE: - if( ( pane = uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.alienBuildList[ uiInfo.alienBuildIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_HBUILDINFOPANE: - if( ( pane = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].infopane ) ) - UI_DrawInfoPane( pane, &rect, text_x, text_y, scale, color, textStyle ); + UI_DrawInfoPane( &uiInfo.humanBuildList[ uiInfo.humanBuildIndex ], + &rect, text_x, text_y, scale, color, textStyle ); break; case UI_HANDICAP: @@ -3171,28 +2980,43 @@ static stage_t UI_GetCurrentHumanStage( void ) /* =============== -UI_LoadTremTeams +UI_LoadTeams =============== */ -static void UI_LoadTremTeams( void ) +static void UI_LoadTeams( void ) { uiInfo.tremTeamCount = 4; uiInfo.tremTeamList[ 0 ].text = String_Alloc( "Aliens" ); uiInfo.tremTeamList[ 0 ].cmd = String_Alloc( "cmd team aliens\n" ); - uiInfo.tremTeamList[ 0 ].infopane = UI_FindInfoPaneByName( "alienteam" ); + uiInfo.tremTeamList[ 0 ].type = INFOTYPE_TEXT; + uiInfo.tremTeamList[ 0 ].v.text = + "The Alien Team\n\n" + "The Aliens' strengths are in movement and the ability to " + "quickly construct new bases quickly. They possess a range " + "of abilities including basic melee attacks, movement-" + "crippling poisons and more."; uiInfo.tremTeamList[ 1 ].text = String_Alloc( "Humans" ); uiInfo.tremTeamList[ 1 ].cmd = String_Alloc( "cmd team humans\n" ); - uiInfo.tremTeamList[ 1 ].infopane = UI_FindInfoPaneByName( "humanteam" ); + uiInfo.tremTeamList[ 1 ].type = INFOTYPE_TEXT; + uiInfo.tremTeamList[ 1 ].v.text = + "The Human Team\n\n" + "The humans are the masters of technology. Although their " + "bases take long to construct, their automated defense " + "ensures they stay built. A wide range of upgrades and " + "weapons are available to the humans, each contributing " + "to eradicate the alien threat."; uiInfo.tremTeamList[ 2 ].text = String_Alloc( "Spectate" ); uiInfo.tremTeamList[ 2 ].cmd = String_Alloc( "cmd team spectate\n" ); - uiInfo.tremTeamList[ 2 ].infopane = UI_FindInfoPaneByName( "spectateteam" ); + uiInfo.tremTeamList[ 2 ].type = INFOTYPE_TEXT; + uiInfo.tremTeamList[ 2 ].v.text = "Watch the game without playing."; uiInfo.tremTeamList[ 3 ].text = String_Alloc( "Auto select" ); uiInfo.tremTeamList[ 3 ].cmd = String_Alloc( "cmd team auto\n" ); - uiInfo.tremTeamList[ 3 ].infopane = UI_FindInfoPaneByName( "autoteam" ); + uiInfo.tremTeamList[ 3 ].type = INFOTYPE_TEXT; + uiInfo.tremTeamList[ 3 ].v.text = "Join the team with the least players."; } /* @@ -3202,24 +3026,24 @@ UI_AddClass */ static void UI_AddClass( pClass_t class ) { - uiInfo.tremAlienClassList[ uiInfo.tremAlienClassCount ].text = + uiInfo.alienClassList[ uiInfo.alienClassCount ].text = String_Alloc( BG_FindHumanNameForClassNum( class ) ); - uiInfo.tremAlienClassList[ uiInfo.tremAlienClassCount ].cmd = + uiInfo.alienClassList[ uiInfo.alienClassCount ].cmd = String_Alloc( va( "cmd class %s\n", BG_FindNameForClassNum( class ) ) ); - uiInfo.tremAlienClassList[ uiInfo.tremAlienClassCount ].infopane = - UI_FindInfoPaneByName( va( "%sclass", BG_FindNameForClassNum( class ) ) ); + uiInfo.alienClassList[ uiInfo.alienClassCount ].type = INFOTYPE_CLASS; + uiInfo.alienClassList[ uiInfo.alienClassCount ].v.pclass = class; - uiInfo.tremAlienClassCount++; + uiInfo.alienClassCount++; } /* =============== -UI_LoadTremAlienClasses +UI_LoadAlienClasses =============== */ -static void UI_LoadTremAlienClasses( void ) +static void UI_LoadAlienClasses( void ) { - uiInfo.tremAlienClassCount = 0; + uiInfo.alienClassCount = 0; if( BG_ClassIsAllowed( PCL_ALIEN_LEVEL0 ) ) UI_AddClass( PCL_ALIEN_LEVEL0 ); @@ -3238,24 +3062,24 @@ UI_AddItem */ static void UI_AddItem( weapon_t weapon ) { - uiInfo.tremHumanItemList[ uiInfo.tremHumanItemCount ].text = + uiInfo.humanItemList[ uiInfo.humanItemCount ].text = String_Alloc( BG_FindHumanNameForWeapon( weapon ) ); - uiInfo.tremHumanItemList[ uiInfo.tremHumanItemCount ].cmd = + uiInfo.humanItemList[ uiInfo.humanItemCount ].cmd = String_Alloc( va( "cmd class %s\n", BG_FindNameForWeapon( weapon ) ) ); - uiInfo.tremHumanItemList[ uiInfo.tremHumanItemCount ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( weapon ) ) ); + uiInfo.humanItemList[ uiInfo.humanItemCount ].type = INFOTYPE_WEAPON; + uiInfo.humanItemList[ uiInfo.humanItemCount ].v.weapon = weapon; - uiInfo.tremHumanItemCount++; + uiInfo.humanItemCount++; } /* =============== -UI_LoadTremHumanItems +UI_LoadHumanItems =============== */ -static void UI_LoadTremHumanItems( void ) +static void UI_LoadHumanItems( void ) { - uiInfo.tremHumanItemCount = 0; + uiInfo.humanItemCount = 0; if( BG_WeaponIsAllowed( WP_MACHINEGUN ) ) UI_AddItem( WP_MACHINEGUN ); @@ -3329,10 +3153,10 @@ static void UI_ParseCarriageList( int *weapons, int *upgrades ) /* =============== -UI_LoadTremHumanArmouryBuys +UI_LoadHumanArmouryBuys =============== */ -static void UI_LoadTremHumanArmouryBuys( void ) +static void UI_LoadHumanArmouryBuys( void ) { int i, j = 0; stage_t stage = UI_GetCurrentHumanStage( ); @@ -3353,7 +3177,7 @@ static void UI_LoadTremHumanArmouryBuys( void ) slots |= BG_FindSlotsForUpgrade( i ); } - uiInfo.tremHumanArmouryBuyCount = 0; + uiInfo.humanArmouryBuyCount = 0; for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) { @@ -3364,16 +3188,16 @@ static void UI_LoadTremHumanArmouryBuys( void ) !( BG_FindSlotsForWeapon( i ) & slots ) && !( weapons & ( 1 << i ) ) ) { - uiInfo.tremHumanArmouryBuyList[ j ].text = + uiInfo.humanArmouryBuyList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); - uiInfo.tremHumanArmouryBuyList[ j ].cmd = + uiInfo.humanArmouryBuyList[ j ].cmd = String_Alloc( va( "cmd buy %s retrigger\n", BG_FindNameForWeapon( i ) ) ); - uiInfo.tremHumanArmouryBuyList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) ); + uiInfo.humanArmouryBuyList[ j ].type = INFOTYPE_WEAPON; + uiInfo.humanArmouryBuyList[ j ].v.weapon = i; j++; - uiInfo.tremHumanArmouryBuyCount++; + uiInfo.humanArmouryBuyCount++; } } @@ -3386,46 +3210,46 @@ static void UI_LoadTremHumanArmouryBuys( void ) !( BG_FindSlotsForUpgrade( i ) & slots ) && !( upgrades & ( 1 << i ) ) ) { - uiInfo.tremHumanArmouryBuyList[ j ].text = + uiInfo.humanArmouryBuyList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); - uiInfo.tremHumanArmouryBuyList[ j ].cmd = + uiInfo.humanArmouryBuyList[ j ].cmd = String_Alloc( va( "cmd buy %s retrigger\n", BG_FindNameForUpgrade( i ) ) ); - uiInfo.tremHumanArmouryBuyList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) ); + uiInfo.humanArmouryBuyList[ j ].type = INFOTYPE_UPGRADE; + uiInfo.humanArmouryBuyList[ j ].v.upgrade = i; j++; - uiInfo.tremHumanArmouryBuyCount++; + uiInfo.humanArmouryBuyCount++; } } } /* =============== -UI_LoadTremHumanArmourySells +UI_LoadHumanArmourySells =============== */ -static void UI_LoadTremHumanArmourySells( void ) +static void UI_LoadHumanArmourySells( void ) { int weapons, upgrades; int i, j = 0; - uiInfo.tremHumanArmourySellCount = 0; + uiInfo.humanArmourySellCount = 0; UI_ParseCarriageList( &weapons, &upgrades ); for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) { if( weapons & ( 1 << i ) ) { - uiInfo.tremHumanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); - uiInfo.tremHumanArmourySellList[ j ].cmd = + uiInfo.humanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); + uiInfo.humanArmourySellList[ j ].cmd = String_Alloc( va( "cmd sell %s retrigger\n", BG_FindNameForWeapon( i ) ) ); - uiInfo.tremHumanArmourySellList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForWeapon( i ) ) ); + uiInfo.humanArmourySellList[ j ].type = INFOTYPE_WEAPON; + uiInfo.humanArmourySellList[ j ].v.weapon = i; j++; - uiInfo.tremHumanArmourySellCount++; + uiInfo.humanArmourySellCount++; } } @@ -3433,25 +3257,25 @@ static void UI_LoadTremHumanArmourySells( void ) { if( upgrades & ( 1 << i ) ) { - uiInfo.tremHumanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); - uiInfo.tremHumanArmourySellList[ j ].cmd = + uiInfo.humanArmourySellList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); + uiInfo.humanArmourySellList[ j ].cmd = String_Alloc( va( "cmd sell %s retrigger\n", BG_FindNameForUpgrade( i ) ) ); - uiInfo.tremHumanArmourySellList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sitem", BG_FindNameForUpgrade( i ) ) ); + uiInfo.humanArmourySellList[ j ].type = INFOTYPE_UPGRADE; + uiInfo.humanArmourySellList[ j ].v.upgrade = i; j++; - uiInfo.tremHumanArmourySellCount++; + uiInfo.humanArmourySellCount++; } } } /* =============== -UI_LoadTremAlienUpgrades +UI_LoadAlienUpgrades =============== */ -static void UI_LoadTremAlienUpgrades( void ) +static void UI_LoadAlienUpgrades( void ) { int i, j = 0; int class, credits; @@ -3461,7 +3285,7 @@ static void UI_LoadTremAlienUpgrades( void ) trap_Cvar_VariableStringBuffer( "ui_currentClass", ui_currentClass, MAX_STRING_CHARS ); sscanf( ui_currentClass, "%d %d", &class, &credits ); - uiInfo.tremAlienUpgradeCount = 0; + uiInfo.alienUpgradeCount = 0; for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ ) { @@ -3469,25 +3293,25 @@ static void UI_LoadTremAlienUpgrades( void ) BG_FindStagesForClass( i, stage ) && BG_ClassIsAllowed( i ) ) { - uiInfo.tremAlienUpgradeList[ j ].text = String_Alloc( BG_FindHumanNameForClassNum( i ) ); - uiInfo.tremAlienUpgradeList[ j ].cmd = + uiInfo.alienUpgradeList[ j ].text = String_Alloc( BG_FindHumanNameForClassNum( i ) ); + uiInfo.alienUpgradeList[ j ].cmd = String_Alloc( va( "cmd class %s\n", BG_FindNameForClassNum( i ) ) ); - uiInfo.tremAlienUpgradeList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sclass", BG_FindNameForClassNum( i ) ) ); + uiInfo.alienUpgradeList[ j ].type = INFOTYPE_CLASS; + uiInfo.alienUpgradeList[ j ].v.pclass = i; j++; - uiInfo.tremAlienUpgradeCount++; + uiInfo.alienUpgradeCount++; } } } /* =============== -UI_LoadTremAlienBuilds +UI_LoadAlienBuilds =============== */ -static void UI_LoadTremAlienBuilds( void ) +static void UI_LoadAlienBuilds( void ) { int weapons; int i, j = 0; @@ -3496,7 +3320,7 @@ static void UI_LoadTremAlienBuilds( void ) UI_ParseCarriageList( &weapons, NULL ); stage = UI_GetCurrentAlienStage( ); - uiInfo.tremAlienBuildCount = 0; + uiInfo.alienBuildCount = 0; for( i = BA_NONE +1; i < BA_NUM_BUILDABLES; i++ ) { @@ -3505,26 +3329,26 @@ static void UI_LoadTremAlienBuilds( void ) BG_FindStagesForBuildable( i, stage ) && BG_BuildableIsAllowed( i ) ) { - uiInfo.tremAlienBuildList[ j ].text = + uiInfo.alienBuildList[ j ].text = String_Alloc( BG_FindHumanNameForBuildable( i ) ); - uiInfo.tremAlienBuildList[ j ].cmd = + uiInfo.alienBuildList[ j ].cmd = String_Alloc( va( "cmd build %s\n", BG_FindNameForBuildable( i ) ) ); - uiInfo.tremAlienBuildList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sbuild", BG_FindNameForBuildable( i ) ) ); + uiInfo.alienBuildList[ j ].type = INFOTYPE_BUILDABLE; + uiInfo.alienBuildList[ j ].v.buildable = i; j++; - uiInfo.tremAlienBuildCount++; + uiInfo.alienBuildCount++; } } } /* =============== -UI_LoadTremHumanBuilds +UI_LoadHumanBuilds =============== */ -static void UI_LoadTremHumanBuilds( void ) +static void UI_LoadHumanBuilds( void ) { int weapons; int i, j = 0; @@ -3533,7 +3357,7 @@ static void UI_LoadTremHumanBuilds( void ) UI_ParseCarriageList( &weapons, NULL ); stage = UI_GetCurrentHumanStage( ); - uiInfo.tremHumanBuildCount = 0; + uiInfo.humanBuildCount = 0; for( i = BA_NONE +1; i < BA_NUM_BUILDABLES; i++ ) { @@ -3542,16 +3366,16 @@ static void UI_LoadTremHumanBuilds( void ) BG_FindStagesForBuildable( i, stage ) && BG_BuildableIsAllowed( i ) ) { - uiInfo.tremHumanBuildList[ j ].text = + uiInfo.humanBuildList[ j ].text = String_Alloc( BG_FindHumanNameForBuildable( i ) ); - uiInfo.tremHumanBuildList[ j ].cmd = + uiInfo.humanBuildList[ j ].cmd = String_Alloc( va( "cmd build %s\n", BG_FindNameForBuildable( i ) ) ); - uiInfo.tremHumanBuildList[ j ].infopane = - UI_FindInfoPaneByName( va( "%sbuild", BG_FindNameForBuildable( i ) ) ); + uiInfo.humanBuildList[ j ].type = INFOTYPE_BUILDABLE; + uiInfo.humanBuildList[ j ].v.buildable = i; j++; - uiInfo.tremHumanBuildCount++; + uiInfo.humanBuildCount++; } } } @@ -3998,65 +3822,65 @@ static void UI_RunMenuScript(char **args) { UI_LoadMods(); } else if( Q_stricmp( name, "LoadTeams" ) == 0 ) - UI_LoadTremTeams( ); + UI_LoadTeams( ); else if( Q_stricmp( name, "JoinTeam" ) == 0 ) { if( ( cmd = uiInfo.tremTeamList[ uiInfo.tremTeamIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadHumanItems" ) == 0 ) - UI_LoadTremHumanItems( ); + UI_LoadHumanItems( ); else if( Q_stricmp( name, "SpawnWithHumanItem" ) == 0 ) { - if( ( cmd = uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].cmd ) ) + if( ( cmd = uiInfo.humanItemList[ uiInfo.humanItemIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadAlienClasses" ) == 0 ) - UI_LoadTremAlienClasses( ); + UI_LoadAlienClasses( ); else if( Q_stricmp( name, "SpawnAsAlienClass" ) == 0 ) { - if( ( cmd = uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].cmd ) ) + if( ( cmd = uiInfo.alienClassList[ uiInfo.alienClassIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadHumanArmouryBuys" ) == 0 ) - UI_LoadTremHumanArmouryBuys( ); + UI_LoadHumanArmouryBuys( ); else if( Q_stricmp( name, "BuyFromArmoury" ) == 0 ) { - if( ( cmd = uiInfo.tremHumanArmouryBuyList[ uiInfo.tremHumanArmouryBuyIndex ].cmd ) ) + if( ( cmd = uiInfo.humanArmouryBuyList[ uiInfo.humanArmouryBuyIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadHumanArmourySells" ) == 0 ) - UI_LoadTremHumanArmourySells( ); + UI_LoadHumanArmourySells( ); else if( Q_stricmp( name, "SellToArmoury" ) == 0 ) { - if( ( cmd = uiInfo.tremHumanArmourySellList[ uiInfo.tremHumanArmourySellIndex ].cmd ) ) + if( ( cmd = uiInfo.humanArmourySellList[ uiInfo.humanArmourySellIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadAlienUpgrades" ) == 0 ) { - UI_LoadTremAlienUpgrades( ); + UI_LoadAlienUpgrades( ); //disallow the menu if it would be empty - if( uiInfo.tremAlienUpgradeCount <= 0 ) + if( uiInfo.alienUpgradeCount <= 0 ) Menus_CloseAll( ); } else if( Q_stricmp( name, "UpgradeToNewClass" ) == 0 ) { - if( ( cmd = uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].cmd ) ) + if( ( cmd = uiInfo.alienUpgradeList[ uiInfo.alienUpgradeIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadAlienBuilds" ) == 0 ) - UI_LoadTremAlienBuilds( ); + UI_LoadAlienBuilds( ); else if( Q_stricmp( name, "BuildAlienBuildable" ) == 0 ) { - if( ( cmd = uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].cmd ) ) + if( ( cmd = uiInfo.alienBuildList[ uiInfo.alienBuildIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "LoadHumanBuilds" ) == 0 ) - UI_LoadTremHumanBuilds( ); + UI_LoadHumanBuilds( ); else if( Q_stricmp( name, "BuildHumanBuildable" ) == 0 ) { - if( ( cmd = uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd ) ) + if( ( cmd = uiInfo.humanBuildList[ uiInfo.humanBuildIndex ].cmd ) ) trap_Cmd_ExecuteText( EXEC_APPEND, cmd ); } else if( Q_stricmp( name, "PTRCRestore" ) == 0 ) @@ -5070,19 +4894,19 @@ static int UI_FeederCount(float feederID) { else if( feederID == FEEDER_TREMTEAMS ) return uiInfo.tremTeamCount; else if( feederID == FEEDER_TREMHUMANITEMS ) - return uiInfo.tremHumanItemCount; + return uiInfo.humanItemCount; else if( feederID == FEEDER_TREMALIENCLASSES ) - return uiInfo.tremAlienClassCount; + return uiInfo.alienClassCount; else if( feederID == FEEDER_TREMHUMANARMOURYBUY ) - return uiInfo.tremHumanArmouryBuyCount; + return uiInfo.humanArmouryBuyCount; else if( feederID == FEEDER_TREMHUMANARMOURYSELL ) - return uiInfo.tremHumanArmourySellCount; + return uiInfo.humanArmourySellCount; else if( feederID == FEEDER_TREMALIENUPGRADE ) - return uiInfo.tremAlienUpgradeCount; + return uiInfo.alienUpgradeCount; else if( feederID == FEEDER_TREMALIENBUILD ) - return uiInfo.tremAlienBuildCount; + return uiInfo.alienBuildCount; else if( feederID == FEEDER_TREMHUMANBUILD ) - return uiInfo.tremHumanBuildCount; + return uiInfo.humanBuildCount; return 0; } @@ -5270,38 +5094,38 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan } else if( feederID == FEEDER_TREMHUMANITEMS ) { - if( index >= 0 && index < uiInfo.tremHumanItemCount ) - return uiInfo.tremHumanItemList[ index ].text; + if( index >= 0 && index < uiInfo.humanItemCount ) + return uiInfo.humanItemList[ index ].text; } else if( feederID == FEEDER_TREMALIENCLASSES ) { - if( index >= 0 && index < uiInfo.tremAlienClassCount ) - return uiInfo.tremAlienClassList[ index ].text; + if( index >= 0 && index < uiInfo.alienClassCount ) + return uiInfo.alienClassList[ index ].text; } else if( feederID == FEEDER_TREMHUMANARMOURYBUY ) { - if( index >= 0 && index < uiInfo.tremHumanArmouryBuyCount ) - return uiInfo.tremHumanArmouryBuyList[ index ].text; + if( index >= 0 && index < uiInfo.humanArmouryBuyCount ) + return uiInfo.humanArmouryBuyList[ index ].text; } else if( feederID == FEEDER_TREMHUMANARMOURYSELL ) { - if( index >= 0 && index < uiInfo.tremHumanArmourySellCount ) - return uiInfo.tremHumanArmourySellList[ index ].text; + if( index >= 0 && index < uiInfo.humanArmourySellCount ) + return uiInfo.humanArmourySellList[ index ].text; } else if( feederID == FEEDER_TREMALIENUPGRADE ) { - if( index >= 0 && index < uiInfo.tremAlienUpgradeCount ) - return uiInfo.tremAlienUpgradeList[ index ].text; + if( index >= 0 && index < uiInfo.alienUpgradeCount ) + return uiInfo.alienUpgradeList[ index ].text; } else if( feederID == FEEDER_TREMALIENBUILD ) { - if( index >= 0 && index < uiInfo.tremAlienBuildCount ) - return uiInfo.tremAlienBuildList[ index ].text; + if( index >= 0 && index < uiInfo.alienBuildCount ) + return uiInfo.alienBuildList[ index ].text; } else if( feederID == FEEDER_TREMHUMANBUILD ) { - if( index >= 0 && index < uiInfo.tremHumanBuildCount ) - return uiInfo.tremHumanBuildList[ index ].text; + if( index >= 0 && index < uiInfo.humanBuildCount ) + return uiInfo.humanBuildList[ index ].text; } return ""; @@ -5422,19 +5246,19 @@ static void UI_FeederSelection(float feederID, int index) { else if( feederID == FEEDER_TREMTEAMS ) uiInfo.tremTeamIndex = index; else if( feederID == FEEDER_TREMHUMANITEMS ) - uiInfo.tremHumanItemIndex = index; + uiInfo.humanItemIndex = index; else if( feederID == FEEDER_TREMALIENCLASSES ) - uiInfo.tremAlienClassIndex = index; + uiInfo.alienClassIndex = index; else if( feederID == FEEDER_TREMHUMANARMOURYBUY ) - uiInfo.tremHumanArmouryBuyIndex = index; + uiInfo.humanArmouryBuyIndex = index; else if( feederID == FEEDER_TREMHUMANARMOURYSELL ) - uiInfo.tremHumanArmourySellIndex = index; + uiInfo.humanArmourySellIndex = index; else if( feederID == FEEDER_TREMALIENUPGRADE ) - uiInfo.tremAlienUpgradeIndex = index; + uiInfo.alienUpgradeIndex = index; else if( feederID == FEEDER_TREMALIENBUILD ) - uiInfo.tremAlienBuildIndex = index; + uiInfo.alienBuildIndex = index; else if( feederID == FEEDER_TREMHUMANBUILD ) - uiInfo.tremHumanBuildIndex = index; + uiInfo.humanBuildIndex = index; } static void UI_Pause(qboolean b) { @@ -5593,26 +5417,6 @@ void _UI_Init( qboolean inGameLoad ) { UI_LoadMenus("ui/ingame.txt", qfalse); UI_LoadMenus("ui/tremulous.txt", qfalse); - UI_LoadInfoPanes( "ui/infopanes.def" ); - - if( uiInfo.uiDC.debug ) - { - int i, j; - - for( i = 0; i < uiInfo.tremInfoPaneCount; i++ ) - { - Com_Printf( "name: %s\n", uiInfo.tremInfoPanes[ i ].name ); - - Com_Printf( "text: %s\n", uiInfo.tremInfoPanes[ i ].text ); - - for( j = 0; j < uiInfo.tremInfoPanes[ i ].numGraphics; j++ ) - Com_Printf( "graphic %d: %d %d %d %d\n", j, uiInfo.tremInfoPanes[ i ].graphics[ j ].side, - uiInfo.tremInfoPanes[ i ].graphics[ j ].offset, - uiInfo.tremInfoPanes[ i ].graphics[ j ].width, - uiInfo.tremInfoPanes[ i ].graphics[ j ].height ); - } - } - Menus_CloseAll(); trap_LAN_LoadCachedServers(); |