2025-07-04 09:55 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000179Spring engineGeneralpublic2006-05-25 12:47
ReporterNOiZE 
Assigned Totvo 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000179: Some specific Commander settings don't work in Spring yet
DescriptionIt would be nice if the following tags worked in spring
FBI tags:
showplayername=1; <-- should display the player name instead of the unitname in the tooltip.

HideDamage=1; <-- hide the ammount of damage in the tooltip and the healthbar. Also the "costs" should be hidden in the tooltip, so the commander can get high buildcosts, to prevent it from getting experiance so quickly
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon mantis179.patch (3,684 bytes) 2006-05-25 11:59 -
    Index: Game/SelectedUnits.cpp
    ===================================================================
    --- rts/Game/SelectedUnits.cpp	(revision 1324)
    +++ rts/Game/SelectedUnits.cpp	(working copy)
    @@ -3,6 +3,7 @@
     //////////////////////////////////////////////////////////////////////
     
     #include "StdAfx.h"
    +#include "Game/Team.h"
     #include "SelectedUnits.h"
     #include "Sim/Units/Unit.h"
     #include <map>
    @@ -431,7 +432,13 @@
     	if(selectedGroup!=-1 && grouphandler->groups[selectedGroup]->ai){
     		s="Group selected";
     	} else if(!selectedUnits.empty()){
    -		s=(*selectedUnits.begin())->tooltip;
    +		// show the player name instead of unit name if it has FBI tag showPlayerName
    +		if((*selectedUnits.begin())->unitDef->showPlayerName)
    +		{
    +			s=gs->players[gs->Team((*selectedUnits.begin())->team)->leader]->playerName.c_str();
    +		} else {
    +			s=(*selectedUnits.begin())->tooltip;
    +		}
     	}
     	if(selectedUnits.empty()){
     		return s;
    Index: Game/UI/MouseHandler.cpp
    ===================================================================
    --- rts/Game/UI/MouseHandler.cpp	(revision 1324)
    +++ rts/Game/UI/MouseHandler.cpp	(working copy)
    @@ -548,11 +548,21 @@
     	float dist=helper->GuiTraceRay(camera->pos,dir,9000,unit,20,false);
     
     	if(unit){
    -		s=unit->tooltip;
    -		char tmp[500];
    -		sprintf(tmp,"\nHealth %.0f/%.0f \nExperience %.2f Cost %.0f Range %.0f \n\xff\xd3\xdb\xffMetal: \xff\x50\xff\x50%.1f\xff\x90\x90\x90/\xff\xff\x50\x01-%.1f\xff\xd3\xdb\xff Energy: \xff\x50\xff\x50%.1f\xff\x90\x90\x90/\xff\xff\x50\x01-%.1f",
    -			unit->health,unit->maxHealth,unit->experience,unit->metalCost+unit->energyCost/60,unit->maxRange, unit->metalMake, unit->metalUse, unit->energyMake, unit->energyUse);
    -		s+=tmp;		
    +		// show the player name instead of unit name if it has FBI tag showPlayerName
    +		if(unit->unitDef->showPlayerName)
    +		{
    +			s=gs->players[gs->Team(unit->team)->leader]->playerName.c_str();
    +		} else {
    +			s=unit->tooltip;
    +		}
    +		// don't show the unit health and other info if it has FBI tag hideDamage and isn't on our team
    +		if(!(unit->unitDef->hideDamage && unit->team != gu->myTeam))
    +		{
    +			char tmp[500];
    +			sprintf(tmp,"\nHealth %.0f/%.0f \nExperience %.2f Cost %.0f Range %.0f \n\xff\xd3\xdb\xffMetal: \xff\x50\xff\x50%.1f\xff\x90\x90\x90/\xff\xff\x50\x01-%.1f\xff\xd3\xdb\xff Energy: \xff\x50\xff\x50%.1f\xff\x90\x90\x90/\xff\xff\x50\x01-%.1f",
    +				unit->health,unit->maxHealth,unit->experience,unit->metalCost+unit->energyCost/60,unit->maxRange, unit->metalMake, unit->metalUse, unit->energyMake, unit->energyUse);
    +			s+=tmp;
    +		}
     		return s;
     	} else {
     		if(dist<8900){
    Index: Sim/Units/UnitDef.h
    ===================================================================
    --- rts/Sim/Units/UnitDef.h	(revision 1324)
    +++ rts/Sim/Units/UnitDef.h	(working copy)
    @@ -185,6 +185,7 @@
     	bool isFeature;
     	bool hideDamage;
     	bool isCommander;
    +	bool showPlayerName;
     
     	bool canResurrect;
     	bool canCapture;
    Index: Sim/Units/UnitDefHandler.cpp
    ===================================================================
    --- rts/Sim/Units/UnitDefHandler.cpp	(revision 1324)
    +++ rts/Sim/Units/UnitDefHandler.cpp	(working copy)
    @@ -256,6 +256,7 @@
     	ud.canCapture=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\canCapture").c_str());
     	ud.hideDamage=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\HideDamage").c_str());
     	ud.isCommander=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\commander").c_str());
    +	ud.showPlayerName=!!atoi(tdfparser.SGetValueDef("0", "UNITINFO\\showplayername").c_str());
     
     	ud.cloakCost=atof(tdfparser.SGetValueDef("-1", "UNITINFO\\CloakCost").c_str());
     	ud.cloakCostMoving=atof(tdfparser.SGetValueDef("-1", "UNITINFO\\CloakCostMoving").c_str());
    
    patch file icon mantis179.patch (3,684 bytes) 2006-05-25 11:59 +

-Relationships
+Relationships

-Notes

~0000199

colorblind (reporter)

I uploaded a patch that resolves this. It
* adds 'showplayername' to fbi tags that spring reads
* properly implements the 'hidedamage' fbi tag to not show health and other unit info if the unit belongs another team.
Please be so kind to commit it :)

~0000200

colorblind (reporter)

Reminder sent to: tvo

Ik heb een patch geschreven voor mantis 0000179; zou je er naar willen kijken?

~0000201

tvo (reporter)

committed
+Notes

-Issue History
Date Modified Username Field Change
2006-05-17 09:31 NOiZE New Issue
2006-05-25 11:59 colorblind File Added: mantis179.patch
2006-05-25 11:59 colorblind Note Added: 0000199
2006-05-25 12:03 colorblind Note Added: 0000200
2006-05-25 12:47 tvo Status new => assigned
2006-05-25 12:47 tvo Assigned To => tvo
2006-05-25 12:47 tvo Status assigned => resolved
2006-05-25 12:47 tvo Resolution open => fixed
2006-05-25 12:47 tvo Note Added: 0000201
+Issue History