2018-10-20 14:41 EDT


View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002001FSSCPuser interfacepublic2010-08-26 23:40
ReporterFUBAR-BDHR 
Assigned ToZacam 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.6.11 
Target VersionFixed in Version3.6.12 
Summary0002001: Primary weapon loadouts with text names are displaying the # and characters after
DescriptionIf you are using the default text names (no models or anitmations) for primary weapons and use the # character (for insatnce #weak) the selection will show the #weak.
Additional Information3.6.11 r5615
TagsNo tags attached.
Attached Files
  • jpg file icon screen1129.jpg (4,681 bytes) 2009-10-01 02:01 -
    jpg file icon screen1129.jpg (4,681 bytes) 2009-10-01 02:01 +
  • patch file icon M2001_patch_02112010.patch (1,871 bytes) 2010-02-11 04:04 -
    Index: missionui/missionweaponchoice.cpp
    ===================================================================
    --- missionui/missionweaponchoice.cpp	(revision 5899)
    +++ missionui/missionweaponchoice.cpp	(working copy)
    @@ -37,10 +37,10 @@
     #include "network/multiui.h"
     #include "missionui/chatbox.h"
     #include "network/multi_pmsg.h"
    +#include "parse/parselo.h"
     
     
     
    -
     #define IS_BANK_PRIMARY(x)			(x < MAX_SHIP_PRIMARY_BANKS)
     #define IS_BANK_SECONDARY(x)		(x >= MAX_SHIP_PRIMARY_BANKS)
     
    @@ -2793,9 +2793,14 @@
     					//Draw the weapon name, crappy last-ditch effort to not crash.
     					int half_x, half_y;
     					char *print_name = (Weapon_info[Carried_wl_icon.weapon_class].alt_name[0]) ? Weapon_info[Carried_wl_icon.weapon_class].alt_name : Weapon_info[Carried_wl_icon.weapon_class].name;
    +
    +					// Truncate the # and everything to the right. Zacam
    +					end_string_at_first_hash_symbol(print_name);
    +					
    +					// Center-align and fit the text for display
     					gr_get_string_size(&half_x, &half_y, print_name);
     					half_x = sx +((56 - half_x) / 2);
    -					half_y = sy +((24 - half_y) / 2);
    +					half_y = sy +((28 - half_y) / 2); // Was ((24 - half_y) / 2) Zacam
     					gr_string(half_x, half_y, print_name);
     				}
     			}
    @@ -3044,9 +3049,14 @@
     			//Draw the weapon name, crappy last-ditch effort to not crash.
     			int half_x, half_y;
     			char *print_name = (Weapon_info[index].alt_name[0]) ? Weapon_info[index].alt_name : Weapon_info[index].name;
    +
    +			// Truncate the # and everything to the right. Zacam
    +			end_string_at_first_hash_symbol(print_name);
    +
    +			// Center-align and fit the text for display
     			gr_get_string_size(&half_x, &half_y, print_name);
     			half_x = x +((56 - half_x) / 2);
    -			half_y = y +((24 - half_y) / 2);
    +			half_y = y +((28 - half_y) / 2); // Was ((24 - half_y) / 2) Zacam
     			gr_string(half_x, half_y, print_name);
     		}
     	}
    
    patch file icon M2001_patch_02112010.patch (1,871 bytes) 2010-02-11 04:04 +

-Relationships
+Relationships

-Notes

~0011632

Zacam (administrator)

Proposed working .patch attached.

The concept of using:
char print_name[NAME_LENGTH];
strncpy_s(print_name, [...], NAME_LENGTH);

results in the text not displaying until the icon is clicked on.
Instead:
end_string_at_first_hash_symbol(print_name);

Is added to the code (with concise commentary) and even centered better. Also parses and trims out "#andtotheright" off of $Alt Name: entries as well.

~0011633

FUBAR-BDHR (developer)

Worked fine for me.

~0011648

Zacam (administrator)

Committed in 5902. Leaving issue open for feedback until 3.6.12 Final and then closing if no issues occur.

~0012332

Zacam (administrator)

Closing as no reported issues or feedback (other than being asked if it can now be closed)
+Notes

-Issue History
Date Modified Username Field Change
2009-10-01 02:01 FUBAR-BDHR New Issue
2009-10-01 02:01 FUBAR-BDHR File Added: screen1129.jpg
2009-11-03 12:14 Zacam Status new => assigned
2009-11-03 12:14 Zacam Assigned To => Zacam
2010-02-11 01:34 Zacam Status assigned => confirmed
2010-02-11 04:04 Zacam File Added: M2001_patch_02112010.patch
2010-02-11 04:07 Zacam Note Added: 0011632
2010-02-11 04:07 Zacam Status confirmed => feedback
2010-02-11 05:46 FUBAR-BDHR Note Added: 0011633
2010-02-11 11:45 Zacam Note Added: 0011648
2010-08-26 23:40 Zacam Note Added: 0012332
2010-08-26 23:40 Zacam Status feedback => resolved
2010-08-26 23:40 Zacam Fixed in Version => 3.6.12
2010-08-26 23:40 Zacam Resolution open => fixed
+Issue History