2025-08-22 21:13 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000446Spring engineGeneralpublic2007-03-04 06:38
ReporterFLOZi 
Assigned ToILMTitan 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000446: [patch] Minor updates to FPS mode
Description* Displays weapons TDF 'name' tag (held internally as description) in FPS mode instead of 'Weapon <x>'.
* Does a little reorganising to prevent the Unit Health text getting hidden behind weapons.
Additional InformationAs requested by Crampman here:
http://spring.clan-sy.com/phpbb/viewtopic.php?t=9313
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • diff file icon fpsWeaponNames.diff (2,819 bytes) 2007-02-21 22:55 -
    Index: Game/Game.cpp
    ===================================================================
    --- Game/Game.cpp	(revision 3430)
    +++ Game/Game.cpp	(working copy)
    @@ -123,6 +123,7 @@
     #include "Sim/MoveTypes/MoveType.h"
     #include "Sim/Units/COB/CobFile.h"
     #include "Sim/Weapons/Weapon.h"
    +#include "Sim/Weapons/WeaponDefHandler.h"
     #endif
     
     #include "mmgr.h"
    @@ -2838,7 +2839,7 @@
     	glEnable(GL_TEXTURE_2D);
     
     	glPushMatrix();
    -	glTranslatef(0.25f, 0.12f, 0);
    +	glTranslatef(0.02f, 0.65f, 0);
     	glScalef(0.03f,0.03f,0.03f);
     	glColor4d(0.2f,0.8f,0.2f,0.8f);
     	font->glPrint("Health %.0f",unit->health);
    @@ -2846,7 +2847,7 @@
     
     	if(gs->players[gu->myPlayerNum]->myControl.mouse2){
     		glPushMatrix();
    -		glTranslatef(0.02f,0.34f,0);
    +		glTranslatef(0.02f,0.7f,0);
     		glScalef(0.03f,0.03f,0.03f);
     		glColor4d(0.2f,0.8f,0.2f,0.8f);
     		font->glPrint("Free fire mode");
    @@ -2854,18 +2855,21 @@
     	}
     	for(int a=0;a<unit->weapons.size();++a){
     		glPushMatrix();
    -		glTranslatef(0.02f,0.3f-a*0.04f,0);
    +		glTranslatef(0.02f,0.32f-a*0.04f,0);
     		glScalef(0.0225f,0.03f,0.03f);
     		CWeapon* w=unit->weapons[a];
    -		if(w->reloadStatus>gs->frameNum){
    -			glColor4d(0.8f,0.2f,0.2f,0.8f);
    -			font->glPrint("Weapon %i: Reloading",a+1);
    -		} else if(!w->angleGood){
    -			glColor4d(0.6f,0.6f,0.2f,0.8f);
    -			font->glPrint("Weapon %i: Aiming",a+1);
    -		} else {
    -			glColor4d(0.2f,0.8f,0.2f,0.8f);
    -			font->glPrint("Weapon %i: Ready",a+1);
    +		WeaponDef* wd=w->weaponDef;
    +		if(!wd->isShield){
    +			if(w->reloadStatus>gs->frameNum){
    +				glColor4d(0.8f,0.2f,0.2f,0.8f);
    +				font->glPrint("%s: Reloading",wd->description.c_str());
    +			} else if(!w->angleGood){
    +				glColor4d(0.6f,0.6f,0.2f,0.8f);
    +				font->glPrint("%s: Aiming",wd->description.c_str());
    +			} else {
    +				glColor4d(0.2f,0.8f,0.2f,0.8f);
    +				font->glPrint("%s: Ready",wd->description.c_str());
    +			}
     		}
     		glPopMatrix();
     	}
    Index: Sim/Weapons/WeaponDefHandler.cpp
    ===================================================================
    --- Sim/Weapons/WeaponDefHandler.cpp	(revision 3430)
    +++ Sim/Weapons/WeaponDefHandler.cpp	(working copy)
    @@ -76,6 +76,7 @@
     	//std::string modelName;
     
     	sunparser->GetDef(weaponDefs[id].tdfId, "0", weaponname + "\\id");
    +	weaponDefs[id].description = sunparser->SGetValueDef("Weapon", weaponname + "\\name");
     	sunparser->GetDef(weaponDefs[id].avoidFriendly, "1", weaponname + "\\AvoidFriendly");
     	weaponDefs[id].collisionFlags=0;
     	bool collideFriendly, collideFeature;
    Index: Sim/Weapons/WeaponDefHandler.h
    ===================================================================
    --- Sim/Weapons/WeaponDefHandler.h	(revision 3430)
    +++ Sim/Weapons/WeaponDefHandler.h	(working copy)
    @@ -36,6 +36,7 @@
     
     	std::string name;
     	std::string type;
    +	std::string description;
     
     	/*std::string sfiresound;
     	std::string ssoundhit;
    
    diff file icon fpsWeaponNames.diff (2,819 bytes) 2007-02-21 22:55 +

-Relationships
+Relationships

-Notes

~0000741

ILMTitan (reporter)

I'll commit this the same time I commit the get/set upright.

~0000752

ILMTitan (reporter)

Last edited: 2007-03-04 06:37

Committed revision 3453.

~0000755

ILMTitan (reporter)

Committed revision 3453.
+Notes

-Issue History
Date Modified Username Field Change
2007-02-21 22:55 FLOZi New Issue
2007-02-21 22:55 FLOZi File Added: fpsWeaponNames.diff
2007-02-25 03:37 ILMTitan Status new => assigned
2007-02-25 03:37 ILMTitan Assigned To => ILMTitan
2007-02-25 03:38 ILMTitan Note Added: 0000741
2007-03-04 06:37 ILMTitan Note Added: 0000752
2007-03-04 06:37 ILMTitan Note Edited: 0000752
2007-03-04 06:38 ILMTitan Status assigned => closed
2007-03-04 06:38 ILMTitan Note Added: 0000755
2007-03-04 06:38 ILMTitan Resolution open => fixed
+Issue History